Repository navigation
fix(windows): harden long compaction recovery paths with the extended spelling - #7823
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
ACL path handling and recovery coverage src/codex/ocx-compaction-history.ts, tests/codex-integration/history-ocx-compaction-recovery.test.ts, tests/cli/cli-help.test.ts, structure/transports/responses-failover.md |
At src/codex/ocx-compaction-history.ts:83-84, Windows paths are converted to namespaced paths before ACL hardening. The integration test covers short and long paths (tests/codex-integration/history-ocx-compaction-recovery.test.ts:82-92). The CLI assertion includes stderr on failure (tests/cli/cli-help.test.ts:378), and the documentation describes extended-length ACL paths (structure/transports/responses-failover.md:323). |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- Issue 7810 reports a Windows long-
TEMPfailure inrecover-history. This change updates the recovery ACL path handling and adds long-path test coverage. The issue’s local-proxy failures are outside this change.
Possibly related PRs
- lidge-jun/opencodex#7822: Both changes affect compaction-history recovery; this PR addresses Windows long-path ACL handling.
- lidge-jun/opencodex#7773: Both changes affect Windows ACL handling for protected files; this PR passes a namespaced path to ACL hardening.
Merge Risk: 
Minimal · up to b217e
-
No actionable regression was identified in the changed recovery, test, CLI, or documentation paths.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
✅ Deterministic PR hygiene checks passed. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Maintainer dev integration (L5 lane), per MAINTAINERS.md. Decision: squash-merge at exact head
This resolves the long-TEMP half of #7810. The tests that depend on a host proxy remain open there. |
…opt the long-TEMP fix Adopted from upstream 86b72a6 (lidge-jun#8019) and extended across the fork: NTFS file IDs above 2^53 collide as JS numbers, which broke the fork's lstat -> open -> fstat defence for credential, OAuth, config, CA and lock files. src/lib/file-identity.ts compares dev and ino as bigints from { bigint: true } stats, rejects unsafe numbers instead of falling back, and is used by the 86 callers that compared identities; no caller moved from fstat-on-fd to a path stat. Test doubles now mimic bigint stats; a diagnostics test isolates the external Windows ACL process. Also adopted 95cfa30 (lidge-jun#7823): compaction history hardens the namespaced long path. The upstream triage rows that only carry a stat-derived reason are marked classified-only, three misclassifications are fixed, and the commit baseline stays at 88aaa75. Broad caller suites match main except for failures that already exist there. A near-term row tracks the mtime precision change for persisted migration journals. Co-authored-by: JUN <jun@lidgeai.com> Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: SanHsien <34234698+SanHsien@users.noreply.github.com>
Summary
ocx recover-historyfails on Windows withEICACLSwhen its backup or atomic-repair file path is longer thanMAX_PATH, for example under a ~80-character%TEMP%or profile path. This is the first symptom in #7810.Recovery builds a timestamped backup filename and a longer atomic-repair temp filename, then runs required ACL hardening on each before writing.
icaclscannot open ordinary paths past the 260-character limit. On the same 261-character file, Bun read the file successfully whileicaclsexited 3 with the ordinary spelling, 0 with the extended\\?\spelling, and 3 again with the ordinary spelling. An 80-character control succeeded with both spellings. SQLite, file reads and fixture nesting are therefore not the cause.writePrivateFilenow passestoNamespacedPath(path)to the required hardening call. Hardening is still required. Exclusive creation, owner-only permissions, error propagation, fsync, digest check, atomic replacement and cleanup are unchanged. The timeout memo key stays the ordinary path.The second half of #7810 (tests that depend on a host proxy) is tracked separately, so this PR does not close the issue.
Verification
Windows 11, Bun 1.4.4,
OCX_TEST_NO_QUEUE=1:TMP/TEMPset to an 81-character directory,bun test --isolate tests/cli/cli-help.test.ts -t recover-history: 2 pass / 1 fail (EICACLS) before, 3 pass / 0 fail after.bun test --isolate tests/codex-integration/history-ocx-compaction-recovery.test.ts -t 'long paths': 0 pass / 2 fail before; the whole file passes 5 / 0 after. The regression builds ordinary and >260-character rollout/backup paths on every host and runs against the real Windows ACL implementation.tsc --noEmit,structure:checkandprivacy:scanentrypoints: exit 0.structure/transports/responses-failover.mdstays within its budget at 600/600 lines.NOT RUN: full suite and local
test:changed(CI runstest changedandci:full), Linux and macOS locally, hosted lane=all (to be dispatched on the merge head).Checklist
Summary by CodeRabbit