Skip to content

lifecycle: store each change set a gate binds, mapped to graph node ids (#4022) - #4058

Merged
lex00 merged 3 commits into
mainfrom
feat/4022-stored-change-sets
Oct 17, 2026
Merged

lex00 merged 3 commits into
mainfrom
feat/4022-stored-change-sets

Conversation

@lex00

@lex00 lex00 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Closes #4022

The change set a gate binds is now stored by its digest and can be read after the step ends, with each entry placed on its graph node.

  • components pr-apply stores the change-set document its gate binds before deciding the gate: _change-sets/<digest>.json on chant/lifecycle (under _members/<member>/ in a workspace), written once.
  • Each entry gets node, the id chant workspace graph uses for that address, read from the member's own chant graph --format ir with the member name in front in a workspace. A chant entry's id is its address; a terraform, tofu or choudoufu entry's is <root>/<block> with module calls as path segments and the instance index dropped. A delete of a block the planning commit no longer declares gets null. node and the new graph field stay out of the digest, so no existing digest changes.
  • If the graph can't be read (for example a member that fails chant lint, which chant graph refuses), the document is still stored with null nodes and pr-apply warns. The gate decides the same either way.
  • chant change-set show <digest> [--member <name>] [--json] prints it. --json is the new change-set-show read (v1, floor 0.124.28), reusing not-a-git-repository, ledger-unreadable and ledger-malformed.
  • A gate in workspace status --json gains changeSet when a document is stored under its planDigest. A component gate in a plain run --components binds the lifecycle-plan digest and has none.
  • storeGateChangeSet (lifecycle/gate-change-set.ts) is the call releases: gate approvals bind the release digest, the environment and the change set #4045 uses for release gates and empty resolutions; it is posted on releases: gate approvals bind the release digest, the environment and the change set #4045.

The graph read is one chant graph --format ir child process per new digest, a few seconds on a real project and skipped on a repeat apply or --resume. Tests inject the graph reader through setGraphIdReader. A new e2e test checks the in-process ids equal the spawned chant graph ids, so the fast unit test stays within the 5 s budget.

Level-0 output changes

On the exceptions page and #2525: --help lists change-set show; pr-apply writes a _change-sets/ commit to chant/lifecycle, runs chant graph --format ir once per new digest and may warn; workspace status --json gates gain changeSet; stored documents gain entries[].node and graph. No golden moved.

Acceptance

  • Change sets stored by digest and readable with chant change-set show (change-set-store.test.ts, gate-change-set.e2e.test.ts).
  • Entries map to graph node ids, with a test against a real estate: the tofu pull-request loop over five real roots, the repo's real floci plan as an aws workspace member checked against chant workspace graph, and change-set-graph.e2e.test.ts against a real terraform root with a module.
  • Pending gates link to their change set in the status contract ("a gate whose planDigest names a stored change set carries changeSet; a component gate does not", and the e2e through real workspace status --json).
  • epic: workspace read contracts for behold's default view (runs, waves, events, drift, change sets, metrics, alerts) #3990's stored-change-set item is cross-referenced (comment posted).

Checks

  • npx tsx scripts/typecheck.ts: no regressions (26 baselined)
  • npx tsx scripts/check-lexicons.ts: no untracked tier-1 failures
  • handlers, lifecycle, terraform components, change-set graph, read-contract, status-contract, boundary roster, level-0 and wave-loop goldens: 1638 passed with GITHUB_SHA, GITHUB_RUN_ID and CI set, after rebasing on run events: emitters in the local runtime, run --components, fountain, and pr-plan/pr-apply #4041
  • Full vitest: only the 3 known local op/factory.e2e.test.ts failures
  • lint-docs-sentences (no regressions), lint-prompts, check-docs-diataxis, ./scripts/build-docs.sh: pass

Not covered, noted on #4045: an Op gate that binds a composeChangeSet digest stores nothing yet.

lex00 added 3 commits October 16, 2026 21:39
…aph node ids (#4022)

components pr-apply stores the change-set document its gate binds at _change-sets/<digest>.json on chant/lifecycle (under _members/<member>/ in a workspace) before it decides the gate, written once. Each entry gets node, the id chant workspace graph gives it, mapped against the member's own chant graph --format ir; node and the document's graph stay outside the digest. storeGateChangeSet is the call #4045 makes for release gates and empty resolutions. chant change-set show <digest> --json prints the new change-set-show read (v1, floor 0.124.28), and a gate in workspace status --json gains changeSet when a change set is stored under its planDigest. The tofu pull-request loop test and an aws workspace member check the node ids against the real graph.
…eading the graph in process; the spawned graph moves to an e2e test (#4022)
@lex00
lex00 force-pushed the feat/4022-stored-change-sets branch from c180fa8 to 41050d0 Compare October 17, 2026 03:40
@lex00
lex00 merged commit 984534e into main Oct 17, 2026
11 checks passed
@lex00
lex00 deleted the feat/4022-stored-change-sets branch October 17, 2026 03:57
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.

lifecycle: store each change set a gate binds by digest, mapped to graph node ids

1 participant