Repository navigation
Feat(revise): Inherit run parameters on hand-back - #243
ModeSevenIndustrialSolutions merged 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new validator rejects previously valid stale_status_minutes inputs, causing workflow dispatches to fail before any author job runs even when inheritance is disabled.
1 open issue
What changed in this PR
Adds opt-in run-parameter inheritance so revision rounds can retain the model, budgets and switches used by a pull request’s previous round. This prepares Code Monkey for the review bot’s separately planned hand-back update.
Changes:
- Defines and validates the inherited parameter set, recording it in outcome footers.
- Adds
inherit_run_parametersfor single-pull-request runs and exposes effective values to downstream jobs. - Forwards effective parameters through continuations and adds tests and documentation.
| File | Description |
|---|---|
tests/test_workflow.py |
Tests inheritance inputs, effective outputs and continuation forwarding. |
tests/test_select_issues.py |
Checks selection remains unchanged with inheritance off. |
tests/test_run_parameters.py |
Tests encoding, validation, footer reading, fallback and budgets. |
scripts/selection_outputs.py |
Reports inherited values or fallback reasons in summaries. |
scripts/selection_inputs.py |
Adds the inheritance command-line flag. |
scripts/select_issues.py |
Applies inheritance before parameter-dependent selection. |
scripts/run_parameters.py |
Defines parameter validation, encoding and effective outputs. |
scripts/round_reads.py |
Reads parameter tokens and their source runs from footers. |
scripts/publish_cli.py |
Accepts the parameter token for outcome comments. |
scripts/parameter_inheritance.py |
Retrieves and applies parameters with fallback handling. |
scripts/issue_comment.py |
Appends parameter tokens to outcome footers. |
README.md |
Introduces run-parameter inheritance. |
docs/DESIGN.md |
Documents inputs, provenance, hand-back and continuation behavior. |
.github/workflows/code-monkey.yaml |
Settles effective parameters and connects downstream jobs. |
.github/workflows/code-monkey-cron.yaml |
Exposes inheritance and forwards effective continuation values. |
Review effort: Balanced
93f49cf to
9e27202
Compare
9e27202 to
4dc1046
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new footer breaks compatibility with deployed and SHA-pinned readers, risking duplicate hand-back dispatches and lost review state without reader updates, rollout safeguards, and compatibility tests.
1 open issue
Review effort: Balanced
Issue lfreleng-actions#241 asks a hand-back round to inherit the run parameters its pull request's last round used. These tests pin the behaviour before it exists: the footer token's codec, the round history reading the latest token, the selector's inheritance and refusals, the settle step's outputs, and the workflow contracts for the new input, the select job outputs and the continue job's forwarding. Each is marked as an expected failure until the change lands. Review round 3: - Copilot: the token spelt its fields name=value, so a reader looser than round_reads.FOOTER took its antagonistic=1 for the footer's answered review. The fixtures now spell name:value, and a new test checks no footer field can be read out of the token. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
An antagonistic hand-back dispatches the caller with the form's defaults, so the round that answers the review can run on another model, tier or budget than the round it reviewed (lfreleng-actions#241). Every outcome footer now records the run's parameters as a params=v1: token. The new inherit_run_parameters input, refused unless the run names one pull request alone in pull-requests mode, makes the select job read the latest footer that carries a token, check each value as the input check would, and use them in place of the form's. A missing, unreadable or invalid token keeps the form's values; the last two warn. scripts/run_parameters.py is the single definition of the inherited set, its checks and the codec. A new select step settles the values in effect and publishes them as job outputs, which the author, publish and antagonistic jobs now read in place of the inputs. The caller gains the input, and its continue job forwards the values the run used plus the switch, so a chain keeps inherited values. With the switch off, the selection, the session and the dispatch are unchanged; only the footer gains its token. Review round 1: - Copilot: the stale_status_minutes check refused 08, 00 and values over six digits, which the input check and stale_statuses accept, and the settle step runs it on every dispatch. It now takes any digits as given; runtime and rounds keep their bounded check. - aislop complexity/file-too-large on select_issues.py: the target checks, the inheritance refusal included, move to selection_inputs.py, which parses the inputs before any read. Review round 2: - Copilot: a stale footer, from a run another push superseded, could set the inherited values, and a late retry of an older round could rewind them. The source is now the latest footer not marked stale, ordered by its read time as the watermark is. - Copilot: a newest footer without a token fell back to an older round's. That footer now inherits nothing, so the form stands. - Copilot: the model check capped ids at 64 characters, which the input check does not; it now takes the input check's pattern. A token past its bound is still left out of the footer. Review round 3: - Copilot: the token's antagonistic=1, review=1 and stale=8 shared the footer's own name=value fields, so the review bot's looser antagonistic= read could take the token's switch for an answered review and dispatch a hand-back again. Fields are now name:value and the token holds no "=". DESIGN.md 20.1 says so, and says that readers pinned before the token miss the whole footer, so callers working the same issues move to this commit together and older runs finish first. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
4dc1046 to
749616b
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The footer breaks older pinned readers, requiring maintainer confirmation of coordinated caller upgrades, draining older runs, and review-bot deployment sequencing that cannot be verified from the diff.
No open issues 🎉
Review effort: Balanced
a3860d2
into
lfreleng-actions:main


Closes #241
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLIaea90aa3cbad7425f711418ec87c1f727cef042cuv run python -B -m unittest tests.test_run_parametersuv run python -B -m unittest tests.test_run_parameters.CodecTest.test_the_token_spells_no_footer_field (old encoding, expected to fail)uv run python -B -m unittest discover -s testsgit checkout a666d4d && uv run python -B -m unittest discover -s testszizmor --persona auditor .github/workflows/uvx zizmor --persona auditor .github/workflows/gitlint --commits aea90aa3..HEADuvx gitlint --commits aea90aa3..HEADgit log --raw --format=%h aea90aa3..HEADprek run --files $(git diff --name-only aea90aa3 HEAD)The
github-code-monkey-botworkflow opened this pull request.Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds per antagonistic review round; after that a maintainer, or the next antagonistic review, takes on any finding that remains, and a maintainer reviews every round before merge.
Round 3 of revision, on its base.
Closes #241.
What this does
A hand-back round (the review bot's dispatch) used to run on the form's defaults. This PR adds the
inherit_run_parametersinput so the round runs on the parameters of the round it answers.scripts/run_parameters.pyis the single definition of the inherited set (model, Fusion tier, runtime, rounds, stale minutes and the five switches) and of their checks. Every outcome footer now records the run's values as aparams=v1:token. With the switch on, the select job reads the latest non-stale footer of the one named pull request, checks each value, and publishes the effective values as job outputs. The author, publish, antagonistic andcontinuejobs read those outputs. If the token is invalid or missing, the form's values stay. With the switch off, nothing changes except the footer token.The review bot change (
-f inherit_run_parameters=trueinlfreleng-actions/github-code-review-bot) must merge after this one. GitHub refuses a dispatch that names an undeclared input.This round
antagonistic=1,review=1andstale=8reused the footer's ownname=valuefields. The review bot's looserantagonistic=read could take the token's switch for an answered review and dispatch the hand-back again. The token's fields are nowname:value, and the token never holds=. A new test (expected failure in the test commit) checks this.Checks run
uv run python -B -m unittest discover -s tests, at both commits: OKprek run --files <branch files>(every hook, aislop included): OKzizmor --persona auditor .github/workflows/: no findingsgitlint: OKFor the reviewer