Skip to content

refactor(planning): simplify the surface checks, surface registry and plan panel - #14788

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14697

Summary

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

Removed repeated code inside three planning files with no behavior change. In surface-checks.sh, a port_of helper replaces eleven copies of the PORT sed pipeline, the existing rapply helper replaces fifteen printf-then-apply pairs, and finish() stops servers in two loops. registry.mjs stats each PATH candidate once and parses options with one index step. plan-panel.js reads each judge's score rows through one scoresFor helper, builds the rubric list and the ran list once, and returns drafts without copying it again. round.sh, schema.py and the three surfaces/entries files were reviewed and left as they were: they were already minimal. Deduping the entries files would mean sharing code across files, which the issue rules out of scope.

Not verified

  • The planning test suites (plan-panel.test.mjs, surface-registry.test.mjs, surface*.test.sh) were not run here: this lane allows no node or bash test runner. Left to the PR's CI.
  • ci-status green is a PR CI check, left to the PR's CI.
  • tidy (code-tidying:tidy-diff) ran every pass and made no edits. For the markdown fragment, only the rubric read ran: the ai-slop detect.sh script is not a wrapper this lane can run.
  • The runner's environment dotfiles (.bashrc, .gitconfig, .idea, .mcp.json and others) show as untracked at the checkout root. They are not part of this change and were not counted in the tidy measure.

Fix

  • plugins/planning/surface/surface-checks.sh: added port_of(data-dir) in place of 11 copies of the sed PORT read; 15 printf-to-file + round.sh apply pairs now call the existing rapply helper; finish() stops the fixed and the optional data dirs in two loops instead of seven lines
  • plugins/planning/surfaces/registry.mjs: onPath calls statSync once per candidate; main() option parsing advances with i++ and rest[++i] instead of the i += 2 / i -= 1 pair
  • plugins/planning/workflows/plan-panel.js: a scoresFor(r, id) helper replaces three copies of the draft-letter match; RUBRIC_LIST and RAN are computed once; the returned drafts array is passed through instead of being copied again into the same {id, angle, plan, key_ideas} shape; dropped an `if…
  • .changes/planning/work-resolve-issue-issue-14697-42645331299-1-f49c064c.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 04c56f2:

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

The run reports:

Left out: the items under Not verified.

Related

#14697

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

Security review: PR #14788 (head 04c56f29)

I found no security issues.

I read every hunk of all 4 changed files. None of them match a trusted-path glob. No trust control, plugin manifest or standing instruction is touched.

  • plugins/planning/surface/surface-checks.sh: this test-only harness, run by the surface-*.test.sh suites, gets two helpers. port_of replaces 11 copies of the same sed read on a fixed file in a temp data dir. rapply replaces 15 printf-then-round.sh apply pairs. The finish() stop calls are folded into loops. Every variable stays double-quoted and the op JSON stays single-quoted literals. The one interpolated payload (${ls[*]} in the handle op) is unchanged. No new input source reaches a command.
  • plugins/planning/surfaces/registry.mjs: onPath now calls statSync once instead of twice. It is still gated by accessSync(X_OK) and the isFile/size check. In main(), the option loop moved from i += 2 / i -= 1 to i++ / rest[++i]. The same allowlist of keys and the same incomplete-option error apply, so nothing new is accepted.
  • plugins/planning/workflows/plan-panel.js: scoresFor, RUBRIC_LIST and RAN are pure refactors. The returned drafts is now passed through as it is instead of being copied again. Where it is built (plan-panel.js:126-129), its shape is already exactly {id, angle, plan, key_ideas}, so no extra data is exposed.
  • .changes/...md: a changelog fragment only.

The PR context file holds no embedded instructions aimed at this lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14788 (refactor(planning): simplify the surface checks, surface registry and plan panel)

No findings. I read every hunk of all 4 changed files and compared each against the code it replaces, reading the head files where I needed more context. None of the changed files matches a trusted path.

Equivalence checks (my reading of the code; I ran nothing)

  • plugins/planning/surface/surface-checks.sh
    • finish(): the two new loops stop the same data dirs as the seven lines they replace. They read $d/$c/$e/$j/$g directly as before and guard ${pg:-} / ${sd:-}, so nothing changes under set -u.
    • port_of: it runs the same sed | tr pipeline as the 11 inline copies it replaces.
    • rapply (defined at line 147): it does the same printf-to-file and then round.sh apply --file. Its exit status is the apply's, so every || bad ... still fires on refusal. The >/dev/null 2>&1 on the revising-by-claude call now also covers the printf, which only ever wrote to its file. The multi-line JSON arguments and the handle-op ${ls[*]// /, } splice reach the file unchanged.
  • plugins/planning/surfaces/registry.mjs
    • The option loop moves the index the same way as before for every argv shape: --unattended advances by 1 and a keyed option by 2. The missing-value check rest[i + 1] === undefined is still there.
    • statSync now runs once per candidate, still inside the same try.
  • plugins/planning/workflows/plan-panel.js
    • drafts (line 126) is already built in the {id, angle, plan, key_ideas} shape, and nothing changes it later. Returning it directly gives the same output as the old copy.
    • Dropping if (!row) continue is safe. returned keeps only judges that complete accepts, so each has exactly one row per draft id, and s.draft is always one of those ids.
    • Destructuring the first item of scoresFor(...) returns the same row as the old find.
    • RAN and RUBRIC_LIST hold the same values as the expressions they replace.

Closing issue #14697 acceptance criteria

  • Behavior unchanged: met, by my reading above. plan-panel.test.mjs, surface-registry.test.mjs and the surface*.test.sh suites cover these paths.
  • Diff edits only the listed files plus a changelog fragment: met.
  • Within 400 changed lines and 15 files: met.
  • planning fragment with bump: patch, ### Changed and "Internal simplification, no behavior change.": met.
  • ci-status green: not checked here, because this lane can't see CI. The author also says the test suites were not run in their lane, so passing tests are unverified until CI runs.

No settled threads. Prior findings: none, and this is not a blocking-only review. The PR context contains no embedded instructions. The diff changes no plugin manifests.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 04c56f2

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-14788-04c56f29fb3dc23e70b9282fc889e6ab95fd6611, 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 03e37c8 Nov 9, 2026
67 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14697-42645331299-1 branch November 9, 2026 19:59
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 03e37c8e1bd353c28f98d3fddf47c2210796391e; 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 surface, entries, surfaces and 1 more planning plugin code

0 participants