Skip to content

terragucci waves: a wave's result from its own report, not its job's exit - #751

Merged
lex00 merged 1 commit into
mainfrom
tg-wave-results-751
Oct 19, 2026
Merged

lex00 merged 1 commit into
mainfrom
tg-wave-results-751

Conversation

@lex00

@lex00 lex00 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

On the terragucci fan-out kiosks (fan-out-tofu, fan-out-choudoufu), the fix chapter showed a "wave 3 failed" pill. In the change merge's failed run, wave 3 applied cluster-b's six apps and blocked cluster-a's six. terragucci ends that wave's Forgejo job as a failure on purpose (terragucci#1161), so the commit status isn't green while roots are unapplied. The wave's report.json says what happened: state: "applied", with blocked and outcomes.

behold now words a terragucci wave's result from its report, and uses the job status only when no report of that wave is read (or the report is older than the job, i.e. an earlier run's on the same commit).

What changed

  • src/terragucci-reports.ts: waveResult() and TerragucciRead.results. Each wave's state, applied, unchanged, failed and blocked roots, by commit, for the newest 4 tf-apply commits, each wave by its newest report (the reports are already in the read's cache).
  • src/terragucci-view.ts: /api/terragucci passes results through.
  • web/terragucci-change.js: waveResultOf(answer, commit, wave, { after }), resultWords, resultTone, resultFailed, resultBlocked. Words: "applied 6, 6 blocked by cluster-a", "6 blocked by cluster-a", "1 failed, 1 applied".
  • web/kiosk-event-help.js (the tip pill, the "This cycle" trail, and the failure modal, which opens from a failed fact):
    • A wave job that failed while the wave's report says it applied is no failed fact. That applies to the current run's jobs (failedJob) and to the cycle's earlier runs (pastFailures).
    • Such a wave gets a blocked fact instead: "wave 3 applied 6, 6 blocked by cluster-a", or "wave 3: 6 blocked by cluster-a" when nothing ran. It replaces the plain "wave 3 applied" for that run.
    • Earlier runs' blocked waves (pastBlocked) still lead to "wave 3 runs again" in the fix's apply.
  • web/terragucci-components-live.js: reportStatus(). A wave box whose job failed reads the report: "apply-wave-3 · applied 6, 6 blocked by cluster-a", in the blocked tone. This covers the kiosk's and Inspect's wave box titles.

A wave that really failed still reads failed: wave 2, where cluster-a failed, has report state failed.

Places that word a wave from its job status, and what happened to each

Place Before Now
kiosk-event-help.js cycleFacts, failedJob (pill, trail, modal) job failure gave "wave N failed" report first
kiosk-event-help.js ehSnapshot pastFailures (fix chapter's pill/trail) an earlier run's job failure gave "wave N failed" report first; blocked waves go to pastBlocked
kiosk-event-help-ui.js failure modal title Wave N failed opened on those facts unchanged code; it no longer gets a fact for wave 3
terragucci-components-live.js componentMarks wave title (jobStatus, JOB_WORDS.failure) "apply-wave-3 · failed" report first
kiosk-watch.js resultModel (result card's per-wave rows) metrics and trace words only, and only at applied unchanged: it never used the job status
kiosk-watch.js activeWave job failure picks the framed wave, but only before the run view has the cycle unchanged: it frames, it doesn't word
kiosk.js trace drawer head (tr.trace.result) terragucci's own span result unchanged: not the job status
kiosk-runs.js (Runs pane, statusIcon, defaultJob) and kiosk-watch.js tailLines (the drawer's log tail) the Forgejo jobs as Forgejo ran them unchanged: that pane is the CI view, and the job did fail
terragucci-lifecycle.js, kiosk-annotations.js chant lifecycle facts / terragucci's own log line unchanged: neither reads the job status

Chant repos are unaffected. Their waves come from chant's run events (chantWaves, which already say "wave 3 applied 6; 6 blocked"), not from job statuses.

Tests

  • src/__fixtures__/terragucci-wave-results/: a real fan-out-choudoufu cycle (605) from the demo bucket. It has the change merge 2a615596 (run 6745: wave 2 failed, wave 3 applied 6 and blocked 6 by cluster-a, both jobs failure) and the fix merge 5cfbdb79 (run 6748). The tf-apply reports are trimmed to run, roots and waves.
  • src/terragucci-wave-results.test.ts: the read's results, and waveResult on older reports.
  • web/terragucci-wave-results.test.js:
    • the failure chapter, the fix chapter and the fix's apply facts;
    • the fallback to the job status without a report, or with a stale one;
    • the wave box titles.
  • npm test: 238 files passed, 6 skipped (3686 tests passed, 20 skipped). tsc --noEmit and npm run build both pass.

Live

Served on :4641 against the shared stack and recorded /choudoufu-fanout and /tofu-fanout through the failure and fix chapters. Wave 2 still reads failed: its tip, its "Wave 2 failed" modal, and its box. In the fix chapter, the tip over wave 3 now reads "wave 3 applied 6, 6 blocked by cluster-a", where it used to read "wave 3 failed". The trail reads: wave 1 applied: 1 updated > wave 2 failed > wave 3 applied 6, 6 blocked by cluster-a.

🤖 Generated with Claude Code

…exit (behold#751)

terragucci ends the Forgejo job of a wave that applied what it planned and
blocked the rest as a failure (terragucci#1161), so the fan-out kiosks read
"wave 3 failed" where wave 3 applied cluster-b's six apps and blocked
cluster-a's six. /api/terragucci now carries `results`: each wave's state,
applied, unchanged, failed and blocked roots from its newest report, for the
newest four tf-apply commits. The event-help facts (the tip pill, the This
cycle trail, the failure modal) and the wave box titles prefer it, and use the
job's status only where no report of the wave is read, or the report is older
than the job.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@lex00
lex00 merged commit 1ab4e19 into main Oct 19, 2026
3 checks passed
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.

1 participant