Skip to content

fix(update): avoid repeated private candidate scans - #169075

Merged
steipete merged 2 commits into
mainfrom
upd/upd-l1558
Oct 11, 2026
Merged

steipete merged 2 commits into
mainfrom
upd/upd-l1558

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

POSIX npm updates repeatedly walk a candidate package that the updater just installed in private staging, adding unnecessary time to publication.

User Impact

Fresh candidate publication uses directory identity, package version, and launcher checks. Same-window content drift inside that private candidate is intentionally not detected. Current-format recovery still verifies recorded full fingerprints after interruption and on retries; existing legacy recovery behavior, backup ownership, and rollback remain intact. Older installed updaters retain their own checks.

Why This Change Was Made

Capture the candidate fingerprint once, then avoid repeated candidate tree walks during uninterrupted publication. Disable the fast path after an error and before rollback. Preserve the previous-package observation reuse from #168958 and the current legacy recovery policy. A single artifact inventory now supplies both names and current identities for retirement.

No configuration, CLI, schema, or dependency changes. Production: +152/-153 LOC, net -1; tests: +116/-72, net +44; docs: +7. Runtime retention and Doctor execution are unchanged.

Evidence

Controlled local Docker comparison: 16 CPUs, 8 GiB RAM, native /tmp volume, tiny isolated state, identical driver/candidate source within each cell. Before: 6e06137f85ef3262f47dae63626d97f14c2f1ca1; after: 2a1cca52bc7f860c31555ddf3b030419a369c523. These timing runs precede the later legacy-recovery integration; the final head is independently covered by the tests and released-driver cell below. One pair, not a statistical benchmark; phase steps can overlap.

Phase Before After
Total update 451.230 s 359.878 s
Runtime retention 39.716 s 43.026 s
Package installation 26.818 s 37.129 s
Candidate state snapshot 8.935 s 8.963 s
Candidate Doctor 12.289 s 13.236 s
Candidate Doctor lint 8.059 s 7.512 s
Package publication 120.607 s 74.602 s
Live Doctor 21.243 s 15.055 s
Post-plugin Doctor 20.793 s 16.545 s
Managed service install 7.766 s 7.560 s
Gateway verification 3.211 s 2.398 s
Post-activation inspections 8.616 s 7.332 s
Post-plugin Doctor lint 6.699 s 5.025 s

Publication was 38.1% faster; total update was 20.2% faster. Both cells passed managed restart, /readyz, build identity, durable history preservation, and incognito cleanup. The two-minute target is not met.

Final head: 880f812722e3585d5245e5cb3f00dae97d542fbf, based on 3e832726ad2a19e1a19d07651e7817a6dd8aa2b9.

  • Cross-import and legacy coverage: 601 passed, 66 platform skips across 39 selected files; 344.75 seconds wall time.
  • Serial changed-file proof: 39 passed in 42.54 seconds (node scripts/run-vitest.mjs src/infra/package-update-activation-bounds.test.ts src/infra/package-update-publication-boundary.test.ts src/infra/package-update-publication-durability.test.ts --maxWorkers=1). File wall times: bounds 1.134 s, boundary 14.728 s, durability 10.648 s. No CI timing claim.
  • Negative control on the pre-fix timing base rejects the changed private candidate; final code accepts it. Recovery still rejects changed content, version, identity, and launchers, including interrupted same-owner retry. Legacy API callers default to full verification.
  • Typechecks, formatting, changed-file lint, and all other selected checks passed; runtime import checks and Madge report zero cycles. Full check:changed stops at inherited unused-export findings in unchanged agent, talk, and UI files. Its nine later checks were run separately and passed. No suppressions or baselines were changed.
  • Automated independent review was unavailable (HTTP 401); maintainer review remains required.
  • Released 2026.10.1 → final source candidate (fixture version 2026.10.1): PASS through the unmodified canonical published-driver Docker script. CLI exit 0, run succeeded/finished, readiness 200, serving build verified, managed PID changed, durable history retained, and incognito history/artifacts absent. Candidate tarball SHA256: 850592aad392dabf17a2c45889687404716fc598e909e7affefdd88ebd0b3038.

@clawsweeper

clawsweeper Bot commented Oct 11, 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 docs Improvements or additions to documentation size: L labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR replaces repeated fresh-candidate content scans with directory, version, and launcher checks during uninterrupted npm package publication.

Example: A POSIX npm update publishes version 2.0.0 with one launcher.

  • Before: The filesystem fixture hashes candidate payloads four times through publication and once during retirement.
  • After: The fixture requires one preparation hash, while reopened recovery still verifies candidate contents.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch has meaningful owner-boundary coverage and no identified defect, but required released-state compatibility validation remains incomplete.
Proof confidence 🌊 off-meta tidepool Not applicable: Ordinary contributor proof gating does not apply to this maintainer-authored PR; the mandatory updater compatibility evidence remains pending for publication, retirement, and existing recovery records, despite unchanged persisted formats.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: POSIX npm updates spend unnecessary publication time repeatedly walking a freshly prepared candidate.
Reason: The established area owner supplies the direction and explicitly documents the verification tradeoff; the implementation stays with the existing owner.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this PR provides a useful update optimization absent from current main, with no identified introduced code defect; the earlier conflict is resolved.

