Repository navigation
feat(cli): OpRuntimeProvider hook, chant run --on <lexicon>, run approve (#2121) - #2137
Merged
Merged
Conversation
This was referenced Sep 6, 2026
…ove (#2121) `chant run` had two runtimes braided through one file. This puts a seam between the CLI and whatever hosts a run, and moves every subcommand onto it. `packages/core/src/op/runtime.ts` declares `OpRuntimeProvider` with `start`, `status`, `log`, `list`, `cancel`, an optional `resolveGate` and an optional `runComponents`. `LexiconPlugin.opRuntime` hangs one off a lexicon, next to `generateOpPipeline`; core ships `local` (`op/runtimes/local.ts`), wrapping `runOpLocally` and deriving status, log and list from the `OpRunResult` this process produced. `chant run` resolves one runtime per invocation: `--on <name>` picks the named lexicon's provider, otherwise `local`. `run list/status/log/cancel` call it instead of refusing outside `--temporal`, and `run signal` becomes `run approve <op> <gate>`, which records the same gate-ledger fact `chant approve` writes (`recordGateApproval`, extracted from handlers/operator.ts) and then wakes the runtime through `resolveGate`. `cli/mcp/op-tools.ts` moves onto the provider and no longer imports `makeTemporalClient`; `op-signal` becomes `op-approve`. `runOpLocally` gains an optional `onRecord`, so `--progress-json` streams a StepRecord per settled step on the local runtime too. `OpRunStatus` and `OpRunRecord` are minimal here; #2118 owns the ledger-backed shape and the two reconcile at merge. `--temporal` and the Temporal code behind it are left in place, and #2116 deletes them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JH1b63nCr6fXETJYMvL4xK
lex00
force-pushed
the
feat/2121-op-runtime-seam
branch
from
September 6, 2026 15:38
842d4d5 to
b81cac8
Compare
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 #2121. Sub-issue 5 of #2114.
chant runnow resolves one runtime per invocation and every subcommand goes through it. Core ships thelocalprovider; a lexicon that hosts runs implementsLexiconPlugin.opRuntimeandchant run <op> --on <lexicon>finds it.run signalis renamedrun approveand shares the ledger write withchant approve(recordGateApproval), then calls the provider's optionalresolveGate. The MCP op tools go through the same seam.One documented deviation from the issue body, posted as a comment on #2121:
--temporalstays reachable as a pre-seam branch rather than unreachable, because about forty tests exercise it and the issue's own acceptance requiresrun.test.tsto pass. #2130 deletes that branch and the Temporal code in one diff.Acceptance
OpRuntimeProviderexists in core,LexiconPlugin.opRuntimeis declared, andlocalis registered as the default provider.chant run <op>with no flag behaves exactly as today on the local runtime; therun.test.tssuite passes unchanged apart from the rename ofsignaltoapprove.chant run <op> --on stubin a test with a stub lexicon plugin reaches the stub'sstart, andrun status/log/list/cancel --on stubreach their methods.chant run <op> --on nopeerrors with the configured-lexicon list;--onon a lexicon withoutopRuntimeerrors naming the lexicon.chant run approve <op> <gate>writes the resolution and callsresolveGatewhen the provider has one.cli/mcp/op-tools.tsno longer importsmakeTemporalClient; the MCP op tools work on the local provider.docs/src/content/docs/cli/run.mdxdocuments--onandapprove; the--temporalparagraphs are left for epic: remove Temporal from chant — lexicon, core, examples, docs, CI, npm #2116.npm testpass.Gates
npx vitest run packages/core: 357 files passed.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: 4220 findings, 1 below baseline, no regressions.node scripts/check-docs-diataxis.mjs: no failures.🤖 Generated with Claude Code
https://claude.ai/code/session_01JH1b63nCr6fXETJYMvL4xK