Skip to content

fix(ci): preserve the trusted PR helper closure - #134196

Closed
steipete wants to merge 12 commits into
codex/ci-windows-runtime-20260831from
codex/ci-trusted-helper-closure-20260831
Closed

steipete wants to merge 12 commits into
codex/ci-windows-runtime-20260831from
codex/ci-trusted-helper-closure-20260831

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #134038

What Problem This Solves

Maintainer review and prepare commands can fail with missing modules when both the PR worktree and canonical checkout differ from the trusted main wrapper. The temporary trusted copy omits dependencies needed by artifact initialization, hosted verification and changelog checks. Loading the missing packages alone also leaves TypeScript aliases able to redirect helper imports into the caller checkout.

Why This Change Was Made

The existing materialization owner now includes the complete tracked helper closure and connects its fresh temporary directory to the canonical checkout’s installed toolchain. Three Node-resolvable CLI entrypoints use native erasable TypeScript through the existing supervised child launcher. The verifier imports the same verified normalization leaf directly; other TypeScript-loader consumers retain their current loader.

Trust-anchor selection, blob verification, command classification, operation locks, exact-head checks and merge authorization retain their existing owners. The shared child launcher preserves cwd, argv identity, signal forwarding, close joins and exit propagation. Missing toolchains produce an actionable package-load failure without installing dependencies.

Real-wrapper fixtures now copy the canonical component declaration from scripts/pr instead of maintaining two incomplete lists. Their private Git templates also track the verified normalization package. Deliberately stubbed integrity fixtures remain independent; production trust checks are unchanged.

User Impact

Native review, prepare and merge tooling can run from the verified main wrapper while the canonical checkout is parked on another branch. This PR is stacked on #134038 for CI and will target main after that prerequisite lands. No product configuration, dependency, permission, authentication or merge-bypass setting is added.

Evidence

Real Git fixtures reproduce the missing helper failures before repair. Separate benign alias probes demonstrate the caller normalization and third-party package paths being executed by the old loader; both final regression cases pass with native entrypoints. Parent integration passes all 359 tests across the seven wrapper, artifact, verifier, watcher, launcher, attribution and local-runtime owner suites.

Independent materialization proof passes all six cases on Node 22.22.3 and 24.19.0. The real CLI matrix also passes 88 cases on each runtime, covering argv identity, cwd, errors, absent dependencies and caller aliases with no GitHub call. The complete changed-file gate passes, including scripts and root-test typechecks and canonical scripts lint. Scoped Codex review reports no actionable finding at the configured blocking threshold. Exact-head CI is required before landing.

The previous exact-head CI failed four linked-wrapper cleanup cases because the fixture's private main omitted six required components. That failure reproduces on the old fixture. The shared copier removes the duplication, and parent integration passes all 139 wrapper/operation-lock cases with one existing Linux-only skip on macOS. Full root-test types, script lint, changed-file checks and a fresh Codex review pass. The original commit is byte-identical after restacking onto the parent's Gateway validation fixes. Fresh exact-head CI remains required.

Production tooling is net +20 lines: the verified dependency closure and installed-toolchain link supply missing ownership, while the common native launcher adds three net lines. Tests/support are net +137 after deleting the duplicate component lists. No test-only production seam is introduced.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 31, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:15 PM ET / 16:15 UTC.

ClawSweeper review

What this changes

The branch completes the trusted temporary PR-wrapper helper closure, links it to the canonical checkout’s installed dependencies, and launches selected TypeScript helpers without caller-controlled loader aliases.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

The patch is a coherent repair for an open trusted-wrapper failure and introduces no concrete correctness finding. It must remain open because it is stacked on #134038 and its exact-head CI is still incomplete.

Priority: P2
Reviewed head: a603b3f820350047a562dc188c2733f70f15230b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused repair and source-derived regression coverage are strong; merge readiness still depends on retargeting and exact-head CI.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored CI-wrapper repair is exempt from the external-contributor proof gate; the supplied real-Git fixture evidence directly covers the materialized-anchor path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored CI-wrapper repair is exempt from the external-contributor proof gate; the supplied real-Git fixture evidence directly covers the materialized-anchor path.
Evidence reviewed 6 items Missing closure on current main: The fetched current-main wrapper lists the original helper set and lacks the newly required attribution, argument, record, and normalization files, so current main does not already provide this repair.
Trusted materialization repair: The introduced closure lists the Node-resolvable helper dependencies and creates the temporary directory’s node_modules link before executing the verified anchor.
Native launcher preserves existing behavior: The refactor shares child spawning, signal forwarding, exit propagation, cwd, environment, and argv handling; only the selected entrypoints omit the tsx import.
Findings None None.
Security None None.

How this fits together

scripts/pr substitutes verified wrapper code when a linked worktree differs from the trusted main wrapper. The materialized helpers run CI, hosted-gate, review-artifact, and changelog checks that feed maintainer PR operations.

