You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Op waves: release records per environment, an exported stack lock reader, per-resource progress lines #4615
plywood#16 (merge 38845a5ec2e1a4ce05175647d427467876816129) and plywood#17 (merge 0a97abe9b3d95c763aa34b8f6578e0ca5c66307b) found three chant gaps:
Op waves write no environment release record, so chant components rollback only finds a stack's previous release after it was promoted under a release. An op-wave apply should record what it applied per environment the way promote does.
chant does not export its lock reader, so plywood cancel (chant#4578's gatedStackCancel) needs the user to supply the lock id. Export a reader that lists a stack's current lock id for file:// backends.
chant's run events have no per-resource lines, so a job log shows one line per stack even when plunge reports per-resource progress (chant#4579 timings). Add optional per-resource progress events that the CLI prints.
Done when: all three exist with tests, and plywood drops its workarounds behind a feature-detect.
Merged to integration/ci-products at 98216a5 (unit branch unit/cp-chant-4615, commit 6f50385). Compile check only: npm ci, scripts/ci-lexicon-artifacts.sh --steps generate,bundle and npx tsx scripts/typecheck.ts pass on the merged tree with no regressions, and the docs prose lint shows 0 regressions. Tests are written and were not run.
Release records from op-wave applies (packages/core/src/op/op-waves-release.ts, called from applyLeased in op-waves-run.ts)
A spec with a step appends one release record for each run it applied, once the wave's apply loop ends, through maybeRecordAutoRelease (the same writer chant run --components uses). A failed run gets none, and a write that fails is a log line; the exit code stays the job's.
Names: env is labels.Env, else the wave's name (the env opWaveStepContext already plans in), and the component is the run's target. A new spec field release: { env?, component? } and a run's own release change them, with {target}, {op} and {wave} filled. "release": false writes none. RunOpWaveOptions.releases takes a port, or false; by default it is the git ledger unless the caller passed its own gates, the rule runs follows.
When a release cut from the applied commit records the component's templates for that env (newest cut wins, releaseOfCommit), the record carries releaseDigest and the templates digest with digestKind: "templates", the record promote --release writes. components rollback <env> --component <name> then runs under that release (Roll back a Terraform root to a named release: record root trees in release cut, plan them on promote and rollback --release #4542 items 1 to 3). With no such release, the record is an apply record (digestKind: "plan", the step's plan digest), as pr-apply writes. Rollback passes over it, since no files were recorded.
OP_WAVE_RELEASE_RECORD_FLOOR (NEXT_RELEASE) is exported from @intentius/chant/op, with gitOpWaveReleasePort, opWaveReleaseNames and releaseOfCommit.
pulumiStackLockIds({ dir, stack, project?, engine?, env? }) returns { checked, backend?, ids }: the backend from PULUMI_BACKEND_URL or Pulumi.yaml, and on file:// the lock ids diyStackLockIds lists (both layouts). Other backends answer checked: false. A plunge stack answers no ids. gatedStackCancel now reads through it. Both are exported from the lexicon index.
Per-resource progress
step-settle gains optional resources (RunEventResource: resource, type?, name?, status, startedAt?, durationMs, calls?), added within contract 1 with RUN_EVENT_RESOURCES_FLOOR (NEXT_RELEASE) and in run-event.schema.json. I picked a field on step-settle over a new event type because RUN_EVENT_TYPES and the schema's oneOf are closed under contract 1, so readers that already exist keep working.
CapabilityTraceFacts.resources is how a capability gives them. pulumi-up's pulumiTraceFacts fills it from plunge's timings (plungeResourceProgress in plunge-timings.ts), on success and on PulumiUpFailedError. OpWaveRunEvents.stepSettle puts them on the stack's step-settle, and chant run wave logs one line each (opWaveResourceLines), such as shop/dev: assets (aws:s3/bucket:Bucket) ok in 412 ms, 3 calls. The lines come once the stack's update ends, because plunge prints its timings with each step's outputs.
Docs: guide/op-waves (new "Release records" section, Traces), cli/components (rollback), the pulumi lexicon README, CHANGELOG.
Tests written, not run: packages/core/src/op/op-waves-release.test.ts (names and their checks, the release join, requests per applied run through runOpWave with a fake port, release: false, resources on step-settle and in the log), lexicons/pulumi/src/stack-ops.test.ts (lock reader on both layouts, PULUMI_BACKEND_URL, a non-file backend, plunge) and lexicons/pulumi/src/plunge-timings.test.ts (progress lines, stock gives none).
Still missing:
The "done when" clause also asks plywood to drop its workarounds behind a feature-detect. That is plywood#26, which comes next.
An apply with no release cut from its commit gets an apply record, and rollback only finds releases. A pipeline that cuts after the waves run gets apply records for those waves.
planRollback takes the newest non-apply record as current. A stack whose newest apply was unreleased therefore looks like it still runs its last release, the same as after pr-apply today.
Every check needs a run (a recorded wave on a ledger, rollback under the joined release, a plunge job log), so these wait for epic-ready.
Open question:
A. When the merge commit has no release cut, how should the op-wave apply record it?
(a) Keep today's build: an apply record, with rollback refusing it by name (recommended). It writes nothing the user didn't ask for, and a pipeline that wants rollback cuts the release before the waves run.
(b) Add release: { cut: true } so the wave job cuts a release from the commit before it applies, and every record joins one.
(c) Teach rollback to apply an earlier commit's checkout for a plan record.
No release cut from the merge commit: option (a), the recommended one and what was built. The op-wave apply writes a plan-digest record that rollback skips; a pipeline that wants rollback cuts the release before the waves run.
Epic-ready fix, merged into integration/ci-products at 9f00e0b (unit/cp-chant-fix-bundles).
op/op-waves.ts imports op/op-waves-release.ts for opWaveReleaseProblems, and that file also held gitOpWaveReleasePort, whose dynamic imports (auto-release, release-ledger, release-store, release-promote) esbuild inlines. Through release-compile, cli/plugins and the package index, every bundle holding op-waves.ts took in typescript, zod and esbuild, and the gate decision, op/gate.ts and lifecycle/green-apply.ts reached the index store. That turned stage-hooks-bundle, gated-waves-bundle, gate-decision-bundle and index-store-load-bearing red.
The port now lives in packages/core/src/op/op-waves-release-port.ts, imported by op-waves-run.ts and re-exported from op/index.ts as before. op-waves-release.ts keeps the names, the checks, releaseOfCommit and the floor. No behaviour changed. The stage-hooks and gate-decision bundle lists now name op-waves-release.ts, which only imports types and the floor constant.
Epic-ready fix merged to integration/ci-products at 0a2addb (commit bf01f4a).
packages/core/src/op/op-waves-release.test.ts "per-resource progress" failed from the commit that added it. opWaveStepFacts (packages/core/src/op/op-waves-capability.ts) passed on the capability's attributes and spans but dropped resources, so no step-settle carried them and the log had no per-resource lines. It passes resources on now, and the test passes alone.
On main: 6f50385 via 98216a5 (release records from op-wave applies, pulumiStackLockIds, per-resource progress on step-settle), 9f00e0b (release port moved out of the op-waves bundle) and bf01f4a (opWaveStepFacts passes resources on).
All three gaps exist with tests: op-waves-release.test.ts, lexicons/pulumi/src/stack-ops.test.ts and plunge-timings.test.ts. plywood reads the lock through pulumiStackLockIds behind a feature-detect (plywood#26, packages/plywood/src/stack-ops.ts). Per option (a) in the thread, an apply with no release cut from its commit writes an apply record that rollback skips.
Closing: the issue has no checkboxes and its "done when" is met on main.
Activity
Op waves: release records per environment, an exported stack lock rea…
Merge unit/cp-chant-4615: op-wave release records, stack lock reader,…
lex00 commentedon Oct 28, 2026
Merged to integration/ci-products at 98216a5 (unit branch
unit/cp-chant-4615, commit 6f50385). Compile check only:npm ci,scripts/ci-lexicon-artifacts.sh --steps generate,bundleandnpx tsx scripts/typecheck.tspass on the merged tree with no regressions, and the docs prose lint shows 0 regressions. Tests are written and were not run.packages/core/src/op/op-waves-release.ts, called fromapplyLeasedinop-waves-run.ts)stepappends one release record for each run it applied, once the wave's apply loop ends, throughmaybeRecordAutoRelease(the same writerchant run --componentsuses). A failed run gets none, and a write that fails is a log line; the exit code stays the job's.labels.Env, else the wave's name (the envopWaveStepContextalready plans in), and the component is the run's target. A new spec fieldrelease: { env?, component? }and a run's ownreleasechange them, with{target},{op}and{wave}filled."release": falsewrites none.RunOpWaveOptions.releasestakes a port, orfalse; by default it is the git ledger unless the caller passed its owngates, the rulerunsfollows.releaseOfCommit), the record carriesreleaseDigestand the templates digest withdigestKind: "templates", the recordpromote --releasewrites.components rollback <env> --component <name>then runs under that release (Roll back a Terraform root to a named release: record root trees in release cut, plan them on promote and rollback --release #4542 items 1 to 3). With no such release, the record is an apply record (digestKind: "plan", the step's plan digest), aspr-applywrites. Rollback passes over it, since no files were recorded.OP_WAVE_RELEASE_RECORD_FLOOR(NEXT_RELEASE) is exported from@intentius/chant/op, withgitOpWaveReleasePort,opWaveReleaseNamesandreleaseOfCommit.lexicons/pulumi/src/stack-ops.ts)pulumiStackLockIds({ dir, stack, project?, engine?, env? })returns{ checked, backend?, ids }: the backend fromPULUMI_BACKEND_URLorPulumi.yaml, and onfile://the lock idsdiyStackLockIdslists (both layouts). Other backends answerchecked: false. A plunge stack answers no ids.gatedStackCancelnow reads through it. Both are exported from the lexicon index.step-settlegains optionalresources(RunEventResource:resource,type?,name?,status,startedAt?,durationMs,calls?), added within contract 1 withRUN_EVENT_RESOURCES_FLOOR(NEXT_RELEASE) and inrun-event.schema.json. I picked a field onstep-settleover a new event type becauseRUN_EVENT_TYPESand the schema'soneOfare closed under contract 1, so readers that already exist keep working.CapabilityTraceFacts.resourcesis how a capability gives them.pulumi-up'spulumiTraceFactsfills it from plunge's timings (plungeResourceProgressinplunge-timings.ts), on success and onPulumiUpFailedError.OpWaveRunEvents.stepSettleputs them on the stack'sstep-settle, andchant run wavelogs one line each (opWaveResourceLines), such asshop/dev: assets (aws:s3/bucket:Bucket) ok in 412 ms, 3 calls. The lines come once the stack's update ends, because plunge prints its timings with each step's outputs.Docs: guide/op-waves (new "Release records" section, Traces), cli/components (rollback), the pulumi lexicon README, CHANGELOG.
Tests written, not run:
packages/core/src/op/op-waves-release.test.ts(names and their checks, the release join, requests per applied run throughrunOpWavewith a fake port,release: false, resources onstep-settleand in the log),lexicons/pulumi/src/stack-ops.test.ts(lock reader on both layouts,PULUMI_BACKEND_URL, a non-file backend, plunge) andlexicons/pulumi/src/plunge-timings.test.ts(progress lines, stock gives none).Still missing:
planRollbacktakes the newest non-apply record as current. A stack whose newest apply was unreleased therefore looks like it still runs its last release, the same as afterpr-applytoday.Open question:
A. When the merge commit has no release cut, how should the op-wave apply record it?
release: { cut: true }so the wave job cuts a release from the commit before it applies, and every record joins one.planrecord.lex00 commentedon Oct 28, 2026
No release cut from the merge commit: option (a), the recommended one and what was built. The op-wave apply writes a plan-digest record that rollback skips; a pipeline that wants rollback cuts the release before the waves run.
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).
op/op-waves.ts imports op/op-waves-release.ts for opWaveReleaseProblems, and that file also held gitOpWaveReleasePort, whose dynamic imports (auto-release, release-ledger, release-store, release-promote) esbuild inlines. Through release-compile, cli/plugins and the package index, every bundle holding op-waves.ts took in typescript, zod and esbuild, and the gate decision, op/gate.ts and lifecycle/green-apply.ts reached the index store. That turned stage-hooks-bundle, gated-waves-bundle, gate-decision-bundle and index-store-load-bearing red.
The port now lives in packages/core/src/op/op-waves-release-port.ts, imported by op-waves-run.ts and re-exported from op/index.ts as before. op-waves-release.ts keeps the names, the checks, releaseOfCommit and the floor. No behaviour changed. The stage-hooks and gate-decision bundle lists now name op-waves-release.ts, which only imports types and the floor constant.
fix(op-waves): pr-apply --wave-gate on op waves keeps its old behavio…
lex00 commentedon Oct 28, 2026
Epic-ready fix merged to integration/ci-products at 0a2addb (commit bf01f4a).
packages/core/src/op/op-waves-release.test.ts "per-resource progress" failed from the commit that added it. opWaveStepFacts (packages/core/src/op/op-waves-capability.ts) passed on the capability's
attributesandspansbut droppedresources, so no step-settle carried them and the log had no per-resource lines. It passesresourceson now, and the test passes alone.lex00 commentedon Oct 29, 2026
Close-out (2026-10-29)
On main: 6f50385 via 98216a5 (release records from op-wave applies, pulumiStackLockIds, per-resource progress on step-settle), 9f00e0b (release port moved out of the op-waves bundle) and bf01f4a (opWaveStepFacts passes resources on).
All three gaps exist with tests: op-waves-release.test.ts, lexicons/pulumi/src/stack-ops.test.ts and plunge-timings.test.ts. plywood reads the lock through pulumiStackLockIds behind a feature-detect (plywood#26, packages/plywood/src/stack-ops.ts). Per option (a) in the thread, an apply with no release cut from its commit writes an apply record that rollback skips.
Closing: the issue has no checkboxes and its "done when" is met on main.