refactor(scheduling): delete the legacy file-backed cronstore
The schedules feature no longer runs on it: jobs live in the state store as the schedules control-plane document, read and written through the control-plane client (scheduleResourceStore), and the legacy jobs.json migration into that document has run its course. What remained of internal/infrastructure/cronstore was 1,600 lines of file store, OS-level cross-process locking and schema-versioned JSON envelope -- plus the schedule vocabulary held hostage inside it. The vocabulary moves to internal/domain/scheduling, which is where migration-decisions already said a schedules vocabulary belongs: a domain vocabulary package must not import infrastructure. JobSpec, Target, Payload, the kind constants, Schedule and Duration move unchanged -- same wire shape, same JSON tags -- with the two sentinel errors callers matched outside the package (ErrJobNotFound, ErrScheduleUnsupported) and ErrInvalidSpec, which the schedule arithmetic itself raises. The store's own sentinels die with the store. The legacy migration path (migrateLegacySchedules, readLegacyJobs) goes with it: its only dependency was cronstore.Open, and its work is done. crondelivery keeps its consumer-owned contracts; the compile-time assertions that pinned *cronstore.Store move to the production implementation, scheduleResourceStore, in internal/app/archied. The package's fixtures swap the real file store for an in-memory one with the same Get/MarkRun/Due semantics, so the run-recording acceptance test still asserts against real schedule arithmetic. A future storage backend (PocketBase) implements the same vocabulary.
This commit is contained in:
26 files changed
+297
-2568
No files matched your search
@@ -264,9 +264,10 @@ around is no longer a boundary.
|
||||
returns and validates `workflow.ExecutionSettings`, so any package holding it
|
||||
links the workflow domain and therefore `internal/agentexec`. This is why the
|
||||
client cannot move as one package -- see open question 2.
|
||||
- The schedules document, whose type is `cronstore.JobSpec` in
|
||||
`internal/infrastructure`. A domain vocabulary package may not import
|
||||
infrastructure.
|
||||
- The schedules document, whose type is `scheduling.JobSpec` in
|
||||
`internal/domain/scheduling` -- the vocabulary moved there when the legacy
|
||||
file-backed cronstore was deleted, which is also what satisfies the rule
|
||||
that a domain vocabulary package may not import infrastructure.
|
||||
- The schema derivation, which describes the documents the server advertises.
|
||||
|
||||
**Placement as landed (2026-09-22, `archie-core-1ng1`).** One new package,
|
||||
|
||||
Reference in new issue
Block a user