flowchart LR
  A[PR worktree command] --> B[Trusted wrapper selection]
  B --> C[Materialized helper closure]
  C --> D[Canonical dependency link]
  D --> E[CI and review helpers]
  E --> F[Gate and artifact results]
Loading

Before merge

  • Resolve merge risk (P1) - The repair adds 20 production tooling lines to the wrapper trust boundary; its explicit component manifest should remain the single source of truth for every materialized dependency.
  • Resolve merge risk (P1) - Exact-head CI is still in progress, and the branch remains stacked on perf(ci): remove repeated setup and balance complete test workloads #134038; its final integration state must be rechecked after retargeting to main.
  • Complete next step (P2) - No repair lane is needed: the submitted patch has no concrete review finding, while retargeting and exact-head CI are normal maintainer merge checks.
Agent review details

Security

None.

PR surface

Tests +137, Other +20. Total +157 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 240 103 +137
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 6 41 21 +20
Total 10 281 124 +157

Review metrics

Metric Value Why it matters
Production versus test delta production +20, tests/support +137 The production increase explicitly completes the verified helper closure, while the test-support growth replaces duplicated fixture manifests with one derived source.

Merge-risk options

Maintainer options:

  1. Retarget and validate the exact head (recommended)
    After the prerequisite lands, rebase or retarget this branch to main and require successful exact-head CI before merge.
  2. Pause the stacked repair
    Pause this branch if the prerequisite is not landing, then reopen it as a focused repair against current main.

Technical review

Best possible solution:

Retarget the repair onto main after its prerequisite lands, retain the manifest-derived fixture coverage, and land only after the exact head completes the platform and gate checks.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: the prior anchor manifest omitted helpers now required by the materialized command paths, and the added real-Git fixtures model the parked-canonical path and caller alias interference.

Is this the best way to solve the issue?

Yes: keeping the verified closure in the wrapper’s authoritative component list and deriving fixtures from that list avoids a second drifting manifest while preserving the existing launcher lifecycle behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9cc05cca83e2.

Labels

Label justifications:

  • P2: This is a bounded reliability repair for maintainer CI-wrapper operations.
  • merge-risk: 🚨 automation: The branch changes the trusted PR-wrapper materialization and CI-helper launch paths.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored CI-wrapper repair is exempt from the external-contributor proof gate; the supplied real-Git fixture evidence directly covers the materialized-anchor path.

Evidence

What I checked:

  • Missing closure on current main: The fetched current-main wrapper lists the original helper set and lacks the newly required attribution, argument, record, and normalization files, so current main does not already provide this repair. (scripts/pr:53, 9cc05cca83e2)
  • Trusted materialization repair: The introduced closure lists the Node-resolvable helper dependencies and creates the temporary directory’s node_modules link before executing the verified anchor. (scripts/pr:53, a62c140d2bfc)
  • Native launcher preserves existing behavior: The refactor shares child spawning, signal forwarding, exit propagation, cwd, environment, and argv handling; only the selected entrypoints omit the tsx import. (scripts/lib/tsx-cli-shim.mjs:94, a62c140d2bfc)
  • Regression coverage follows the production manifest: The fixture copier derives its file set from scripts/pr, and wrapper tests exercise materialized artifact initialization plus native entrypoints against caller alias probes. (test/scripts/pr-wrappers.test.ts:488, a603b3f82035)
  • Feature history: The materialized trust-anchor behavior dates to the merged feature commit, followed by this focused closure repair. (scripts/pr:47, 9b4c3d5f1b21)
  • Release status: No release tag contains the unmerged repair commit; the latest release therefore cannot include this branch. (a62c140d2bfc)

Likely related people:

  • unknown: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-31T14:50:12.599Z sha 0639860 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/ci-windows-runtime-20260831 branch from 8cc1e0f to d088cbd Compare August 31, 2026 15:08
@vincentkoc

Copy link
Copy Markdown
Member

Superseded by #134366, authored by @steipete and landed as 0959561.

The landed PR carries the trusted helper closure repair, physical wrapper-path fix, real extracted-wrapper regression coverage, and the contributor credit. This older branch remains stacked, conflicting, and duplicates the shipped main fix, so I am closing it rather than copying or relanding the work.

@vincentkoc vincentkoc closed this Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Implemented through #134038, merged as 4ee565c6d2a, including the complete trusted PR helper dependency closure. The integration preserves the connected main changes and removes the superseded duplicate paths.

Exact-head CI33434384581 completed successfully with all applicable Testboxes green. Both Windows jobs, all 16 UI jobs and the macOS Node job passed. The integration PR records the focused source-owner and regression proof, including the Windows readiness repair and trusted-wrapper merge checks. This source PR is superseded by that verified landing.

@RomneyDa
RomneyDa deleted the codex/ci-trusted-helper-closure-20260831 branch October 22, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants