Skip to content

refactor(composer): extract selected PR submit resolution - #27203

Closed
nwparker wants to merge 1 commit into
nwparker/explicit-workspace-name-10-09from
nwparker/selected-pr-submit-extraction-10-10
Closed

nwparker wants to merge 1 commit into
nwparker/explicit-workspace-name-10-09from
nwparker/selected-pr-submit-extraction-10-10

Conversation

@nwparker

@nwparker nwparker commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Prepare the existing GitHub review submit code for a separate fix that prevents old base-branch lookups from affecting a newer selection.

What Changed

Move the selected-PR matching, lookup construction and result application into selected-pr-submit-resolution.ts. The existing hook keeps its cache check, await and callback dependencies. Raw URL and query submission are unchanged.

Why

The parent hook is close to the repository's 300-line limit. This extraction gives the later ownership repair room without hiding behavior changes in a refactor or disabling the limit. The helper runs synchronously; transport, cache, setters and returned data retain their existing order.

Linked Issue

Follow-up to #26937. The separate reproduced stale review-base bug is repaired in the next stack layer.

Visual Proof

N/A: behavior-preserving source extraction. No user interface behavior changes in this layer. Captured before/after cache, transport, setter, result and microtask traces match exactly.

Testing

  • I tested these changes locally with production hooks and captured traces.
  • Existing controls and separate parity verification run.

At 81bc40f4d527923008f3b88a5db9c12db42121cc, based on the untouched naming parent 4c5b385e2a39b447088a140f8b88459426932a9a: 47 focused controls and 22 parity checks pass. Twenty before/after executions preserve all results and setter/transport traces, 40 callback-identity assertions and 120 microtask markers. Cold imports invoke no transport. Cached/uncached, local/remote owner, guards, errors and stale descriptors are covered.

The frozen 52-case existing review-ownership bug suite has exactly the same 35 failures and 17 passes before and after extraction, with identical case identities and input hashes. Those failures are deliberately preserved for the separate behavior repair; this refactor claims no bug fix. Web typecheck, full-file main/native lint, formatting and diff checks pass. All seven canonical changed-code quality scans pass at this exact commit against its parent; ordinary CI will provide broader checks. Tests use background-launch policy and existing locked dependencies in an owned overlay; no dependency installation or native rebuild.

AI Disclosure

Review

Root read the complete original hook, extracted helper and final hook. An independent refactor review found no behavior changes. Fourteen source audit invariants pass: guard and body equivalence, exact raw-query path and dependencies, runtime literal and call counts, unchanged hook ownership, and four parent awaits with zero helper awaits. The two source hashes and all 25 frozen proof artifacts are verified. Only two production files change.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer content is copied.

Notes

No new state, effect, ownership guard, protocol field or execution-host routing is introduced. This is stacked on #26937 so its existing naming behavior remains intact. No external contributor implementation was newly adopted in this extraction.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Visual proof is N/A with reason
  • Self-reviewed for correctness, security and performance
  • Cross-platform, SSH/remote and folder workspace behavior considered
  • Broader checks pass (ordinary CI is pending)

@nwparker

Copy link
Copy Markdown
Contributor Author

Closing this prerequisite as orphaned. The related review-selection fencing already has an open implementation in #26954, which was missed in the initial related-PR check. This extraction preserves behavior and passed source/parity checks, but it was based on the naming parent rather than the existing fencing implementation. A future residual repair should extend #26954 and extract from that code if needed. No behavior fix is included here; the original naming PR #26937 and #26954 remain open and untouched by this closure.

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.

1 participant