Repository navigation
Closed
Labels
enhancementNew feature or requestepic:self-serviceSelf-service from templates: catalog, add-ons, day-2 actions, agent requests, upgradesproduct-pipelinesterragucci and SQL Yodeler on chant's shared pipeline layer (gates, waves, overrides, releases)
Description
Unit of INTENTIUS/chant#4642 (epic: self-service from templates). Paths at behold origin/main c70fa72.
Day-2 actions from behold: an app card lists the actions its template offers, a button asks terragucci to run one, and the card's history shows each request, its approval and how it ended. behold approves nothing here; the approval is a person's, as for a wave.
Today
- The terragucci timeline (
GET /api/terragucci/timeline?root=,src/terragucci-timeline.ts) readsaudit.jsonland the inspect pane filters it to a card's root (web/terragucci-timeline.js:3). - The lifecycle read (
GET /api/terragucci/lifecycle) lists wave gates with their states and approve lines; it reads_gates/tf-apply.jsonlonly. - behold never approves on a terragucci repo; the remedy names
npx terragucci approve ...(AGENTS.md "Invariant").
To build
- The app card's inspect pane lists the template's
actions(fromtemplate.yml, through/api/templates/apps), one button each, labelled with the action's name. POST /api/templates/action{root, address}dispatches terragucci's action workflow with those inputs (GitHub throughgh, Forgejo through its dispatch API), allowlisted on a terragucci repo, and follows the run./api/terragucci/lifecyclereads_gates/tf-action.jsonland_gates/tf-action/applied.jsonltoo, so a pending action shows as a gate card with statewaitingand its approve line (terragucci approve action <root> --plan <digest>), thenappliedwith the result.- The card's history reads the timeline's
action-requestedandactionentries for the root: who asked, who approved, the digest,okorfailed, and the run link.
Done when (build, checked in CI)
- With a fixture
template.ymlnamingaction.aws_lambda_invoke.rotate, theordersinspect pane shows one buttonrotate; clicking it runsgh workflow run terragucci-action.yml -f root=apps/orders -f address=action.aws_lambda_invoke.rotate(spawn spy). -
POST /api/templates/actionwith an address not listed in the template answers422 {code: "unknown-action"}and starts nothing. - A fixture
chant/lifecyclewith a pendingtf-actionfact makes/api/terragucci/lifecyclelist a gate{op: "tf-action", state: "waiting", command: "npx terragucci approve action apps/orders --plan sha256:..."}; with an applied and finished line it listsstate: "applied"andapplied.result: "ok". -
web/terragucci-timeline.test.js: anactionentry renders as "rotate on apps/orders, approved by , ok" with its run link. -
src/terragucci-repo.test.tspasses with the action route allowlisted; with--publicthe route answers405. -
docs/src/content/docs/using/templates.mdxdescribes the buttons, the gate card and the history;npm testandnpm run typecheckpass.
Done when (run, recorded on the harness)
-
not run: emulator runs dropped by maintainer ruling 2026-10-28tg-behold-action(terragucci harness, claimbehold/action-button). Plain arm: baseapps/orderswith therotateaction applied;out-of-bandstack/harness/check.sh behold-action apps/orders action.aws_lambda_invoke.rotate(exit 0), outcomeledger: {op: "tf-action", status: "gated", count: 1};out-of-bandstack/harness/check.sh chant-approve tf-action ...as the second identity;out-of-bandthe resume job, outcomeledger: {op: "tf-action", status: "ok", count: 1};out-of-bandstack/harness/check.sh behold-history apps/orders actionasserting oneactionentry withresult: ok(exit 0). BREAK arm:overlays/breakapproves as the requester's identity, the request stays gated, and theokoutcome does not hold (caught).
Depends on: #1036 (apps on the graph); INTENTIUS/terragucci#1310 (day-2 actions).
Tracker: INTENTIUS/chant#4642
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestepic:self-serviceSelf-service from templates: catalog, add-ons, day-2 actions, agent requests, upgradesproduct-pipelinesterragucci and SQL Yodeler on chant's shared pipeline layer (gates, waves, overrides, releases)
Activity
Merge unit/ss-behold-1037: Day-2 action buttons, the tf-action gate c…
lex00 commentedon Oct 28, 2026
Landed on
integration/self-serviceas merge7fd1ec0384340d0d0048e8648bd889055c19c1e0(unit commit 1d600ce onunit/ss-behold-1037), on top of #1036's merge, built on the published chant 0.124.54.What landed
POST /api/templates/action{root, address}insrc/templates.ts.422 not-an-app. An address the root'sactions(terragucci#1309) does not list answers422 unknown-actionwith the offered addresses. Neither starts anything.422 action-engine, naming the engine and where behold read it. The sources, in order, are terragucci.yml'sbinary,.opentofu-version/.terraform-version, and.tofufiles in the root, the way terragucci detects it but without the PATH check./api/projectcarriesterragucciActionRefusal, so the pane keeps the buttons, switched off, with the refusal beside them.terragucci-action.ymlwith exactlyrootandaddressthrough Apps on the graph: an app and its add-ons in one frame, with drift, add-on and upgrade buttons #1036's shared dispatch-and-follow helper:gh workflow run terragucci-action.yml -f root=apps/orders -f address=module.app.action.aws_lambda_invoke.rotateon GitHub, the dispatch API on Forgejo. An action opens no pull request, so the helper now takes the branch as optional and looks for none.409 no-action-workflowwhen the workflow is not committed.409 terragucci-too-oldwhen it takes neither input. GitLab answers422 request-forgewithnpx terragucci action <root> <address>.TERRAGUCCI_ALLOWED_WRITESand refuses on its own off a terragucci repo withtemplates, like the request and the upgrade. The non-allowlisted route walker still answers 409 for every other write.--publicanswers 405.src/terragucci-lifecycle.ts: terragucci's lane spec gainsactions. The read takes_gates/tf-action.jsonland_gates/tf-action/applied.jsonlinto a separateactionslist on/api/terragucci/lifecycle, so wave-shaped code is untouched. Each entry is{op: "tf-action", gate: "<root>:<address>", root, address, name, requester, state, digest, command}. It is decided by chant's gate-decision under the mode the request records, else the mode at base. The requester's own approval is left out and listed underuncountedwith the reason. While waiting,commandisnpx terragucci approve action <root> --plan <digest>. Once applied and finished,applied.resultisokorfailed, taken from the finished line'sdetail.result, withexit.audit.schema.jsonis re-vendored from terragucci integration at c5e88fc5.AUDIT_KINDSand the kinds fixture gainaction-requestedandaction, plus the three kinds that were unowned:unrecorded-write,agent-runandrequest. An entry'sdetail.rootnow counts as its root.appButtonsgives one button per action, labelled with its name.renderAppSectiondraws the root's action gate cards (Copy only) and its action history.web/terragucci-timeline.jswords an action asrotate on apps/orders, approved by dana, okand links its run (<repo>/actions/runs/<run_id>, from the ledger commit URL).gateCardElement.using/templates.mdxhas a "Day-2 actions" section. It also notes the issue or PR comment form (chant#4654 ruling).Tests
npx vitest run src/templates.test.ts: 36 passed (7 new).src/terragucci-repo.test.ts: 30 passed.src/terragucci-lifecycle.test.ts: 41 passed (3 new).src/terragucci-timeline.test.ts: 15 passed.web/terragucci-timeline.test.js: 7 (2 new).web/terragucci-lifecycle.test.js: 10 (2 new).web/template-apps.test.js: 10 (4 new).npm test: 4971 passed, 26 skipped (340 files, 9 skipped).npm run tscclean,npm run buildpasses,just checkpasses,node docs/scripts/lint-prompts.mjspasses.Build-level choices
module.app.action.aws_lambda_invoke.rotate, not theaction.aws_lambda_invoke.rotatethis issue's first check names. That check is ticked on the module address, which is what terragucci lists and dispatches.actions, notgates, because a gate there is a wave. The third check is ticked onactions[0].npm run typecheckdoes not exist (npm run tscpasses).stack/harness/check.shis not touched. The run item needsbehold-action <root> <address>(POST /api/templates/action; exit 0 on 202, nonzero on any refusal) andbehold-history <root> action(GET /api/terragucci/timeline?root=; exit 0 when exactly oneactionentry for the root hasresult: ok).chant-approveexists already.lex00 commentedon Oct 29, 2026
Build choice (2026-10-28): Pulumi actions on a plywood repo are not part of this unit (its build items are terragucci's). They are filed as behold#1038; until then Pulumi actions run from
plywood actionand the/plywood actioncomment.Merge integration/self-service into main (self-service epic: behold#1…
lex00 commentedon Oct 29, 2026
The terragucci harness side of the run item landed on terragucci
integration/self-servicein mergeb37f7eeb2a8794bffe78026dcef15898cca64df4(branchunit/ss-terragucci-harness):stack/harness/scenarios/tg-behold-action/scenario.jsonand the helpersbehold-actionandbehold-historyinstack/harness/check.sh.check.sh behold-action <root> <address>:POST /api/templates/actionwith{root, address}; exits 0 only on 202.check.sh behold-history <root> <kind>: waits for the repo's runs to settle, then runsterragucci audit(in the tofu CI image on the stack's network) intos3://terragucci-reports/hs-<id>/audit.jsonlin floci, the record the scheduled audit job writes. It then starts behold with that record as its--terraguccidirectory, with--terragucci-projecttaken from the record, and readsGET /api/terragucci/timeline?root=<root>. It exits 0 when exactly one<kind>entry for the root hasresult: ok.check.sh chant-approveapproves as the author underBREAK=1when the scenario'soverlays/breakholds anapprove-asfile sayingauthor.apps/ordersis an app made from the fixture templateacme/app/aws1.0.0, on Terraform. The catalog lists itsaws_lambda_invoke.rotateaction, so the apps read offersmodule.app.action.aws_lambda_invoke.rotate. Terraform takes a module download's location only from the X-Terraform-Get header, so this scenario's modules come from the stack's newtemplate-registryservice (profiletemplates,stack/harness/template-registry.mjs). That service answers from the repo's own files on Forgejo.pass): the base push applies orders's function;check.sh behold-action apps/orders module.app.action.aws_lambda_invoke.rotate(exit 0);check.sh settlewith outcomegated: {op: "tf-action", status: "gated", count: 1};check.sh chant-approve tf-action apps/orders:module.app.action.aws_lambda_invoke.rotateas the reviewer;check.sh rerun terragucci-resume.ymlwithgated: {op: "tf-action", status: "ok", count: 1};check.sh behold-history apps/orders action(exit 0).caught): the author, who asked, approves. That approval does not count, the request stays gated, and the resume step'sgated okoutcome does not hold.BEHOLD="node <behold checkout>/bin/behold.js" npx tsx stack/harness/harness.ts run tg-behold-actionThe issue's
ledgeroutcomes are chant#4650'sgatedoutcome: a gated request writes no op-run record. terragucci'sharness.tsnow passes the driver the gated requests it reads, which tg-action-run needs too. The address is the module address, as the merge comment above says. Not checked without a run: the exact shape of the action entries in behold's timeline (kind: "action",result: "ok",rootsholding the root), and whetherterragucci auditneeds more than--buckethere.How the behold helpers work: each one clones main of the scenario repo and starts
behold serveon that clone. This checkout's terragucci comes first on PATH,FORGEJO_TOKENis the author's token andFORGEJO_URLis the stack's Forgejo. The helper makes the same call a person's browser makes (same-origin, JSON), prints the answer and stops behold.BEHOLDnames the behold command, for exampleBEHOLD="node <behold checkout>/bin/behold.js"on a build of behold's integration/self-service. Without it the helpers usebeholdfrom PATH. UnderBREAK=1the scenario'soverlays/breakis copied over the clone first.behold_up,behold_callandbehold_checkoutinstack/harness/check.share the shared pieces, so a new helper is one more case arm.The scenarios read the fixture module registry
stack/harness/fixtures/templates/, which runs on the local Forgejo and floci only (details on terragucci#1308). The issue'splan,approveandapplysteps are terragucci out-of-band checks here (pr-run,review,main-runs) because terragucci writes no chant pr-report. Before a run:just stack-up forgejo,just imagesandjust build-cliin terragucci.harness.ts runexits 0 when the row holds. Nothing was run on the stack, and no run item is ticked. In terragucci atb37f7eeb2a8794bffe78026dcef15898cca64df4,npx tsx stack/harness/harness.ts lintreports 16 of 16 hold, andjust check-unit,just lint-docsandnpx tsc --noEmit -p tsconfig.jsonpass.lex00 commentedon Oct 29, 2026
Handoff (self-service-1, 2026-10-28).
Built: integration merge 7fd1ec0.
On main: e3cfbee (push CI green: ci 40791621907, docs 40791621919).
Left: the docs item (draft page using/templates.mdx) and the run item tg-behold-action. Pulumi actions on a plywood repo are filed as #1038.
Harness runs have not been made. They run on the emulator only (local Forgejo, floci on 127.0.0.1, wrapped in
chant e2e safe-run --scan), one repo at a time, after ci-products-1's pw22 round, with the products built against chant's integration/self-service (or a chant release carrying chant#4650-4655). Commands and expected verdicts: engine-wt/goals/self-service-1-runs.md.lex00 commentedon Oct 29, 2026
Close-out (2026-10-28)
behold: chant 0.124.58 bump merged to main at 1b8a812. The template-request feature-detect is now a static import and the TS2322 in src/component-status.test.ts is fixed. CI green: ci 40818247582, docs 40818247650. The using/templates guide is published, so the docs item is ticked. Run items are struck: the maintainer dropped the emulator harness runs on 2026-10-28, so they were not run.
lex00 commentedon Oct 29, 2026
Docs item now names using/templates.mdx, where the content shipped (behold main 1b8a812).