Skip to content

test(lock): share Root-lock replacement and resolver harnesses - #808

Closed
steipete wants to merge 1 commit into
mainfrom
steipete/deslop-r4-tests-lock
Closed

steipete wants to merge 1 commit into
mainfrom
steipete/deslop-r4-tests-lock

Conversation

@steipete

@steipete steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Root-lock and durable-queue suites rebuilt the same harnesses inline: the directory-replacement race fixture was written out per test, queue transition scenarios repeated their setup, raw ownership-token tests repeated acquisition, and final-resolver interception scaffolding was copied across resolver tests.

User Impact

No user-visible change; tests only (src/ and native/ byte-identical).

Why This Change Was Made

  • One local directory-replacement fixture with explicit prepare, replace, and restore steps keeps both the Windows identity-substitution and POSIX inode-preserving implementations, parser-triggered timing, partial cleanup, and descriptor assertions.
  • Queue transitions run from tables; ownership-token tests share one acquisition fixture; resolver interception keeps its one-shot semantics in a shared local helper.

Net -168 lines.

Evidence

  • Expanded test counts identical in all five files (83 before and after, all passing).

  • tsc, lint:file-size, lint:fs-boundary: pass. Codex autoreview (P0-P2): clean.

  • Tests added or updated when behavior changed

  • Security and compatibility impact considered

  • CHANGELOG.md updated when release-relevant

  • No credentials, private paths, private hosts, or sensitive contents included

@steipete
steipete requested a review from a team as a code owner October 1, 2026 14:04
@clawsweeper

clawsweeper Bot commented Oct 1, 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.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 10:08 AM ET / 14:08 UTC.

ClawSweeper review

What this changes

The PR shares test fixtures for directory replacement, lock acquisition, and resolver interception, and combines repeated durable-queue scenarios into tables.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused test cleanup absent from current main. The introduced changes preserve the race scenarios, rejection checks, descriptor assertions, and cleanup behavior; no actionable defect was found.

Priority: P3
Reviewed head: d9f169552cb02e074d3e78115aa0911f128ab5ed

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test cleanup with preserved scenario semantics and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: Verified repository-admin authorship exempts this test-only refactor from ordinary contributor runtime proof; production owners and persistent formats are unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Verified repository-admin authorship exempts this test-only refactor from ordinary contributor runtime proof; production owners and persistent formats are unchanged.
Evidence reviewed 7 items Repository policy applied: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer notes were found. Applied its security-boundary preservation and maintenance-only changelog guidance. The review contract supersedes execution of bundled autoreview helpers.
Pinned introduced scope: The pinned main-to-head delta changes exactly five test files, adding 219 and deleting 387 lines. Production, native, package, dependency, and workflow paths have no changes. Current main retains the inline scaffolding this PR consolidates.
Replacement and resolver invariants retained: Compared all introduced hunks with their original versions. The replacement helper retains separate Windows observation and POSIX replacement paths, partial-cleanup flags, parser-triggered timing, and inode checks. Resolver interception retains disarming before injection, retry gating, error controls, and closed-descriptor assertions. Queue tables retain both original setup sequences and conditional retirement checks.
Findings None None.
Security None None.

How this fits together

fs-safe’s locks protect filesystem operations through sidecar ownership and Root confinement checks, while its durable queues preserve work across interrupted transitions. These tests inject filesystem races and failures to check rejection, cleanup, and recovery.

flowchart TD
  A[Lock and queue scenarios] --> B[Shared test fixtures]
  B --> C[Filesystem races and failures]
  C --> D[Lock identity checks]
  C --> E[Queue transitions]
  D --> F[Rejection and cleanup assertions]
  E --> G[Recovery and generation assertions]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests +219/-387; net -168 The reduction is confined to test scaffolding and introduces no runtime growth.

Technical review

Best possible solution:

Keep these fixtures local to their suites while preserving explicit race timing, platform controls, and security assertions.

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

Not applicable: this PR consolidates existing tests rather than fixing a reported runtime failure.

Is this the best way to solve the issue?

Yes: local helpers and scenario tables remove repetition while retaining the original triggers and assertions.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is test maintenance with no user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Verified repository-admin authorship exempts this test-only refactor from ordinary contributor runtime proof; production owners and persistent formats are unchanged.

Label justifications:

  • P3: This is test maintenance with no user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Verified repository-admin authorship exempts this test-only refactor from ordinary contributor runtime proof; production owners and persistent formats are unchanged.

Evidence

What I checked:

  • Repository policy applied: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer notes were found. Applied its security-boundary preservation and maintenance-only changelog guidance. The review contract supersedes execution of bundled autoreview helpers. (AGENTS.md:1, d9f169552cb0)
  • Pinned introduced scope: The pinned main-to-head delta changes exactly five test files, adding 219 and deleting 387 lines. Production, native, package, dependency, and workflow paths have no changes. Current main retains the inline scaffolding this PR consolidates. (d9f169552cb0)
  • Replacement and resolver invariants retained: Compared all introduced hunks with their original versions. The replacement helper retains separate Windows observation and POSIX replacement paths, partial-cleanup flags, parser-triggered timing, and inode checks. Resolver interception retains disarming before injection, retry gating, error controls, and closed-descriptor assertions. Queue tables retain both original setup sequences and conditional retirement checks. (test/file-lock-sync-root-authority-replacement.test.ts:17, d9f169552cb0)
  • Production boundary inspected: Root-backed sidecar reads use the actual Root open path, inspect discard receipts and parent identities, and preserve failures when confinement proof fails. The PR changes test orchestration without changing this authority or persistent queue formats. (src/sidecar-lock-root.ts:9, d9f169552cb0)
  • Historical routing: Current-main file history includes Peter Steinberger’s prior lock cleanup and shared-test maintenance, including commits 22672b0 and c1f3866. GitHub commit metadata maps the former author to steipete. Some older blob reads needed by blame failed with HTTP 403, so no source-line introduction attribution is asserted. (test/sidecar-lock-ownership-token.test.ts, 22672b0be996)
  • Verified trusted author: Although live PR author-association metadata says CONTRIBUTOR, the repository permission endpoint verifies steipete has the admin role. This establishes maintainer status independently and supports the ordinary real-behavior-proof exemption.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

steipete added a commit that referenced this pull request Oct 1, 2026
Share the Root-lock directory-replacement fixture (keeping the Windows and POSIX implementations), table durable-queue transitions, and share ownership-token acquisition and final-resolver interception scaffolding. Test counts identical; tests only, net -168 lines.
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Landed on main as 5e4e93b through the batch PR #816 (rebase merge, one commit per original PR), to avoid ten serial up-to-date CI cycles. Content is identical to this PR's reviewed diff.

@steipete steipete closed this Oct 1, 2026
steipete added a commit that referenced this pull request Oct 1, 2026
Share the Root-lock directory-replacement fixture (keeping the Windows and POSIX implementations), table durable-queue transitions, and share ownership-token acquisition and final-resolver interception scaffolding. Test counts identical; tests only, net -168 lines.
@steipete
steipete deleted the steipete/deslop-r4-tests-lock branch October 1, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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