Skip to content

test(update): cover lease database loss shapes reported after temp cleanup - #167564

Merged
steipete merged 1 commit into
mainfrom
upd/upd-l1507
Oct 9, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-l1507

Conversation

@steipete

@steipete steipete commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The reported publication-complete recovery states lacked explicit coverage for temporary lease database loss. This adds the reported shapes to the existing published-candidate recovery test: a missing file, a recreated parent directory, and a replacement inode.

Refs #167506 #167557

User Impact

Regression coverage only: main already settles these states and admits the next package preparation. OpenClaw 2026.9.9 does not include the missing-database fix in #165238 or the replaced-database fix in #164849. These tests do not establish a recovery entry point for an already-blocked older installed driver.

Thanks @mkdelta221 and @masterdevill for the detailed reports.

Why This Change Was Made

Reuse the existing recovery fixture and assertions instead of duplicating the prepared-operation cases from the earlier fixes. Retain the existing publishing/replaced case and add only the three publication-complete cases. Each exercises public repair, checks durable settlement, and prepares the next package successfully.

Moving the lease database remains a separate design decision. Simply changing its default path splits authority: live drivers and retained config/service custody can remain in the old registry while new callers use an empty one. This PR changes neither production behavior nor storage location.

Evidence

  • node scripts/run-vitest.mjs src/cli/update-cli/update-repair-package-activation.test.ts --maxWorkers=1: 75 tests passed on each of three runs; wrapper wall times 68.39s, 52.49s, and 47.86s.
  • The three new cases together took 2.779s, 3.112s, and 2.732s of test time. The existing full file exercises real filesystem/SQLite publication, settlement, archival, and refusal boundaries; subprocess/compiler preparation is included in the wall times.
  • Local proof used isolated home and state directories. No production files changed, so the production-importer sweep is not applicable.
  • git diff --check: passed.
  • node scripts/check-changed.mjs: all preceding checks, including core test typechecking, passed; the dead-export scan failed on four untouched production exports (the unchanged baseline reproduces the exact same findings). The remaining scoped core lint command passed separately.
  • Independent Codex P1 review was attempted, but the reviewer returned HTTP 401 Unauthorized and produced no verdict. Proceeding under the campaign's explicit review-unavailable exception for lead review of the PR head.
  • Baseline 78a91dba21d485211ba97e51d5801a7f0afa301e reproduced the same dead-export findings after temporarily removing this test diff, then the exact three-pass-tested bytes were restored. Production scan findings: bindCliQuestionAnswerAuthority, prepareSessionEventTargetForHost, readSessionEntryCreationTransition, and RESTART_CONTINUATION_CONTEXT_PREFIX. The full-tree scan reports the latter two; the script scan passes. No baseline or ignore changes were made.
  • Hosted CI duration: pending at publication; no green CI claim.

…eanup

Refs #167506 #167557. Cover publication-complete recovery after a missing lease database, a recreated parent directory, or replacement inode. Main already settles these shapes; durable storage relocation remains a separate authority-cutover design.
@clawsweeper

clawsweeper Bot commented Oct 9, 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 cli CLI command changes size: XS labels Oct 9, 2026
@steipete
steipete marked this pull request as ready for review October 9, 2026 01:58
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 9, 2026
@clawsweeper

clawsweeper Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Extends package-recovery tests to cover completed publication after a missing lease database, a recreated parent directory, or a replacement database inode.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused coverage with no identified defect; the evidence is an in-process harness rather than a shipped CLI run.
Proof confidence 🦐 gold shrimp (3/6) This maintainer's test-only change reports successful isolated public-repair harness runs with real filesystem and SQLite state; no production behavior or stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes
Reason: Concrete incident shapes justify extending the existing recovery fixture. The change preserves the original case and protects durable settlement and subsequent package preparation.

Merge readiness

✅ Ready for maintainer review

This PR provides useful, distinct recovery coverage that current main lacks. No actionable patch defect was found.

Priority: P3
Reviewed head: 3a34d73c7cd31e050e4624fdceeac4064b7bd9ed

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The added cases run through the public command function rather than the shipped CLI process; they provide coverage for existing behavior, not a new runtime fix.
Agent review details

How this fits together

Package updates record publication and recovery obligations in SQLite. Public repair verifies the installed package, settles obsolete recovery obligations, preserves evidence, and allows another update to prepare.

flowchart TD
  A[Published package fixture] --> B[Remove or replace lease database]
  B --> C[Public update repair]
  C --> D[Verify package and current ownership]
  D --> E[Settle and archive recovery evidence]
  E --> F[Prepare next package]
  F --> G[Assert preparation succeeds]
Loading

Technical review

Best possible solution:

Retain the focused recovery coverage and track supported older-driver recovery and storage durability in the existing issue discussions.

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

Not applicable to a new runtime defect: the tests exercise recovery states current main already handles, and the PR reports three successful harness runs.

Is this the best way to solve the issue?

Yes. Extending the existing public-repair table protects distinct completed-publication states without duplicating a recovery implementation or adding production seams.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit fb84dd5 adds src/cli/update-cli/update-repair-package-activation.test.ts:170 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fb84dd57fd57; files: src/cli/update-cli/update-repair-package-activation.test.ts)
  • Dallin Romney: Raw commit 4821885 adds src/cli/update-cli/update-repair-package-activation.test.ts:313 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/cli/update-cli/update-repair-package-activation.test.ts)
  • Scott Hanselman: Raw commit 3ed1e21 adds src/cli/update-cli/update-repair-package-activation.test.ts:169 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3ed1e21065ea; files: src/cli/update-cli/update-repair-package-activation.test.ts)

PR surface

Tests +17. Total +17 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 32 15 +17
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 32 15 +17

Labels

Label changes:

  • add P3: This is focused regression coverage with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is focused regression coverage with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed October 8, 2026, 10:03 PM ET / October 9, 2026, 02:03 UTC.

@steipete

steipete commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Merging at the pinned head despite one red check. check-guards-architecture fails on a madge import cycle between src/agents/prepared-model-catalog-fingerprints.ts and src/agents/prepared-model-catalog-worker.ts. That cycle exists on main since 811d442 and is unrelated to this PR, which only changes src/cli/update-cli/update-repair-package-activation.test.ts. Every other check is green. The main-side cycle is being handed to its owner separately.

@steipete
steipete merged commit b0c330d into main Oct 9, 2026
166 of 175 checks passed
@steipete
steipete deleted the upd/upd-l1507 branch October 9, 2026 02:05
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…eanup (openclaw#167564)

Adds recovery regressions for the three ways OS temp cleanup removes the managed-update handoff lease database (missing file, recreated parent directory, replacement inode), as reported in openclaw#167506 and openclaw#167557: recovery settles and admits the next package preparation. Main already settles these via openclaw#165238 and openclaw#164849; 2026.9.9 does not include them. Refs openclaw#167506 openclaw#167557.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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.

1 participant