Skip to content

feat(codex): add proof-bound Windows CLI update planning - #7596

Merged
lidge-jun merged 78 commits into
devfrom
codex/windows-cli-provenance-stack-20261023
Oct 28, 2026
Merged

lidge-jun merged 78 commits into
devfrom
codex/windows-cli-provenance-stack-20261023

Conversation

@luvs01

@luvs01 luvs01 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Windows x64 CLI inspection produces a read-only update plan only for an explicitly selected supported npm installation whose prefix-local Node, npm, package and backing files pass held-identity checks.

Windows evidence is rebuilt in the Worker realm; private native handles are not cloned. The plan remains inapplicable with windows_apply_disabled. Direct Windows apply refuses before inspection/lease acquisition. Unsupported layouts and existing API boundaries remain unchanged.

Stacked on #7586 at eec0d143d990eff3c43d5673cad30832711cf47e. Candidate d662a41ed4e97d60d22a48d504921d22643a1237 normally merges previous public 486768f0 with that refreshed parent. The parent-relative scope is 33 files (+704/-72). Retarget to dev only after the parent lands.

Verification

At this refreshed head, source TypeScript, structure/INDEX consistency, generated skill surface, both layout guards (29 cases / 579 assertions) and parent-relative privacy/file-size checks passed under Bun 1.4.4. Native processes exited with both output streams at EOF and no remaining direct child. The whitespace check also passed.

  • Independent source review cleared the lower stack. New candidate reference TypeScript, structure, generated skill-surface and scoped checks passed. Both Bun roles remain 1.4.4.
  • Earlier d10c5c9d Windows Worker planning evidence (1 pass / 8 assertions) and affected CLI/HTTP/apply-disabled controls (3 pass / 21 assertions) remain historical source-unit evidence. The planner/Worker evidence is not a full-suite result for this refreshed head.
  • Additional top-child convergence runs passed 30 tests / 390 assertions and 38 tests / 170 assertions; these are not direct executions on this commit.
  • Actual npm installation, vendor Codex, other Windows users, ARM64 and compiled FFI behavior remain unverified. No installed application, account, trust store or service was changed.

PR CI 40177221119 passed on this exact head. Its Ubuntu lane does not establish native Windows coverage. Full cross-platform CI 40189941034 passed on this exact head: 28 jobs passed / 6 conditional jobs skipped, including all nine Windows shards, all three macOS shards and macOS control. Actual npm/vendor installation, other users, ARM64, compiled FFI behavior and explicit maintainer security acceptance remain separate conditions. Windows apply support belongs to the separate transaction child.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • New Features
    • Windows x64 checks can inspect eligible standard npm installations when the captured absolute launcher path, prefix-local Node/npm, and verified platform support files meet the supported layout.
    • Supported installations can produce deterministic, read-only update plans with verified package metadata and a plan ID. These plans are not applicable, and applying updates on Windows remains disabled.
  • Documentation
    • Updated CLI guidance to describe supported Windows layouts and cases that remain deferred or unmanaged.
  • Tests
    • Added coverage for Windows inspection, read-only planning, and refusal cases.

luvs01 added 18 commits October 23, 2026 11:49
Carry only the request-id, POSIX job-store and status usage hunks from 86ad5a0; Windows read-only plan tests remain separate.
…lans

Port the Windows-plan hunks of 44353b9, 86ad5a0 and c291ff8 onto the
7586 POSIX stack head 4c22308. A proof-captured absolute standard npm
codex.cmd shim, its global-prefix package, prefix-local Node/npm and the
prefix-local optional backing are bound by held-handle identity
re-verification; the plan then reports applicable: false with refusal
windows_apply_disabled. PATH-only selection and separate-prefix Node stay
refused; Windows apply remains disabled. The independent
cli-installation-targets refused-probe fix (#7577) is intentionally not
included.
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between dda17d8 and 188954e.

Files selected for processing: 1
  • tests/fixtures/test-layout-expected.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

Windows inspection now recognizes a restricted standard npm Codex CLI installation layout. Validated evidence can support deterministic read-only update plans, but Windows apply remains disabled. Tests and documentation cover supported and deferred layouts.

Changes: Windows Codex CLI planning

Layer / File(s) Summary
Bounded Windows installation provenance
src/codex/cli-install-provenance.ts, src/codex/cli-installation-identity.ts, src/codex/cli-installation-limits.ts, src/codex/cli-windows-plan-provenance.ts, src/codex/windows-installation-files.ts, structure/runtime.md, structure/codex-cli-update.md
Inspection validates a proof-captured standard npm codex.cmd selection and observes its prefix-local package, Node, npm, and platform backing. Held handles reject reparses. Hash-only observations use the shared 1 GiB limit.
Read-only Windows update planning
src/codex/cli-update-artifacts.ts, src/codex/cli-update-plan.ts, src/codex/cli-update-apply.ts, src/codex/cli-update-job-execution.ts
The planner queries target metadata using the observed Node/npm toolchain and rechecks its identity. A resolved Windows plan has applicable: false and refusal windows_apply_disabled. Windows apply remains disabled.
Windows behavior validation and documentation
tests/codex-integration/codex-cli-windows-plan.test.ts, tests/codex-integration/codex-cli-windows-installation-files.test.ts, tests/cli/cli-codex-cli-update.test.ts, tests/codex-integration/codex-cli-update-artifacts.test.ts, scripts/test-layout/layout-codex-collision.json, tests/fixtures/test-layout-expected.json, docs-site/src/content/docs/*/reference/cli*
Tests cover supported inspection and planning, identity changes, size limits, and refusal paths. Translated documentation describes supported and deferred Windows layouts.

Priority: Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Selection as Proof-captured codex.cmd selection
  participant Provenance as Windows installation provenance
  participant Files as Windows installation file inspection
  participant Planner as Codex CLI update planner
  participant Toolchain as Observed Node and npm toolchain
  participant Registry as npm registry
  Selection->>Provenance: Provide selected command path
  Provenance->>Files: Request bounded installation-file observations
  Files-->>Provenance: Return observed files and identity evidence
  Provenance-->>Planner: Provide validated Windows plan evidence
  Planner->>Toolchain: Query target metadata under rechecked identity
  Toolchain->>Registry: Request target package metadata
  Registry-->>Toolchain: Return target metadata
  Toolchain-->>Planner: Return target metadata
  Planner-->>Selection: Return deterministic plan with Windows apply disabled
Loading

Possibly related PRs

Merge Risk: Minimal · previous review 18895

The Windows runtime documentation matches the inspected behavior, so no actionable merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: proof-bound Windows CLI update planning. It matches the documented read-only planning support for supported Windows x64 npm installations.
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Oct 23, 2026
@luvs01
luvs01 marked this pull request as ready for review October 23, 2026 06:12
Base automatically changed from codex/cli-update-stack-posix-20261023 to dev October 27, 2026 17:57
…losure is verified

Holding node.exe and npm-cli.js does not cover npm's module closure or Node's executable dependencies. The default Windows plan now reports target_unresolved instead of running npm. The regression uses an npm entrypoint that requires a separate module and asserts it never runs.
@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration decision: merging into dev at head b828263047cb888a390a7fc8c1e01770a8218137.

  • PR CI on this exact head: all required checks passed (Cross-platform CI test 1/4..4/4, gates, structure, storage, docs, docker smoke, npm-global).
  • Independent security review: round 1 raised one blocking item (the Windows plan ran npm while only node.exe and npm-cli.js were held). It is fixed in b82826304: the default Windows plan spawns no npm metadata child and reports target_unresolved until the toolchain closure is verified. The regression uses an npm entrypoint that requires a separate module and asserts it never runs (red before, green after). Round 2 on this head: PASS, 0 blocking.
  • Local checks on this head: focused Windows plan/CLI/installation-file tests, test-layout guards, file-size ratchet, structure:check, typecheck, privacy:scan.
  • Scratch merge with current dev (fb22d055e) is clean.

Next in the stack: #7626, then #7648 (which adds the verified toolchain authority that re-enables Windows metadata).

@lidge-jun
lidge-jun merged commit 8178745 into dev Oct 28, 2026
30 checks passed
@lidge-jun
lidge-jun deleted the codex/windows-cli-provenance-stack-20261023 branch October 28, 2026 02:42
lidge-jun added a commit that referenced this pull request Oct 28, 2026
Rebased onto dev after #7596 landed: this single commit carries the #7626 layer
delta (17 commits on codex/windows-cli-job-store-20261023) on top of dev.

Co-authored-by: Epinephrine <luvs01@hanmail.net>
Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com>
lidge-jun added a commit that referenced this pull request Oct 28, 2026
Rebased onto the rebased #7626 head: this single commit carries the #7648 layer
delta (40 commits on codex/windows-apply-transaction-20261023). It replaces the
#7596 refusal of Windows npm metadata with the verified, held toolchain authority.

Supersedes #7614, #7618 and #7619, whose commits are contained in this layer.

Co-authored-by: Epinephrine <luvs01@hanmail.net>
Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com>
lidge-jun added a commit that referenced this pull request Oct 28, 2026
Rebased onto dev after #7596 landed: this single commit carries the #7626 layer
delta (17 commits on codex/windows-cli-job-store-20261023) on top of dev.

Co-authored-by: Epinephrine <luvs01@hanmail.net>
Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com>
lidge-jun added a commit that referenced this pull request Oct 28, 2026
Rebased onto dev after #7596 landed: this single commit carries the #7626 layer
delta (17 commits on codex/windows-cli-job-store-20261023) on top of dev.

Co-authored-by: Epinephrine <luvs01@hanmail.net>
Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com>
lidge-jun added a commit that referenced this pull request Oct 28, 2026
)

Rebased onto dev after #7596 landed: this single commit carries the #7626 layer
delta (17 commits on codex/windows-cli-job-store-20261023) on top of dev.

Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants