-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add deterministic isolated OCX client artifacts #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,111
−0
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5fce6bd
feat: add deterministic remote client artifacts
f966530
fix: harden client artifact isolation
ffcce79
fix: block client artifact repair paths
df88b66
fix: resolve PowerShell client home links
b032378
fix(client): bind artifacts to committed builder
ChefGroep 654f8e2
fix(client): reject symlinked artifact destinations
ChefGroep 47166e4
fix(client): preserve proxy failure exit code
ChefGroep 62ebe24
fix(client): rebuild frozen deps before artifact bundling
d2aa96c
fix(client): confine artifact publication parent
bafae01
fix(client): isolate frozen dependency refresh
e0dae7a
fix(client): canonicalize isolated bundle source paths
053abb9
test(client): budget isolated artifact builds
faa33aa
test(client): isolate dependency tamper fixture
1361a61
fix(client): close cross-platform artifact review gaps
27455a6
test(client): budget PowerShell artifact build
9e40bec
fix(client): confine client homes outside native Codex home
ChefGroep c080037
docs(client): document token-file override and precedence
ChefGroep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # Remote client artifacts | ||
|
|
||
| Build a versioned client candidate from a clean runtime checkout: | ||
|
|
||
| ```sh | ||
| bun install --frozen-lockfile | ||
| bun run build:client --output /path/to/client-artifacts/new-candidate | ||
| bun /path/to/client-artifacts/new-candidate/src/cli/index.js --version | ||
| ``` | ||
|
|
||
| To rebuild an older pinned source revision with the current reviewed builder, | ||
| pass its clean checkout explicitly: | ||
|
|
||
| ```sh | ||
| bun run build:client --output /path/to/client-artifacts/new-candidate \ | ||
| --source-root /path/to/clean-pinned-checkout | ||
| ``` | ||
|
|
||
| The destination must not exist. Its parent must resolve without symlinks; on | ||
| POSIX it must be owned by the current user and not be group- or world-writable. | ||
| This keeps the final same-directory publication confined to a trusted parent. | ||
| This command never activates a candidate, changes a `current` link, reads home | ||
| configuration or starts a proxy. Runtime | ||
| source and lockfile changes must be committed first. Source provenance is the | ||
| checkout HEAD; package metadata comes from that Git revision, while the | ||
| manifest separately records the committed builder source revision, builder digest and Bun version. | ||
|
|
||
| The artifact preserves the remote launcher's contract: `src/cli/index.js`, | ||
| `package.json`, `source-sha` and `index.js.sha256`. It also ships the executable | ||
| `bin/codex.ocx-client` POSIX shim and `bin/codex.ocx-client.ps1` PowerShell shim | ||
| for an operator-controlled install step. The shims always select | ||
| `OCX_CLIENT_CODEX_HOME` or its isolated default `~/.codex-ocx`; | ||
| they ignore an inherited `CODEX_HOME` and explicitly refuse the native | ||
| `~/.codex` home, including normalized aliases, symlinked paths, and the | ||
| physical target of a symlinked native home. A client home inside the native | ||
| home is rejected as well. An explicit | ||
| `OCX_CLIENT_CODEX_HOME` must be absolute. `OCX_CLIENT_OCX_BIN` and | ||
| `OCX_CLIENT_CODEX_BIN` can select the governed remote launcher and real Codex | ||
| executable during installation. | ||
|
|
||
| `OCX_CLIENT_TOKEN_FILE` selects the API token file (default | ||
| `~/.opencodex/service-api-token`). Both shims read it only when | ||
| `OPENCODEX_API_KEY` is unset. They also seed `OPENCODEX_API_AUTH_TOKEN` from | ||
| that key when the auth-token variable is unset; explicit environment values | ||
| are preserved. | ||
|
|
||
| The PowerShell shim resolves every existing reparse-point component to its | ||
| physical target before comparing homes, and fails closed if a target cannot be | ||
| resolved. It separately rejects a client-home override that traverses a | ||
| reparse point, so no link alias can select the native home. | ||
|
|
||
| The CLI and its imported dependencies and upstream model snapshot are bundled. | ||
| Generated Bun source-path comments are canonicalized so the random isolated | ||
| build-directory name cannot change artifact bytes between identical builds; a | ||
| temporary build path outside generated comments fails the build closed. Package | ||
| metadata remains alongside the bundle for version reporting. This is | ||
| not a GUI, tray, service or storage-worker distribution. Direct bundle use is | ||
| limited to help and version commands, which exit before CLI auto-repair hooks; | ||
| every other command fails closed and must go through the governed remote | ||
| launcher. | ||
| Continue using the existing governed remote launcher for remote connectivity | ||
| and command authorization; it prevents indirect lifecycle paths too. Building | ||
| a candidate does not replace a globally installed shim or modify either the | ||
| isolated or native Codex home. | ||
|
|
||
| Before activation, review the exact source revision, run the catalog sync | ||
| regressions and harmless version probe, and compare the bundle checksum against | ||
| `index.js.sha256`. `artifact-manifest.json` additionally binds the package, | ||
| lockfile, builder and Bun version. Artifact integrity does not prove provider | ||
| availability or healthy remote deployment. Activation and rollback of the | ||
| launcher-managed `current` link are separate operator actions. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.