Priority: P2
Reviewed head: 880f812722e3585d5245e5cb3f00dae97d542fbf

Before merge

  • Complete next step - Mark this PR ready for review when its preparation is complete.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Supply the pending published 2026.10.1 update result with settings and data preserved, plus a candidate-driver publication and interrupted-recovery trace for the changed path.
Agent review details

How this fits together

The installed updater gives prepared fingerprints and executor authority to the publication owner, which replaces package directories and launchers and records recoverable progress in the activation journal.

flowchart TD
A[Installed update CLI] --> B[Candidate preparation]
B --> C[Publication owner]
C --> D[Package and launcher filesystem]
C --> E[Activation journal]
E --> F[Recovery executor]
F --> C
Loading

Technical review

Best possible solution:

Keep the optimization in the existing publication owner while preserving full verification for resumed recovery and rollback.

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

Current-main source shows repeated candidate walks, and the changed filesystem fixture measures their reduction; this review executed no target code.

Is this the best way to solve the issue?

The existing publication owner is the appropriate boundary, and the owner explicitly accepts the reduced same-window verification while retaining strict recovery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Candidate publication and retirement content checks changes intended behavior with a stated reason (274d27d: Fresh candidate checks protected publication and retirement against byte changes, including writable mappings that preserve metadata.)
  • Candidate integrity resource fallback changes intended behavior with a stated reason (775ea5c: Verification exhaustion could degrade to directory, version, and launcher checks; preparation retains that fallback while full-fingerprint recovery intentionally becomes strict.)
  • Legacy verification and best-effort retirement keeps the original intent (3e83272: Legacy previous generations may settle by identity/version while current and legacy candidate fingerprints remain strict, building on verified best-effort cleanup.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b107d4a adds src/infra/package-update-publication-owner.ts:36 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b107d4af14d7; files: src/infra/package-update-publication-owner.ts)
  • Dallin Romney: Raw commit 4821885 adds src/infra/package-update-publication-owner.ts:619 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4821885e5b4d; files: src/infra/package-update-publication-owner.ts)

PR surface

Source -1, Tests +44, Docs +7. Total +50 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 152 153 -1
Tests 3 116 72 +44
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 275 225 +50

Review metrics

Metric Value Why it matters
Production versus test LOC Production +152/-153, net -1; tests +116/-72, net +44. Production remains approximately flat; test growth covers candidate identity/version refusal, strict reopened recovery, and disabling the fast path after interruption.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: Recovery with a stored full fingerprint now refuses verification-budget exhaustion instead of degrading to identity/version checks; the direction is owner-approved, but released-driver compatibility still requires validation.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded updater performance improvement without a demonstrated urgent runtime outage.
  • merge-risk: 🚨 compatibility: Recovery with a stored full fingerprint now refuses verification-budget exhaustion instead of degrading to identity/version checks; the direction is owner-approved, but released-driver compatibility still requires validation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • 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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T11:05:25.371Z sha 2a1cca52bc7f860c31555ddf3b030419a369c523 :: blocked before merge. :: none

Reviewed October 11, 2026, 7:54 AM ET / 11:54 UTC (Revision 2).

Use directory identity, package version, and launcher checks for a freshly prepared private candidate during uninterrupted publication. Preserve its full fingerprint and disable the fast path after failure or when recovery resumes. Same-window content drift is an accepted tradeoff.

Keep legacy recovery behavior and consolidate recovery artifact names and identities into one inventory. Release note: package updates avoid repeated candidate tree scans without changing backup or rollback ownership.
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 11, 2026
@steipete
steipete marked this pull request as ready for review October 11, 2026 12:05
@steipete
steipete merged commit 537792d into main Oct 11, 2026
199 checks passed
@steipete
steipete deleted the upd/upd-l1558 branch October 11, 2026 12:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…idate (openclaw#169075)

Package publication no longer rescans the whole tree of the candidate it just installed into a private directory; it checks identity, version and launcher on the uninterrupted path. Recovery and legacy records keep full verification. Accepted tradeoff (named in code): same-window content drift of our own private candidate is not detected. Measured: publication 121 s -> 75 s, total update 451 s -> 360 s. Production -1 LOC.
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 19, 2026
First-parent upstream 5ed6a30..cb1b6cd (21 commits, including
openclaw#168999 state query reduction and worker moves, openclaw#169075, af03aa0 ACP
owner settlement, openclaw#168837 plugin metadata/reload ownership, openclaw#168776,
openclaw#168951, openclaw#169039 runtime-only server builds, openclaw#169092 test batch d050,
openclaw#168860 memory index publication writes into workers, openclaw#168991 session
read lifetimes and reconciliation scheduling, openclaw#169091 tool/replay prompt
prefixes, openclaw#168762 Solid chat leaf elements, openclaw#168941).

Conflicts:
- test/vitest/vitest.unit-fast-paths.mjs: upstream stopped forcing the
  two ACP translator files into the fast lane; kept that and our
  reply-turn-admission module-identity entry.
- worker-access inventory: regenerated (634 files, 2429 calls).

openclaw-state-worker-contract.ts auto-merged: upstream's GitHub
publication-source operations next to our continuation custody operations.

Refs #1475

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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