Skip to content

refactor(planning): simplify round.py part 1 of 2 - #14784

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14694-42645320126-1
Nov 9, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14694-42645320126-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14694

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Simplified the first half of plugins/planning/surface/round.py (original lines 1-1775 of 3550; every edited function starts in that range) with no behavior change. Code repeated in more than one place now goes through five small helpers: revise_recommendation (op_reply and op_revise), newest_stage and stage_round (add_question and op_propose), sentence_count (lint_questions and checked_round_restate) and find_group (four group lookups). Three other edits: load() passes an empty default because its setdefault loop already fills the same keys in the same order, prepare() reads the plugin manifest once instead of twice, and repoint_dependents builds its dependsOn rewrite in plain branches instead of a nested generator. No name was removed or renamed, and no flag, output, exit code or written JSON changed.

Not verified

  • plugins/planning/surface/test_round.py was not run: this lane allows no Python interpreter. Left to the PR's CI.
  • ruff lint of round.py was not run here: no interpreter or ruff wrapper in this lane. Left to the PR's CI.
  • ci-status green is a PR check, left to the PR's CI.
  • tidy pass 5 (ai-slop): the deterministic detect.sh could not run, because this lane runs only its named wrappers. The rubric read of the one-line fragment found no tells.

Fix

  • plugins/planning/surface/round.py: added helpers revise_recommendation, newest_stage, stage_round, sentence_count and find_group and used them in place of duplicated code; simplified load(), prepare(), repoint_dependents() and op_record_terminal's alt check (56 added, 59 removed lines)
  • .changes/planning/work-resolve-issue-issue-14694-42645320126-1-6d47b59f.md: patch fragment for planning, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 3dd59f1:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: All 1 changelog fragment(s) under .changes/ are valid (run before and after tidy)
  • check-changed-skills: no changed skills, nothing to gate (run before and after tidy)
  • check-affected: 13 passed, 6 skipped over 2 changed files (run before and after tidy)
  • fresh-context review subagent over the whole diff: confirmed every change is behavior-equivalent for every reachable input, including JSON key order and side-effect order; the new helper names collide with nothing; no removed names; the only importer, test_round.py, uses names left unchanged
  • grep: the new helper names are defined once in round.py and used nowhere else in plugins/planning; test_round.py reads only r.guard_revision, r.set_aside_answer, r.sidecar_lock, r.end_watcher, r.webbrowser, r.open_browser, r.OP_ARGS, r.main and APPLY_ONLY, all unchanged
  • diff size: 2 files, 115 changed lines in round.py plus a 7-line fragment, within the issue's 400-line limit
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42645320126

Left out: the items under Not verified.

Related

#14694

Merge-Risk: max=MEDIUM demote=false head=3dd59f1eb787589923a25adebd212cb63ec9d234 rubric=8.1.6 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 3dd59f1eb787589923a25adebd212cb63ec9d234: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14784 (head 3dd59f1)

I found no security issues.

I read every hunk of both changed files:

  • plugins/planning/surface/round.py: This is a refactor that changes no behavior. Five helpers replace duplicated code: revise_recommendation, newest_stage, stage_round, sentence_count and find_group. Four other functions are simplified:

    • load() now passes an empty default, and the setdefault loop after it fills the same keys.
    • prepare() reads the plugin version once.
    • repoint_dependents rebuilds dependsOn in plain branches.
    • op_record_terminal moves its alt check inside the branch.

    No code path gains new input handling, subprocess or shell use, filesystem paths, network access or credential handling. The rewritten branches refuse the same inputs as before: the alt required check and the cycle handling in repoint_dependents give the same result.

  • .changes/planning/...md: This is a changelog fragment only.

Other checks

  • Trusted paths: Neither changed file matches a trusted-path glob.
  • Trust controls and manifests: The diff changes no trust control (trusted-trigger, token broker, kill switch or merge hold), no plugin manifest and no instruction surface.
  • PR context: The pull request text contains no embedded directives aimed at this lane.
  • Prior findings: This lane has posted none, and this was not a blocking-only review.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 3dd59f1eb787589923a25adebd212cb63ec9d234: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

This review read both changed files in full: plugins/planning/surface/round.py and the changelog fragment. I compared each hunk with the base version to check that the refactor keeps behavior the same.

  • load(): load_json (interview_server.py) returns a deep copy of the default when the file is missing. The setdefault loop then fills meta, rev, groups, questions and visuals in the same order the old default dict had them, so key order and values in the written JSON stay the same.
  • prepare(): plugin_version() is still called only when rev is falsy, and now runs once instead of twice. The stamped value is the same.
  • repoint_dependents(): in the old generator, p is rebound to the mapped value before the filter runs. On the cycle branch the mapping is the identity and the filter drops old["id"]. On the non-cycle branch the filter is a no-op and old is replaced by new. The new if/else does the same thing, and the dedup is still through dict.fromkeys.
  • sentence_count(): re.split on "" gives [""], which the filter turns into 0. That matches the old if basis else 0 guard in lint_questions.
  • find_group(): in record_summary_of, a missing group would now raise TypeError where it used to raise StopIteration. Neither caller can reach that case: both run after put_group has added the group (round.py:937, round.py:1179). The other three lookups already used next(..., None).
  • revise_recommendation, newest_stage, stage_round, and the op_record_terminal alt check match the code they replace line for line.

Closing issue #14694, acceptance criteria:

  • Behavior unchanged: met, from reading the code; the existing test_round.py covers it.
  • Edits only listed files plus fragments: met.
  • Within 400 changed lines: met (about 115 lines).
  • Fragment with ### Changed / "Internal simplification, no behavior change.": met, bump: patch.
  • Only functions starting in range 1 of 2: met. Every edited function starts before the file's midpoint (the last is op_record_terminal, near line 1587 of about 3550).
  • ci-status is green: left to CI. The author's description says neither the tests nor ruff ran in the authoring lane. I did not run them either: this review lane has no shell.

The only path-scoped rule matching a changed file is .claude/rules/ruff-pin.md (**/*.py), which is about how to run lint; none of the changed lines break it. No plugin manifests changed. I found no embedded instructions in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 3dd59f1eb787589923a25adebd212cb63ec9d234, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 3dd59f1

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14784-3dd59f1eb787589923a25adebd212cb63ec9d234, expires on 2026-12-09.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit ead2a28 Nov 9, 2026
69 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14694-42645320126-1 branch November 9, 2026 21:03
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.

Simplify the round.py planning plugin code (part 1 of 2)

0 participants