Skip to content

feat(ci-respond): a model's summary of a refused wave (#5335) - #5365

Merged
lex00 merged 2 commits into
mainfrom
feat/5335-wave-refused-summary
Nov 20, 2026
Merged

lex00 merged 2 commits into
mainfrom
feat/5335-wave-refused-summary

Conversation

@lex00

@lex00 lex00 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #5335

respond.wave-refused takes a third value, summary. It posts the note diff posts today with a model's summary above it. The default stays diff, so the summary runs only where a product sets summary.

What it does

  • CI_RESPONSES["wave-refused"] is diff, summary, off. --respond wave-refused=summary, CHANT_RESPOND and an op waves spec's respond all take it.
  • summarizeRefusedWave (packages/core/src/ci-respond-summary.ts) runs one command the same way the review agent does. The prompt goes in on stdin and the summary comes back on stdout. The command's environment holds the model's key and process basics. The default command is the review command with --output-format json, so the cost is read from Claude Code's result. The prompt uses the product's words (product, noun, plan and apply verbs) and quotes the diff as data.
  • respondPrApply and respondOpWave post one note per event and place, under the same marker as before, with the summary above the diff. When the summary cannot run or its command fails, the note is the diff alone, headed The summary was skipped: <reason>. The reason names the cause: a missing key variable, for one.
  • Held and declined waves carry no diff and post the same text as before.
  • Each run that starts the command writes one run record (agentRunRecordInput) under op <product>-refused-wave, trigger refused-wave (terragucci's op and trigger words, so its audit file keeps reading the same lines), result summarized or failed, with promptDigest and usage (model, tokens, USD). AgentResult gains summarized.
  • Limits are the agent's: maxRuns and maxCostUsd per day, checked with overLimit on those records before the command runs. A run past a limit runs nothing and records nothing.
  • The summary changes no exit code and approves nothing; the note says so.
  • WAVE_REFUSED_SUMMARY_FLOOR (= NEXT_RELEASE) is exported from @intentius/chant/ci-product and @intentius/chant/ci-respond-summary, with the floor table regenerated.

Product words

Key Value chant
respond.wave-refused diff, summary, off CiResponses["wave-refused"]
agent.wave-refused.command a command line CHANT_WAVE_SUMMARY_COMMAND
agent.wave-refused.key_secret a secret or variable name CHANT_WAVE_SUMMARY_KEY_ENV
agent.wave-refused.timeout a whole number of minutes CHANT_WAVE_SUMMARY_TIMEOUT
agent.wave-refused.max_runs a whole number CHANT_WAVE_SUMMARY_MAX_RUNS
agent.wave-refused.max_cost_usd a number above 0 CHANT_WAVE_SUMMARY_MAX_COST_USD

The new keys are in the Stage keys table of the product config page and in PRODUCT_CONFIG_WORDS with section stage.

Generated jobs

A product hands the agent.wave-refused.* settings to chant as waveSummary on its op waves spec or its pull request loop options (productPipelineJobs passes them on to the waves spec). When respond["wave-refused"] is summary, chant's generated jobs carry them:

  • GitHub and Forgejo: the pull request loop's apply job and the wave jobs that carry the notify secrets get CHANT_WAVE_SUMMARY_* and the model's key as <KEY>: ${{ secrets.<KEY> }}.
  • GitLab: the same jobs get CHANT_WAVE_SUMMARY_*, naming the key's variable. The key is the CI/CD variable of that name, which every GitLab job already has.

With diff or off the jobs carry none of this, and the render tests compare the rendered files byte for byte with and without waveSummary. The existing default goldens are unchanged. opWavesSummaryEnv (@intentius/chant/op/op-waves) and waveSummaryJobEnv hold the rule in one place, and assertOpWavesSpec checks waveSummary.

Tests

lexicons/{github,gitlab,forgejo}/src/components/generate-wave-summary.test.ts render both pipelines in each forge with summary, diff and off. packages/core/src/ci-respond-summary.test.ts drives the summary through a fake command, ledger and forge. It covers the settings and the prompt. The run record's digest and cost are checked too. It checks that each limit and each failure leaves the diff alone with its reason, and that an op wave refusal posts one note with the summary above the diff.

@lex00
lex00 enabled auto-merge November 20, 2026 02:52
@lex00
lex00 added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 20, 2026
@lex00
lex00 force-pushed the feat/5335-wave-refused-summary branch from e04ed2c to b7ccbdd Compare November 20, 2026 08:53
@lex00
lex00 enabled auto-merge November 20, 2026 08:53
@lex00
lex00 added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 57d7598 Nov 20, 2026
10 checks passed
@lex00
lex00 deleted the feat/5335-wave-refused-summary branch November 20, 2026 09:11
@lex00 lex00 mentioned this pull request Nov 20, 2026
78 of 84 tasks
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.

ci-respond: a model's summary of a refused wave for every product

1 participant