Skip to content

refactor(planning): simplify the first half of surface exporters.py - #14780

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14691

Summary

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

Simplified four functions in the first line range (lines 1-1165 of 2331) of plugins/planning/surface/exporters.py without changing behavior. register() now builds the confirmed/unconfirmed lists from the marked commitments it has already computed, instead of a second commitments() pass over the events, and it calls readable() once instead of twice. settle() returns through one conditional instead of two branches. parse_hold() builds its confirmed list in one expression. confirmation_recap() counts statuses with collections.Counter. Every function, flag, exported name and output stays the same; commitments() is kept because round.py and the tests call it.

Not verified

  • plugins/planning/surface/test_exporters.py and test_round.py were not run: this lane allows no Python interpreter. They are left to the PR's CI.
  • ruff/black lint and format were not run (no interpreter or linter available here). The new lines were kept under 88 columns by hand. Left to the PR's CI.
  • tidy: passes 1-3 (simplify, comment deletion, generated-code residue) found nothing more to change in the listed lines. Passes 4-5 (docs-hygiene, ai-slop) were skipped for the changelog fragment, because the issue fixes its exact wording.
  • ci-status green on the PR is a PR check, left to the PR's CI.
  • The working tree has untracked files this run did not create (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc). They look like runner or sandbox artifacts and were left alone; they are not part of this change.

Fix

  • plugins/planning/surface/exporters.py: register() takes confirmed/unconfirmed from the marked_commits result it already holds and calls readable() once (readable() already returns clean() output, and clean() gives the same result when applied twice); settle() returns through a single conditional;…
  • .changes/planning/work-resolve-issue-issue-14691-42645279046-1-01746713.md: new patch fragment for planning, created with new-changelog-fragment, body '### Changed' and 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 2981101:

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

The run reports:

  • check-changelog-fragments: all 1 fragment valid (run before and after tidy/review)
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 13 passed, 6 skipped (typos not installed, shellcheck no shell, validate-plugins steps reported by the check), over 2 changed files
  • fresh-context review subagent over the whole diff: found no behavior change. It confirmed clean() returns the same result when applied twice, that commitments() is the split of marked_commits() for the same q/events, that row lists are fresh objects in both versions, and that counts is only used…
  • git-read diff: the diff touches only exporters.py (+11/-17 lines in parse_hold, settle, register, confirmation_recap and the imports) plus the new fragment
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42645279046

Left out: the items under Not verified.

Related

#14691

Merge-Risk: max=MEDIUM demote=false head=298110143abaa9b9c006eabb274f0101205fafc5 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 298110143abaa9b9c006eabb274f0101205fafc5: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14780, head 2981101

No security issues found.

I read every hunk of both changed files:

  • plugins/planning/surface/exporters.py: an internal refactor confined to four functions.
    • parse_hold() now builds its confirmed list in one map(unesc_field, ...) expression over the same inputs. The checks that refuse unreadable held rows (raise SystemExit(...)) are untouched.
    • settle() collapses two return branches into one conditional.
    • register() builds confirmed and unconfirmed from the marked commitments it already holds, and calls readable() once.
    • confirmation_recap() counts statuses with collections.Counter, from the standard library.
    • No new input source, subprocess, file path, network call, deserialization or credential handling is added. The output-escaping path (clean()) is kept on display. readable now takes shown directly; the PR says readable() already returns clean() output, and since readable() was always wrapped in clean() before, this is not a new escaping gap. Whether the behavior is exactly the same is a correctness question for the code-review lane, not a security finding.
  • .changes/planning/...md: a new changelog fragment with a patch bump. It is prose only.

No changed file matches a TRUSTED PATHS glob. No plugin manifest, workflow, trust control, merge hold or standing instruction is touched, so neither the trust-control lens nor the instruction-surface lens applies.

The PR context has no embedded instructions aimed at this lane. The closing issue's body was left out by the wrapper.

Prior findings: 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 298110143abaa9b9c006eabb274f0101205fafc5: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read both changed files in full: plugins/planning/surface/exporters.py and the new changelog fragment. I also read the code the changed lines call (clean, readable, marked_commits, commitments, unesc_field, and the counts consumer in confirmation_recap). Each of the four edits behaves the same as before:

  • parse_hold: list(map(unesc_field, [f.group(2), *rest[i + 1:]])) builds the same list, in the same order, as the old two-step build.
  • settle: the single conditional returns the same tuple on both branches.
  • register:
    • readable() already returns clean(...) output, and clean gives the same result when applied twice (no pipes left, whitespace already collapsed). So "readable": shown is unchanged, and so is "display": clean(lead + shown).
    • The confirmed/unconfirmed lists built from briefed equal what commitments(q, events) returned. marked_commits is a pure function of q and events, nothing changes either one between the two calls, and an own decision still gives empty lists.
    • Each row still gets fresh list objects.
  • confirmation_recap: counts is only read through sorted(counts.items()). Counter holds no zero entries, so the tally text is the same. Counter doesn't clash with any other name in the module.

Closing issue #14691, acceptance criteria:

  • Behavior unchanged: met, by the reading above. Existing tests in test_exporters.py cover commitments, held-row round trips and recap output. I could not run them (no interpreter), so it's unverified that they pass.
  • Diff edits only the listed file and a changelog fragment: met.
  • Under 400 changed lines and 15 hand-edited files: met (+11/−17 in one file).
  • ci-status green: left to CI, not checked here.
  • Fragment body is ### Changed plus "Internal simplification, no behavior change.", with a patch bump: met.
  • Only functions starting in lines 1–1165 changed: met. All edits fall between lines 111 and 906 at head.

The PR description reports test, lint and check results from its own run. I did not re-run any of them.

No path-scoped rule or paved-path criteria apply. No plugin manifest is changed. This is not a blocking-only review: there are no earlier reviews or prior findings on this PR.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 2981101

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-14780-298110143abaa9b9c006eabb274f0101205fafc5, 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 334ae34 Nov 9, 2026
69 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14691-42645279046-1 branch November 9, 2026 20:57
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 exporters.py planning plugin code (part 1 of 2)

0 participants