Skip to content

refactor(planning): simplify core.js and proto-pin.js in the shared web page - #14778

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14689-42645245910-1
Nov 9, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14689-42645245910-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14689

Summary

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

Simplified the planning plugin's shared web scripts with no behavior change. core.js gets one JSON-answer helper (answered/getJson) in place of eight copies of the fetch, parse, throw-on-refusal block, and one POST-init helper (json(body, headers)) in place of three hand-built request inits. It also gains small helpers for code that was repeated: random hex, the own-record filter, clearing the typing flag after an action, the share base URL and setting the role flags. isOther is hoisted so toView uses it, scopeOf now goes through the existing qOf, and a stale duplicate doc line is gone. In proto-pin.js, pick reuses stop, the scroll behavior is computed once, and a redundant catch assignment is dropped. connect.js was reviewed and left unchanged: it is already compact, and each candidate cut would have changed a printed prompt or an exported value.

Not verified

  • planning shared test suites (test_server.py, test_session.py, ui_*.js browser suites) and a node syntax parse of core.js/proto-pin.js were not run here: this lane runs no interpreter; left to the PR's CI
  • tidy proposals not applied: the doc comments '/** n random bytes as lowercase hex. /' (core.js:15) and '/* GET as me. */' (core.js:839) restate their code, but the COMMENT-ONLY proof needs a scratch copy of the 1,680-line file, which this lane cannot make
  • tidy markdown passes (write-for-humans, ai-slop) skipped for the changelog fragment: its text is fixed word for word by the issue
  • build and lint of the touched JS files: the repository has no JS lint/build step that check-affected runs for these files, and the lane runs no node; left to the PR's CI
  • ci-status green on the PR: a PR check, left to the PR's CI

Fix

  • plugins/planning/shared/web/core.js: added answered()/getJson() and used them in cardHistory, health, uploadImage, reportImage, uploadChunk, join, redeemPair and chatPage; json() now takes extra headers and is used by send, the client-log post and adoptIdentity's heartbeat; added hex, ownRecord,…
  • plugins/planning/shared/web/proto-pin.js: pick calls stop() instead of repeating it, the focus handler computes the scroll behavior once, and placeOf's empty catch no longer reassigns null
  • .changes/planning/work-resolve-issue-issue-14689-42645245910-1-e136f200.md: patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 1ae43c3:

  • 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
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 12 passed, 7 skipped (shellcheck/ruff/changed-skills not applicable, typos not installed, three validate-plugins sub-checks skipped by design)
  • fresh-context review subagent over the whole diff (TDZ/hoisting, sync-vs-async throws, fetch headers and key order, promise chains, null destructuring, proto-pin.js forbidden-token rule from test_server.py, test_session.py OTHER-literal rule): no findings
  • grep of plugins/planning/shared/tests: the only source-text assertions on these files (test_server.py pin-helper bytes and forbidden tokens, test_session.py no === "other" literal) still hold
  • tidy (code-tidying:tidy-diff) over the changed lines: no edits needed; two class-A doc-comment proposals left unapplied (see not_done)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42645245910

Left out: the items under Not verified.

Related

#14689

Merge-Risk: max=HIGH demote=true head=462c5cad9b7e319a1fc2b4e9c0e4eecc3c4b2e52 rubric=8.2.0 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 needs no new review of 462c5cad9b7e319a1fc2b4e9c0e4eecc3c4b2e52: no file of this pull request changed since the review of 1ae43c3.

Security review: no security issues found

I read every hunk of all 3 changed files: the changelog fragment, plugins/planning/shared/web/core.js and plugins/planning/shared/web/proto-pin.js. None of them matches a trusted-path glob. The diff touches no plugin manifest, workflow, trust control, merge hold or standing instruction.

