Skip to content

fix: reuse frozen PR installs across source-only commits - #185493

Merged
steipete merged 4 commits into
mainfrom
solid2/hf-pr-depcache-2
Oct 27, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/hf-pr-depcache-2

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes repeated full frozen installs during PR landing when main changes but install inputs do not. The cache previously keyed every source-tree byte, so unrelated source commits each consumed another multi-GB installation.

User Impact

PR tooling can reuse one installation across audited source-only heads. There is no Control UI/runtime behavior change. Source authentication, ancestry, complete archive verification, pinned package validation, concurrent publication, and live-consumer retention are preserved.

Why This Change Was Made

Key the audited installation by 606 dependency/lifecycle inputs, platform, architecture, and Node ABI. The input policy includes every package manifest, lockfile, patches, package-manager configuration, the complete lifecycle import closure, two SQL schemas, and native protocol generator inputs. Root is the only workspace with install lifecycle scripts, including pnpm:devPreinstall. esbuild configuration files and future ancestor tsconfig.json files are included. The three standard root hooks and pnpm pre-hook were executed under a write-confined, network-denied sandbox with filesystem instrumentation; there were no unkeyed source reads. Registry build hooks present on the qualified Mac read their own package payloads/platform siblings.

Any changed audited input, unaudited runtime, tracked dist tree, or retained wrapper without an audit keeps the original full-tree key. This is deliberate: a new hook could read new paths. Such changes require renewing the audit before cross-head sharing resumes. The current audit covers Darwin arm64 / Node ABI 147. SQL schemas are executable inputs too, because the Kysely generator passes them to SQLite; they have no special data exception.

Evidence

Acceptance: sequential cold-cache identity over six consecutive first-parent main heads with unchanged audited inputs, followed by one synthetic lockfile change. No real installs were needed for the workload or key tests.

Check Result
Six main heads, 5a8be2a1eb7b through 154e39f03a2d 6 entries/install attempts → 1
Same sequence plus one lockfile change 7 entries/install attempts → 2 (5 avoided)
pr-dependency-cache.test.ts --maxWorkers=1 3 passed: reuse, invalidation, changed-hook fallback, retention
SQL-symlink regression Red on the first candidate, green with full-tree fallback
Focused pr-wrappers.test.ts --maxWorkers=1 4 passed: reuse, concurrent publish, changed-manifest/extra-hook rejection
Tooling test typecheck and focused root-test lint Passed
CI runtime fixture correction Reproduced Bun ABI 147 / Node 24.22.1 ABI 137 mismatch; same assertion passes after probing the child Node runtime
Sandboxed pnpm pre-hook, preinstall/postinstall/prepare All exited 0; Kysely and Swift/Kotlin protocol generation completed; 376 source/generated read paths traced, no unkeyed source reads
Shell syntax, changed-file formatting, diff whitespace Passed
Independent review Fresh staged review: scoped-clean, no accepted/actionable P0–P2 findings; earlier ABI-context, index and test-fixture findings resolved

The ~3.5 GB/install observation implies ~17.5 GB less logical install payload for this sequence, not a measurement of physical APFS savings. Live observation: 14 complete entries (11 with live consumers, 3 unused), plus 7 staging entries. No shared installation was manually deleted or altered. Native initialization used the existing workflow to create one full installation; pnpm reported 1576 packages in 33.3s, excluding source extraction/verification.

Scope LOC before LOC after
scripts/pr 1478 1507
Audit policy 0 63
Key/retention tests 87 201
Tooling documentation 324 341

No startup/UI bytes change; no screenshots apply. No remote leases or local Docker. Release-note context: reduce repeated frozen installation and disk churn in maintainer PR tooling.

CI run 40456196847 caught a test-fixture assumption: the Bun runner and spawned Node process report different ABIs. The fixture now keys its audit to the actual Node child, preserving all assertions and production behavior. A focused local run reproduced the CI failure and passed after the correction.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T05:55:42.344087Z 5e6b022 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: M labels Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR reuses frozen PR-tooling installations across source revisions whose audited installation inputs are unchanged.

Example: Six consecutive main revisions have identical audited installation inputs on Darwin arm64 with Node ABI 147.

  • Before: Full-tree keys select six separate installation entries.
  • After: The audited key selects one shared entry; changing the lockfile restores full-tree isolation.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, focused optimization with a justified audit boundary, but its central new regression fails in exact-head CI.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor proof gate does not apply to this maintainer-authored PR; supplied evidence exercises key calculations and lifecycle hooks, while native initialization demonstrates one full installation rather than cross-anchor reuse.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Maintainers accumulate separate large frozen installations when adjacent workflow anchors differ only in unrelated source.
Reason: The maintainer-authored direction reduces documented installation churn and preserves conservative isolation for unaudited inputs and runtimes.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the optimization has maintainer-approved value, but its newly added reuse regression fails on the reviewed head and blocks CI.

Priority: P2
Reviewed head: fec837dfe4be262dd15d4d0dc61ccc81edb21a34

