Repository navigation
feat(op): labels for discovery, a run ledger for outcomes, Chant::Op (#2118) - #2147
Merged
Merged
Conversation
This was referenced Sep 6, 2026
lex00
force-pushed
the
feat/2117-activities-into-core
branch
from
September 6, 2026 15:39
66ac07f to
6142bcc
Compare
lex00
force-pushed
the
feat/2118-op-model-run-ledger
branch
from
September 6, 2026 15:40
cd3f6c2 to
d666cec
Compare
lex00
force-pushed
the
feat/2117-activities-into-core
branch
from
September 6, 2026 16:00
6142bcc to
cbcfc5b
Compare
lex00
force-pushed
the
feat/2118-op-model-run-ledger
branch
from
September 6, 2026 16:00
fd78217 to
1355646
Compare
lex00
force-pushed
the
feat/2117-activities-into-core
branch
from
September 6, 2026 16:35
cbcfc5b to
e4c5fb5
Compare
lex00
force-pushed
the
feat/2118-op-model-run-ledger
branch
from
September 6, 2026 16:35
1355646 to
9586ab4
Compare
…2118) `OpConfig` carried three fields only a workflow engine reads. `taskQueue` and `namespace` are gone. `searchAttributes` split by what it was actually doing: - Discovery keys become `labels: Record<string, string>`. `ConvergeOp` sets `Converge` and `Env`, `WatchOp` sets `Watch`, `discoverConvergeOps` reads both, and `chant run list` prints them where the task queue used to sit. - Run outcomes become ledger facts. `packages/core/src/lifecycle/run-ledger.ts` appends one `OpRunRecord` per settled run to `<env>/runs__<op>.jsonl` on the lifecycle branch, carrying the run id, the start and end instants, the status, the Op's labels, every captured `outcomeAttribute`, and each phase's per-step verdict. `chant operator log` merges those into its timeline; `chant run <op> --json` prints the same record it writes. The path is `runs__<op>.jsonl`, not `runs/<op>.jsonl`: `writeBlobToPath` assembles the orphan branch with `git mktree` over a flat `<env>/<file>` layout, and mktree rejects a slash in an entry name. `__` is the separator `snapshotKey` already uses for the same reason. Noted on the issue. The record is the shape #2121's `OpRuntimeProvider` reads back, so it lives in `packages/core/src/op/runtime.ts` beside the contract rather than in the ledger module, replacing that issue's placeholder. The built-in local runtime's `status`, `log` and `list` answer from the ledger — a run started by cron, CI or another machine is visible, and an answer survives the process — keeping its in-memory history only as the fallback for a project with no ledger to read. `start` is where the append happens, the one seam every local run passes through. `status` is #2119's three-state outcome, `gated` included, and a gated record names the gate it stopped on. `OpResource` becomes `("Chant::Op", "chant", {})`. That moves Op entities out of the temporal partition, so `op-ir.ts` moves to core (taking the activity contract registry as a parameter, defaulting to empty, so core imports no lexicon; profiles come from #2117's `ACTIVITY_PROFILES`), `chant build` writes `dist/ops/<name>/op.json` itself at `formatVersion` 2.0, and Ops are held out of `partitionByLexicon` the way secret declarations and plan scenarios already are. `lexicons/temporal/src/op/op-ir.ts` stays as a shim binding this lexicon's contracts, until epic C deletes it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JH1b63nCr6fXETJYMvL4xK
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JH1b63nCr6fXETJYMvL4xK
…on the Op (#2118) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JH1b63nCr6fXETJYMvL4xK
lex00
force-pushed
the
feat/2118-op-model-run-ledger
branch
from
September 6, 2026 17:11
9586ab4 to
fa9338c
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2118. Sub-issue 2 of #2114. Stacked on #2146 (#2117), which stacks on #2139 and #2137; retarget to
mainas those merge.OpConfiglosestaskQueue,namespaceandsearchAttributes. Discovery keys becomelabels, read bydiscoverConvergeOpsand printed bychant run list. Run outcomes (Phase,Drift,Approver, theoutcomeAttributecaptures) become facts on a new run ledger, one record per settled run on thechant/lifecyclebranch at<env>/runs__<op>.jsonl, andchant operator loginterleaves them. The record shape is the oneOpRuntimeProvider(#2121) reads back, so the local runtime'sstatus,logandlistnow survive the process.OpResourcebecomesChant::Opin lexiconchant, andchant buildwritesdist/ops/<name>/op.jsonfrom core (formatVersion2.0) with nothing else generated underdist/ops/.Two consequences, both commented on #2118: the ledger path uses a
runs__prefix rather than aruns/directory becausewriteBlobToPathbuilds the orphan tree withgit mktreeover a flat layout; and taking Op entities out of the temporal serializer's partition meanschant run --temporalhas no generated worker until #2130 deletes that path, which is what the issue asks for and what epic #2116 completes.Acceptance
OpConfighaslabelsand notaskQueue,namespace, orsearchAttributes; the workspace typechecks with the composites and the operator switched tolabels.discoverConvergeOpsfinds aConvergeOpbylabels.Convergeand scopes--envbylabels.Env;operator.test.tscovers both.run-ledger.tsappends oneOpRunRecordperrunOpLocallycompletion (ok, fail, gated) with a test on the same git fixtureconverge-ledger.test.tsuses. Path is<env>/runs__<op>.jsonl(see above).chant operator logshows run records interleaved with tick records;chant run <op> --jsonoutput equals the appended record.op.jsonis written by core withformatVersion2.0,labelspresent, and the three deleted fields absent; the round-trip test is ported.Temporal::Opstring remains inpackages/orlexicons/outsidelexicons/temporal.Gates
npx vitest run packages/core lexicons/temporal lexicons/terraform lexicons/github: 507 files passed, 1 skipped.npx tsx scripts/typecheck.ts: 44 known failures, no regressions.npx tsx scripts/check-lexicons.ts: no untracked tier-1 failures.node scripts/lint-docs-sentences.mjs: 4217 findings, 4 below baseline, no regressions.node scripts/check-docs-diataxis.mjs: no failures.🤖 Generated with Claude Code
https://claude.ai/code/session_01JH1b63nCr6fXETJYMvL4xK