Skip to content

fix(scripts): preserve PR tooling across process handoffs - #185964

Merged
vincentkoc merged 22 commits into
mainfrom
fix/pr-cache-anchor-lifetime-code
Oct 28, 2026
Merged

vincentkoc merged 22 commits into
mainfrom
fix/pr-cache-anchor-lifetime-code

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Problem

PR tooling can collect an installation while an inherited reader still uses its projected packages. Creator/PID death does not prove the installation is unused. A wrapper can also lose its selected physical Git executable across PATH and process handoffs. Real regression proof establishes these failures; no shipped incident is claimed.

Closes #185962
Related work and credit: #185493.

Change

  • scripts/pr-lib/cache-lifetime.mjs owns readiness, durable holds and settlement in builtin SQLite. Holds bind canonical paths and physical identities before projection. Creator FD9, revalidated identities and process drain precede release; authoritative eligibility replaces PID/path-disappearance collection.
  • scripts/pr-lib/git-invocation.mjs replaces PATH-only Git rediscovery with captured executable/environment handoffs. Native Windows GH admits matching physical Git or refuses before execution. The Darwin-only offline test observes actual GH using the selected policy in two directories, sync and async, including denial, config preservation and binary identity.
  • Bootstrap helpers retain authenticated authority. Runtime closure preserves declaration artifacts while excluding them from executable traversal. Canonical standalone-command Knip roots remain intact; unused-entry enforcement stays enabled.
  • Keep the required bigint-to-number wait conversion. Remove only its obsolete lint directive and paired allowance. The GH rejection assertions observe the same existing promise, preserving numeric/nonzero rejection without another GH invocation.
  • The operator guide now documents v3 namespaces, SQLite holds and settlement, ledger reuse order, drained anchor retirement and ordinary failed-stage cleanup. It removes obsolete PID/mtime and 24-hour-sweep promises. Failed settlement protects recorded holds even if the anchor was already removed.

The PR's initial unshipped v3 cache layout refuses older PR-only hold keys without modifying that database. It adds no public configuration, parallel file ledger or runtime fallback. The baseline integration inherits upstream state-v36 metadata and template migrations; those are not a new schema change authored by this PR.

Production/workflow/declarations/config: 1,290 added / 208 removed, net +1,082. Growth establishes the lifetime owner, authenticated bootstrap and physical Git boundary. Tests: 3,349 added / 509 removed, net +2,840; the canonical eligible LF delta is +2,839 because the Python file is outside its pathspec. Documentation is separate: 36 added / 19 removed, net +17.

Current head and qualification

Signed candidate: 46d2212, integrating the preceding reviewed head with fixed upstream 3a5a369ec654dc14041e1a2dcea867d0115b23d9. Source postchecks bind all 25 retained PR paths and the remaining tree to that target. The sole conflict takes upstream's entire commented test baseline unchanged, removing this PR's override.

The inherited ceiling is 6,310,000. Current canonical CI measured 6,305,288, leaving 4,712. Upstream's entire baseline and comments are retained; this PR adds no counter allowance, test pruning or ratchet-policy change.

Current M hosted CI/docs checks, all ten ratchets and the automatic exact-head Darwin run passed. The fresh exact-M ClawSweeper review reports no actionable finding, no Before merge item and no remaining Rank-up move. These are current-head hosted and review results, not a full native-gate stamp or merge authorization. Historical physical receipts remain scoped below.

Source review is composed: findings from the full report were repaired in later narrow reviews, with independent signed-source and integration checks. The old report is not relabeled clean. The fresh exact-M ClawSweeper review, updated2026-10-28T16:23:42Z, covers 46d221211272bb6cbf287561ce3491c317f77103: Findings None, Before merge None, Security None, and no remaining Rank-up move. It confirms the owner-boundary fix and sufficient proof, with no actionable defect. Its ready-for-maintainer-review state is not bot-automerge approval.

