feat(discovery): implement job discovery system #77
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/kronai!77
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/0014-implement-job-discovery"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implement job discovery: scan interval directories, detect job type (ephemeral vs recurring), parse numeric IDs, and load job configs with defaults.
Why
Enables the discovery layer that feeds into the job execution engine.
Testing
Breaking Changes
None.
Notes
Job type determined by marker files:
.ephemeral= run-once/delete,.recurring(or absent) = keep after run. Non-numeric directories are skipped with a warning.Closes #0010
Closes #0011
Closes #0012
Closes #0013
Closes #0014
Automated Review — PR #77
Result: APPROVED
Clean implementation of the discovery layer. Here's the analysis:
DiscoveryErrorfor missing jobs directory.ValueErrorfromparse_job_idcaught per-job with warning.ConfigErrorfrom invalid config.toml propagates up (see suggestion #3).Suggestions (non-blocking)
src/kronai/discovery.py:66-70—except ValueErrorwraps three function calls but onlyparse_job_idraises it. Consider narrowing the try/except to just theparse_job_id()call to avoid silently swallowing futureValueErrorfrom other functions:src/kronai/discovery.py:130-137—raw.get()returnsobjectbut values flow into typedJobConfig()fields. e.g.,mcp_serversexpectslist[str]but a TOML table or scalar would slip through silently. Consider addingisinstanceguards or using a Pydantic-style validator in the future.src/kronai/discovery.py— Invalidconfig.tomlraisesConfigErrorwhich propagates fromdiscover_jobs()and halts discovery of all jobs. Consider catching it per-job (log warning, use defaults) so one bad config doesn't block everything.