Skip to content

feat(cli): OpRuntimeProvider hook, chant run --on <lexicon>, run approve (#2121) - #2137

Merged
lex00 merged 1 commit into
mainfrom
feat/2121-op-runtime-seam
Sep 6, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/2121-op-runtime-seam

Conversation

@lex00

@lex00 lex00 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Closes #2121. Sub-issue 5 of #2114.

chant run now resolves one runtime per invocation and every subcommand goes through it. Core ships the local provider; a lexicon that hosts runs implements LexiconPlugin.opRuntime and chant run <op> --on <lexicon> finds it. run signal is renamed run approve and shares the ledger write with chant approve (recordGateApproval), then calls the provider's optional resolveGate. The MCP op tools go through the same seam.

One documented deviation from the issue body, posted as a comment on #2121: --temporal stays reachable as a pre-seam branch rather than unreachable, because about forty tests exercise it and the issue's own acceptance requires run.test.ts to pass. #2130 deletes that branch and the Temporal code in one diff.

Acceptance

  • OpRuntimeProvider exists in core, LexiconPlugin.opRuntime is declared, and local is registered as the default provider.
  • chant run <op> with no flag behaves exactly as today on the local runtime; the run.test.ts suite passes unchanged apart from the rename of signal to approve.
  • chant run <op> --on stub in a test with a stub lexicon plugin reaches the stub's start, and run status/log/list/cancel --on stub reach their methods.
  • chant run <op> --on nope errors with the configured-lexicon list; --on on a lexicon without opRuntime errors naming the lexicon.
  • chant run approve <op> <gate> writes the resolution and calls resolveGate when the provider has one.
  • cli/mcp/op-tools.ts no longer imports makeTemporalClient; the MCP op tools work on the local provider.
  • docs/src/content/docs/cli/run.mdx documents --on and approve; the --temporal paragraphs are left for epic: remove Temporal from chant — lexicon, core, examples, docs, CI, npm #2116.
  • Repo-wide typecheck and npm test pass.

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

…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
lex00 force-pushed the feat/2121-op-runtime-seam branch from 842d4d5 to b81cac8 Compare September 6, 2026 15:38
@lex00
lex00 merged commit f7abe03 into main Sep 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core(cli): OpRuntimeProvider hook on LexiconPlugin, chant run --on <lexicon>, run approve; local becomes the built-in runtime

1 participant