Evidence

  • Current M CI: run40715594222, attempt1, succeeded at16:09:46Z: 45 successful jobs / 27 skips / zero failures across72 jobs. Required openclaw/ci-gate job122939374888 passed; all 16 executed Node jobs, production/test types and five core stripes, central/core/selected-plugin lint, guards, architecture/source contracts/package boundaries, UI E2E and all 10 ratchets passed. The separate Node24 compatibility job was skipped. Physical checkout db3b900925afc29d185a796c2e60c38dd36fefb0 merges M into 0ebeb475e394c53ff3101b101716d8e90187d688. Baseline Node24.22.1/pnpm12.15 ran the normal frozen205-workspace install with cache-hit=true/already-up-to-date and successful prepare. The canonical test-line command used the explicit CI ratchet base with --no-merge-base.
  • Current M docs: CI run40715594222, docs job122913476678, passed canonical checks: 16,235 internal links / zero broken, 1,406 clean formatted files, docs1,396 plus20 templates linted without issues, MDX1,418, config examples and changelog checks. Glossary coverage was skipped because no merge base was available. Separately from the baseline job's cache-hit install, Node24.22.1/pnpm12.15 completed the docs job's normal frozen full-tree installation and prepare in3.7s using content-store hardlinks. Its empty cache-hit flag does not establish a cold or cache-off install.
  • Current M automatic Darwin: run40715593402, attempt1/job122912270905, succeeded at15:38:10Z on exact M. Metadata confirms source/runtime identity checks, Python, all five TypeScript suites including native GH, and both postactions succeeded. No new log download or detailed M count/binary claim is made; this does not settle the separate failed Mac custody.
  • Detailed preceding K Darwin: run40649520403 retains the physical receipts: fresh cache-off frozen205 install, arm64 Node24.22.1/Python3.14.7, 30 Python passes / one optional skip, 215 TypeScript passes / 18 platform skips. Actual GH2.100.0 observed two cwd × sync/async, four allowed / four denied, unchanged configs and no cwd-Git bypass; binary identities and cleanup were recorded. Those detailed counts and binaries remain K-scoped.
  • Historical Linux lifetime: exact-442 run40612772493 passed 271 tests / 15 intentional skips under each Node24 and pinned Bun191, plus 19-worker SQLite ledgers. B paired run40622793829 observed baseline RED_LIVE_READER_ENOENT versus candidate GREEN_RETAINED_SAME_PHYSICAL_PACKAGE: genuine packages, creator exit before five pressure installations, fresh reads and both joins. It composes with 13 earlier B stages; the outer cleanup deadline was separately settled.
  • Historical Windows GH: exact-442 run40612735050 passed 15 tests / three POSIX skips, actual GH2.103.0 dual-cwd sync/async dispatch, denial78 and config preservation. Hosted teardown passed; descendant settlement was not attested. Windows assertions remain unchanged.

The isolated Mac attempt stopped in native preflight; installation and all five suites were UNRUN. Cleanup remains UNKNOWN, with claim/workspace and recovery inputs retained; hosted Darwin success does not settle that custody. Follow-ups: persist native preflight identity before dispatch and support exact completion reconciliation; explain focused-versus-canonical typed-lint inference; add commit/phase progress identities and an established bound to baseline-successor history validation; profile the observed1,405.30s database-worker ratchet, which passed with T1 counts168→168 and compatibility15→15, without claiming a regression.

Owner decision: squash landing including the existing automatic docs sync/publication is explicitly approved. The publisher workflow is unchanged. Exact-head review and native landing guards still apply; no protected label or marker has been cleared.

No release, package publication, or unrelated deployment is requested.

@vincentkoc vincentkoc self-assigned this Oct 27, 2026
@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.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL labels Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment 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 maintainer review before merge.

What this changes

This PR preserves dependency installations and selected Git execution policy across process handoffs.

Example: A package reader survives its creator while five newer frozen installations create cache pressure.

  • Before: PID-based collection can delete the reader’s installation, causing a fresh package read to fail with ENOENT.
  • After: The installation remains protected by its anchor hold until authorized retirement settles that hold.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong boundary receipts and current-head qualification support this substantial lifecycle repair; no actionable defect remains.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Supplied Linux paired output exercises genuine projected packages after creator exit and collection pressure, recording baseline ENOENT and retained candidate reads; native GH receipts cover allowed and denied dispatch through the production adapter on Darwin and Windows, with current-head Darwin qualification confirming the retained implementation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Maintainer PR commands can lose packages or selected Git policy while inherited consumers still need them.
Reason: The maintainer-approved repair restores an evidenced execution-context invariant without adding public configuration; conservative retention during uncertain cleanup is explicitly accepted.

Merge readiness

✅ Ready for maintainer review

