Skip to content

Feat(revise): Inherit run parameters on hand-back - #243

Merged
ModeSevenIndustrialSolutions merged 2 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-241
Nov 24, 2026
Merged

ModeSevenIndustrialSolutions merged 2 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-241

Conversation

@lf-releng-code-monkey-bot

@lf-releng-code-monkey-bot lf-releng-code-monkey-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #241

Authored by an AI agent; human review required
Command Exit
uv run python -B -m unittest tests.test_run_parameters 0
uv run python -B -m unittest tests.test_run_parameters.CodecTest.test_the_token_spells_no_footer_field (old encoding, expected to fail) 1
uv run python -B -m unittest discover -s tests 0
git checkout a666d4d && uv run python -B -m unittest discover -s tests 0
zizmor --persona auditor .github/workflows/ 127
uvx zizmor --persona auditor .github/workflows/ 0
gitlint --commits aea90aa3..HEAD 127
uvx gitlint --commits aea90aa3..HEAD 0
git log --raw --format=%h aea90aa3..HEAD 0
prek run --files $(git diff --name-only aea90aa3 HEAD) 0

The github-code-monkey-bot workflow 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_parameters input so the round runs on the parameters of the round it answers. scripts/run_parameters.py is 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 a params=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 and continue jobs 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=true in lfreleng-actions/github-code-review-bot) must merge after this one. GitHub refuses a dispatch that names an undeclared input.

This round

  • Copilot (high): the token's antagonistic=1, review=1 and stale=8 reused the footer's own name=value fields. The review bot's looser antagonistic= read could take the token's switch for an answered review and dispatch the hand-back again. The token's fields are now name:value, and the token never holds =. A new test (expected failure in the test commit) checks this.
  • Older Code Monkey readers pinned before this change fail to parse any footer that carries the token. Code cannot fix that, so DESIGN.md §20.1 now gives the rollout: move every caller working the same issues to this commit together, and let older runs finish first.

Checks run

  • uv run python -B -m unittest discover -s tests, at both commits: OK
  • prek run --files <branch files> (every hook, aislop included): OK
  • zizmor --persona auditor .github/workflows/: no findings
  • gitlint: OK

For the reviewer

  • The rollout note in DESIGN.md §20.1 for callers pinned to older commits.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_parameters for 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

Comment thread scripts/run_parameters.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Parameter inheritance can select superseded or outdated run settings, and the new identifier-length limit rejects inputs still accepted by the workflow.

3 open issues

Review effort: Balanced

Comment thread scripts/round_reads.py Resolved
Comment thread scripts/round_reads.py Resolved
Comment thread scripts/run_parameters.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread scripts/issue_comment.py Resolved
lf-releng-code-monkey-bot Bot and others added 2 commits November 24, 2026 16:25
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit a3860d2 into lfreleng-actions:main Nov 24, 2026
36 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the code-monkey/issue-241 branch November 24, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat(revise): Inherit run parameters on hand-back

2 participants