Skip to content

chore(e2e): add bounded package-tree recovery witnesses - #185644

Merged
vincentkoc merged 1 commit into
mainfrom
test/package-recovery-tree-witnesses
Oct 27, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
test/package-recovery-tree-witnesses

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Related: #177381

What Problem This Solves

Installed-package recovery tests need a bounded filesystem witness that distinguishes tree changes from the updater's expected permission tightening.

User Impact

No user-visible change. This adds harness helpers and tests; product runtime changes: 0.

Why This Change Was Made

Capture the root and complete entry inventory, including hidden files, bytes, raw symlink targets, ownership, inode identity, and permissions. Comparisons stay exact unless the caller explicitly requires the canonical permission-tightening transition. Entry and byte limits fail without truncating the compared inventory; directory handles close before descent and on budget failure.

This self-contained prerequisite keeps the later installed-recovery integration separate. The four tests cover physical rename/hardlink behavior, strict and permitted transitions, bounded diagnostics, and wide-directory early stopping with real handle closure.

Evidence

  • Signed source: c5f05618c0d1d9f0f620c34c93977d1133f764a9; 139 harness/declaration lines and 223 test lines, no product runtime change.
  • Independent source/composition review and fresh scoped automated review found no actionable defects. Exact-head ClawSweeper review lists no findings or pre-merge actions.
  • Hosted CI 40468181869, attempt 1 passed: 32 successful jobs, 29 skipped, zero failed. Both required CI/security gate entries passed.
  • The complete witness test file passed 4/4, zero skipped in job 122069021174, including physical rename/hardlinks, strict permission negatives, bounded diagnostics, and real directory early-stop/closure. The actual tested merge was 2e365e785eabec0b6cff93a3cd95b65a5d9f8185 (base 9d1606006cb533c2952925e4fd149d3f4c606d4a plus the signed source), using Bun 1.4.4-canary.1 / Vitest 5.0.5 on Linux x64.
  • Normal pinned-tool commit hooks and whitespace checks passed without changing the reviewed bytes. Full installed-updater validation remains in the linked integration PR.

@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.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M labels Oct 27, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 27, 2026 07:36
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head c5f05618c0d1d9f0f620c34c93977d1133f764a9. Fresh scoped automated review is clean, and all four package-tree witness tests passed in CI run 40468181869.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. 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. and removed clawsweeper:intake:feature 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 adds bounded package-tree snapshots and strict comparisons with an explicit permission-tightening mode.

Example: before/after values are internal harness observations, with no user-visible behavior change

  • Before: No standalone bounded witness for this recovery scenario.
  • After: The harness can distinguish expected permission tightening from package-tree drift.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, apparently correct harness code with green exact-head CI; evidence remains component-level and the broader integration is intentionally partial.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored harness-only prerequisite is outside the ordinary contributor runtime-proof gate; its tests exercise real filesystem operations, while full installed-updater proof belongs to the linked integration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Partial
Reason: The maintainer has approved this focused prerequisite through authorship; its value is stronger recovery evidence, while the linked integration remains explicitly outside this stage.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides a focused recovery-test prerequisite, with no actionable defects found and passing exact-head CI.

Priority: P3
Reviewed head: c5f05618c0d1d9f0f620c34c93977d1133f764a9

Before merge

None.

Findings

None.

Agent review details

How this fits together

The upgrade-survivor test harness reads package directories into in-memory inventories and compares their contents, identities, ownership, links, and modes.

flowchart LR
  A[Package directory] --> B[Bounded tree capture]
  B --> C[Entry inventory]
  C --> D[Tree comparison]
  E[Expected permission transition] --> D
  D --> F[Pass or bounded diagnostic]
Loading

Technical review

Best possible solution:

Retain this bounded witness as the focused prerequisite and complete its installed-recovery integration in the linked PR.

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

This PR adds a test prerequisite rather than fixing a reported runtime defect; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The helper is a coherent minimal stage: it bounds discovery and hashing, closes handles, retains complete inventories, and makes the permitted mode transition explicit without changing historical survivor cells.

AGENTS.md: found and applied where relevant.

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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Tests +223, Other +139. Total +362 across 3 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 223 0 +223
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 139 0 +139
Total 3 362 0 +362

Labels

Label changes:

  • add P3: This is test-harness infrastructure with no product runtime change or immediate user-facing regression.
  • 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 test-harness infrastructure with no product runtime change or immediate user-facing regression.
  • 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 execution lanes are retired.

Reviewed October 27, 2026, 3:49 AM ET / 07:49 UTC.

@vincentkoc
vincentkoc merged commit 73bd213 into main Oct 27, 2026
179 checks passed
@vincentkoc
vincentkoc deleted the test/package-recovery-tree-witnesses branch October 27, 2026 07:54
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

1 participant