This PR addresses verified PR-tooling lifetime failures, and the reviewed head has no remaining actionable findings.

Priority: P2
Reviewed head: 46d221211272bb6cbf287561ce3491c317f77103

Before merge

None.

Findings

None.

Agent review details

How this fits together

The scripts/pr wrapper selects trusted tooling, projects dependencies, and starts supervised operations; its lifetime owners retain those resources until consumers drain.

flowchart TD
  A[PR command] --> B[Trusted wrapper selection]
  B --> C[Authenticated bootstrap]
  C --> D[SQLite installation holds]
  C --> E[Selected Git context]
  D --> F[Supervised operation]
  E --> F
  F --> G[Drain and retire resources]
Loading

Technical review

Best possible solution:

Retain one SQLite lifetime owner and one Git invocation owner while preserving existing workflow authentication and operation-lock semantics.

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

Current-main source permits eviction after creator death despite surviving readers, and PATH adapters can rediscover the selected launcher recursively; supplied paired receipts demonstrate the lifetime failure and repair.

Is this the best way to solve the issue?

The change fixes resource ownership rather than masking missing-package errors, removes the superseded PID sweep, and shares Git policy across bootstrap, supervision, installation, and GH calls.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Frozen dependency retention and anchor sweeping changes intended behavior with a stated reason (3a4c80c: The earlier cleanup addressed substantial leaked temporary directories, deliberately accepting dead-creator and age-based collection; later dependency retention bounded unused installations.)
  • Selected Git handoff keeps the original intent (1abf60d: Selected host tooling and PATH adapters kept PR operations usable across checkout drift and process handoffs.)
  • Supervisor resource retirement keeps the original intent (dab8c15: Creator-bound retirement reclaimed materialized wrappers after supervised completion while preserving uncertain consumers.)
  • Runtime import inventories keeps the original intent (c8eab36: The native compiler migration separated executable import discovery from source analysis; declarations remain inventory artifacts and source-import graphs still resolve their types.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 8776378 adds scripts/pr:579 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8776378deb1c; files: scripts/pr)
  • Vincent Koc: Raw commit c821108 adds scripts/pr-lib/process-group-runner.mjs:81 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c82110895d71; files: scripts/pr-lib/process-group-runner.mjs)
  • Dallin Romney: Raw commit a939a9d adds scripts/pr-lib/process-group-runner.mjs:540 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a939a9dfdae0; files: scripts/pr-lib/process-group-runner.mjs)

PR surface

Tests +2840, Docs +17, Config +117, Other +965. Total +3939 across 25 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 11 3349 509 +2840
Docs 1 36 19 +17
Config 1 117 0 +117
Generated 0 0 0 0
Other 12 1173 208 +965
Total 25 4675 736 +3939

Review metrics

Metric Value Why it matters
Production versus test growth Production/workflow/declarations +1,290/-208; tests/support +3,349/-509. Growth establishes durable lifetime settlement and authenticated bootstrap/Git boundaries; the added tests cover distinct consumer, failure, concurrency, and platform contracts.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on maintainer: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The verified failures affect maintainer PR operations and resource lifetime, with no demonstrated end-user runtime outage or shipped-release incident.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-27T14:11:31.745Z sha d68f1dc :: needs real behavior proof before merge. :: [P2] Store durable cache holds in SQLite
  • reviewed 2026-10-28T07:47:05.846Z sha 4e86c8b :: needs changes before merge. :: [P3] Update the documented cache and anchor cleanup policy
  • reviewed 2026-10-28T07:54:06.358Z sha 4e86c8b :: needs changes before merge. :: [P3] Update the documented cache and anchor cleanup policy
  • reviewed 2026-10-28T08:27:13.552Z sha b16e750 :: blocked before merge. :: none

Reviewed October 28, 2026, 12:22 PM ET / 16:22 UTC (Revision 5).

@vincentkoc
vincentkoc marked this pull request as ready for review October 27, 2026 15:49
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 28, 2026
@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. labels Oct 28, 2026
@vincentkoc
vincentkoc merged commit 39b3d94 into main Oct 28, 2026
165 checks passed
@vincentkoc
vincentkoc deleted the fix/pr-cache-anchor-lifetime-code branch October 28, 2026 16:35
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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.

PR tooling can retire live installs or lose its selected Git context

1 participant