What I checked, since the change moves credential headers into shared helpers:

  • Auth headers are unchanged.
    • act used to build {"Content-Type": "application/json", ...ident()} inline. It now calls json(body, ident()), which builds the same headers with the same key order.
    • The client-log post keeps keepalive: true and sends the same headers.
    • The heartbeat still sends only X-Session-Secret, now through json(..., { "X-Session-Secret": secret }).
    • join and redeemPair call json(...) with no second argument. They still send no identity header, as before.
  • Error handling is unchanged. getJson sends { headers: ident() }, as each GET did inline. The cardHistory, health, uploadImage, reportImage and chatPage reads, and uploadChunk's POST, still reject with {status, ...body} when the response is not ok.
  • Link building is unchanged. shareBase() gives the same base URL that personalLink and guestLink built inline. The guest secret still goes only into the #me= fragment, under the same secret && !ownerToken condition.
  • The new helpers keep the old logic. ownRecord keeps the cid, !claude and !option own-record filter. takeRole sets the owner, leader and trusted role flags from the server's answer, exactly as before. These role flags only steer the UI; the server decides who may do what.
  • IDs keep the same randomness. hex(n) keeps crypto.getRandomValues for the page-view and tab ids.
  • proto-pin.js changes no behavior. pick returns early when !mode, so its call to stop(e) still always calls preventDefault and stopImmediatePropagation. Only the comment changed in placeOf's empty catch. The scroll behavior is now computed once, with the same value.

PR context: the PR text contains no instructions aimed at the review lane.

Instruction-surface lens: not applicable, since no standing instruction is changed. Prior findings: none, and this is the lane's first review of this pull request, so it is not blocking only.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

claude-review needs no new review of 462c5cad9b7e319a1fc2b4e9c0e4eecc3c4b2e52: no file of this pull request changed since the review of 1ae43c3.

Code review: no findings

This pull request is a refactor of plugins/planning/shared/web/core.js and proto-pin.js that is meant to keep behavior the same, plus a changelog fragment. I read every hunk of all 3 changed files, then checked the new code against the head file and the code it calls.

What I checked

  • Order of definitions. hex (core.js:16) and isOther (core.js:98) are defined before anything uses them. ownRecord, afterTyping and shareBase (core.js:391-393) use Core and typingUntil only when they run. typingUntil is a let in the same closure (core.js:61). answered, getJson and takeRole are function declarations, so they can be called from anywhere in the closure.
  • json(body, headers). It produces the same header keys in the same order as each hand-built request it replaces: send with ident(), the client-log post (still with keepalive), and the heartbeat with X-Session-Secret. Spreading an undefined headers is harmless for the callers that pass none.
  • answered / getJson. Each of the 8 call sites rejects with the same {status, ...body} as before and returns the same value: .image for the two image getters, and the whole JSON everywhere else. join's callback can drop async because it never awaits.
  • Other changes. scopeOf through qOf (core.js:93) matches the old find(q => q.id === qid). In proto-pin.js, pick already returns when !mode, so stop(e) still always prevents the default. The comment added in the catch contains none of the tokens that test_server.py (server.pin_helper) refuses.

Closing issue #14689 acceptance criteria

  • Behavior unchanged, and no file renamed or deleted: met, going by the review above. The planning ui_*.js browser suites run these paths, so a regression has tests that could catch it.
  • Only the listed files plus a fragment are edited: met. connect.js is left alone.
  • Size limit (400 changed lines, 15 files): met. The diff is well under both.
  • Fragment: met. It has bump: patch, a ### Changed heading and the exact required line.
  • ci-status green: I could not verify this. The lane has no CI access, and the author says the test suites were not run.

The author's own verification in the PR body (check-affected, the subagent review and the test grep) is their claim, and I did not confirm it. I ran no code: this lane has no shell.

No embedded instructions in the PR context. No manifest changes, no paved-path or path-scoped-rule hits in scope, and nothing that costs money.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 9, 2026
@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped fix-ci on this pull request: the lane could fix a failing check only by weakening a required check, and the head has no fresh fixer round left (it ran one, or an earlier lane stop already spent its same-head retry), so a session builder takes it. The lane labels it needs-session for a session builder, who makes the change this lane cannot, and the run ends in a failing pr-unblock/fix-ci status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=14778 -f activity=fix-ci

@melodic-automation-lanes melodic-automation-lanes Bot removed the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 9, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 462c5ca

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-14778-462c5cad9b7e319a1fc2b4e9c0e4eecc3c4b2e52, 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 c34abd9 Nov 9, 2026
105 of 106 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14689-42645245910-1 branch November 9, 2026 20:56
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 web planning plugin code

1 participant