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: control-repo dispatch after the last wave, and cross-stack edge marks in the note #4617
plywood#18 (merge c9ccfcd270b79f5bca8d7e621ff91854d6a54617) found that chant#4568's prLoop.control adds the control-repo dispatch only to the pull-request loop's own apply. Products that apply on merge through op waves (plywood, terragucci) have no way to tell the control repo a member applied.
Done when: op-waves specs take a control option and the github, gitlab and forgejo op-wave generators emit a dispatch job that runs after the last wave applies, carrying the real apply outcome, with the same token handling as chant#4568; the PR note marks cross-stack edges as stale, current or unknown from the control entries; generator tests for each forge.
plywood and terragucci switch behind feature-detects.
Merged to integration/ci-products at 8ef09c1 (unit branch unit/cp-chant-4617, commit 2c6f4dd). Compile checks 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; they wait for epic-ready.
The control option on op waves
OpWavesSpec.control (packages/core/src/op/op-waves.ts) takes the pull request loop's control settings (ControlSettingsInput) plus sentCheck and markSent. member is required, since a spec has no repository name to default it to. assertOpWavesSpec checks it with opWavesControlProblems. OP_WAVES_CONTROL_FLOOR (NEXT_RELEASE) is the name a product feature-detects on @intentius/chant/op/op-waves.
chant run wave --spec <file> --waves-outcome adds up every wave job's outcome file under .chant/op-waves/<name>/outcomes and prints one word: applied, partial, unchanged, waiting or failed (applyOutcomeOf in packages/core/src/control/applied.ts). --json prints the counts too. It is in the wave runtime as well.
GitHub and Forgejo (lexicons/github/src/components/generate-op-waves-pipeline.ts; Forgejo through its dialect): a control-dispatch job needs the last wave's applying jobs with if: !cancelled(), so a failed run does not stop it. It downloads every outcome artifact, runs --waves-outcome through the product's bin into CHANT_CONTROL_OUTCOME, then sends one dispatch for ${{ github.sha }}. Only the dispatch step maps secrets.<tokenSecret> into CHANT_CONTROL_TOKEN, and curl reads it on stdin (controlDispatchScript from CI core: the control repo (cross-repo dispatch, project records, reconcile) for terragucci and plywood #4568, bb599f2). markSent adds statuses: write.
GitLab (lexicons/gitlab/src/components/generate-op-waves-pipeline.ts): a control stage after the waves, and its job needs the last wave's jobs, whose artifacts hold every outcome file. The setup and the outcome run in a subshell that unsets the control token variables, then the dispatch runs with $CI_COMMIT_SHA. Every wave job, the resume job and the record-plans job start with unset CHANT_CONTROL_TOKEN CHANT_CONTROL_READ_TOKEN <tokenSecret> <readTokenSecret>. A last wave whose runs failed (exit 1) lets the job run. A wave waiting at its gate stops it with the waves, and it runs once the retried job carries on.
The dispatch carries the outcome: client_payload.outcome on GitHub, inputs.outcome on Forgejo, variables[CHANT_CONTROL_OUTCOME] on GitLab (packages/core/src/control/dispatch.ts). The pull request loop's dispatch is unchanged and carries none.
The control repo's side
generateControlPipeline passes the outcome to the step, and the Forgejo and GitHub workflows gain an outcome input. The step checks it against the five words, records a dispatch that carries one, and runs chant workspace run --dependents-of only after applied or partial (or no outcome, as before).
The record is a control-applied line of _control/applied.jsonl on the control repo's chant/lifecycle, beside the entries: member, op, sha, outcome, at and a digest over the rest (recordControlApplied, parseControlApplied, latestControlApplies). The step calls recordControlAppliedFromEnv from the control repo's own install through a node -e feature-detect, which also pushes the branch. A chant without it says so and records nothing, and a failed record or push is a warning, never the job's failure. The GitHub workflow now asks for contents: write and the full history. GitLab gets GIT_DEPTH: "0", and its notes say the job token needs push access.
Exported from @intentius/chant/ci-control with CONTROL_APPLIED_FLOOR (NEXT_RELEASE).
Cross-stack edges in the note
pulumi-up's artifact gains stackReferences.lastUpdate, the export's deployment.manifest.time (lexicons/pulumi/src/pulumi-up.ts).
PrReport.crossStackEdges (PR_REPORT_CROSS_STACK_FLOOR, schema and read contract row): one entry per outside reference from the plans' artifacts (crossStackReadsOf in packages/core/src/components/pr-run.ts), with member, stack, lastUpdate, status, owner, ownerApplied and why.
markCrossStackEdges (packages/core/src/control/edges.ts) finds the owner among control entries whose estates hold the stack: the exact name, or the same <project>/<stack> once an org is dropped. A bare stack name only matches exactly. It then reads that project's newest applied or partial record, keyed by the entry's settings.member, else the repository's name. stale means the owner applied after the reader's last update and current means the reader updated after it. Every other case is unknown with its reason: not read, unclaimed, claimed twice, no apply on record, or a reader that has not updated.
The plan job marks every edge unknown. postPlanReport (and pr-plan's own publish) marks them again from the checkout CHANT_CONTROL_DIR names, using only each edge's reader, stack and last update from the report. That way a mark the report wrote itself never shows. The note gets a table under the member table and a line naming the stale edges (packages/core/src/pr-loop.ts).
Docs: guide/op-waves ("Tell the control repo"), concepts/ci-products (the op waves dispatch, the record, "Cross-stack edges"), cli/run (--waves-outcome), reference/workspace-read-contract.
Tests written, not run: packages/core/src/control/applied.test.ts, packages/core/src/control/edges.test.ts, and generate-op-waves-pipeline.control.test.ts in each of the github, gitlab and forgejo lexicons. The control workflow test in lexicons/github/src/components/generate-pr-pipeline.control.test.ts was updated for the new input.
Still missing
No generated job checks out the control repo for the note. A product sets CHANT_CONTROL_DIR in its note job (terragucci already clones it in controlCheckoutStep; plywood needs the same step), and until then every edge is unknown.
plywood and terragucci switch behind feature-detects. plywood#18's follow-up does that for plywood.
Every check that needs a run waits for epic-ready: a dispatch reaching a loopback control repo with its outcome, the record pushed, a note marking a stale edge. No box is ticked.
Defaults I took
The dispatch goes for every outcome, failed and waiting included. The control repo records each one and runs dependents only after applied or partial, so its record shows a member that tried and applied nothing.
The apply records live in their own file beside the entries, which keeps the entries' version chain about settings alone.
On main: 2c6f4dd (op waves: control-repo dispatch after the last wave, and cross-stack edge marks in the note), merged at 8ef09c1. Checked against origin/main: OpWavesSpec.control and OP_WAVES_CONTROL_FLOOR, chant run wave --waves-outcome, a control-dispatch job in the github and forgejo op-wave generators and a control stage in gitlab's, the outcome carried in the dispatch (control/dispatch.ts), recordControlApplied on the control repo's side, PrReport.crossStackEdges with markCrossStackEdges (control/edges.ts), and stackReferences.lastUpdate in pulumi-up. Tests: generate-op-waves-pipeline.control.test.ts in each of the github, gitlab and forgejo lexicons, control/applied.test.ts and control/edges.test.ts.
The issue has no boxes. Left to the products: a note job that sets CHANT_CONTROL_DIR (until then every edge reads unknown), and plywood and terragucci switching behind the feature-detect. Closing.
Activity
Op waves: control-repo dispatch after the last wave, and cross-stack …
lex00 commentedon Oct 28, 2026
Merged to integration/ci-products at 8ef09c1 (unit branch
unit/cp-chant-4617, commit 2c6f4dd). Compile checks 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; they wait for epic-ready.The
controloption on op wavesOpWavesSpec.control(packages/core/src/op/op-waves.ts) takes the pull request loop's control settings (ControlSettingsInput) plussentCheckandmarkSent.memberis required, since a spec has no repository name to default it to.assertOpWavesSpecchecks it withopWavesControlProblems.OP_WAVES_CONTROL_FLOOR(NEXT_RELEASE) is the name a product feature-detects on@intentius/chant/op/op-waves.chant run wave --spec <file> --waves-outcomeadds up every wave job's outcome file under.chant/op-waves/<name>/outcomesand prints one word:applied,partial,unchanged,waitingorfailed(applyOutcomeOfinpackages/core/src/control/applied.ts).--jsonprints the counts too. It is in the wave runtime as well.lexicons/github/src/components/generate-op-waves-pipeline.ts; Forgejo through its dialect): acontrol-dispatchjob needs the last wave's applying jobs withif: !cancelled(), so a failed run does not stop it. It downloads every outcome artifact, runs--waves-outcomethrough the product's bin intoCHANT_CONTROL_OUTCOME, then sends one dispatch for${{ github.sha }}. Only the dispatch step mapssecrets.<tokenSecret>intoCHANT_CONTROL_TOKEN, and curl reads it on stdin (controlDispatchScriptfrom CI core: the control repo (cross-repo dispatch, project records, reconcile) for terragucci and plywood #4568, bb599f2).markSentaddsstatuses: write.lexicons/gitlab/src/components/generate-op-waves-pipeline.ts): acontrolstage after the waves, and its job needs the last wave's jobs, whose artifacts hold every outcome file. The setup and the outcome run in a subshell that unsets the control token variables, then the dispatch runs with$CI_COMMIT_SHA. Every wave job, the resume job and the record-plans job start withunset CHANT_CONTROL_TOKEN CHANT_CONTROL_READ_TOKEN <tokenSecret> <readTokenSecret>. A last wave whose runs failed (exit 1) lets the job run. A wave waiting at its gate stops it with the waves, and it runs once the retried job carries on.client_payload.outcomeon GitHub,inputs.outcomeon Forgejo,variables[CHANT_CONTROL_OUTCOME]on GitLab (packages/core/src/control/dispatch.ts). The pull request loop's dispatch is unchanged and carries none.The control repo's side
generateControlPipelinepasses the outcome to the step, and the Forgejo and GitHub workflows gain anoutcomeinput. The step checks it against the five words, records a dispatch that carries one, and runschant workspace run --dependents-ofonly afterappliedorpartial(or no outcome, as before).control-appliedline of_control/applied.jsonlon the control repo'schant/lifecycle, beside the entries:member,op,sha,outcome,atand a digest over the rest (recordControlApplied,parseControlApplied,latestControlApplies). The step callsrecordControlAppliedFromEnvfrom the control repo's own install through anode -efeature-detect, which also pushes the branch. A chant without it says so and records nothing, and a failed record or push is a warning, never the job's failure. The GitHub workflow now asks forcontents: writeand the full history. GitLab getsGIT_DEPTH: "0", and its notes say the job token needs push access.@intentius/chant/ci-controlwithCONTROL_APPLIED_FLOOR(NEXT_RELEASE).Cross-stack edges in the note
pulumi-up's artifact gainsstackReferences.lastUpdate, the export'sdeployment.manifest.time(lexicons/pulumi/src/pulumi-up.ts).PrReport.crossStackEdges(PR_REPORT_CROSS_STACK_FLOOR, schema and read contract row): one entry per outside reference from the plans' artifacts (crossStackReadsOfinpackages/core/src/components/pr-run.ts), withmember,stack,lastUpdate,status,owner,ownerAppliedandwhy.markCrossStackEdges(packages/core/src/control/edges.ts) finds the owner among control entries whoseestateshold the stack: the exact name, or the same<project>/<stack>once an org is dropped. A bare stack name only matches exactly. It then reads that project's newestappliedorpartialrecord, keyed by the entry'ssettings.member, else the repository's name.stalemeans the owner applied after the reader's last update andcurrentmeans the reader updated after it. Every other case isunknownwith its reason: not read, unclaimed, claimed twice, no apply on record, or a reader that has not updated.postPlanReport(andpr-plan's own publish) marks them again from the checkoutCHANT_CONTROL_DIRnames, using only each edge's reader, stack and last update from the report. That way a mark the report wrote itself never shows. The note gets a table under the member table and a line naming the stale edges (packages/core/src/pr-loop.ts).readControlEntrieswithlenient, so a broken line leaves the rest marked.Docs: guide/op-waves ("Tell the control repo"), concepts/ci-products (the op waves dispatch, the record, "Cross-stack edges"), cli/run (
--waves-outcome), reference/workspace-read-contract.Tests written, not run:
packages/core/src/control/applied.test.ts,packages/core/src/control/edges.test.ts, andgenerate-op-waves-pipeline.control.test.tsin each of the github, gitlab and forgejo lexicons. The control workflow test inlexicons/github/src/components/generate-pr-pipeline.control.test.tswas updated for the new input.Still missing
CHANT_CONTROL_DIRin its note job (terragucci already clones it incontrolCheckoutStep; plywood needs the same step), and until then every edge isunknown.Defaults I took
failedandwaitingincluded. The control repo records each one and runs dependents only afterappliedorpartial, so its record shows a member that tried and applied nothing.lex00 commentedon Oct 29, 2026
Close-out (2026-10-29)
On main: 2c6f4dd (op waves: control-repo dispatch after the last wave, and cross-stack edge marks in the note), merged at 8ef09c1. Checked against origin/main:
OpWavesSpec.controlandOP_WAVES_CONTROL_FLOOR,chant run wave --waves-outcome, acontrol-dispatchjob in the github and forgejo op-wave generators and acontrolstage in gitlab's, the outcome carried in the dispatch (control/dispatch.ts),recordControlAppliedon the control repo's side,PrReport.crossStackEdgeswithmarkCrossStackEdges(control/edges.ts), andstackReferences.lastUpdatein pulumi-up. Tests:generate-op-waves-pipeline.control.test.tsin each of the github, gitlab and forgejo lexicons, control/applied.test.ts and control/edges.test.ts.The issue has no boxes. Left to the products: a note job that sets
CHANT_CONTROL_DIR(until then every edge reads unknown), and plywood and terragucci switching behind the feature-detect. Closing.