Repository navigation
fix(core,fountain): --approver on chant approve, the fountain approve re-run, and --profile back on chant run (#2192) - #2197
Merged
Conversation
… re-run, and --profile back on chant run (#2192) Seven leftovers from #2116 that are behaviour rather than prose, each proven against main at 4853da2. `chant approve <op> <gate> --approver <name>` dropped the name: `runApprove` read only `ctx.args.actor`, so the ledger fell through to $GITHUB_ACTOR or $USER while every example README teaches `--approver you`. It now reads `approver ?? actor`, the precedence `chant run approve` has had since #2126. `chant run approve <op> <gate> --on fountain` posted `chant run approve <op> <gate>` onto the steward's thread. The ACP parser reads that as the approve verb, so the sandbox wrote the same resolution a second time on its local runtime and never re-applied the op. It now posts `chant run <op>`, still carrying `--approver` and `--url`, which parses as an op run and re-reads the gate from the ledger. A test asserts the prompt string and feeds it back through `parseChantCommandLine`. The three docs pages and the getting-started walkthrough follow; the walkthrough drops the local `chant approve` that wrote the resolution twice and gains a closing `chant run status`. What a live fountain instance is still needed to prove is recorded on #2180. `-p/--profile` is back in `parseArgs` and `ParsedArgs`, threaded through `OpRunStartOptions.profile` to the runtime seam. The fountain runtime picks the named profile per run and refuses an undeclared name rather than falling back to `defaultProfile`. `profiles.mdx` drops its `temporal.profiles` comparisons. `test/azure-drift-e2e.sh` generated a config naming a lexicon that cannot resolve and an `OpConfig` field that does not exist; both are gone. The `OperatorStack` destructive-target refusal cited TMP014 and argued from the local executor's inability to honour a gate, which OPS014's own header retires. It now cites OPS014 and gives OPS014's reason. `--durable-requests` reads as reserved in `cli/run.mdx` and `registry.ts`, matching `cli/run.mdx:55` and the runtime that refuses it by name. The MCP context bundle told agents `chant://ops` carries `taskQueue`, that the runs resource is workflow history, and that ops have `chant-op-<name>` workflow ids. It now matches `resource-handlers.ts`. The agent-integration diagram source and both tracked SVGs show `op-approve` and drop "durable". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0148a4dPTErCBpmNy7J7933f
This was referenced Sep 7, 2026
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 #2192.
Sub-issue 1 of #2191: the seven findings that are behaviour rather than prose. Each was proven against main at 4853da2 and re-read before editing.
The seven fixes
chant approve --approverrecorded the wrong person.runApproveinpackages/core/src/cli/handlers/operator.tshanded onlyctx.args.actortorecordGateApproval, andrecordGateApprovalfalls through to$GITHUB_ACTOR,$GITLAB_USER_LOGINor$USERwhen that is absent.--approverwas parsed and then thrown away, so every example README that teaches--approver youwrote the shell user onto the ledger. The getting-started transcript shows exactly that:[approved] alexunder its own--approver you. The handler now readsapprover ?? actor, the precedencechant run approvehas applied since #2126, and the READMEs stay as written. The stale--approverdocstring inregistry.ts, which described the flag as riding achant run signalpayload into workflow history, now says what the flag does.chant run approve --on fountainnever re-applied the op. The fountain runtime'sresolveGateposted the promptchant run approve <op> <gate>onto the steward's thread under a comment saying it re-runs the op. The ACP command parser inlexicons/fountain/src/acp/command-line.tsonly classifies a prompt askind: "op-run"when the command isrunwith a path and no compound verb;run approveis a registered compound, so it parsed as a verb,runOpApprovewrote the same resolution a second time on the sandbox's local runtime, and the sandbox printed "re-runchant run <op>" at nobody. The prompt is nowchant run <op>, which parses as an op run, and the re-run decides the gate from the ledger throughevaluateGateinpackages/core/src/op/gate.ts.--approverand--urlstill ride along so the thread names who resolved the gate. The two error messages that called it "the approve prompt" now call it the re-run prompt.--profiledid not exist. Commit 257ca0c deleted-p/--profilefrom the parser with a message claiming nothing outside the Temporal paths read it, but #2124 had already documented it for fountain, and three fountain pages plus the skill still teach it. The flag is back inparseArgsand inParsedArgs,OpRunStartOptionsgrows aprofilefield,runOpOnRuntimepasses it, and the fountain runtime selects that profile before it opens its connection. It keeps the refusal #2124 shipped: a name that is not underfountain.profilesis an error rather than a silent fall back todefaultProfile, so a misspelt profile cannot run against the wrong instance.profiles.mdxloses its twotemporal.profilescomparisons;runtime.mdx:40andchant-fountain-ops.md:89were already true and are untouched.test/azure-drift-e2e.shgenerated a config that cannot load. It wrotelexicons: ["azure", "temporal"], naming a lexicon that no longer resolves, andtaskQueue: "azure-drift-e2e"into anOpwhose config has no such field. Both are gone.The
OperatorStackrefusal cited the wrong rule and argued from a retired premise.deriveHostVerbClassthrew "(TMP014; the local dispatch executor can't honor its required gate)" and then advised remediating "manually via a gated op", which contradicts the reason it just gave. The rule is OPS014, and its own header records that #2119 retired the executor argument: a gated op ends the rungatedrather than being refused, so the refusal stands on the unattended-approval ground instead. The message now names OPS014 and gives that reason. The other TMP014 comment citations in the same file (lines 40, 44, 49, 107, 201) belong to #2195 and are untouched.--durable-requestswas documented as honoured. Its only implementation throws, pending managoat/managoat#1635. Thecli/run.mdxflag table row and theregistry.tsdocstring now read as reserved and name the upstream issue, consistent with whatcli/run.mdx:55already said.The MCP context bundle served agents false ground truth. It said
chant://opsreturnstaskQueue(the handler returnslabels), thatchant://ops/{name}/runsis workflow run history (it is the run ledger), and that ops carry deterministic workflow idschant-op-<opName>, which do not exist. The bundle now matchesresource-handlers.tsand the Workflow IDs section is gone. The tracked diagram sourcedocs/diagrams/agent-integration-surfaces.ir.jsonand both SVGs showedop-signal, renamedop-approveinmcp/op-tools.ts, and "durable · observable · gate-able".Acceptance
chant approve <op> <gate> --approver yourecordsyouon the gate ledger, with a test.packages/core/src/cli/handlers/operator.ts:557(actor: ctx.args.approver ?? ctx.args.actor); test "--approverwins over--actorand over the CI/shell identity" inoperator.test.ts, which stubsGITHUB_ACTOR=ci-botandUSER=alexand assertsresolvedBy: "you".chant run approve <op> <gate> --on fountainpostschant run <op>with the approver and url, with a test on the prompt text; the three docs pages and the getting-started walkthrough describe what happens.lexicons/fountain/src/op/runtime.ts:888(const parts = [\chant run ${op}`]); tests "posts the op's re-run prompt with the approver and the url" and "the posted prompt parses as an op run, not as a verb" inruntime.test.ts. Pages:tutorials/fountain-steward.mdx:183,cli/run.mdx:55,guide/operator.mdx:147, pluslexicons/fountain/docs/pages/runtime.mdx:77andsrc/skills/chant-fountain-ops.md:121, which said the same stale thing.examples/getting-started/README.md:226drops the redundant localchant approveand closes withchant run status --on fountain`.chant run <op> --on fountain --profile <name>selects that profile, with a test; the three fountain pages and the skill stay accurate.packages/core/src/cli/main.ts:196,registry.ts:40(profile?: string),op/runtime.ts:152(OpRunStartOptions.profile),handlers/run.ts:767,lexicons/fountain/src/op/runtime.ts:732(selectProfile(startOpts.profile)). Tests: "-p/--profilecarries the runtime's connection profile" inmain.test.ts, "--profilereaches the hosting runtime's start options" and "without--profilethe runtime is left to its own default" inrun.test.ts, "--profileon the run selects that profile's endpoint, token and team" and "--profilenaming an undeclared entry is refused on the run" in the fountainruntime.test.ts.profiles.mdxrewritten at lines 7, 43 and 76;runtime.mdx:40andchant-fountain-ops.md:89were already true and stay as they are.test/azure-drift-e2e.shgenerates a config with no temporal lexicon and no taskQueue.test/azure-drift-e2e.sh:101is nowlexicons: ["azure"], and thetaskQueue:line underOp({ name: "deploy" ...})is deleted.lexicons/k8s/src/composites/operator-stack.ts:214; test "deriveHostVerbClass: the destructive refusal names OPS014 and the unattended-approval reason" asserts/OPS014/,/unattended/and noTMP014.--durable-requestsreads as reserved incli/run.mdxandregistry.ts.docs/src/content/docs/cli/run.mdx:191andpackages/core/src/cli/registry.ts:269.context.tsmatchesresource-handlers.ts; the agent-integration diagram source and SVGs showop-approve.packages/core/src/cli/mcp/resources/context.ts:72-74againstresource-handlers.ts:158-166;docs/diagrams/agent-integration-surfaces.ir.json:24,33and both tracked SVGs.What was and was not verified for the fountain re-run
Verified offline, in
lexicons/fountain/src/op/runtime.test.ts: the exact string posted toPOST /api/conversations/:id/promptsischant run alb-deploy --approver alex --url https://github.com/o/r/pull/1, and that same string, fed back throughparseChantCommandLine, parses askind: "op-run"withop: "alb-deploy"and both flags set. That test runs core's ownparseArgsandresolveCommand, not a stub parser.Not verified, because it needs a live instance: that the sandbox's
chant run <op>can reach thechant/lifecycleorphan branch from inside the sandbox's checkout; that the re-run's turn completes rather than gating again; and whetherconversation_busyis hit in practice when the approve command is issued while the first turn is still settling. All three are recorded on #2180 along with the closingchant run statusstep added to the getting-started walkthrough.Diagram rebuild
bash scripts/build-diagrams.shwas run and reports both agent-integration SVGs copied todocs/public/diagrams/(gitignored). It does not regenerate them: it renders.dotsources with graphviz and passes.svgfiles through as-is, and these two are pinhole renders (see 676338a), whose.dotsource was deleted when they were repainted.pinholeis not installed here, so the two tracked SVGs were edited by hand to match the.ir.json. Both edited strings sit in left-anchored<text>elements inside their cards, so nothing re-centres:op-run · op-status · op-approveis one character longer than the old label and stays well inside the 237px card, andobservable · gate-ableis shorter than what it replaces.Gates
All run from the worktree root at 76d5923.
npx vitest run packages/core lexicons/fountain lexicons/k8snpx vitest run packages lexiconsnpx tsc --noEmit -p packages/core/tsconfig.jsonnpx tsx scripts/typecheck.tsnpx tsx scripts/check-lexicons.tsnode scripts/depcheck.mjsnpx eslint packages/meta/publish-metadata.test.tsnode scripts/lint-docs-sentences.mjsnode scripts/check-docs-diataxis.mjsThe prose ratchet came out one below its baseline, from replacing an em dash in
guide/operator.mdxwith a sentence break. The baseline file is left at 4111 rather than ratcheted down, to keep this diff to the seven fixes.The first cold run of the full suite timed out 9 tests across 5 files, all of them CLI-subprocess end-to-end tests with a 20s per-test limit (
security-boundary,component-security-boundary,op/discover,mcp/server,commands/audit). Every one passes on a warm re-run, and the same targeted command on the main checkout at b111293 passes all 477 files in 40s against this worktree's cold 80s, so it is transform-cache warmth rather than the change. The numbers in the table are the warm runs.🤖 Generated with Claude Code
https://claude.ai/code/session_0148a4dPTErCBpmNy7J7933f