Skip to content

refactor(planning): simplify the second half of the interview exporters - #15122

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14692-42835705818-1
Nov 10, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14692

Summary

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

Simplified the functions that start in range 2 of 2 of plugins/planning/surface/exporters.py (lines 1170-2339 as measured at start, ledger_constraints onward), with no behavior change. The three ledger importers (import_hold, import_named, import_ledger) now share new helpers for the base question dict, the seeded commitsConfirmed records and the superseded-by-plan proposal, building dicts with the same keys in the same order. Refusals that repeated the existing refuse() helper's refused: <what> in <where> text now call it with the same message, and render_visual, visuals_for and loose_ends lost repeated expressions and loop boilerplate. Choice of means: I kept the per-branch rev computation in import_ledger rather than hoisting it, because hoisting would raise earlier on a non-int rev, and I left the refusals whose wording differs from refuse() (..., in <where>, in <ledger>: <id>) as they were.

Not verified

  • The Python test suites (plugins/planning/surface/test_exporters.py, test_round.py) were not run: this lane cannot run an interpreter. They are left to the PR's CI.
  • ci-status green on the PR: left to the PR's CI.
  • Tidy pass 5 (ai-slop:audit fix) ran its rubric layer only, on the changelog fragment: this lane's Bash cannot run the ai-slop detector script, so the deterministic layer and its findings file were skipped. The fragment's one line is fixed word for word by the issue and showed no tells.
  • Build, lint and test of the touched Python file were not run locally (no interpreter in this lane). The verify step is left to the PR's CI.

Fix

  • plugins/planning/surface/exporters.py: added seeded_question, seed_confirms and seed_superseded and used them in import_hold, import_named and import_ledger; routed five identically worded SystemExit refusals through refuse(); computed the visual's escaped name once in render_visual; turned…
  • .changes/planning/work-resolve-issue-issue-14692-42835705818-1-16d3d803.md: new patch fragment for planning from new-changelog-fragment, body ### Changed with "Internal simplification, no behavior change."

Verification

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

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

The run reports:

  • check-changelog-fragments: all 9 fragments under .changes/ valid (run after tidy and after review fixes)
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 13 passed, 6 skipped (shellcheck: no shell; typos: not installed; three validate-plugins sub-checks that run tree code; changed-skills: none), over 2 changed files
  • ruff.toml lint select (E4, E7, E9, F): read to confirm that line length is not linted; I matched the file's black-style 88-column wrapping anyway
  • fresh-context review subagent over the whole diff: no reachable behavior difference; it flagged that hoisting rev in import_ledger would raise TypeError earlier on a non-int rev (reverted) and that the new name seed_proposal_row was easy to confuse with seed_proposal (renamed to seed_superseded)
  • git-read diff --numstat HEAD: 1 code file, 152 changed lines, plus the 7-line fragment; within the 400-line / 15-file limit
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42835705818

Left out: the items under Not verified.

Related

#14692

Merge-Risk: max=MEDIUM demote=false head=daa3392e73727ebc29a732b0e7c1c36f8b8c19b8 rubric=8.3.5 rater=claude-opus-5-5 checker=claude-opus-5-5

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15122 (head daa3392)

No security issues found. I read every hunk of both changed files.

This is a refactor of plugins/planning/surface/exporters.py plus a changelog fragment. No changed file matches a trusted path, and the change touches no trust control, merge hold, workflow, token, manifest or instruction surface.

What I checked:

  • HTML output escaping in render_visual: The title or id is still passed through esc(), once, into name. name then goes into the <h4>, the iframe title= and the img alt= attributes, so it is escaped exactly as before. The iframe keeps sandbox="" and srcdoc="{esc(content)}", and the image path keeps its data:image/ prefix check. Nothing new reaches an attribute or the page without escaping.
  • visuals_for: The new code filters v and not v.get("archived") over the listed and scoped visuals together. This drops the same missing and archived entries as before, so no archived or unresolved visual is newly rendered.
  • Refusals routed through refuse(): refuse(what, where) at exporters.py#L2007-L2008 always raises SystemExit(f"refused: {what} in {where}"). So every replaced call, including the one in resolve_row before older.groups(), still stops execution with the same message, and no refusal now falls through.
  • Seeded-question helpers (seeded_question, seed_confirms, seed_superseded): These only build plain dicts. No new input source, file path or command is involved.
  • The .changes/ fragment: Changelog prose only.

The PR context contains no embedded instructions aimed at this lane.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of both changed files: plugins/planning/surface/exporters.py and the new changelog fragment .changes/planning/work-resolve-issue-issue-14692-42835705818-1-16d3d803.md. I traced each change against the code it replaces to check that behavior stays the same.

  • refuse() rerouting (locate_row, resolve_row, import_ledger): refuse(what, where) raises SystemExit(f"refused: {what} in {where}"). That gives the same text as all five refusals it replaces, including the conditional message in locate_row. The calls that run before its definition line are fine, because it is a module-level function and is looked up when the call runs. Nothing in the file shadows it.
  • seeded_question / seed_confirms / seed_superseded: the dict keys come out in the same order. In import_hold, waiting/waitsOn/waitingSince are still added after alternatives, and alternatives keeps its position when it is overwritten. The seeded row's status, round, resolution and proposal are unchanged. import_named still adds wasForm to seeded[qid] afterwards, and q["id"] == qid there.
  • visuals_for: the old code dropped falsy listed entries before the archived filter. The new code applies v and not v.get("archived") to both the listed and the scoped entries. That is equivalent, because a scoped entry must carry a scope key and so cannot be an empty dict.
  • render_visual: name is the same esc(...) expression the old code already evaluated at the top for head, so no new evaluation or exception path appears. loose_ends: the list comprehension is equivalent to the old loop.
  • Closing issue Simplify the exporters.py planning plugin code (part 2 of 2) #14692 criteria:
    • Only functions starting at or after line 1170 of the base file are edited, and the new helpers sit inside that range.
    • The diff touches only the listed file and a fragment.
    • The diff is about 150 changed lines.
    • The fragment's bump: patch / ### Changed / "Internal simplification, no behavior change." matches the required text.
    • ci-status and the test suites were not run by the author (author-stated, unverified). I did not run them either, since this lane has no interpreter. They are left to CI.

No plugin manifest changed. Nothing here can cause a cost or a hold.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head daa3392e73727ebc29a732b0e7c1c36f8b8c19b8. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:unreadable)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for daa3392

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-15122-daa3392e73727ebc29a732b0e7c1c36f8b8c19b8, expires on 2026-12-10.

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 10, 2026
Merged via the queue into main with commit 8be16a2 Nov 10, 2026
69 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14692-42835705818-1 branch November 10, 2026 16:29
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 8be16a2797afbb50b29db8ae07cff48b96e585a5; later checks count it verified from this comment.

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 2 of 2)

0 participants