Skip to content

fix(windows): retain exact directory preparation identities - #825

Merged
steipete merged 1 commit into
mainfrom
fix/windows-directory-identity
Oct 2, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/windows-directory-identity

Conversation

@steipete

@steipete steipete commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

ensureAbsoluteDirectory() retained numeric directory identities. Distinct 64-bit Windows file IDs can round to the same JavaScript number, allowing a replaced directory to compare equal during the final guard check. Select the existing strict bigint guard for this private preparation flow; keep the public result shape and the ordinary guard API defaults unchanged.

Extend the queued-replacement regression with distinct real directories whose reported IDs are 2^54 and 2^54 + 1. The case fails on unmodified main because preparation unexpectedly succeeds, and passes with exact identities. The ordinary case and neighboring result-contract tests remain covered. This helper still accepts caller-trusted absolute paths and retains its documented best-effort concurrency boundary.

This bounded correction was identified while investigating the repeated Windows directory-scheduling coverage failure during #824. Validation: 79 focused local tests pass; real Windows AWS with Node 24.21.0 reproduces the large-ID failure on main and passes 75 tests with the fixed source (four existing platform skips). Codex autoreview is clean through P2. Exact-head CI, including pnpm check on Linux/macOS/Windows, Windows coverage, native builds, and CodeQL, passed. The Intel native sidecar-contention proof passed one targeted rerun; its independent unchanged-main replay passed too. Parallel and serial local full runs hit unrelated timeouts on a heavily loaded host, so the passing isolated CI runs supply the full-check gate.

@steipete
steipete requested a review from a team as a code owner October 2, 2026 01:53
@clawsweeper

clawsweeper Bot commented Oct 2, 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 P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. 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 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 1, 2026, 10:08 PM ET / October 2, 2026, 02:08 UTC (Revision 2).

ClawSweeper review

What this changes

The PR makes trusted absolute-directory preparation retain exact bigint identities and adds a large-file-ID replacement regression, documentation, and a changelog entry.

Merge readiness

⛔ Blocked before merge - 3 items remain

The correction remains necessary on main and in v0.22.0. No concrete patch defect was found, but the previously identified Windows compatibility change still needs explicit acceptance and helper-level coverage.

Priority: P2
Reviewed head: f133633d7b6a012f2d012f30af094dfe2a82095d
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused implementation reuses established safety machinery without a definite defect; the compatibility decision remains a separate merge blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository State identifies a MEMBER author, so the ordinary contributor proof gate is exempt. The body reports Windows AWS before/after focused validation of the changed preparation path; this is supplemental and does not resolve unknown-ID compatibility. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository State identifies a MEMBER author, so the ordinary contributor proof gate is exempt. The body reports Windows AWS before/after focused validation of the changed preparation path; this is supplemental and does not resolve unknown-ID compatibility. No stored-data contract changes.
Evidence reviewed 8 items Introduced correction: The pinned delta changes private guard capture to bigint mode without changing the public result type or ordinary guard defaults. The new regression uses real directory replacement with injected distinct IDs that collide as numbers.
Current main still needs the correction: Main captures numeric directory guards, so the central precision problem remains.
Latest release also uses numeric capture: GitHub's v0.22.0 source shows captureDirectoryGuard(target, "native") without bigint mode.
Findings None None.
Security None None.

How this fits together

Absolute-directory preparation creates caller-trusted directory paths one segment at a time. Directory guards check identity around creation and before returning success; the helper also feeds durable-directory preparation.

flowchart TD
 A[Trusted absolute path] --> B[Inspect existing directory prefix]
 B --> C[Capture exact directory identity]
 C --> D[Check parent and create missing segment]
 D --> E[Recheck directory identities]
 E --> F[Return prepared path]
 E --> G[Return policy failure]
Loading

Decision needed

Question Recommendation
Should ensureAbsoluteDirectory reject persistently unknown Windows identities after one retry, replacing its previous permissive comparison? Approve bounded strict admission: Accept persistent unknown-ID rejection after preparation-level compatibility coverage and documentation establish the exact behavior.