Before merge

  • Repair the source-only reuse regression on the Node CI shard (P2) - On reviewed head fec837d, changing only the fixture's src/page.ts makes this equality assertion fail in checks-node-compact-small-4-2, which also fails openclaw/ci-gate. The annotation records two different keys at this exact line. Diagnose and repair the fixture/runtime setup or key calculation responsible for that mismatch while retaining the equality assertion and invalidation cases; the supplied passing local result does not resolve this exact-head failure.

Findings

  • [P2] Repair the source-only reuse regression on the Node CI shard — test/scripts/pr-dependency-cache.test.ts:115-117

Tests

  • Missing end-to-end proof: The supplied evidence does not show two audited source-only anchors reusing one real frozen installation, or base-red/head-green proof of that complete path.
Agent review details

How this fits together

The scripts/pr bootstrap selects dependencies for authenticated workflow anchors, materializes frozen installations when installed versions differ, and pins package directories for the supervised operation.

flowchart TD
  A[Trusted workflow anchor] --> B[Installed package validation]
  B --> C[Audited dependency key]
  C --> D[Complete cached installation]
  C --> E[Verified archive and frozen install]
  E --> D
  D --> F[Pinned tooling packages]
Loading

Technical review

Best possible solution:

Retain audited reuse in the existing materializer and repair the failing reuse regression without weakening input invalidation or full-tree fallback.

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

Current-main source directly establishes that unrelated source changes produce different installation keys; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The existing materializer is the appropriate owner, and the audited lifecycle closure plus conservative fallback addresses the documented reason for full-tree identity.

Full review comments:

  • [P2] Repair the source-only reuse regression on the Node CI shard — test/scripts/pr-dependency-cache.test.ts:115-117
    On reviewed head fec837d, changing only the fixture's src/page.ts makes this equality assertion fail in checks-node-compact-small-4-2, which also fails openclaw/ci-gate. The annotation records two different keys at this exact line. Diagnose and repair the fixture/runtime setup or key calculation responsible for that mismatch while retaining the equality assertion and invalidation cases; the supplied passing local result does not resolve this exact-head failure.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4ac0cd149daa.

Provenance checked

  • Frozen installation cache identity changes intended behavior with a stated reason (8776378: Full-tree identity covered every workspace and lifecycle input at the deliberate cost of reduced reuse.)
  • Manifest-only sharing exclusion keeps the original intent (62a2e74: SQL schemas and native-protocol inputs made manifests alone an incomplete installation contract.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test test/scripts/pr-dependency-cache.test.ts --maxWorkers=1
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.root.tooling.json --incremental
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json test/scripts/pr-dependency-cache.test.ts
  • pnpm test test/scripts/pr-wrappers.test.ts --maxWorkers=1 -t 'older anchor|creators overlap|unverified frozen install'
  • bash -n scripts/pr

What I checked:

PR surface

Tests +109, Docs +17, Other +92. Total +218 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 112 3 +109
Docs 1 21 4 +17
Config 0 0 0 0
Generated 0 0 0 0
Other 2 98 6 +92
Total 4 231 13 +218

Labels

Label changes:

  • add P2: This reduces repeated installation and disk costs in maintainer tooling, with no established urgent runtime impact.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This reduces repeated installation and disk costs in maintainer tooling, with no established urgent runtime impact.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 27, 2026, 1:51 AM ET / 05:51 UTC.

@steipete
steipete enabled auto-merge (squash) October 27, 2026 06:00
@steipete
steipete merged commit 98b0c55 into main Oct 27, 2026
107 of 109 checks passed
@steipete
steipete deleted the solid2/hf-pr-depcache-2 branch October 27, 2026 06:03
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…5493)

* fix: reuse frozen PR installs across source-only commits

* fix: complete frozen-install input audit

* fix: audit SQL schemas as executable install inputs

* test: bind dependency cache fixture to child Node runtime
vincentkoc added a commit that referenced this pull request Oct 28, 2026
* fix(scripts): preserve PR tooling across process handoffs

Follow-up to #185493.

* fix(scripts): persist PR cache lifetime in SQLite

* test(scripts): align PR lifetime fixtures with owner contracts

* fix(scripts): qualify PR cache and bootstrap fixtures

* test(scripts): assert bootstrap archive refusal

* fix(tooling): register maintained commands and preserve numeric wait conversion

* fix(tooling): align test-line ceiling with main

* fix(tooling): remove stale cache lint suppression

* test(tooling): prove native GitHub CLI policy on Darwin

* test(tooling): assert native GH promise rejections

* fix(tooling): align test budget and canonical Knip roots

* docs(tooling): align cache lifetime and anchor cleanup guide
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 29, 2026
…85964)

* fix(scripts): preserve PR tooling across process handoffs

Follow-up to openclaw#185493.

* fix(scripts): persist PR cache lifetime in SQLite

* test(scripts): align PR lifetime fixtures with owner contracts

* fix(scripts): qualify PR cache and bootstrap fixtures

* test(scripts): assert bootstrap archive refusal

* fix(tooling): register maintained commands and preserve numeric wait conversion

* fix(tooling): align test-line ceiling with main

* fix(tooling): remove stale cache lint suppression

* test(tooling): prove native GitHub CLI policy on Darwin

* test(tooling): assert native GH promise rejections

* fix(tooling): align test budget and canonical Knip roots

* docs(tooling): align cache lifetime and anchor cleanup guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant