Repository navigation
Description
terragucci writes its own gate, approval, apply and run lines to chant/lifecycle with raw git, and decides approvals with its own code. Ruling E (INTENTIUS/plywood#1) says these records belong in the chant workspace ledger, written by chant. Ruling F says both products use the same chant feature. Most of the storage exists already. This issue lists the ledger and API for each record, and the few pieces chant still lacks.
Read at chant ef5e494 and terragucci 83fac46. terragucci paths are under packages/terragucci/.
Audit finding covered
Finding 3. terragucci's appendLifecycle (src/apply.ts:586-611) builds commits with hash-object, commit-tree and push. It never resolves a member prefix (no _members or resolveMemberLedger anywhere in src/), so inside a workspace its lines land at the top of the branch, apart from the member's ledger chant writes. Gate logic is its own too: parseLedger (src/apply.ts:424), decideGate (:467), spendStanding (:2472), quorum (:3365-3460), and the pr-review record (src/review.ts:1-30). The op-waves spec passes only approvals: { spend: true } (src/chant-waves.ts:91) and ledger under pr-review (:77).
The ledger
The member's ledger on chant/lifecycle: the top of the branch at level 0, _members/<member>/ for a member, resolved by resolveMemberLedger (packages/core/src/lifecycle/member-ledger.ts:84). The table is in the workspace declaration reference, section Ledgers. Decision ws-068 keeps these ledgers as append-only ledgers read through the read contract (chant ledger, chant query).
Each terragucci write and its chant home
| terragucci writes | at | chant ledger and API |
|---|---|---|
| wave pending facts and approvals | _gates/tf-apply.jsonl (src/apply.ts:520, :570-580) |
gate ledger _gates/<op>.jsonl: appendPendingGate and appendGateResolution (packages/core/src/lifecycle/gate-ledger.ts:475, :460), read with readGateLedger / parseGateLedger (:528, :543). Op waves already write these. |
| applied and finished lines | _gates/tf-apply/applied.jsonl |
AppliedGateRecord and FinishedGateRecord (packages/core/src/lifecycle/gate-applied.ts:25, :64, path :76), written by op waves through the port's appendApplied (packages/core/src/op/op-waves-run.ts:2484) under approvals.spend. isApprovalSpent (gate-applied.ts:140) replaces spendStanding. |
| the plan report beside a pending fact | _gates/tf-apply/wave-<k>/<digest>.json (src/apply.ts:557, :3634) |
the change-set store _change-sets/<digest>.json: persistChangeSet and readStoredChangeSet (packages/core/src/lifecycle/change-set-store.ts:54, :109), under retention. The pending fact cites the digest. No new store. |
| migration proof, applied and done | _gates/<migrate op>/…, done.jsonl (src/migrate.ts:88-90, :1597, :1642, :1658) |
gate ledger plus applied.jsonl / finished lines, as above |
| state export done | _gates/<export op>/done.jsonl (src/export.ts:56, :314) |
gate ledger for the request and approval, applied.jsonl and a finished line for the export |
| state-lock release done | _gates/<unlock op>/done.jsonl (src/unlock.ts:53, :417) |
same as export |
| ephemeral copy records | chant's own _pr-envs/records.jsonl (src/ephemeral.ts:116, :612) |
chant's PR-environment ledger (packages/core/src/components/pr-environment.ts:54-55). chant exports only the parser (parsePrEnvRecords, :249), no append, so terragucci writes chant's file by hand. |
| module release records | <env>/releases.jsonl (src/publish/ledger.ts:23, src/publish/index.ts:471, :587) |
release ledger: appendReleaseRecord (packages/core/src/lifecycle/release-ledger.ts:398) |
| agent runs | _gates/agent-runs.jsonl (src/report/audit.ts:97, src/agent-record.ts:214) |
run ledger <env>/runs__<op>.jsonl: appendRunRecord (packages/core/src/lifecycle/run-ledger.ts:164) |
| overrides | (through chant today) | override ledger _gates/policy-override.jsonl: recordOverrideDenial and recordOverridesApplied (packages/core/src/lifecycle/override-ledger.ts:43, :50) |
Gate decisions
| terragucci | chant |
|---|---|
decideGate (src/apply.ts:467) |
decideGateApproval (packages/core/src/gate-decision.ts:496), evaluateGate (packages/core/src/op/gate.ts:799) |
quorum, quorumSince and the rest (src/apply.ts:3365-3460) |
approvals.quorum (packages/core/src/op/op-waves.ts:56-60, packages/core/src/op/gate-quorum.ts) |
its own pr-review record (src/review.ts:1-30) |
op waves' pr-review branch (packages/core/src/op/op-waves-run.ts:1938-1950) and approvals.reviewLedger (op-waves.ts:542) |
Missing in chant (core, both products)
- Op waves append a run record per wave run to the run ledger with
appendRunRecord. Today only the local executor does (packages/core/src/op/local-executor.ts:1776), so a wave apply leaves noruns__<op>.jsonlline. - A pending fact can cite a stored change set by digest, so a refusal or a respond job reads the plans an approval was asked for.
- A gated request for an op that has no wave (export, unlock, ephemeral copy, migration): request, approve, applied, finished, all on the gate ledger, decided by
decideGateApprovalwith the same quorum andpr-reviewrules. plywood needs it forplywood approveandplywood overrideoutside waves. - An exported append for
_pr-envs/records.jsonl. - Every write above takes the member prefix and honours
--no-record.
None of this is engine-specific, so nothing goes to a lexicon.
Missing in terragucci
Pass pr-review and the quorum rules through the op-waves spec, write each record through the chant API in the table, and delete appendLifecycle, parseLedger, decideGate, spendStanding and the quorum code.
Acceptance
-
git grep -n "commit-tree\|hash-object" packages/terragucci/srcfinds no ledger writer. - In a workspace member, terragucci's records land under
_members/<member>/, andchant ledger gatesandchant ledger runslist them. - A wave decided under quorum or
pr-reviewgives the same answer in terragucci and in a plain op-waves spec.
Related: #4530, INTENTIUS/terragucci#1280, #4545, INTENTIUS/plywood#1.
Activity
lex00 commentedon Oct 27, 2026
Design for the four ledger gaps (ci-products Wave 0). The record-by-record mapping in the body above is ruled and this builds on it. Paths are at
origin/integration/ci-products(chant 3037bbe, terragucci 18f6431); chant paths are underpackages/core/src/, terragucci paths underpackages/terragucci/src/.Two things hold for all four and need no new code. Every chant ledger write resolves the member prefix from its
cwd(lifecycle/git.ts:40-46,ledgerPrefixOfcallsresolveMemberLedger), so a writer only has to run withcwdinside the member.--no-recordandCHANT_NO_RECORDare enforced in the git layer (lifecycle/no-record.ts), so every writer below honours them once it goes throughlifecycle/git.ts. The one wiring gap ischant run wave: its handler (cli/handlers/run-wave.ts:45) never readsargs.noRecord(cli/registry.ts:757), so gap 1 adds it there the waycli/handlers/run.ts:1039does.Every new floor below is
export const <NAME>_FLOOR = NEXT_RELEASE;(release-floors.ts:22, now 0.124.55), soscripts/release-floors.tsresolves them at the next cut. terragucci stays green on its pinned chant 0.124.54 through the loader pattern it already uses inchant-next.ts:1-20: a@ts-ignored dynamicimport()of the new subpath (reachable through the package's./*export), undefined on an older chant, with today's code as the fallback.1. Op-wave run record
Today only the local executor appends a run record (
op/local-executor.ts:1776);runOpWave(op/op-waves-run.ts:1197) writes the outcome file and returns.Shape. The existing
OpRunRecord(op/runtime.ts:119), written withappendRunRecord(lifecycle/run-ledger.ts:164) to<env>/runs__<spec.name>.jsonl, one line perchant run wavejob, plus one optional field:phaseshas one phase per wave the job walked (arestwave walks several), namedwave-<k>, and one step per run target:fnis the target,okwhen it applied,failwhen it failed,skippedwhen it moved, was blocked or waited.gateis set on a gated job with the wave's gate and the pending fact's timestamp.runOriginandgitShaare filled as the executor fills them.idis minted; a job joins its pending facts onrunOriginandwave, since every job of one CI run shares the CI run id the facts carry (op/op-waves-run.ts:2026).Status, until chant#4553's table lands: exit 0 is
ok, 3 isgated(orwaitingwhen the gate asks a decision point), 5 and 6 areokwithwave.outcomeset (the job applied nothing and nothing failed), and 1, 4, 7 and 8 arefailwithfailure.codecommand-failed,moved,deniedorpoint-refused.wave.exitCodeis kept raw so a reader can map it under #4553 once ruled.Writer. A new optional port on
RunOpWaveOptions(op/op-waves-run.ts:610),runs?: { append(record: OpRunRecordInput): Promise<void> }, defaulting toappendRunRecordpluspushLifecycleReport(lifecycle/git.ts:897) overcwd.runOpWavecalls it on every return path: the end (:1238), the two early returns (:1210,:1218) and the throw path (:1226). A failed write warns and never changes the exit code, asnotifyOpWavedoes.Read contract.
runsinchant queryandchant ledgergains awaveJSON column (lifecycle/query.ts:73), filterable as--where wave.spec=tf-apply;runs.schema.jsongains the optionalwaveobject. FloorOP_WAVE_RUN_RECORD_FLOOR.terragucci. Nothing to call. Its waves run through the chant bin it installs (
chant-waves.ts:1-20), so the record appears once that bin is at the floor and is absent before it, which is today's state.2. A pending gate that cites a change set
An op wave binds a set digest (
opWaveSetDigest,op/op-waves-run.ts:871), which is not a change-set document's digest, so the ledger keeps no plan an approval was asked for. terragucci fills the gap with its own file_gates/tf-apply/wave-<k>/<digest>.json(apply.ts:557, written at:3634, read atapply.ts:560andapprove.ts:198).Shape.
PendingGateRecord(lifecycle/gate-ledger.ts:323) andGateResolutionRecord(:96) gainchangeSet?: string, the digest of a document stored in_change-sets/bypersistChangeSet(lifecycle/change-set-store.ts:54). On a pull-request or release gate, whoseplanDigestalready is a change-set digest, chant setschangeSetto the same value so readers use one field.Writer.
OpWavePlansFile(op/op-waves-run.ts:170) gainschangeSet?: ChangeSetDocument, the document the product composed withcomposeChangeSet. When the wave waits, chant stores it before the pending fact, the orderwriteCheckpointalready uses (op/gate.ts:119-124), through a new optionalGateLedgerPort.storeChangeSet?(doc)thatgitGateLedgerPort(op/gate.ts:154) implements withpersistChangeSet. A document that fails its digest check is logged and the pending fact goes out withoutchangeSet; it never blocks the gate.OpWaveDecision(:226) gainschangeSet?: stringso the decision record names it.chant approvecopieschangeSetfrom the standing fact onto the approval when the plans match, besidecheckpointDigestandreleaseDigest(cli/handlers/approve.ts:443-451). Retention keeps a stored change set that a pending fact or a resolution names inchangeSet, beside today'splanDigestrule (lifecycle/retention.ts:354).Readers.
readStoredChangeSet(fact.changeSet)(lifecycle/change-set-store.ts:109) andchant change-set show <digest>, both existing. A refused wave reads the approved plans from the mismatched resolution'schangeSet.Read contract.
gatesgains achange_setTEXT column (lifecycle/query.ts:75). FloorGATE_CHANGE_SET_FLOOR.terragucci. The plan callback puts the document
report/build.ts:329already composes intoplans.jsonaschangeSet. The feature-detect is chant's own output: when the wave's decision record (chant-waves.ts,readWaveRecord) carrieschangeSet, terragucci skips the write atapply.ts:3634; without it, it writes as today.approve.ts:198and the respond job read the stored change set first and fall back tostoredReportfor facts written before.3. Gated requests for export, unlock, ephemeral and migrate
terragucci runs each of these as its own request: a digest over the request (
export.ts:123), a pending line with arequestfield (export.ts:267,unlock.ts:377,migrate.ts:1626), its owndecideGate(apply.ts:467) and adone.jsonlbeside the ledger (export.ts:314,unlock.ts:417,migrate.ts:1658) that no chant reader sees.Ephemeral needs no request kind. Its gate is chant's
pr-envgate under oppr-<n>, run bycomponents/pr-env-run; terragucci decides it with its own ports (ephemeral.ts:604-627) only becauselifecyclePrEnvPorts(components/pr-env-ports.ts:53) cannot take asealedapproval mode. The design giveslifecyclePrEnvPortsanapproval?: { mode: GateApprovalSource; signers?: GateSigners }option, decided withdecideGateApproval(gate-decision.ts:496), and terragucci's ports use chant'sdecideGate. Its records are gap 4.For export, unlock and migrate, a new module
lifecycle/gated-request.ts(subpath@intentius/chant/lifecycle/gated-request), with its pure decision in thegate-decisionbundle:The records are the existing ones. The request is a
PendingGateRecordin_gates/<op>.jsonl(gateissubject,planDigestis the request digest) with a new optionalrequestfield. The approval is a plainchant approve <op> <subject> --plan <digest>resolution, with no new verb;plywood approveand terragucci'sapprove export|unlock|migrateare words over it.spendGatedRequestappends anappliedline to_gates/<op>/applied.jsonl(lifecycle/gate-applied.ts:25,:76) and throws unless it was pushed, as op waves require of a spend (op/op-waves-run.ts:1851). The caller acts only after that.finishGatedRequestappends afinishedline (:64), which gainsdetail?: Record<string, string | number | boolean>for the product's flat facts (content_digest, a lock id, version ids before and after), never a state's contents. A request applies once: a spent approval (isApprovalSpent,:140) makesrequestGateanswerspent.attachmentcovers migrate's proof (migrate.ts:1597,keptPath): chant writes it once to_gates/<op>/requests/<digest>.jsonbefore the pending fact, as checkpoints sit at_gates/<op>/checkpoints/(lifecycle/gate-checkpoint.ts:72), and the proof's digest goes infields.proof.Decision rules.
rulesis{ mode: "ledger" | "pr-review" | "sealed", quorum?, reviewLedger?, involved? }, the same block op waves read at base (op/op-waves.ts:530-545,op/op-waves-run.ts:566), read by the caller atbase. Quorum targets match againstsubject. The workspace'sidentity.gatesrule and judge come through the port as for any gate (op/gate.ts:105,:113). Two defaults I took: an approval by the requester never counts (terragucci's export rule, and plywood needs the same), and underpr-reviewa request counts ledger approvals only, since a request made from a laptop has no merged pull request whose review could approve it. A migration run inside a wave keeps going through the wave's hold hook (chant-waves.ts, themigration gatehook), which chant already decides; only the standalone path moves here.Read contract.
gatesgains arequestJSON column. Applied and finished lines are covered by question C. FloorGATED_REQUEST_FLOOR.terragucci.
export.ts,unlock.tsand the standalone path inmigrate.tsloadgated-requestthrough thechant-next.tsloader. When it resolves they callrequestGate,spendGatedRequestandfinishGatedRequest; otherwise they run today's code.report/audit.ts:85,:88read the legacydone.jsonlfiles and the new finished lines, so history from before the switch stays listed. No legacy line is rewritten or copied: the ledgers are append-only, and a copied line would count an export twice.4. Append API for
_pr-envs/records.jsonlchant appends these lines only inside
lifecyclePrEnvPorts.appendRecord(components/pr-env-ports.ts:63), which swallows errors, and exports only the parser (components/pr-environment.ts:249). terragucci writes chant's file with raw git (ephemeral.ts:612), at the top of the branch even inside a member.Shape.
PrEnvRecordas it is (components/pr-environment.ts:208).Writer. A new module
components/pr-env-ledger.tsthat imports onlylifecycle/git.ts, so a product bundle loads no Ajv or component driver:appendPrEnvRecordrefuses a recordparsePrEnvRecordswould skip (aPrEnvRecordError), appends withappendLedgerLine(lifecycle/git.ts:574) under the member prefix, and does not push; the caller callspushLifecycleReport, the two-step shape every ledger here uses.lifecyclePrEnvPorts.appendRecordbecomes a call to it and keeps its warn-and-continue behaviour.Read contract. Question C. Floor
PR_ENV_APPEND_FLOOR.terragucci.
ephemeral.ts:612callsappendPrEnvRecordwhen the loader resolves andappendLifecycleotherwise.LEGACY_EPHEMERAL_DONE(ephemeral.ts:118) is still read first.Docs that change with the build
The Ledgers table in the workspace declaration reference gains
_gates/<op>/requests/. The read contract page andcli/ledger.mdxandcli/query.mdxgain the new columns (and tables, per question C) with their floors. The op-waves page gains the run record andchangeSetin the plans file.Open questions
A. Which
<env>directory does an op-wave run record go under?a. The spec's new optional
labels.Env, elselocal, the rule every Op already follows (lifecycle/run-ledger.ts:58) (recommended). One rule for every run, andchant ledger runs --where op=tf-applyfinds them with no loader change.b. A fixed
wavesdirectory. Easy to find, but it looks like an environment namedwavesto every env reader.c. Each run target's own environment, one line per target. Needs the product to map targets to environments, which only terragucci's
environmentsconfig does.B. Who computes a gated request's digest?
a. chant, with
gatedRequestDigestover the canonical request (recommended). terragucci and plywood bind the same fields the same way, andchant approvecan show exactly what the digest covers. Requests pending at the switch (48 hours at most) are asked again.b. The product passes its own digest. Pending requests survive the switch, but chant cannot show what an approval binds, and each product can bind different fields.
C. How do the read contract and
chant ledgershow applied, finished and pull-request environment lines?a. Two new tables within contract version 1,
applies(eachappliedorchangesline under_gates/<op>/applied.jsonljoined with itsfinishedline, includingdetail) andpr_envs(_pr-envs/records.jsonl), each behind its floor (recommended). The tables are additive, and the acceptance item "chant ledgerlists them" holds for every record in the mapping.b. Fold applied and finished lines into
gatesas two morekindvalues. That changes whatkindholds, so it is contract version 2.c. No new tables; readers use
gate-auditand the products' own reports. No contract change, but the audit trail stays outsidechant ledgerandchant query.D. How many run records does a wave write?
a. One per
chant run wavejob, with one step per run target (recommended). Every job writes its own line with no coordination, and a deciding job and its share jobs join onwave.digest.b. One per run target. Easier to join with a root's history, but a 400-root wave writes 400 lines per job.
c. One per wave across all its jobs. Needs a last job that knows the others finished, which independent share jobs do not have.
lex00 commentedon Oct 27, 2026
Ruling for ci-products (2026-10-27)
chant run wavejob, with one step per run target; jobs join on wave.digest.feat(core): the four ledger gaps for CI products (#4551)
Merge unit/cp-chant-4551: ledger gaps for CI products (#4551)
lex00 commentedon Oct 27, 2026
Built on
integration/ci-products, merge f0bec58 (unit branchunit/cp-chant-4551, commit 3ab5562), per the 2026-10-27 ruling: run records underlabels.Envelselocal, chant computes the request digest,appliesandpr_envstables in contract v1 behind floors, one run record perchant run wavejob. Paths are underpackages/core/src/.runOpWave(op/op-waves-run.ts) records one run per job on every way it ends, the throw path included, through a newrunsport (gitOpWaveRunPort:appendRunRecordthenpushLifecycleReport). A failed write warns and never changes the exit code. A caller that passes its owngatesport records nothing unless it also passesruns.opWaveRunRecordbuilds it: one phasewave-<k>per wave walked, one step per run target (okapplied,failfailed,skippedotherwise),gateorpointwhile waiting,failurefor 1, 4, 7 and 8 (command-failed,moved,denied,point-refused), status by Exit codes: one table in chant core for both products, mapped by the terraform and pulumi lexicons, with moved distinct from gated #4553's table.OpRunRecord.wave(op/runtime.ts) carries spec, number, name, job, share or group, digest, exitCode, outcome and the run lists;parseRunLedgerdrops a malformed one. FloorOP_WAVE_RUN_RECORD_FLOOR.labels(op/op-waves.ts);Envpicks the directory.chant run wavereads--no-recordandCHANT_NO_RECORD(cli/handlers/run-wave.ts). The logic is inlined there rather than imported from run.ts, so the wave-job runtime bundle does not pull run.ts in.changeSet. The deciding job stores it through the newGateLedgerPort.storeChangeSet(persistChangeSet) before any pending fact, and the three settle paths putchangeSeton the fact. A document that fails its digest check is logged and left out.OpWaveDecision.changeSetnames it.PendingGateRecord.changeSetandGateResolutionRecord.changeSet(floorGATE_CHANGE_SET_FLOOR).chant approvecopies it from the standing fact when the plans match.decidePrGateand the release gate in components/driver.ts set it to their plan digest. Retention keeps a cited change set while its fact stands.requestGateanswersapproved,waiting,refusedorspent.spendGatedRequestthrows unless the applied line was pushed.finishGatedRequestwritesdetailon the finished line.readGatedRequestsreturns each request joined with its approvals, applied and finished lines. The requester's own approval never counts, and that is the only meaning ofrefused: an approval stands and does not count, and the request still waits.attachmentis stored at_gates/<op>/requests/<digest>.jsonand its SHA-256 goes infields.proof.pr-reviewcounts ledger approvals only.gatedRequestDigestandgatedRequestOf, re-exported from@intentius/chant/gate-decision. FloorGATED_REQUEST_FLOOR.lifecyclePrEnvPortstakesapproval: { mode, signers? }and decides withdecideGateApproval.appendPrEnvRecord, which refuses a record the parser would skip and does not push, andreadPrEnvRecords.lifecyclePrEnvPorts.appendRecordcalls it and still warns and continues on failure. FloorPR_ENV_APPEND_FLOOR.Read contract (lifecycle/query.ts, ledger-read.ts, workspace/ledger.schema.json):
runs.wave,gates.change_setandgates.requestcolumns (LEDGER_WAVE_COLUMNS_FLOOR), and newappliesandpr_envstables (LEDGER_APPLIES_FLOOR). All floors areNEXT_RELEASE, and the docs and schema texts are listed in scripts/release-floors.ts. The check passes with--release 0.124.55.Docs: guide/op-waves (
changeSetin the plans file, a run record section, exit 8 in the table), cli/query, cli/ledger, reference/workspace-declaration (Ledgers rows), and reference/workspace-read-contract (two rows; the ci-run-index exit row now says 4 for a moved plan).Tests: op/op-waves-run-record.test.ts, lifecycle/gated-request-ledger.test.ts and components/pr-env-ledger.test.ts. Only typecheck ran. The suites wait for epic-ready, and none of the acceptance boxes is ticked.
Still missing
changeSet,gated-requestbehind itschant-next.tsloader,appendPrEnvRecord, deletingappendLifecycleand the rest.ephemeral.tscan now uselifecyclePrEnvPorts({ approval }).--where wave.spec=...depends onchant ledger's existing JSON-column filter; no new filter code was added.changeSetdoes not hold it longer, which matches the existingplanDigestrule.runOpWavewithout agatesport now also write a run record tochant/lifecyclein their scratch repos. Any test that counts lifecycle commits or files there will need updating at epic-ready.docs: reword approve prompt and report URL prose to clear the sentenc…
lex00 commentedon Oct 27, 2026
Merge 65c3e52 on integration/ci-products reworded the ci.reportUrl paragraph and the ledger path rows in docs/src/content/docs/reference/workspace-declaration.mdx so the docs prose lint passes. No meaning changed and the baseline is untouched.
feat(pulumi): gated stack operations, export, cancel and move behind …
feat(pulumi): read plunge's per-resource timings from up --json into …
fix(core): keep the small bundles small after ci-products
lex00 commentedon Oct 28, 2026
Epic-ready fix, merged into integration/ci-products at 9f00e0b (unit/cp-chant-fix-bundles).
lifecycle/gated-request-digest.ts took sortedJsonReplacer from utils.ts, which imports AttrRef, so the gate-decision bundle took in attrref.ts and went over its 58 KB limit. The replacer moved to packages/core/src/sorted-json.ts, which has no imports. utils.ts re-exports it, so its other importers are unchanged. gated-request-digest.ts imports the leaf. The gate-decision bundle is now 56985 bytes, and its list names gated-request-digest.ts and sorted-json.ts.
pr handlers push chant/lifecycle with fetch, replay and retry, and fa…
Merge unit/cp7-chant-lifecycle-retry: pr handlers' chant/lifecycle pu…
lex00 commentedon Oct 28, 2026
The pr handlers'
chant/lifecyclepushes now fetch, replay and retry, on chant main 4073bb3 (merge of unit/cp7-chant-lifecycle-retry, 972a99d). Push CI green: chant — main 40786841659, docs 40786842035, chant-ci-green 40787640830. This is the proposed feature from INTENTIUS/plywood#22 (the record job'sfailed to push some refsonchant/lifecycle, refused asstale info).pushLifecycleRebasingin lifecycle/git.ts: on a stale refusal it fetches the remote'schant/lifecycleinto a scratch ref and replays this checkout's commits on that tip withgit merge-tree --write-tree --merge-base=<parent>. Each replayed commit keeps its author and message, and nothing touches a work tree. The function then points the lease at the tip and pushes again, up toLIFECYCLE_PUSH_TRIES(3) pushes, the countpublishRefin snapshot-store.ts uses. After the last refusal, or a commit that changes a file the other writer changed too, it throwsLifecyclePushLostError, which names the remote and the tries. No remote, recording off and other git refusals (no network, no credentials) come back the waypushLifecycleReportreturns them, which is unchanged for its other callers.pr-apply --greenand the wave path), the push before--merge autoand the change set the gate binds go through it. A lost merge record or green-apply record prints the error and exits 1 after the report is written; it used to warn and exit 0. A lost push before--merge autoleaves the pull request unmerged (mergeAfterApplyrefuses and posts why) and exits 1 instead of 3. A lost change set stops the stage.pushLifecycleRebasinglands, both writes are on the remote, the record's commit sits on the other writer's with its own message and author, and the lease names the new tip. A conflicting write throws the named error and keeps the local branch. A remote whose update hook refuses every push throws after three tries. cli/handlers/pr-record.test.ts covers exit 0 when the retrying push lands, and exit 1 with the error text when it throws; the report is still written. The other pr handler tests stub the new push the way they stub the old one.tsc --noEmiton packages/core reports no error in core sources; the errors left are the ungenerated lexicons of a fresh checkout, the same as before. Docs: one sentence pair in guide/pull-request-ci.mdx on what the record job does. Prose lint showed no regressions (1693 against the baseline of 1694), and the baseline is untouched.Still open: the bench smoke on plywood#22 has not run this push path, because the bench was not started (disk).
lex00 commentedon Oct 29, 2026
plywood#22 finding 9 is on chant main in dec10dc (merge of unit/cp9-chant-queue; bab34db followed with a test timing fix). Push CI on bab34db: chant — main 40799516512 success, docs — main 40799516511 success, chant-ci-green 40799904830 and 40800190876 success. The first push's chant — main 40798720083 failed in shard 3 on that test alone; the other shards passed.
gitOpWaveRunPort, packages/core/src/op/op-waves-run.ts), its release records (maybeRecordAutoRelease, packages/core/src/components/auto-release.ts) and the gate lines (gitGateLedgerPortin packages/core/src/op/gate.ts: pending, resolution, applied and finished) push throughpushLifecycleRebasing. A run or release record whose push never lands after its replays fails the job by name (LifecyclePushLostError). A gate line that never lands reports not pushed with that name, so the spend line still fails the wave.rebaseLifecycleOnRemote, packages/core/src/lifecycle/git.ts) now carries a commit that only appends lines to.jsonlledger files onto the other writer's copy of those files (replayAppends). Without this, two wave jobs appending to one environment's<env>/pulumi-up.jsonlorreleases.jsonlmet in merge-tree and one record was lost. Any other change to a file the other writer changed is still refused by name.chant/lifecyclediverged replays its unpushed commits onto the remote's tip and reportsahead(fetchLifecycleStatus), sorequireLifecycleLedgerreads on. A branch that shares no history with the remote, or whose commits cannot be replayed, stays diverged and is refused as before.Tests with a bare remote advanced by another writer: two writers appending to one
releases.jsonl, a diverged read replayed then pushed, a rewrite still diverged (packages/core/src/lifecycle/git.test.ts), and a waves run record landing after another writer appended to the same run ledger (packages/core/src/op/op-waves-ledger-lock.test.ts). The #2310 gate test now expects the third pending fact to land beside the other writer's.lex00 commentedon Oct 29, 2026
Close-out (2026-10-29)
Chant side is on main: f0bec58 (op-wave run record, pending gate citing a stored change set, gated requests, pr-env ledger append, applies and pr_envs tables), 4073bb3 (pr handler pushes fetch, replay and retry), dec10dc (waves ledger pushes replay and retry). No box is ticked.
Open: terragucci origin/main (bce2a73d4) still has ledger writers built on hash-object and commit-tree (packages/terragucci/src/apply.ts:673, apply-rows.ts:216, chant-waves.ts:186, plus shell in render.ts), so box 1 fails. Boxes 2 and 3 depend on terragucci writing through chant's API and are unconfirmed. The issue stays open for terragucci#1282.
lex00 commentedon Nov 2, 2026
Closing per the close-out comment of 2026-10-29 above: the work is on main and released.