Why: Repository policy favors fail-closed identity checks, but this public helper can now reject legitimate existing Windows workflows; the implementation intent alone does not establish acceptance of that operational change.

Before merge

  • Resolve merge risk (P1) - Windows directory preparation that previously tolerated persistent zero device or inode values will now return path-mismatch after one retry. Explicit acceptance, helper-level transient/persistent coverage, and user-facing documentation of this upgrade behavior remain outstanding.
  • Complete next step (P2) - Confirm acceptance of persistent unknown Windows identity rejection after adding preparation-level transient/persistent coverage and documenting the failure contract.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Establish the preparation contract (recommended)
    Add transient recovery and persistent unknown-ID cases through ensureAbsoluteDirectory, document the returned failure, and obtain explicit acceptance of the stricter Windows behavior.
  2. Hold for contention investigation
    Pause landing until representative Windows contention evidence clarifies the operational impact of persistent identity rejection.

Technical review

Best possible solution:

Retain exact identities and bounded fail-closed admission, with an explicitly approved and documented Windows unknown-ID contract validated through directory preparation.

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

Yes: numeric capture on main can collapse the two distinct IDs used by the queued directory-replacement regression. This review established the mechanism from source and inspected the regression; it did not execute tests.

Is this the best way to solve the issue?

Yes for precision: reusing the existing exact guard is the narrowest repair. Acceptance and validation of its stricter unknown-ID behavior remain necessary.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a focused directory-identity correction with a bounded Windows compatibility concern.
  • merge-risk: 🚨 compatibility: Selecting strict bigint guards makes persistent unknown Windows identities reject preparation that numeric guards previously allowed.
  • 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: Repository State identifies a MEMBER author, so the ordinary contributor proof gate is exempt. The body reports Windows AWS before/after focused validation of the changed preparation path; this is supplemental and does not resolve unknown-ID compatibility. No stored-data contract changes.

Evidence

What I checked:

  • Introduced correction: The pinned delta changes private guard capture to bigint mode without changing the public result type or ordinary guard defaults. The new regression uses real directory replacement with injected distinct IDs that collide as numbers. (src/absolute-path.ts:78, f133633d7b6a)
  • Current main still needs the correction: Main captures numeric directory guards, so the central precision problem remains. (src/absolute-path.ts:78, aab1c65a80d1)
  • Latest release also uses numeric capture: GitHub's v0.22.0 source shows captureDirectoryGuard(target, "native") without bigint mode. (src/absolute-path.ts:78, ef7b5a909bff)
  • Windows compatibility consequence: Bigint guards use strict identity inspection, which permits one retry for unknown Windows components and then rejects with path-mismatch. Numeric sameFileIdentity previously tolerated zero components. The preparation wrapper returns this rejection as a policy failure. (src/strict-file-identity.ts:65, f133633d7b6a)
  • Existing coverage and remaining gap: Existing exact-guard tests cover transient recovery, persistent unknown identities, changed known components, and operational errors. They exercise guard capture, verification, and secret preparation, but not ensureAbsoluteDirectory's result contract. Its new documentation mentions precision without explaining unknown-ID rejection. (test/directory-guard-exact-identity.test.ts:17, f133633d7b6a)
  • Re-review continuity: The previous completed review examined the same head and requested preparation-level transient/persistent identity coverage and documentation. No source update resolves that request. The captured body now reports Windows AWS validation on Node 24.21.0, with main failing the large-ID case and the fixed source passing 75 focused tests with four skips; it does not establish the unknown-ID compatibility outcome. (f133633d7b6a)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Cover transient identity recovery and persistent unknown-ID failure through ensureAbsoluteDirectory, and document the Windows failure contract.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-02T01:55:53.561Z sha f133633 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 2, 2026
@steipete
steipete merged commit 61cb5f1 into main Oct 2, 2026
83 of 84 checks passed
@steipete
steipete deleted the fix/windows-directory-identity branch October 2, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. 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