Repository navigation
fix(ci): make the Windows batch shards green after #8103 - #8109
Conversation
Run 41491122166 left four Windows shards red; dev was green on all eleven in 41262132337 before #8103. - update-orchestrated-identity: the fixture used POSIX paths that are not native on win32. The product also rejected a Windows source path written with '/' separators, so a live install could read as unknown; win32 now equates only the separators (dotted, doubled and wrong-suffix forms still fail closed). - update-bun-ownership-lease: the fixture did not recognize the Windows installer bridge (runWindowsInstallerSync) that #8103 introduced, so it answered unconfirmed and the updater kept its fence. - claude-intercept-acl-barrier: stub the PowerShell owner-ACL probe like the writer-barrier suite, so a slow cold probe cannot use up the 1 s ACL budget before the mocked icacls runs. - update-mutation-guard (windows 9/11): this lint runs only on Windows, where Bun can start the TypeScript sync client, so #8103 landed with 1258 unreviewed findings. Review every #8103 site into the existing tables plus two orchestrated-module sidecars; accept exit 10 only for the exact enterMutation refusal branch, with mutants; orchestrated-entry launches its child through probeSpawn, as job.ts does. - Windows durations refreshed from runs 41491122166 and 41462914814. - storage-policy and lab-read-surfaces left unfinalized prepared statements that keep SQLite files open, so each Windows afterEach removal waited its 15 s retry budget (about 210 s per run) and leaked the home. Plan and evidence: devlog/_plan/261103_windows_batch_shards/010_plan.md
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. |
|
✅ Deterministic PR hygiene checks passed. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Result channel contract and validation src/update/orchestrated-session.mjs, src/update/orchestrated-session.d.mts |
The parent creates a result channel and issues a capability tied to the result path. The child validates the destination and publishes outcomes through a validated descriptor. Channel reads and disposal check the recorded file and directory identities. |
Child argument and driver wiring src/update/orchestrated-arguments.mjs, src/update/orchestrated-arguments.d.mts, src/update/orchestrated-entry.ts, src/update/orchestrated-node-driver.mjs, src/update/index.ts, bin/ocx.mjs |
Child arguments require a valid result capability. The Node and Bun drivers pass the channel path and capability to children, read outcomes through the channel, and dispose of it when the child has stopped. |
Channel integration and regression tests tests/update/update-orchestrated-arguments.test.ts, tests/update/update-orchestrated-entry.test.ts, tests/update/update-orchestrated-plan.test.ts, tests/update/update-orchestrated-session.test.ts, tests/cli/ocx-launcher-desktop-handoff.test.ts, tests/codex-integration/codex-shim-autorestore.test.ts |
Tests cover capability parsing, child launch authorization, destination validation, result reads, cleanup, and Bun and Node child publication. |
Windows shard compatibility and scanner coverage
| Layer / File(s) | Summary |
|---|---|
Windows identity and test fixtures src/update/orchestrated-identity.ts, tests/update/update-orchestrated-identity.test.ts, tests/helpers/update-bun-ownership-child.ts, tests/claude-integration/claude-intercept-acl-barrier.test.ts, tests/lab/lab-read-surfaces.test.ts, tests/storage/storage-policy.test.ts, structure/ops/service-and-sidecars.md |
Identity comparisons treat / and \ as equivalent on Windows while retaining exact source-path matching. Tests use platform-native paths and cover mismatched and dotted paths. The installer fixture recognizes the Windows bridge, the ACL test stubs its owner-ACL runner, and SQLite tests finalize statements before database cleanup. |
Update scanner review and refusal rule tests/helpers/update-review-table.ts, tests/helpers/update-review-orchestrated-*.ts, tests/helpers/update-helper-control-contracts.ts, tests/helpers/update-import-policy.ts, tests/helpers/update-primitive-allowlist.ts, tests/helpers/update-process-allowlist.ts, tests/helpers/update-mutation-scanner.ts, tests/update/update-mutation-scanner.test.ts, tests/update/update-capability-policy.test.ts, structure/ops/update-supervised-recovery.md |
Review tables classify orchestrated-update imports, primitive operations, process operations, and helper contracts. The mutation scanner accepts the exit-10 refusal branch only after awaited mutation entry, lease release, and exit inside the refusal branch. Tests reject altered branch forms. |
Windows shard investigation record devlog/_plan/261103_windows_batch_shards/010_plan.md |
The plan records the four shard failures, repair and verification criteria, duration measurements, outcomes, and follow-ups. It reports that 16 of 20 missing duration entries were filled and that completed shard timings met the headroom target. |
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant UpdateParent as Update parent
participant ResultChannel as Orchestrated result channel
participant UpdateChild as Update child
UpdateParent->>ResultChannel: Create channel and issue capability
UpdateParent->>UpdateChild: Pass result path and capability
UpdateChild->>ResultChannel: Validate destination and publish outcome
UpdateParent->>ResultChannel: Read outcome and dispose channel
Possibly related issues
- lidge-jun/opencodex#7967 — The issue concerns a worker remaining in
runningafter supervisor stop. The provided change summary does not establish that this systemd cgroup scenario is addressed.
Merge Risk: 
Minimal · previous review 68890
-
No merge-blocking issue was established. Windows confirmation remains pending.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 15 functions across 30 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
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.
Add mutants for an unawaited or different initializer, an inverted entered.ok predicate and an else branch (CodeRabbit review).
…ithSession #8103 moved the three reviewed guardedStartWindowsTray deferred imports from runUpdate into runUpdateWithSession, and the policy table follows the code. The fixture now uses that context; the fourth binding, raw namespace, unreviewed binding and other-context cases stay rejected. Windows-only lint; reproduced and verified under Node.
The orchestrated update child now writes its outcome records only into a result file its parent created for it. The parent creates a fresh temp directory holding one exclusively created capability file and passes the token in OCX_UPDATE_RESULT_CAPABILITY. Before any session write, mutex use or identity probe, the child accepts only a canonical, single-link, non-symlink regular file (owner-only on POSIX) whose size and entire content equal that capability document, then publishes every record through the descriptor it validated (truncate, then write at explicit offsets). The parent reads, unlinks and non-recursively removes only the file and directory identities it recorded, and bounds the record size. Update-lint rows are re-reviewed for the new sites, and the POSIX supervisor and marker rows now state only what the code enforces. Tests cover rejected destinations left byte-identical, a path swap after validation, interrupted and oversized records classifying as uncertain, identity-bound cleanup, and real Bun and Node parent-to-child handoffs under a symlinked temp root.
NTFS and ReFS file ids can exceed Number.MAX_SAFE_INTEGER; every identity-bearing lstat/fstat in the result channel and destination validation now uses { bigint: true } (CodeRabbit review).
Remove the result capability from the parsed environment so probes and installers never inherit it; the Node launcher passes it only to the Bun process continuing the same child. Channel cleanup removes by path only on POSIX with non-replaceable ancestors, and otherwise leaves the channel. Cover symlinked and junction destinations in both Node and Bun.
State that cleanup identity checks precede path-based removal on POSIX only, and that marker publication assumes the OpenCodex home cannot be replaced.
|
Maintainer integration into Exact-head verification for
|
Summary
Makes the Windows shards of the
devbatch CI green again. In run 41491122166 (dev with #8103, #8104 and #8106), windows 7/11, 8/11 and 10/11 failed and 9/11 was cancelled at the 30-minute cap. The previous full Windows run on dev, 41262132337, was green on all eleven shards. Every failure traces to #8103 or to a test fixture that depends on Windows runner timing. None comes from #8106.update-orchestrated-identityreturnskind: "unknown"/(whichprocess.argv[1]can pass through unchanged) made a live install read asunknown./and\as the same separator; dotted, doubled and wrong-suffix forms still fail closed.update-bun-ownership-lease(exit 1/75, traceancillary)runWindowsInstallerSync(--input-type=module -e, with the request on stdin). The fixture'sspawnSyncmock only knew the POSIX supervisor, so it answered with an unconfirmed result.claude-intercept-acl-barrier: two cases ended at the 1 s ACL budgetdeadline_before_spawnwithbudgetMs: -12.claude-config-root-writer-barrieralready does.update-mutation-guardreported 1258 unclassified findings, then the shard was silent until the captests/helpers/update-review-*.ts).For windows 9/11, two more changes:
enterMutationrefusal branch. Seven mutants cover it.orchestrated-entry.tslaunches its child throughprobeSpawn, the same functionjob.tsuses for its update worker, instead of a rawnode:child_processimport.Windows timing:
scripts/ci/test-durations.windows.tsvwas refreshed by the tool from runs 41491122166 and 41462914814. Predicted load is even, about 1295 s per shard. Measured setup is 55–100 s. The worst completed job took 26.6 min.storage-policy'sseedHomeand twolab-read-surfacescases left unfinalizeddb.prepare()statements, which keep the SQLite file open afterclose(). On Windows that blocked eachafterEachremoval for the full 15 s retry budget, and the swallowed error leaked the home: 14 cases, about 210 s. This was confirmed withlsofon macOS.Rows for maintainer attention. These update-lint rows are classified by precedent, not by a guard. They are listed in the plan's Build outcome section:
job.tsspawnGuiUpdateWorker; the child does its own mutex, lease, identity and home checks.orchestrated-child.mjsforwards signals to its own child, following the existingchild.kill()rows.orchestrated-session.mjswrites its home marker while holding the mutex, by path (temp file, then rename). This assumes the OpenCodex home and its ancestors cannot be replaced by another principal; see the accepted residuals below. Result records go only through the descriptor validated against the parent's capability file.orchestrated-node-driver.mjscleans up its own temp directory.posix-install-supervisor.mjs:18.No workflow, timeout or shard-count change. No test is skipped or loosened.
Plan, audit and evidence:
devlog/_plan/261103_windows_batch_shards/010_plan.md.Follow-ups (not in this PR):
runWindowsInstallerSync.routing-profile-management-editor"alias changes",routing-compatibility-boundariesCL-06).Orchestrated update result handoff (pre-merge security review). #8103 let the orchestrated update child replace its preflight result at any absolute path it was given. The child now writes outcome records only through a descriptor it has validated against the capability document it was handed:
createOrchestratedResultChannel()) creates a fresh temp directory holding one exclusively created capability file and passes the token inOCX_UPDATE_RESULT_CAPABILITY.The boundary is content-bound. A matching file shows that the destination holds the capability document; it does not prove which process wrote it. The child runs with the invoking user's authority.
Fixed in the final security round:
parseOrchestratedChildArgsdeletesOCX_UPDATE_RESULT_CAPABILITYfrom the environment it parses, so probes, installers, sync and recovery subprocesses no longer inherit it. The Node launcher re-adds it only for the Bun CLI process that continues the same validated child (updateis excluded from the Desktop handoff).realpathSync.native) rejects symbolic links and junctions in the destination path. A new test runs the check in both Node and Bun and leaves the target byte-identical. Other reparse-point kinds are not separately probed.Accepted residuals, for maintainer acceptance:
lstatbefore a path-basedunlink/rmdir. A swap inside the owner-only channel directory between those calls requires write access that already carries the user's authority.structure/ops/service-and-sidecars.mdbut not enforced.Independent Terra security review of the final round: NEAR-PASS, with no code-level blocker. Its remaining items were to push the reviewed commit, keep this description accurate, and get explicit acceptance of the home-ancestor precondition. The update-lint rows for these sites now state the same qualifications.
Verification
bun:testshim. On dev HEAD,update-mutation-guardfails 2 of 4 (both lint cases), which reproduces windows 9/11. On this branch it passes 4 of 4, andupdate-mutation-scannerpasses 193 of 193, including the exit-10 mutants. The Node scanner driver reports 0 failures, 0 policy violations, 0 contract mismatches and 0 unmatched sites.node:pathmapped topath.win32) returnsunknownforC:/…/src/cli/index.tson the old code andliveon the new code. Dotted, doubled and wrong-suffix forms returnunknownon both.bun teston the identity, bun-ownership-lease, acl-barrier, mutation-guard, mutation-scanner, ci-shard-balance, storage-policy, lab-read-surfaces, test-layout, test-layout-tooling, repo-hygiene and structure-ssot files: 216 pass, 191 skip (the Windows-only lint cases above), 0 fail. File-size and import-cycle ratchets: 25 pass.bun run typecheck,bun run structure:checkandbun run privacy:scanpass.bun scripts/test.ts --changed=dev --parallel=1has not exited 0 locally. Thesrc/update/change selects 1368 files through the server import graph, and the default 900 s cap is too short on this machine. WithOCX_TEST_MAIN_TIMEOUT_MS=3600000, the run on 0fe6744 finished in 2238 s with 31,510 pass and 45 fail. All 45 failures are multi-second, timeout-shaped server HTTP cases (server-images,server-live,server-search,catalog-omit-disabled-native, live installation, plus thepackage-treemtime cases that AGENTS.md lists as environment-only), seen at load average 4–7 with concurrent worktrees.server-searchalso fails on an exported dev HEAD tree, and none of these files is in this diff. On b4507ee, one run stalled in thetests/server/server-live*fixtures (main thread blocked on a lock inside Bun, with outbound HTTPS connections open). A rerun is in progress. The Ubuntuci:fullshards (test 1/4–4/4) passed on b4507ee in this PR's CI, so local coverage of those files is left to CI.bin/ocx.mjs) and reaches preflight; channels under a replaceable ancestor, or on Windows, are left in place; a destination reached through a directory link (a junction on Windows) is refused in both Node and Bun, with the target left byte-identical.The wp2 regressions fail on 51493e3 and the final-round token regressions fail on 6889003; all pass on this head. On b4507ee, the 21 focused files give 343 pass, 305 skip (Windows-only and root-only cases) and 0 fail. The update-lint scan reports 0 failures and 0 policy violations, with no contract mismatches or unmatched sites.
update-capability-policyunder the Node shim passes 108 of 109; the one failure is a macOS/varvs/private/varresolver artifact of the shim, and the file passes on Windows.tests/responses/chat-completions-endpoint.test.ts: the proxy for "non-streaming /v1/chat/completions returns error status on upstream failure" had just started, and its un-timedfetchagainst a local upstream never returned. Nothing fix(ci): make the Windows batch shards green after #8103 #8109 changes is in that batch: its 12 files (xai, zai and zed provider tests and fivetests/responses/chat-*files) do not reference update code. The batch runs in its ownbun testprocess. The server's static import graph does reachsrc/update/, but the changed modules add only side-effect-free constants at load time, and the server calls only the unchangeddetectInstall. The same shard passed in 13m05s in this PR's own CI on the same head.update-orchestrated-entry"npm child fences..." case sometimes misses itsfs.watch-driven overrun or completion event under load (about 3 of 13 runs). It is skipped on Windows and passed in the Ubuntuci:fullshards. Follow-up: replace those watch waits with polling.Checklist
structure/ops/service-and-sidecars.mdandstructure/ops/update-supervised-recovery.md; the only user-visible change is that a Windows install launched with/separators is now recognized.)Summary by CodeRabbit
Bug Fixes
Tests