Skip to content

core(op): schedule belongs to the op; composites move into core and return { op }; github pipelines and chant operator read op.schedule #2120

Closed

Description

@lex00

Sub-issue 4 of #2114.

Composites that run on a cadence return { op, schedule } where schedule is a TemporalSchedule (lexicons/temporal/src/composites/watch-op.ts, reconcile-op.ts, converge-op.ts, workflow-audit-op.ts, pipeline-audit-op.ts, lexicon-upgrade-op.ts; apply-op.ts returns { op }). The cron belongs to the op. The github lexicon already renders a cron for an op without Temporal (ScheduledOpSpec in packages/core/src/lexicon.ts, generateOpPipeline, lexicons/github/src/components/generate-op-pipeline.ts), and chant operator ticks converge ops on its own interval while ignoring the Temporal cron (DEFAULT_OPERATOR_INTERVAL_MS's comment).

  • Add schedule?: { cron: string; overlap?: "skip" } to OpConfig (packages/core/src/op/types.ts). overlap has one value and defaults to it. Validate the cron at Op() construction with the five-field parser TMP010 uses (port tmp010-cron-syntax.ts's parser into packages/core/src/op/cron.ts).
  • Move the composites to packages/core/src/op/composites/ with their tests, each returning { op } with schedule set on the op when the caller passed one. Drop kebabToCamel and the workflow-type plumbing they carry. Export them from @intentius/chant/op. Leave lexicons/temporal/src/composites/*.ts as re-export shims until epic: remove Temporal from chant — lexicon, core, examples, docs, CI, npm #2116.
  • generateOpPipeline and ScheduledOpSpec.schedule read op.schedule.cron when the op has one, so a scheduled op needs no second declaration in the github lexicon; keep the explicit trigger override.
  • chant operator honours op.schedule.cron as the tick cadence for that op when present, falling back to --interval.
  • TemporalSchedule stays in the temporal lexicon for the deployment-resource use case until epic: remove Temporal from chant — lexicon, core, examples, docs, CI, npm #2116 deletes it; nothing in core references it after this issue.

Waits on sub-issue 1 (activities in core) so the moved composites import from ../activities. Runs in parallel with sub-issues 3, 5 and 6 after that.

Acceptance

  • Op({ schedule: { cron: "*/10 * * * *" } }) typechecks; an invalid cron throws at construction with the TMP010 message.
  • WatchOp, ReconcileOp, ConvergeOp, ApplyOp, WorkflowAuditOp, PipelineAuditOp, LexiconUpgradeOp are exported from @intentius/chant/op, return { op }, and their tests pass in core.
  • lexicons/temporal/src/composites/*.ts are one-line re-exports; lexicons/terraform/src/composites/terraform-watch-op.ts compiles unchanged.
  • A github pipeline generated for an op with schedule carries its cron; generate-op-pipeline.test.ts covers it.
  • chant operator ticks an op with schedule on that cron; operator.test.ts covers the cadence.
  • No composite in core imports anything from lexicons/temporal.
  • Repo-wide typecheck and npm test pass.

Activity

  1. added
    enhancement
    area:core
    area:ops
    on Sep 6, 2026
  2. lex00 commented on Sep 6, 2026

    @lex00
    ContributorAuthor

    Heads-up from the #2120 branch, not caused by it: with #2117 merged in, lexicons/terraform/src/op/activities/choudoufu.test.ts fails to load with [vitest] No "execFile" export is defined on the "node:child_process" mock.

    Chain: #2117 made packages/core/src/op/activity-registry.ts statically import * as baseActivities from "./activities", so @intentius/chant/op — which lexicons/terraform/src/op/activities/terraform.ts imports for safeHeartbeat — now pulls op/activities/converge.ts and through it ../../lifecycle/*, reaching packages/core/src/lifecycle/index.ts and affected.ts's top-level promisify(execFile). That test's vi.mock("node:child_process") is a full replacement with only exec on it.

    Verified pre-existing: it fails on the merge of main + #2117 with none of #2120's changes applied (stash test), and passes on main alone. Fix is one importOriginal in that test's mock, or making the registry's base-activity import lazy — either belongs to #2117 rather than here, so I left it. Everything else is green on the #2120 branch: npx vitest run 15803 passed / 36 skipped with that one suite failing, repo typecheck 44 baselined + no regressions, check-lexicons tier 1 all green, docs prose ratchet no regressions.

  3. 13 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corearea:opsenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions