@shumkov/orchestra 0.11.2 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/CODEX_RUNTIME_UPGRADE_REPORT.md +419 -0
- package/docs/CODEX_RUNTIME_UPGRADE_SPEC.md +419 -0
- package/docs/codex-app-server-compatibility.md +5 -0
- package/lib/codex/app-server-client.js +32 -3
- package/lib/codex/preflight.js +21 -7
- package/lib/codex/protocol-schema.json +14 -7
- package/lib/codex/runtime-companion.js +66 -0
- package/lib/process/factory.js +5 -4
- package/lib/process/hook-settings.js +6 -1
- package/package.json +1 -1
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
# Codex 0.167.2 local upgrade evidence
|
|
2
|
+
|
|
3
|
+
Status: reviewed local implementation; hard-loss gate scope explicitly reconciled
|
|
4
|
+
to the accepted native-beta/quarantine contract. Native and CLIProxy final validation lanes passed; translated Linux x64
|
|
5
|
+
attestation/schema/consumer/helper/normal-stop validation passed. No production activation,
|
|
6
|
+
publication, commits, package-version changes, or Claude/Agent SDK pin changes.
|
|
7
|
+
|
|
8
|
+
## Scope and decision
|
|
9
|
+
|
|
10
|
+
Orchestra base: `c195f2f96373c8c2cb6a86f5b6fa8ef70ae98431`, worker tree
|
|
11
|
+
`/Users/ivanshumkov/orca/workspaces/orchestra/codex-runtime-upgrade`.
|
|
12
|
+
Polygram consumer base: `960b0be3b191f5a336bab8d5d6577d411c548a3a`, owned Orca child
|
|
13
|
+
`/Users/ivanshumkov/orca/workspaces/polygram/codex-runtime-compat`.
|
|
14
|
+
Parent/trusted/shared-skills/infra worktrees were read only.
|
|
15
|
+
|
|
16
|
+
Official release verification on 2026-11-12 selected non-prerelease `rust-v0.167.2`
|
|
17
|
+
(published 2026-11-11). Read the complete stable release inventory between 0.145.0
|
|
18
|
+
and 0.167.2 (40 releases), exact candidate source and official app-server docs;
|
|
19
|
+
the protocol reviewer independently audited the delta. Evidence is retained in
|
|
20
|
+
`/tmp/codex-runtime-upgrade-research/{latest.json,delta-release-notes.md,codex-rust-v0.167.2}`.
|
|
21
|
+
Sources: [official release](https://github.com/openai/codex/releases/tag/rust-v0.167.2),
|
|
22
|
+
[release API](https://api.github.com/repos/openai/codex/releases/latest),
|
|
23
|
+
[app-server documentation](https://developers.openai.com/codex/app-server).
|
|
24
|
+
|
|
25
|
+
Keeping 0.145.0 retains established evidence but provides no upgrade. The smallest
|
|
26
|
+
stable successor 0.146.0 reduces the delta but still needs new schema/binary/provider
|
|
27
|
+
validation. Exact 0.145/0.146 source already enables `CodeModeHost` by default;
|
|
28
|
+
0.146 does not source-evidently avoid the companion or process-group issue. No
|
|
29
|
+
evidenced earlier stable candidate solves the observed shared crash limitation.
|
|
30
|
+
Prefer finishing 0.167.2 within the already accepted containment boundary, under
|
|
31
|
+
the coordinator-approved correction to the stricter new crash-gate scope. This is
|
|
32
|
+
not a passing crash cleanup result; do not downgrade solely from this observation.
|
|
33
|
+
|
|
34
|
+
## Reviewed changes and interfaces
|
|
35
|
+
|
|
36
|
+
The spec received three initial independent reviews, two instruction-amendment
|
|
37
|
+
reviews and two companion-amendment reviews. Final protocol and scope/security
|
|
38
|
+
reviews are CLEAN for the source changes; final protocol, scope/security and
|
|
39
|
+
validation report re-reviews are also CLEAN. Final provider gates and translated Linux checks passed. Native Linux
|
|
40
|
+
CPU/sandbox/launcher validation remains a release prerequisite. These verdicts do not approve release or activation.
|
|
41
|
+
|
|
42
|
+
Public constructors, profile/receipt shapes, allowed client methods and process
|
|
43
|
+
interfaces remain compatible. Exact new hook metadata is validated (`async:false`,
|
|
44
|
+
`environmentId:null`); eight official PlanType additions are accepted without
|
|
45
|
+
exposing account data. Only the exact UI/auth summary notifications
|
|
46
|
+
`thread/readState/changed`, `account/updated` and provider
|
|
47
|
+
`turn/moderationMetadata` are dropped; unknown methods and
|
|
48
|
+
unsupported hook metadata still fail closed; exact policy checks remain enforced.
|
|
49
|
+
Limited/trusted policies, native ChatGPT admission,
|
|
50
|
+
CLIProxy selection, model/effort catalogs, hook inventory, checkpoint delivery,
|
|
51
|
+
steer/resume and deployment admission/fingerprint fencing remain enforced.
|
|
52
|
+
Trusted filesystem serialization remains `glob_scan_max_depth:null`, digest
|
|
53
|
+
`ce41c7bdb7f357798e0ce66850e28f87de7a8544bb13ce2cc029985aa41d852a`.
|
|
54
|
+
|
|
55
|
+
Candidate explicit-untrusted project loading excludes project instructions as well
|
|
56
|
+
as project configuration. The approved adaptation binds only Polygram's dedicated
|
|
57
|
+
CODEX_HOME/AGENTS.md to the exact admitted workspace's canonical root AGENTS.md.
|
|
58
|
+
It never writes the user global Codex home, copies instructions, overwrites a
|
|
59
|
+
regular file, retargets an existing link, accepts foreign/dangling targets or
|
|
60
|
+
AGENTS.override.md, or reuses another workspace's binding. Existing owned-profile
|
|
61
|
+
identity/admission checks enforce the binding through cache and dispatch; canonical
|
|
62
|
+
content edits remain live shared-source edits. Nested project AGENTS are ignored
|
|
63
|
+
under this runtime's explicit-untrusted mode; this adaptation covers the canonical
|
|
64
|
+
Shumabit root, not a general nested-instruction loader.
|
|
65
|
+
|
|
66
|
+
The approved required companion is the exact-target official
|
|
67
|
+
`codex-code-mode-host`, in the plain standalone sibling layout only. Its secure
|
|
68
|
+
path/owner/mode/nlink/hash and selection layout are bound privately at existing
|
|
69
|
+
attestation boundaries and rechecked before spawn and state-changing writes,
|
|
70
|
+
including after awaited checkpoints. Competing resources/package/bundle layouts
|
|
71
|
+
are rejected. This adds no general executable supervisor or arbitrary helper path.
|
|
72
|
+
|
|
73
|
+
## Artifact attestations
|
|
74
|
+
|
|
75
|
+
All SHA-256 values below are exact official downloaded executable bytes. Preserved
|
|
76
|
+
old and candidate Darwin artifacts are outside updater/vendor GC under
|
|
77
|
+
`/Users/ivanshumkov/.local/share/orchestra-runtime-evidence/codex-<version>/`.
|
|
78
|
+
|
|
79
|
+
| Artifact | SHA-256 |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| 0.145.0 Darwin ARM64 CLI | `1da3f4e0e96028b8a771814293c3033dafd1971f943f6c7e79b0897fe705f590` |
|
|
82
|
+
| 0.145.0 Linux x64 musl CLI (base pin; not newly executed) | `a2a05dafaa1acb002a45eaec0a462de5b13694fcfcd7bc43305f14781ce7be14` |
|
|
83
|
+
| 0.145.0 Darwin ARM64 companion | `c75e27ea296ede4025959e4f66772c283261f28d95b1f27be4d8ef07aabe9bce` |
|
|
84
|
+
| 0.167.2 Darwin ARM64 CLI | `97bc82fd46f117cf10efb95e6ff0c81dc4784f5797bcdc2cb75093ba09e4def0` |
|
|
85
|
+
| 0.167.2 Darwin ARM64 companion | `45acdb759c3ac0a6b30a5107329b364b7ac1579f2cdf270997f03bc8d6365ef6` |
|
|
86
|
+
| 0.167.2 Linux x64 musl CLI | `a9672d0fa0dd8fcf8cad136fa0d056b914bc046f5ac3d78f4a5cf390655af56b` |
|
|
87
|
+
| 0.167.2 Linux x64 musl companion | `007c62795a7215c27ee85486ecb95e714b33118a2d18c6d7b09b0d9793c72ff4` |
|
|
88
|
+
|
|
89
|
+
The base 0.145.0 experimental canonical schema pin was
|
|
90
|
+
`1bc09dedc506075562d4d49b702ecab6d947dd5a8c2a9014a5cde592a0938efb`.
|
|
91
|
+
Fresh candidate Darwin binary generation, stable then experimental v2:
|
|
92
|
+
|
|
93
|
+
| Schema | Stable | Experimental |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| Repository canonical digest | `3acaab0f5788b486250d8e32f75ae5e98198c63090a500c04182df52f0c8f137` | `ca9811bd8310c9576f2acc1c37ba132afeef49c0cdbc3e02908b64ad12126163` |
|
|
96
|
+
| Raw ClientRequest JSON | `94074a415950787a25e09ae3b4d9de312cc264eb0f021633dfca921d300cd42a` | `2d629aaaceea335d7e58ab19ce5908c8dd75ca3f3a6161a5f015bf59aadd3295` |
|
|
97
|
+
| Raw protocol JSON | `021462a9bacd117f4cd40c256a4888619d059cec6a65b795198d521ba660e554` | `486c7c8daa5dc7f3ab2a1fb56de5316804caf7a4210fda1dc28d3f0f4e90cfe1` |
|
|
98
|
+
|
|
99
|
+
The regeneration probe caught an initial research canonicalization mistake:
|
|
100
|
+
Python ASCII escaping differs from the repository algorithm on newly present
|
|
101
|
+
Unicode. Corrected pins above use `lib/canonical-json.js`; raw byte hashes did not
|
|
102
|
+
change. `/tmp/codex-upgrade-schema-digest-red.log` and
|
|
103
|
+
`/tmp/codex-upgrade-schema-regeneration.log` preserve the mismatch and successful
|
|
104
|
+
independent regeneration/manifest comparison. Preflight fingerprint fixtures were
|
|
105
|
+
updated deliberately. Exact Linux x64 CLI/helper attestations and freshly generated
|
|
106
|
+
stable/experimental schemas also passed in the disposable Linux VM using RosettaLinux
|
|
107
|
+
x64 translation; both raw hashes and canonical digests match Darwin. Simulated
|
|
108
|
+
target-selection tests are separately labeled and are not execution evidence.
|
|
109
|
+
|
|
110
|
+
## Verification and red/green evidence
|
|
111
|
+
|
|
112
|
+
Final full runs after the notification correction: Orchestra 1,585/1,604 tests passed
|
|
113
|
+
(19 N/A skips: 17 channel capabilities and two Codex capability cases), zero failures;
|
|
114
|
+
Polygram full run before the final Orchestra-only notification change:
|
|
115
|
+
4,791/4,807 passed (16 existing opt-in Claude skips), zero failures. Logs:
|
|
116
|
+
`/tmp/orchestra-codex-upgrade-final3-full.log` and
|
|
117
|
+
`/tmp/polygram-codex-upgrade-final2-full.log`. Linux target-selection simulation
|
|
118
|
+
passed all 35 preflight tests; this is not Linux execution. After the exact
|
|
119
|
+
notification fix, all 249 client/preflight/upgrade tests and 321 consumer Codex/
|
|
120
|
+
dependency-contract tests passed. Both diffs pass
|
|
121
|
+
`git diff --check`. Historical Codex fixture tests: 116 pass.
|
|
122
|
+
|
|
123
|
+
Concrete failures were pinned before fixes: strict hook metadata, exact account
|
|
124
|
+
notification/plan additions, missing helper admission, helper-selection shadow
|
|
125
|
+
layouts, drift during awaited spawn attestation, canonical instruction ownership,
|
|
126
|
+
and original owned-profile retention through registered admission. Red/green logs:
|
|
127
|
+
`/tmp/codex-upgrade-{hooks,account,plan}-{red,green}.log`,
|
|
128
|
+
`/tmp/codex-companion-{real,prespawn}-{red,green}.log`,
|
|
129
|
+
`/tmp/codex-companion-shadow-red.log`, `/tmp/codex-companion-green.log`,
|
|
130
|
+
`/tmp/polygram-codex-instructions-{red,green}.log`,
|
|
131
|
+
`/tmp/polygram-instruction-admission-{red,green}.log`.
|
|
132
|
+
|
|
133
|
+
Meaningful real-binary deterministic checks (zero external inference):
|
|
134
|
+
|
|
135
|
+
- Production Polygram builder/preflight/factory/CodexProcess/checkpoint path with
|
|
136
|
+
actual code-host tool execution and synthetic memory/skill read plus tool marker;
|
|
137
|
+
two loopback turns, four HTTP requests, two rejected WebSocket attempts followed
|
|
138
|
+
by HTTP fallback, 49 durable checkpoints. Fresh-process resume, ordered steer,
|
|
139
|
+
stale-steer rejection and authoritative JSONL readback passed:
|
|
140
|
+
`/tmp/codex-upgrade-tool-reviewed-fixture.log` (fixture-cgxO6L); final post-pin
|
|
141
|
+
repetition `/tmp/codex-upgrade-tool-final-fixture.log` (fixture-fOyxqr) passed
|
|
142
|
+
the same checks/counts.
|
|
143
|
+
- Real candidate hooks trust lifecycle: all 14 checks passed, credential free,
|
|
144
|
+
`/tmp/codex-upgrade-real-hooks-final.log`.
|
|
145
|
+
- Real limited sandbox: workspace read/write allowed; actual protected-home
|
|
146
|
+
config/auth/daemon-secret canary denied; external sandbox network blocked while
|
|
147
|
+
host loopback control succeeded, `/tmp/codex-upgrade-limited.log`.
|
|
148
|
+
- Old 0.145 synthetic rollout preserved, candidate fresh-process resume and
|
|
149
|
+
authoritative persisted readback passed, `/tmp/codex-upgrade-old-to-new.log`.
|
|
150
|
+
This raw transport characterization is separate from the full consumer fixture.
|
|
151
|
+
- Final candidate normal interrupt fixture passed exact terminal reconciliation,
|
|
152
|
+
background clean and fresh empty-page durable receipts:
|
|
153
|
+
`/tmp/codex-upgrade-interrupt-fixture.log`. Two completed synthetic turns plus
|
|
154
|
+
one intentionally interrupted turn, zero external inference.
|
|
155
|
+
- Helper attestation and delayed pre-spawn selection-shadow checks passed against
|
|
156
|
+
the actual candidate, `/tmp/codex-companion-prespawn-green.log`.
|
|
157
|
+
|
|
158
|
+
Loopback skill/memory execution is deterministic tool proof, not proof that a live
|
|
159
|
+
model independently followed root instructions or consumed discovered skill bodies
|
|
160
|
+
and unprompted synthetic shared memory. Separate actual provider evidence below
|
|
161
|
+
now completes those gates.
|
|
162
|
+
|
|
163
|
+
## Actual provider results and paid-call accounting
|
|
164
|
+
|
|
165
|
+
| Lane | Logical turns attempted | Completed | Result |
|
|
166
|
+
| --- | --- | --- | --- |
|
|
167
|
+
| Original native Astra | 1 | 0 | stopped on unexplained protocol fault |
|
|
168
|
+
| First authorized corrective native | 1 | 0 | stopped on uniquely matched metadata notification |
|
|
169
|
+
| Further explicitly authorized native after deterministic fix | 2 | 2 | passed |
|
|
170
|
+
| First independent CLIProxy Astra | 2 | 2 | passed |
|
|
171
|
+
| Total | 6 | 4 | two stopped lanes retained separately |
|
|
172
|
+
|
|
173
|
+
Transport/inference request-attempt counts are unknown; these logical-turn counts
|
|
174
|
+
are not billable-request counts. No blind paid retries occurred. The coordinator
|
|
175
|
+
explicitly authorized each corrective lane after reviewing evidence.
|
|
176
|
+
|
|
177
|
+
Final native evidence: `/tmp/codex-upgrade-native-final-live.log`, private
|
|
178
|
+
`live-DbxsvM`, 53 durable checkpoints. Final CLIProxy evidence:
|
|
179
|
+
`/tmp/codex-upgrade-cliproxy-live.log`, private `live-F8Tlq0`, 55 checkpoints.
|
|
180
|
+
Both use actual `gpt-6-astra`/high through the production consumer builder/preflight/
|
|
181
|
+
factory/CodexProcess. Both passed canonical root instruction consumption, discovered
|
|
182
|
+
skill-body nonce, unprompted synthetic shared-memory fact, actual shell tool marker,
|
|
183
|
+
completed turns, authoritative JSONL readback, fresh-process resume, accepted and
|
|
184
|
+
semantically consumed steer, and correlated durable request/start/terminal/delta
|
|
185
|
+
checkpoints/events. Native final safe trace directly captured exact
|
|
186
|
+
`turn/moderationMetadata` with threadId/turnId/metadata key names and no values,
|
|
187
|
+
confirming the earlier source/schema-backed inference. Live bot parity is not claimed.
|
|
188
|
+
|
|
189
|
+
The original failed lane `/tmp/codex-upgrade-native-live.log` (live-DvhDQ7) remains
|
|
190
|
+
unexplained at exact-method level; the helper omission was separate. The stopped
|
|
191
|
+
first corrective lane `/tmp/codex-upgrade-native-corrective.log` (live-HBJWiT)
|
|
192
|
+
produced one tool call/output before the inferred metadata rejection, no final
|
|
193
|
+
completion. Their failed results are not relabeled as successes by later passes.
|
|
194
|
+
The reviewed exact-drop correction has pending-RPC red/green privacy and unknown-
|
|
195
|
+
sibling regression proof in `/tmp/codex-moderation-{red,green}.log`.
|
|
196
|
+
|
|
197
|
+
CLIProxy used the existing private loopback Responses provider through SSH forwarding;
|
|
198
|
+
ChatGPT auth remained mandatory. Read-only `/v1/models` advertised Astra. Actual
|
|
199
|
+
WebSocket versus HTTP-fallback selection was not independently captured for the
|
|
200
|
+
live lanes; configured supports_websockets=true alone is not transport proof.
|
|
201
|
+
The deterministic fixture explicitly proves rejected WebSocket/HTTP fallback.
|
|
202
|
+
No production service changes. Probe auth clones remove refresh-token authority,
|
|
203
|
+
enforce bounded access expiry, and verify original auth unchanged. Bearer/account/
|
|
204
|
+
token values are never printed.
|
|
205
|
+
|
|
206
|
+
## Crash comparison and Linux scope inspection
|
|
207
|
+
|
|
208
|
+
The original fixture-qaDACI ran Darwin ARM64 27.0.0, direct binary under Orchestra's
|
|
209
|
+
Node supervisor, with no sessionLauncher. Its app-server PID 347/group 346 was
|
|
210
|
+
SIGKILLed; helper PID 374/group 374 exited; nested `/bin/sleep` PID 375/group 375
|
|
211
|
+
survived beyond eight seconds. The original log omitted platform and precise fault
|
|
212
|
+
timing; it is supplemented by explicit audited reproduction below.
|
|
213
|
+
|
|
214
|
+
Audited fixture-X7a0kn: same OS/launcher, app 6356/group6355, helper6386/group6386,
|
|
215
|
+
nested6387/group6387. No client fault before injection at1794473540531; protocol
|
|
216
|
+
fault followed at1794473540595 (+64ms). At1794473548600 nested6387 remained PPID1;
|
|
217
|
+
only the positively identified fixture process was killed. This injected crash does
|
|
218
|
+
not diagnose the earlier live protocol fault. Evidence:
|
|
219
|
+
`/tmp/codex-upgrade-crash-audited.log`; final repeated probe also records
|
|
220
|
+
authoritative post-cleanup absence in `/tmp/codex-upgrade-crash-final.log`.
|
|
221
|
+
|
|
222
|
+
Equivalent bounded ordinary FOREGROUND `command/exec` crash comparison used
|
|
223
|
+
`/bin/sh -c 'echo $$ > foreground.pid; exec /bin/sleep 30'` under the same production
|
|
224
|
+
supervisor, no session launcher, Darwin ARM64 27.0.0, Node26.5.0. Supervisor source
|
|
225
|
+
SHA `afb5da3227c42d3160e6c149523a5a94aeedff046fb561619c19901fa5366c45`.
|
|
226
|
+
|
|
227
|
+
| Runtime | Supervisor PID | App PID/group | Nested PID/group | After app SIGKILL |
|
|
228
|
+
| --- | --- | --- | --- | --- |
|
|
229
|
+
| Preserved 0.145.0 | 4767 | 4772/4767 | 4774/4774 | survives >8s, PPID1 |
|
|
230
|
+
| Candidate 0.167.2 | 4958 | 4969/4958 | 4988/4988 | survives >8s, PPID1 |
|
|
231
|
+
|
|
232
|
+
Exact old/new CLI identities are the hashes above. Both owned fixture commands were
|
|
233
|
+
identity/group/name checked, killed, and absence read back. Full observations and
|
|
234
|
+
injection timestamps: `/tmp/codex-upgrade-crash-compare.log`, private
|
|
235
|
+
`crash-compare-jHl4Xk/report.json`. This proves a shared Darwin hard-loss limitation,
|
|
236
|
+
not a demonstrated candidate regression. Baseline compatibility docs explicitly
|
|
237
|
+
accept arbitrary-descendant hard-loss limits with daemon-wide same-host reboot
|
|
238
|
+
quarantine (existing document lines29 and728). Normal interrupt/terminal/background
|
|
239
|
+
cleanup remains mandatory. Requiring every arbitrary descendant to disappear after
|
|
240
|
+
hard loss exceeds that documented baseline. Coordinator explicitly corrected this
|
|
241
|
+
upgrade-gate scope; the crash-cleanup observations remain failed.
|
|
242
|
+
|
|
243
|
+
Read-only production Linux inspection found systemd255.4 on x86_64 and installed
|
|
244
|
+
launcher `/usr/local/libexec/claude-session-scope`, SHA
|
|
245
|
+
`c84655092a93df6857ec9008892801ab3f0a020aa5643e5d9932d227c0fef60e`.
|
|
246
|
+
The infra template execs `systemd-run --user --scope --collect --quiet
|
|
247
|
+
--no-ask-password --description=contained-claude-session --expand-environment=no
|
|
248
|
+
--slice=claude.slice` with OOM/resource limits and stripped bus/tmux environment.
|
|
249
|
+
Parent Polygram passes ORCHESTRA_SESSION_LAUNCHER into Codex. Existing client
|
|
250
|
+
attests the launcher, but obtains no exact owned-unit identity or stop receipt.
|
|
251
|
+
|
|
252
|
+
Nine contained scopes existed. Two sampled active scopes had KillMode=control-group,
|
|
253
|
+
KillSignal=15, SendSIGKILL=yes, TimeoutStop=90s, RuntimeMax=infinity,
|
|
254
|
+
StopWhenUnneeded=no, BindsTo/PartOf empty, CollectMode=inactive-or-failed. The outer
|
|
255
|
+
production service has a distinct system.slice cgroup. No scopes were created,
|
|
256
|
+
killed or reconfigured; no prompts, environment secrets or raw journals were read.
|
|
257
|
+
|
|
258
|
+
A scope remains active while any process remains; `--collect` unloads inactive
|
|
259
|
+
units. KillMode applies when stopping the owned scope, not as evidence that a dead
|
|
260
|
+
app-server triggers that stop. No trap/unit-name/lifecycle acknowledgment establishes
|
|
261
|
+
such a stop here. The existing narrow grep RSS/D-state reaper does not supply
|
|
262
|
+
arbitrary orphan cleanup. These conclusions follow the exact source plus official
|
|
263
|
+
[scope](https://raw.githubusercontent.com/systemd/systemd/v255/man/systemd.scope.xml),
|
|
264
|
+
[systemd-run](https://raw.githubusercontent.com/systemd/systemd/v255/man/systemd-run.xml)
|
|
265
|
+
and [kill](https://raw.githubusercontent.com/systemd/systemd/v255/man/systemd.kill.xml)
|
|
266
|
+
semantics. Linux Codex source uses parent-death signaling for its direct child;
|
|
267
|
+
that is not executed Linux or arbitrary-descendant cleanup proof.
|
|
268
|
+
|
|
269
|
+
Initially no isolated Linux environment was running (Docker socket unavailable,
|
|
270
|
+
Colima stopped, no Lima instances). The authorized disposable environment described
|
|
271
|
+
below was subsequently created; no production scope changed. Reusing an exact
|
|
272
|
+
owned scope's stop lifecycle could be smaller than a general descendant supervisor,
|
|
273
|
+
but requires new unit identity/ownership/stop acknowledgment and reviewed alignment;
|
|
274
|
+
it is not an already proven facility. No containment implementation was added.
|
|
275
|
+
|
|
276
|
+
## Files and remaining prerequisites
|
|
277
|
+
|
|
278
|
+
Orchestra changed files: `lib/codex/{app-server-client.js,protocol-schema.json}`,
|
|
279
|
+
new `runtime-companion.js`; updated app-server/hook/preflight fixtures/tests; new
|
|
280
|
+
companion and runtime-upgrade tests plus `tests/fixtures/codex-app-server-0.167.2/`;
|
|
281
|
+
new companion/schema probes, historical spike diagnostic, this report, the spec
|
|
282
|
+
and compatibility-document historical banner.
|
|
283
|
+
Polygram child changed files: `lib/codex/{runtime-profile.js,runtime-controller.js}`,
|
|
284
|
+
binary/dependency/profile/controller/integration tests, and new
|
|
285
|
+
`scripts/spikes/codex-runtime-upgrade.mjs`. Source package manifests/locks unchanged.
|
|
286
|
+
Its node_modules contains the private local same-version Orchestra build only;
|
|
287
|
+
no registry publication or parent dependency write occurred.
|
|
288
|
+
|
|
289
|
+
Remaining: native Linux x64 CPU/sandbox and actual session-launcher crash/stop
|
|
290
|
+
validation; live WebSocket selection remains unproven; final
|
|
291
|
+
integration/release review and separately authorized packaging/deployment/activation.
|
|
292
|
+
Deployment and rollback require both exact-target CLI and companion as immutable
|
|
293
|
+
siblings, plus preserved 0.145 artifacts/config/package backups outside updater GC.
|
|
294
|
+
Nothing in this report claims live bot parity, native Linux sandbox/production
|
|
295
|
+
launcher cleanup, or production activation proof.
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
## Gate correction and corrective native result
|
|
299
|
+
|
|
300
|
+
Coordinator explicitly reconciled the new blanket descendant cleanup gate to the
|
|
301
|
+
accepted native-beta hard-loss/quarantine boundary. The failed crash observations
|
|
302
|
+
remain failures and an honest limitation. Existing normal interrupt/exact terminal
|
|
303
|
+
reconciliation/background clean/fresh empty-page tests and durable quarantine/no
|
|
304
|
+
silent replacement or new admission remain mandatory and passed in the full suite.
|
|
305
|
+
Relevant named regressions include `interrupt waits for exact terminal, clean,
|
|
306
|
+
fresh empty page, and durable stop checkpoints`, `strict clean resume rejects any
|
|
307
|
+
non-empty background terminal page`, and post-spawn fault quarantine tests.
|
|
308
|
+
|
|
309
|
+
The authorized corrective native lane stopped after one incomplete logical turn:
|
|
310
|
+
`/tmp/codex-upgrade-native-corrective.log`, private `live-HBJWiT`. It recorded an
|
|
311
|
+
actual code-mode tool call and output in authoritative JSONL, but no tool-proof
|
|
312
|
+
file and no completed turn. No root/skill-body/memory success is claimed. The
|
|
313
|
+
trace ends with unknown notification keys threadId/turnId/metadata; among the
|
|
314
|
+
generated candidate ServerNotification variants only turn/moderationMetadata has
|
|
315
|
+
that property set (also in the old schema). Exact candidate source forwards this
|
|
316
|
+
opaque provider metadata independently of terminal/errors/guardian decisions.
|
|
317
|
+
The trace masked unknown method names, so method attribution remains inferred
|
|
318
|
+
from the unique schema/source shape, not directly captured exact wire identity.
|
|
319
|
+
|
|
320
|
+
A reviewed narrow fix drops only that exact notification, retains unknown-sibling
|
|
321
|
+
rejection and does not expose metadata or grant new authority. The pending-RPC
|
|
322
|
+
regression reproduced CODEX_PROTOCOL_ERROR before the fix in
|
|
323
|
+
`/tmp/codex-moderation-red.log`. Diagnostic key/item strings are now closed-set
|
|
324
|
+
masked as well. The authorization for that single corrective lane ended when it stopped;
|
|
325
|
+
that stopped lane was not blindly repeated. Coordinator
|
|
326
|
+
then explicitly authorized one further bounded lane after reviewing the fix; its
|
|
327
|
+
completed result and the independent CLIProxy result are recorded above.
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
## Disposable Linux execution
|
|
331
|
+
|
|
332
|
+
Used cua-sandboxes guidance with a dedicated task CUA_HOME, embedded runtime and
|
|
333
|
+
separate state directory. No user/global cua, Colima or Lima home/config/lifecycle
|
|
334
|
+
was changed. The local Linux VM was ARM64 Ubuntu, kernel6.8.0-117-generic, with a
|
|
335
|
+
private Docker engine. Sandbox name codex-runtime-0167; x64 test container
|
|
336
|
+
codex-linux-x64. Node image node:26-bookworm-slim resolved to digest
|
|
337
|
+
sha256:5df79989ed685e09f0a98019db4cebfb22fb9df1a53c0161664a011f7ff6b0f1.
|
|
338
|
+
|
|
339
|
+
QEMU8.2.2 in this owned guest executed the exact x64 Codex CLI and generated matching
|
|
340
|
+
schemas, but crashed Node22 and26 before JavaScript execution. This is a translator
|
|
341
|
+
environment failure, not a demonstrated Codex regression. Existing Apple
|
|
342
|
+
VZLinuxRosettaDirectoryShare availability was installed; the task VM alone was
|
|
343
|
+
restarted via Lima's documented Rosetta support (no host installation). Colima's
|
|
344
|
+
Mac Rosetta receipt heuristic initially refused it; direct Lima correctly exposed
|
|
345
|
+
the already available Linux translator. QEMU's x64 binfmt handler was disabled
|
|
346
|
+
only inside this disposable guest so Rosetta could handle the test processes.
|
|
347
|
+
See [official Lima multi-architecture guidance](https://lima-vm.io/docs/config/multi-arch/).
|
|
348
|
+
|
|
349
|
+
Node22.23.5 x64 was downloaded from official nodejs.org with its SHASUMS256 check:
|
|
350
|
+
archive SHA cdeb8670a0c81f51b4dc4ac61919f9b1ad917b304bf8221eb939570663d240f8.
|
|
351
|
+
Actual process.platform=linux/process.arch=x64, no target overrides or injected
|
|
352
|
+
attestors. Corrected fixture file ownership after Docker cp (foreign uid502 was
|
|
353
|
+
correctly rejected); CLI/helper are root-owned secure test paths with exact hash checks.
|
|
354
|
+
The production schema probe passes CLI/helper attestation and both raw/canonical
|
|
355
|
+
manifest comparisons: /tmp/codex-linux-schema-probe.log. Linux raw hashes are now
|
|
356
|
+
recorded deliberately in the versioned manifest.
|
|
357
|
+
|
|
358
|
+
The consumer fixture initially stopped at account/read before any turn. The slim
|
|
359
|
+
container lacked its OS CA bundle; after installing ca-certificates in this
|
|
360
|
+
disposable container, the same fixture passed without changing auth or production
|
|
361
|
+
code. The final fixture
|
|
362
|
+
passed actual helper execution/tool marker, exact production profile/preflight/
|
|
363
|
+
factory, ChatGPT admission, two completed loopback turns, fresh-process resume,
|
|
364
|
+
ordered and stale steer checks, correlated persisted events, and a third
|
|
365
|
+
intentionally interrupted turn with exact terminal/clean/fresh empty-page receipts.
|
|
366
|
+
Counts:3 logical synthetic turns attempted,2 completed,1 intentionally interrupted;
|
|
367
|
+
5 loopback HTTP requests,2 rejected WebSocket attempts,68 checkpoints,0 external
|
|
368
|
+
inference. /tmp/codex-linux-consumer-green.log, fixture-mJlArb.
|
|
369
|
+
Private durable evidence:
|
|
370
|
+
`/Users/ivanshumkov/.local/share/orchestra-runtime-evidence/linux-translated-4ibjnazn`,
|
|
371
|
+
retaining report/checkpoints/synthetic rollouts/tool marker, excluding auth files. The clone had refresh authority removed; original source credentials
|
|
372
|
+
were never written.
|
|
373
|
+
|
|
374
|
+
These are actual translated Linux x64 CLI/helper/protocol/consumer executions on
|
|
375
|
+
an ARM64 Linux kernel. They do not establish native x64 CPU/seccomp/sandbox behavior
|
|
376
|
+
or the production systemd launcher lifecycle, and no Linux live inference was
|
|
377
|
+
performed. No production scope/service or shared host lifecycle was changed.
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
Cleanup: both positively owned containers were removed, the task VM stopped,
|
|
381
|
+
process inventory read back zero remaining processes referencing its exact state
|
|
382
|
+
root, and that private task CUA_HOME was removed after preserving evidence.
|
|
383
|
+
The task SSH forward was closed. Evidence cleanup.json records this readback;
|
|
384
|
+
no shared VM/service or production scope was stopped.
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
## Exact modified source paths
|
|
388
|
+
|
|
389
|
+
Orchestra:
|
|
390
|
+
|
|
391
|
+
- `docs/CODEX_RUNTIME_UPGRADE_REPORT.md`
|
|
392
|
+
- `docs/CODEX_RUNTIME_UPGRADE_SPEC.md`
|
|
393
|
+
- `docs/codex-app-server-compatibility.md`
|
|
394
|
+
- `lib/codex/app-server-client.js`
|
|
395
|
+
- `lib/codex/protocol-schema.json`
|
|
396
|
+
- `lib/codex/runtime-companion.js`
|
|
397
|
+
- `scripts/spikes/codex-app-server-real.mjs`
|
|
398
|
+
- `scripts/spikes/codex-runtime-companion-probe.mjs`
|
|
399
|
+
- `scripts/spikes/codex-runtime-schema-probe.mjs`
|
|
400
|
+
- `tests/codex-app-server-client.test.js`
|
|
401
|
+
- `tests/codex-hook-composition.test.js`
|
|
402
|
+
- `tests/codex-preflight.test.js`
|
|
403
|
+
- `tests/codex-runtime-companion.test.js`
|
|
404
|
+
- `tests/codex-runtime-upgrade.test.js`
|
|
405
|
+
- `tests/fixtures/codex-app-server-0.167.2/experimental-compatibility.schema.json`
|
|
406
|
+
- `tests/fixtures/codex-app-server-0.167.2/manifest.json`
|
|
407
|
+
- `tests/fixtures/codex-app-server-0.167.2/stable-compatibility.schema.json`
|
|
408
|
+
- `tests/fixtures/fake-codex-app-server.mjs`
|
|
409
|
+
|
|
410
|
+
Polygram child:
|
|
411
|
+
|
|
412
|
+
- `lib/codex/runtime-controller.js`
|
|
413
|
+
- `lib/codex/runtime-profile.js`
|
|
414
|
+
- `scripts/spikes/codex-runtime-upgrade.mjs`
|
|
415
|
+
- `tests/codex-binary.test.js`
|
|
416
|
+
- `tests/codex-runtime-controller.test.js`
|
|
417
|
+
- `tests/codex-runtime-integration.test.js`
|
|
418
|
+
- `tests/codex-runtime-profile.test.js`
|
|
419
|
+
- `tests/orchestra-dependency-contract.test.js`
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
# Codex runtime upgrade: 0.145.0 to 0.167.2
|
|
2
|
+
|
|
3
|
+
Status: implementation and amendments independently reviewed; crash-gate scope corrected by coordinator, bounded provider verification authorized, production unactivated. Detailed evidence: [upgrade report](CODEX_RUNTIME_UPGRADE_REPORT.md). Base: c195f2f96373c8c2cb6a86f5b6fa8ef70ae98431.
|
|
4
|
+
No Claude CLI/Agent SDK pins, package release versions, production configuration,
|
|
5
|
+
service state, publication, or existing parent worktrees may change.
|
|
6
|
+
|
|
7
|
+
## Problem and research
|
|
8
|
+
|
|
9
|
+
Ivan requested a runtime upgrade after trusted/proxy enablement. Orchestra currently
|
|
10
|
+
pins exact 0.145.0 target binaries and experimental v2 schema. Preserve the public
|
|
11
|
+
source interface, limited policy, trusted policy, provider selection, native ChatGPT
|
|
12
|
+
auth admission, model/effort catalog, hooks, durable event delivery, steer and resume.
|
|
13
|
+
|
|
14
|
+
Verified 2026-11-12: the official changelog and OpenAI release API identify
|
|
15
|
+
rust-v0.167.2 (non-prerelease, published 2026-11-11) as latest stable:
|
|
16
|
+
- https://learn.chatgpt.com/docs/changelog (Codex CLI 0.167.2)
|
|
17
|
+
- https://api.github.com/repos/openai/codex/releases/latest
|
|
18
|
+
- https://github.com/openai/codex/releases/tag/rust-v0.167.2
|
|
19
|
+
- https://developers.openai.com/codex/app-server
|
|
20
|
+
|
|
21
|
+
Downloaded official exact-tag source and Darwin ARM64 / Linux x64 musl releases
|
|
22
|
+
under /tmp/codex-runtime-upgrade-research; generated stable and experimental schemas
|
|
23
|
+
from the candidate under an empty isolated CODEX_HOME. Preserved the old Darwin
|
|
24
|
+
binary outside updater/vendor GC at ~/.local/share/orchestra-runtime-evidence/
|
|
25
|
+
codex-0.145.0/codex-aarch64-apple-darwin with the existing matching SHA-256.
|
|
26
|
+
Release notes for all stable versions in the delta and relevant exact-tag source
|
|
27
|
+
are reviewed before implementation; release evidence is summarized in the report.
|
|
28
|
+
|
|
29
|
+
Relevant upstream changes include permission restoration on resume, provider
|
|
30
|
+
validation, thread shutdown/start races, environment-scoped hooks, and command-hook
|
|
31
|
+
async metadata. Local source inspection covered compatibility docs, protocol schema,
|
|
32
|
+
preflight, factory, app-server client, CodexProcess, their immediate tests, Polygram
|
|
33
|
+
runtime profile and the minimal Shumabit spec. Candidate source:
|
|
34
|
+
codex-rs/app-server-protocol/src/protocol/v2/{thread,plugin,permissions}.rs and
|
|
35
|
+
codex-rs/protocol/src/permissions.rs.
|
|
36
|
+
|
|
37
|
+
## Decision and alternatives
|
|
38
|
+
|
|
39
|
+
Choose latest stable 0.167.2 subject to all gates below. Keeping 0.145.0 has the
|
|
40
|
+
strongest old evidence but does not fulfill the requested upgrade. The smallest
|
|
41
|
+
stable successor (0.146.0, verified from official release inventory) reduces the delta but omits
|
|
42
|
+
later permission/resume/provider fixes and still needs fresh binary/schema/live
|
|
43
|
+
attestation; prefer it only if a concrete incompatible candidate behavior prevents
|
|
44
|
+
preserving the agreed contract. Do not silently downgrade or relax policy.
|
|
45
|
+
|
|
46
|
+
Retain stdio app-server rather than switching SDK, exec, WebSocket RPC transport,
|
|
47
|
+
or a remote agent host. Those alternatives alter lifecycle and ownership without
|
|
48
|
+
helping this bounded runtime upgrade. Provider WebSocket transport remains the
|
|
49
|
+
existing supports_websockets=true configuration, independently of stdio RPC.
|
|
50
|
+
|
|
51
|
+
## Interface and data flow
|
|
52
|
+
|
|
53
|
+
Public constructors, receipts, factory selection, checkpoint sinks and process
|
|
54
|
+
state machine remain source-compatible. Update protocol-schema.json exact CLI
|
|
55
|
+
version, both target binary SHA-256 values and experimental v2 canonical digest.
|
|
56
|
+
Add a new versioned fixture/manifest with raw and canonical schema attestations;
|
|
57
|
+
keep the 0.145.0 observations historical and never relabel them as new evidence.
|
|
58
|
+
Use a dedicated candidate gate rather than transplanting old live observations.
|
|
59
|
+
The historical U1a checker must clearly identify its baseline when the active pin
|
|
60
|
+
has changed; its old fixture-unit tests remain historical tests.
|
|
61
|
+
|
|
62
|
+
Candidate schemas preserve required turn/steer fields and legacy sandbox variants.
|
|
63
|
+
Start/resume still expose experimental activePermissionProfile and
|
|
64
|
+
runtimeWorkspaceRoots; validate exact profile, owned root, model/provider, approval,
|
|
65
|
+
and sandbox through the production parser, for both fresh and persisted resume.
|
|
66
|
+
New thread metadata is not permission authority and is not exposed to consumers.
|
|
67
|
+
No new client methods, tools, server requests, or wildcard notification acceptance.
|
|
68
|
+
Any newly emitted notification requires source-backed explicit classification.
|
|
69
|
+
Candidate raw fresh/resume emits thread/readState/changed (source documented in
|
|
70
|
+
app-server README). It carries unread-state UI bookkeeping, not turn/checkpoint
|
|
71
|
+
ownership: add this exact method to dropped notifications with regression tests;
|
|
72
|
+
no wildcard acceptance or source payload exposure.
|
|
73
|
+
Authenticated startup also emits account/updated (account_processor.rs,
|
|
74
|
+
current_account_updated_notification); drop only this exact auth-mode/plan summary,
|
|
75
|
+
without forwarding account data. Explicit account/read remains the auth admission
|
|
76
|
+
authority, and unknown account notifications still fault.
|
|
77
|
+
|
|
78
|
+
Candidate PlanType adds promax, self_serve_business_prolite, ent26,
|
|
79
|
+
enterprise_cbp_automation, edu_plus, edu_pro, sci and sci_plus. Accept only
|
|
80
|
+
these exact schema enum additions; retain ChatGPT-only admission and omit email
|
|
81
|
+
and plan from the public account projection. Unknown values remain protocol errors.
|
|
82
|
+
|
|
83
|
+
HookMetadata now flattens a handler union. A command entry has handlerType=command,
|
|
84
|
+
command and async=false; environmentId must be present and null for our local owned
|
|
85
|
+
hooks. Extend the exact hook metadata verifier only for these observed/pinned
|
|
86
|
+
fields, require async strictly false, reject missing/non-null environmentId,
|
|
87
|
+
missing/true/nonboolean async, foreign handlers, and all unknown fields. Keep the
|
|
88
|
+
existing descriptor/receipt interface unchanged. Reconfirm the live raw shape
|
|
89
|
+
before editing; use a symptom-named failing fixture test before the fix.
|
|
90
|
+
|
|
91
|
+
Trusted filesystem remains exactly {glob_scan_max_depth:null, ':root':'write'}
|
|
92
|
+
(digest ce41c7bdb7f357798e0ce66850e28f87de7a8544bb13ce2cc029985aa41d852a),
|
|
93
|
+
with network enabled/web live; limited policy stays network/web disabled and
|
|
94
|
+
workspaceWrite with exact legacy exclusions/roots. A candidate shape change is a
|
|
95
|
+
stop requiring a reviewed spec amendment, not an extra accepted hash or stripped
|
|
96
|
+
unknown fields. Native memories remain disabled; shell inherits none, login false,
|
|
97
|
+
trusted actual service HOME/explicit PATH; limited mode retains its existing synthetic
|
|
98
|
+
command HOME and controlled PATH. CLIProxy remains optional, loopback Responses, private
|
|
99
|
+
bearer, requires_openai_auth=true, supports_websockets=true, no native fallback.
|
|
100
|
+
|
|
101
|
+
## Verification and failure handling
|
|
102
|
+
|
|
103
|
+
1. Offline: verify downloaded bytes, version, repeat schema generation, stable and
|
|
104
|
+
experimental canonical hashes and production-method parameter compatibility. Keep
|
|
105
|
+
Darwin and Linux evidence separate; compute Linux binary attestation locally and
|
|
106
|
+
run it/schema generation only on an isolated non-production Linux environment if
|
|
107
|
+
available. Never claim Linux execution from a downloaded-byte digest.
|
|
108
|
+
2. Deterministic credential-free fixtures: production client against real candidate
|
|
109
|
+
and bounded loopback Responses provider; exact config/layers/requirements/profile,
|
|
110
|
+
trusted and limited fresh attachment, completed turn/event delivery, authoritative
|
|
111
|
+
JSONL persistence, fresh-process resume, ordered steering/stale steer, interruption
|
|
112
|
+
and background-terminal cleanup. Limited mode must also enforce successful synthetic workspace access and denied
|
|
113
|
+
CODEX_HOME/daemon-secret reads and denied network; serialized policy is insufficient.
|
|
114
|
+
Use held fixture responses for deterministic
|
|
115
|
+
active-turn windows; keep all synthetic commands bounded. Prove old synthetic
|
|
116
|
+
rollout can resume under candidate, retaining an untouched old copy.
|
|
117
|
+
At least one candidate fixture must traverse production preflight -> spawn receipt
|
|
118
|
+
-> factory/CodexProcess -> acknowledged on-disk checkpoint sink, with authoritative
|
|
119
|
+
checkpoint readback; a no-op client sink cannot establish this integration layer.
|
|
120
|
+
Credential-free fixture-only providers may set requires_openai_auth=false; that
|
|
121
|
+
exception never clears production native ChatGPT-auth admission, which is proved
|
|
122
|
+
separately using the exact native/CLIProxy policy.
|
|
123
|
+
3. Hooks: run existing hooks-on/off production-client gate against candidate; raw
|
|
124
|
+
inventory characterization before exact verifier update, red/green fixture tests,
|
|
125
|
+
negative metadata tests, trusted inventory and content-free event dropping.
|
|
126
|
+
4. Actual providers: use only private existing auth, isolated persistent test homes
|
|
127
|
+
and synthetic workspaces. Do not print tokens or account identifiers. Planned
|
|
128
|
+
calls: one native Astra tools/skills/shared-memory turn; one fresh-process native
|
|
129
|
+
resume/steer turn; one CLIProxy Astra tools turn plus fresh-process resume turn if
|
|
130
|
+
accessible. Retain exact requested model and catalog effort; count inference
|
|
131
|
+
requests, distinguish logical turns and transport attempts, record ambiguous
|
|
132
|
+
outcomes and stop that lane without a blind retry. Inspect provider WebSocket/HTTP
|
|
133
|
+
behavior from safe transport metadata; a fixture is not real-provider evidence.
|
|
134
|
+
Skill-body consumption and shared memory use synthetic files only, no business data.
|
|
135
|
+
Require a nonce present only in a discovered harmless skill body, and fresh-session
|
|
136
|
+
recall of a synthetic fact through AGENTS instructions without naming its memory
|
|
137
|
+
file or repeating the fact in the prompt. Native transport attempts can be opaque:
|
|
138
|
+
report their count as unknown, separately from observed logical turns/tool rounds.
|
|
139
|
+
Each provider scenario has a 120-second deadline and bounded process cleanup;
|
|
140
|
+
missing native held-turn setup is explicitly inconclusive, not a steering failure.
|
|
141
|
+
5. Run focused production-client/preflight/factory/process/hook suites and full
|
|
142
|
+
Orchestra tests. The consumer gate is required: create a related
|
|
143
|
+
Polygram child through Orca based on 960b0be3b191f5a336bab8d5d6577d411c548a3a,
|
|
144
|
+
notify coordinator of its path, build/install a local unpublished package only in
|
|
145
|
+
that child, and run candidate profile-builder/preflight plus admission/revocation/catalog/event tests. No parent
|
|
146
|
+
writes or release version bump. Finish independent diff reviews, resolve must-fixes.
|
|
147
|
+
|
|
148
|
+
Credential access failure, unsupported runtime policy/provenance, new protocol
|
|
149
|
+
traffic without a safe explicit interpretation, or ambiguous inference stops the
|
|
150
|
+
relevant lane with concrete evidence. Keep failures and unproven layers visible.
|
|
151
|
+
Local tests are not activation, VPS deployment, or live bot parity proof. Retain
|
|
152
|
+
uncommitted reviewable changes and a final report with attestations, checks/skips,
|
|
153
|
+
red/green evidence, actual call counts, review decisions and release prerequisites.
|
|
154
|
+
|
|
155
|
+
## Approved instruction-source amendment
|
|
156
|
+
|
|
157
|
+
Exact candidate core/src/agents_md.rs:64 skips project instructions whenever
|
|
158
|
+
active_project.is_untrusted(). Version 0.150.0 introduced this security behavior.
|
|
159
|
+
Polygram deliberately writes trust_level="untrusted" to prevent project config and
|
|
160
|
+
thread/start from mutating owned config. Exact candidate app-server
|
|
161
|
+
src/request_processors/thread_processor.rs:1480 onward automatically persists
|
|
162
|
+
trusted project state when trust is absent and effective permissions allow writes.
|
|
163
|
+
Coordinator authorized the narrow dedicated-home symlink adaptation on 2026-11-12.
|
|
164
|
+
Retain explicit untrusted; do not downgrade to preserve the old loading mechanism.
|
|
165
|
+
Nested project AGENTS.md files are skipped by this runtime under untrusted; the
|
|
166
|
+
approved scope restores the canonical workspace root only, with no recursive merge.
|
|
167
|
+
|
|
168
|
+
Existing ownership flow: runtime-profile provisionRuntimeFiles canonicalizes the
|
|
169
|
+
workspace and dedicated owner-only non-temporary home, enforces root separation,
|
|
170
|
+
then provisionBaseConfig validates the exact owned config including its one
|
|
171
|
+
workspace trust stanza. A differing workspace already produces config drift;
|
|
172
|
+
hook preparation also owns home/workspace artifacts. Retain these authoritative
|
|
173
|
+
checks rather than creating another home registry or router.
|
|
174
|
+
|
|
175
|
+
Before provisionRuntimeFiles or any other provisioning mutation:
|
|
176
|
+
- Reject the actual user global Codex home (process user's ~/.codex), plus any
|
|
177
|
+
CODEX_HOME equal to the service HOME's .codex; only the dedicated Polygram home.
|
|
178
|
+
After exact owned config ownership validation, prepare the root instruction reference:
|
|
179
|
+
- If workspace/AGENTS.md exists, require a canonical regular owner-controlled file
|
|
180
|
+
(no symlink, group/other writes, or hard-link alias) and safe parent chain. Create
|
|
181
|
+
CODEX_HOME/AGENTS.md with exclusive symlink creation only if absent; otherwise
|
|
182
|
+
require it already be a symlink resolving directly to exactly that file. Never
|
|
183
|
+
replace a regular file, retarget a link, or follow a foreign/dangling alias.
|
|
184
|
+
- If the canonical root is absent, allow the existing limited generic workspace
|
|
185
|
+
without instructions, but trusted mode requires the canonical root. No home
|
|
186
|
+
AGENTS.md may exist in the absent-root case. Reject CODEX_HOME/AGENTS.override.md
|
|
187
|
+
whether regular, symlink or dangling. Do not create or change workspace files.
|
|
188
|
+
- Keep a private profile binding in the builder's existing ownership mechanism,
|
|
189
|
+
without adding public Orchestra receipt fields, content hashes or snapshots.
|
|
190
|
+
Re-attest path/type/target/override state after awaited characterization, after
|
|
191
|
+
preflight, on cached receipt use, client construction and shared live admission.
|
|
192
|
+
Root content edits remain live canonical edits and do not invalidate the profile;
|
|
193
|
+
replacing/retargeting the link, introducing an override, deleting/introducing the root, or
|
|
194
|
+
reusing the dedicated home for another workspace rejects new admissions.
|
|
195
|
+
- Reuse the existing builder reattest seam and controller assertEntryCurrent seam.
|
|
196
|
+
No per-chat home routing, recursive instruction merger, copied content, or new
|
|
197
|
+
persistent binding file. Exact owned config remains the persisted home/workspace
|
|
198
|
+
ownership authority and symlink target is the instruction binding readback.
|
|
199
|
+
|
|
200
|
+
Tests must reproduce canonical-root absence/foreign-target/override/workspace-reuse
|
|
201
|
+
failures before the fix; verify no existing path gets overwritten, global home is
|
|
202
|
+
refused before writes, normal canonical content edits survive re-attestation,
|
|
203
|
+
async preflight link drift and warm live admission drift are refused. Actual fresh
|
|
204
|
+
root marker, discovered skill-only nonce and unprompted synthetic memory recall
|
|
205
|
+
remain acceptance gates. All filesystem writes use isolated test homes/workspaces.
|
|
206
|
+
|
|
207
|
+
## Independent review receipts
|
|
208
|
+
|
|
209
|
+
Three built-in read-only reviewers completed before runtime edits: protocol and
|
|
210
|
+
feasibility; validation and provider evidence; scope, simplicity and security.
|
|
211
|
+
Must-fixes folded above: mandatory Polygram candidate boundary, distinct limited
|
|
212
|
+
HOME policy, production factory/process/persisted-checkpoint integration, exact
|
|
213
|
+
skill-only nonce and unprompted synthetic recall, provider count/deadline semantics,
|
|
214
|
+
fixture-only auth exception, and candidate limited filesystem/network enforcement.
|
|
215
|
+
The coordinator approved the narrow instruction-source adaptation. Protocol reviewer confirmed
|
|
216
|
+
candidate codex-home/src/instructions/mod.rs:42-76 loads CODEX_HOME/AGENTS.md before
|
|
217
|
+
project instructions and independently of project trust, while repository skill
|
|
218
|
+
host roots have no equivalent trust guard. Recommended narrow alternative:
|
|
219
|
+
retain explicit untrusted and symlink only the dedicated CODEX_HOME/AGENTS.md to
|
|
220
|
+
the canonical workspace AGENTS.md, require AGENTS.override.md absent, never copy
|
|
221
|
+
or translate instructions, and verify fresh root/skill/memory consumption. This
|
|
222
|
+
changes root instruction sourcing only within the approved canonical-root scope.
|
|
223
|
+
|
|
224
|
+
## Initial characterization (not production integration proof)
|
|
225
|
+
|
|
226
|
+
Candidate Darwin SHA-256:
|
|
227
|
+
97bc82fd46f117cf10efb95e6ff0c81dc4784f5797bcdc2cb75093ba09e4def0.
|
|
228
|
+
Downloaded Linux musl SHA-256 (not executed):
|
|
229
|
+
a9672d0fa0dd8fcf8cad136fa0d056b914bc046f5ac3d78f4a5cf390655af56b.
|
|
230
|
+
Darwin generated stable v2 canonical SHA-256:
|
|
231
|
+
3acaab0f5788b486250d8e32f75ae5e98198c63090a500c04182df52f0c8f137.
|
|
232
|
+
Darwin generated experimental v2 canonical SHA-256:
|
|
233
|
+
ca9811bd8310c9576f2acc1c37ba132afeef49c0cdbc3e02908b64ad12126163.
|
|
234
|
+
Raw bounded synthetic loopback characterization passed trusted filesystem shape,
|
|
235
|
+
start, completed turn, JSONL readback and fresh-process resume at
|
|
236
|
+
/private/tmp/polygram-trusted-resume-20o8NR/observation.json. This bypasses the
|
|
237
|
+
production parser/preflight and uses synthetic auth, so does not clear them.
|
|
238
|
+
At this initial characterization stage: one synthetic loopback logical turn and zero
|
|
239
|
+
actual provider calls. Later provider accounting is in the report.
|
|
240
|
+
Related Polygram child created through Orca at
|
|
241
|
+
/Users/ivanshumkov/orca/workspaces/polygram/codex-runtime-compat,
|
|
242
|
+
base HEAD 960b0be3b191f5a336bab8d5d6577d411c548a3a. Subsequent consumer
|
|
243
|
+
implementation and verification are recorded in the report.
|
|
244
|
+
|
|
245
|
+
Amendment re-review: protocol/feasibility and security/scope reviewers accepted
|
|
246
|
+
the design after moving the dedicated-home guard before all provisioning writes.
|
|
247
|
+
Both reviewers required that ordering; the scope reviewer also added the
|
|
248
|
+
absent-root to root-created drift regression. These corrections are incorporated.
|
|
249
|
+
|
|
250
|
+
## Companion executable amendment (approved and independently reviewed)
|
|
251
|
+
|
|
252
|
+
The first native Astra turn reached inference, emitted its intended calibration
|
|
253
|
+
commentary, and was contained on a protocol fault before tool completion. It is
|
|
254
|
+
not a successful provider gate and must not be blindly retried. Loopback tool
|
|
255
|
+
reproduction then exposed a separate concrete distribution requirement: 0.167.2
|
|
256
|
+
code mode needs `codex-code-mode-host`, shipped as a separate official release
|
|
257
|
+
asset; the single CLI archive omits it. An initial output-only fixture was
|
|
258
|
+
insufficient because the model can return text after a failed tool invocation.
|
|
259
|
+
The strengthened gate must assert the synthetic tool marker exists.
|
|
260
|
+
|
|
261
|
+
Exact-tag source: install-context/src/lib.rs:175-205 resolves the code host from
|
|
262
|
+
packaged resources first, then beside the executable; core/src/thread_manager.rs
|
|
263
|
+
selects the host-backed runtime. The code host creates its own process group;
|
|
264
|
+
kill-on-drop is useful evidence but does not by itself establish containment.
|
|
265
|
+
Required validation includes successful tool output and cleanup with the companion,
|
|
266
|
+
plus SIGKILL of the app-server itself while a bounded synthetic tool is active.
|
|
267
|
+
Observe the code-host PID/group and actual nested command PID; verify both exit
|
|
268
|
+
independently of the supervisor-group proof, and report survivors as blockers.
|
|
269
|
+
|
|
270
|
+
Proposed narrow implementation: retain public runtime/profile/receipt interfaces,
|
|
271
|
+
but treat the code host as another exact pinned executable of the selected target
|
|
272
|
+
inside the existing binary attestation/start boundary. Validate its canonical
|
|
273
|
+
path chain, owner/mode/nlink/executable status and exact hash using the existing
|
|
274
|
+
rules. Resolve only the upstream documented plain standalone sibling layout for
|
|
275
|
+
this bounded release; reject competing codex-resources or package-metadata layouts
|
|
276
|
+
rather than accepting a different helper silently. Bind the companion fingerprint and helper-selection layout privately, recheck
|
|
277
|
+
after initial attestation/spawn and before state-changing request writes because
|
|
278
|
+
upstream launches it lazily. Test missing/tampered companion, replacement after
|
|
279
|
+
startup, and late resource/package-metadata shadow introduction. Record both target companion
|
|
280
|
+
hashes in the pin manifest. Do not disable code mode, choose alternate tools, add
|
|
281
|
+
RPC methods, weaken filesystem policy, or accept arbitrary helper paths.
|
|
282
|
+
|
|
283
|
+
Alternatives: disable code mode and force direct tools (changes native model/tool
|
|
284
|
+
behavior and can fail closed for CodeModeOnly models); use an earlier stable candidate (legitimate fallback if evidenced compatible, but
|
|
285
|
+
requires its own artifact/schema/provider gates and does not yet solve this issue);
|
|
286
|
+
accept helper presence without exact attestation (weakens executable identity).
|
|
287
|
+
If supported helper selection or cleanup cannot be proved within this boundary,
|
|
288
|
+
stop before release/activation and report the specific blocker.
|
|
289
|
+
|
|
290
|
+
Official companion downloaded-byte SHA-256 values:
|
|
291
|
+
Darwin ARM64 45acdb759c3ac0a6b30a5107329b364b7ac1579f2cdf270997f03bc8d6365ef6;
|
|
292
|
+
Linux x64 musl 007c62795a7215c27ee85486ecb95e714b33118a2d18c6d7b09b0d9793c72ff4.
|
|
293
|
+
Linux remains byte-attested only. A paid retry requires coordinator permission
|
|
294
|
+
because the prior live action failed; the corrective retry will be bounded to
|
|
295
|
+
one fresh two-turn native lane after the deterministic tool/cleanup gate passes.
|
|
296
|
+
|
|
297
|
+
Companion amendment review: protocol and scope/security reviewers accepted the
|
|
298
|
+
narrow approach with the lazy-spawn fingerprint/layout fence and explicit
|
|
299
|
+
SIGKILL/host/nested-command cleanup checks above. Native live fault diagnosis
|
|
300
|
+
remains separate from the verified missing-helper distribution requirement.
|
|
301
|
+
|
|
302
|
+
Coordinator approval: exact official companion dependency and ONE corrective
|
|
303
|
+
native diagnostic lane (at most two turns) are authorized after deterministic
|
|
304
|
+
helper/tool/SIGKILL cleanup gates. No production installation is authorized.
|
|
305
|
+
Deployment and rollback must preserve both exact-target standalone artifacts:
|
|
306
|
+
`codex` and sibling `codex-code-mode-host`, immutable and owned under the same
|
|
307
|
+
secure versioned directory; include Darwin ARM64 and Linux x64 musl hashes above.
|
|
308
|
+
Do not install only the CLI archive or mix helper versions. Keep the old 0.145
|
|
309
|
+
runtime directory and its source/package/config backups outside updater GC;
|
|
310
|
+
rollback selects those preserved artifacts rather than overwriting candidate files.
|
|
311
|
+
Before any production step, Linux execution/schema/helper/cleanup proof and the
|
|
312
|
+
existing deploy/admission checks remain mandatory. The helper selection contract
|
|
313
|
+
currently excludes npm/package/resource layouts; activation must use the reviewed
|
|
314
|
+
plain standalone sibling layout.
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
## Bounded crash comparison and current hold
|
|
318
|
+
|
|
319
|
+
The stricter companion SIGKILL gate failed on Darwin: the host exits but a nested
|
|
320
|
+
foreground sleep survives. Equivalent bounded direct foreground command crashes
|
|
321
|
+
on preserved 0.145.0 and candidate 0.167.2 show the same orphan beyond eight
|
|
322
|
+
seconds, using the production Node supervisor and no session launcher. This is
|
|
323
|
+
evidence of an existing hard-loss limitation, not a demonstrated candidate
|
|
324
|
+
regression. The existing compatibility document explicitly accepts arbitrary
|
|
325
|
+
descendant hard-loss limits with same-host reboot quarantine. A blanket new
|
|
326
|
+
descendant guarantee exceeds that accepted baseline and requires explicit
|
|
327
|
+
alignment; it must not be silently introduced or silently waived.
|
|
328
|
+
|
|
329
|
+
Production Linux source/read-only inspection finds systemd scope membership and
|
|
330
|
+
resource limits, but no exact owned-unit stop acknowledgment or app-server-death
|
|
331
|
+
trigger. Scope collection does not kill an active orphan. No isolated Linux
|
|
332
|
+
execution has been performed. A new owned-scope lifecycle might be narrower than
|
|
333
|
+
a general supervisor, but it changes ownership/lifecycle and is outside the
|
|
334
|
+
current implementation without reviewed alignment. Exact 0.145/0.146 source already
|
|
335
|
+
enables code-mode hosting; the smallest stable successor has no evidenced cure.
|
|
336
|
+
|
|
337
|
+
Keep 0.167.2 unactivated and both remaining paid lanes held while reporting these
|
|
338
|
+
comparisons. Prefer finishing the candidate under the existing accepted boundary
|
|
339
|
+
if explicitly aligned; no blind retry or containment expansion. The report records
|
|
340
|
+
exact identities, cleanup readback, native-attempt accounting, tests, limitations
|
|
341
|
+
and release prerequisites.
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
## Accepted containment boundary after comparison
|
|
345
|
+
|
|
346
|
+
Coordinator explicitly aligned the upgrade gate to the existing native-beta
|
|
347
|
+
hard-loss/quarantine contract. This corrects the newly introduced blanket
|
|
348
|
+
arbitrary-descendant guarantee; it does not turn the failed SIGKILL cleanup
|
|
349
|
+
observations into passes. Preserve both logs and limitation. Normal interrupt,
|
|
350
|
+
exact terminal reconciliation, background clean and fresh empty-page checks,
|
|
351
|
+
durable hard-loss quarantine, and no silent replacement/admission remain required.
|
|
352
|
+
No new containment subsystem or downgrade is justified by the shared result.
|
|
353
|
+
|
|
354
|
+
The one corrective fresh native lane (at most two logical turns) and first
|
|
355
|
+
independent CLIProxy lane are released under existing paid authorization. Stop a
|
|
356
|
+
lane after another unexplained or ambiguous result; no blind retry. After provider
|
|
357
|
+
diagnosis, pursue disposable non-production Linux validation without production
|
|
358
|
+
scope/service changes, shared host lifecycle changes, or paid cloud provisioning.
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
## Native diagnostic notification amendment
|
|
362
|
+
|
|
363
|
+
The one corrective native lane stopped after one incomplete logical turn with
|
|
364
|
+
CODEX_PROTOCOL_ERROR and no retry. Its content-free tail ends with an unknown
|
|
365
|
+
notification carrying exactly threadId, turnId and metadata. Among all generated
|
|
366
|
+
ServerNotification variants, only turn/moderationMetadata has that property set
|
|
367
|
+
(in both old and candidate schemas). The trace deliberately masked unknown method
|
|
368
|
+
names, so this is source/schema-backed attribution by shape, not captured exact
|
|
369
|
+
wire-method proof. The host now ran a tool call/output, so the earlier missing
|
|
370
|
+
companion does not explain this separate protocol omission.
|
|
371
|
+
|
|
372
|
+
Exact candidate protocol/common.rs declares experimental turn/moderationMetadata;
|
|
373
|
+
v2/model.rs defines its opaque JSON metadata. core/session/turn.rs forwards the
|
|
374
|
+
provider event to session/mod.rs, and app-server/bespoke_event_handling.rs forwards
|
|
375
|
+
it directly as this notification. It is observational provider metadata, does not
|
|
376
|
+
request authority, and is distinct from errors, terminal status or guardian
|
|
377
|
+
assessment. The existing protocol subset omitted it even though the old schema
|
|
378
|
+
also contains it.
|
|
379
|
+
|
|
380
|
+
Narrow correction: classify only this exact notification as dropped, preserving
|
|
381
|
+
existing envelope checks and privacy; do not expose opaque metadata, add methods,
|
|
382
|
+
accept wildcard siblings, or bypass actual error/terminal handling. Add the exact
|
|
383
|
+
observed parameter shape to a pending-RPC fixture; prove rejection before the pin
|
|
384
|
+
change and healthy completion with zero delivered payload afterward. Add a sibling
|
|
385
|
+
unknown turn notification negative. Alternative: opt out at initialization, which
|
|
386
|
+
changes startup negotiation without benefiting this static exact-drop policy;
|
|
387
|
+
delivering opaque metadata adds unnecessary public surface. Native corrective
|
|
388
|
+
authorization is exhausted by its stopped lane; no automatic repeat. The first
|
|
389
|
+
independent CLIProxy lane remains unused and can run after this deterministic fix.
|
|
390
|
+
|
|
391
|
+
Improve content-free tracing with closed source-backed method/key/item-type sets;
|
|
392
|
+
unknown names and key names remain redacted (retaining counts/types). Add only the
|
|
393
|
+
new exact source-backed method to the existing recognizer for this fix. Never
|
|
394
|
+
record arbitrary item-type/key strings or metadata/prompt values.
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
## Native correction validation authorization and result
|
|
398
|
+
|
|
399
|
+
After reviewing the exact-drop fix and red/green evidence, coordinator authorized
|
|
400
|
+
one further fresh native lane, at most two turns. It completed both turns with
|
|
401
|
+
actual Astra tools, canonical root instruction marker, discovered skill-body
|
|
402
|
+
nonce, unprompted synthetic memory, authoritative JSONL, fresh-process resume,
|
|
403
|
+
semantic steer and durable event correlation. The now-allowlisted trace captured
|
|
404
|
+
exact turn/moderationMetadata with keys only, confirming method identity without
|
|
405
|
+
metadata values. Independent first CLIProxy lane also completed both turns.
|
|
406
|
+
Provider transport attempt counts remain unknown. No production activation.
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
## Linux translated execution evidence boundary
|
|
410
|
+
|
|
411
|
+
A task-owned local cua/Lima VM and private Docker engine supplied ARM64 Linux
|
|
412
|
+
with the already-installed RosettaLinux translator. Exact pinned Linux x64 CLI
|
|
413
|
+
and companion passed production attestation, raw/canonical schema regeneration
|
|
414
|
+
(matches Darwin), and the real consumer fixture with helper tools, fresh resume,
|
|
415
|
+
steer, durable events and normal interrupt/terminal/clean/fresh-empty receipts.
|
|
416
|
+
Node22.23.5 x64 ran without target overrides or injected attestors. No Linux
|
|
417
|
+
external inference or production launcher changes. This is translated execution,
|
|
418
|
+
not native x64 CPU/seccomp/sandbox or systemd scope cleanup proof. Preserve that
|
|
419
|
+
limitation for release/activation; no blanket descendant guarantee is added.
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Date: 2026-07-26
|
|
4
4
|
|
|
5
|
+
This is historical 0.145.0 evidence. The unactivated 0.167.2 candidate,
|
|
6
|
+
independent gates and remaining blockers are recorded in
|
|
7
|
+
[the upgrade spec](CODEX_RUNTIME_UPGRADE_SPEC.md) and
|
|
8
|
+
[the upgrade report](CODEX_RUNTIME_UPGRADE_REPORT.md).
|
|
9
|
+
|
|
5
10
|
Scope: U1a core protocol, steering, healthy stop, isolation, accepted
|
|
6
11
|
native-beta containment contract, and U1b operational/security
|
|
7
12
|
characterization
|
|
@@ -13,6 +13,10 @@ const os = require('node:os');
|
|
|
13
13
|
const path = require('node:path');
|
|
14
14
|
const { StringDecoder } = require('node:string_decoder');
|
|
15
15
|
const { promisify } = require('node:util');
|
|
16
|
+
const { attestRuntimeCompanion, assertRuntimeCompanion } = require('./runtime-companion');
|
|
17
|
+
|
|
18
|
+
const COMPANION_ATTESTATIONS = new WeakMap();
|
|
19
|
+
const CLIENT_COMPANIONS = new WeakMap();
|
|
16
20
|
|
|
17
21
|
function deepFreeze(value) {
|
|
18
22
|
if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value;
|
|
@@ -129,17 +133,19 @@ const HOOK_METADATA_REQUIRED_FIELDS = Object.freeze([
|
|
|
129
133
|
'timeoutSec',
|
|
130
134
|
'trustStatus',
|
|
131
135
|
]);
|
|
132
|
-
//
|
|
136
|
+
// Nullable local-hook metadata is reported on every entry. A missing or
|
|
133
137
|
// populated one means the reported shape is not the shape this pin was built
|
|
134
138
|
// against, which is a refusal rather than something to interpret.
|
|
135
139
|
const HOOK_METADATA_NULL_OPTIONAL_FIELDS = Object.freeze([
|
|
136
140
|
'additionalContextLimit',
|
|
137
141
|
'matcher',
|
|
142
|
+
'environmentId',
|
|
138
143
|
'pluginId',
|
|
139
144
|
'statusMessage',
|
|
140
145
|
]);
|
|
141
146
|
const HOOK_METADATA_FIELDS = Object.freeze([
|
|
142
147
|
...HOOK_METADATA_REQUIRED_FIELDS,
|
|
148
|
+
'async',
|
|
143
149
|
...HOOK_METADATA_NULL_OPTIONAL_FIELDS,
|
|
144
150
|
'command',
|
|
145
151
|
]);
|
|
@@ -527,13 +533,18 @@ async function attestPinnedCodexBinary(
|
|
|
527
533
|
'CODEX_BINARY_MISMATCH',
|
|
528
534
|
);
|
|
529
535
|
}
|
|
530
|
-
|
|
536
|
+
const companion = await attestRuntimeCompanion(
|
|
537
|
+
binary, protocolSchema.codeModeHostSha256ByTarget[targetReceipt.target],
|
|
538
|
+
);
|
|
539
|
+
const attestation = {
|
|
531
540
|
path: binary,
|
|
532
541
|
target: targetReceipt.target,
|
|
533
542
|
sha256,
|
|
534
543
|
version: stdout.trim(),
|
|
535
544
|
fingerprint,
|
|
536
545
|
};
|
|
546
|
+
COMPANION_ATTESTATIONS.set(attestation, companion);
|
|
547
|
+
return attestation;
|
|
537
548
|
}
|
|
538
549
|
|
|
539
550
|
async function characterizePinnedSessionLauncher(launcher) {
|
|
@@ -1599,12 +1610,20 @@ function projectRpcResult(method, value, ownedCwd) {
|
|
|
1599
1610
|
'plus',
|
|
1600
1611
|
'pro',
|
|
1601
1612
|
'prolite',
|
|
1613
|
+
'promax',
|
|
1602
1614
|
'team',
|
|
1615
|
+
'self_serve_business_prolite',
|
|
1603
1616
|
'self_serve_business_usage_based',
|
|
1604
1617
|
'business',
|
|
1618
|
+
'ent26',
|
|
1619
|
+
'enterprise_cbp_automation',
|
|
1605
1620
|
'enterprise_cbp_usage_based',
|
|
1606
1621
|
'enterprise',
|
|
1607
1622
|
'edu',
|
|
1623
|
+
'edu_plus',
|
|
1624
|
+
'edu_pro',
|
|
1625
|
+
'sci',
|
|
1626
|
+
'sci_plus',
|
|
1608
1627
|
'unknown',
|
|
1609
1628
|
].includes(planType)) {
|
|
1610
1629
|
throw new CodexAppServerError(
|
|
@@ -1939,7 +1958,8 @@ function hookEntryMatches(hook, descriptor, expectedTrustStatus) {
|
|
|
1939
1958
|
if (hook[field] !== null) return false;
|
|
1940
1959
|
}
|
|
1941
1960
|
if (
|
|
1942
|
-
|
|
1961
|
+
hook.async !== false
|
|
1962
|
+
|| typeof hook.command !== 'string'
|
|
1943
1963
|
|| createHash('sha256').update(hook.command).digest('hex')
|
|
1944
1964
|
!== descriptor.commandSha256
|
|
1945
1965
|
) return false;
|
|
@@ -2661,6 +2681,11 @@ class CodexAppServerClient extends EventEmitter {
|
|
|
2661
2681
|
'CODEX_CLIENT_CLOSED',
|
|
2662
2682
|
);
|
|
2663
2683
|
}
|
|
2684
|
+
const companion = COMPANION_ATTESTATIONS.get(attestation);
|
|
2685
|
+
if (companion) {
|
|
2686
|
+
assertRuntimeCompanion(companion);
|
|
2687
|
+
CLIENT_COMPANIONS.set(this, companion);
|
|
2688
|
+
}
|
|
2664
2689
|
this.child = this.spawnFn(command, commandArgs, {
|
|
2665
2690
|
cwd: this.cwd,
|
|
2666
2691
|
env: this.env,
|
|
@@ -2720,6 +2745,7 @@ class CodexAppServerClient extends EventEmitter {
|
|
|
2720
2745
|
'CODEX_CONFIG_MISMATCH',
|
|
2721
2746
|
);
|
|
2722
2747
|
}
|
|
2748
|
+
if (companion) assertRuntimeCompanion(companion);
|
|
2723
2749
|
this.state = 'initializing';
|
|
2724
2750
|
const result = await dispatchRequest(this, 'initialize', {
|
|
2725
2751
|
clientInfo: {
|
|
@@ -2844,6 +2870,8 @@ class CodexAppServerClient extends EventEmitter {
|
|
|
2844
2870
|
if (params !== undefined) message.params = params;
|
|
2845
2871
|
const line = this._serializeMessage(message);
|
|
2846
2872
|
if (pending.stateChanging) {
|
|
2873
|
+
const companion = CLIENT_COMPANIONS.get(this);
|
|
2874
|
+
if (companion) assertRuntimeCompanion(companion);
|
|
2847
2875
|
const controller = new AbortController();
|
|
2848
2876
|
pending.sinkController = controller;
|
|
2849
2877
|
try {
|
|
@@ -2867,6 +2895,7 @@ class CodexAppServerClient extends EventEmitter {
|
|
|
2867
2895
|
}
|
|
2868
2896
|
}
|
|
2869
2897
|
if (this.pending.get(pending.id) !== pending) return;
|
|
2898
|
+
if (companion) assertRuntimeCompanion(companion);
|
|
2870
2899
|
pending.writeAttempted = true;
|
|
2871
2900
|
}
|
|
2872
2901
|
await this._writeLine(line);
|
package/lib/codex/preflight.js
CHANGED
|
@@ -443,27 +443,30 @@ function normalizeExpectedProfile(value) {
|
|
|
443
443
|
|
|
444
444
|
function assertExpectedPolicy(profile) {
|
|
445
445
|
const config = plainObject(profile.expectedConfig, 'expected config projection');
|
|
446
|
+
const trusted = profile.permissionProfileId === 'polygram-trusted';
|
|
447
|
+
const expectedProviders = config.modelProvider === 'cliproxyapi'
|
|
448
|
+
? { count: 1, keySha256: [digest('cliproxyapi')] }
|
|
449
|
+
: { count: 0, keySha256: [] };
|
|
446
450
|
if (
|
|
447
451
|
config.sha256 !== profile.expectedConfigSha256
|
|
448
|
-
|| config.modelProvider
|
|
452
|
+
|| !['openai', 'cliproxyapi'].includes(config.modelProvider)
|
|
449
453
|
|| config.defaultPermissions !== profile.permissionProfileId
|
|
450
454
|
|| config.approvalPolicy !== 'never'
|
|
451
455
|
|| config.approvalsReviewer !== 'user'
|
|
452
|
-
|| config.webSearch !== 'disabled'
|
|
456
|
+
|| config.webSearch !== (trusted ? 'live' : 'disabled')
|
|
453
457
|
|| config.allowLoginShell !== false
|
|
454
458
|
|| config.shellEnvironmentInherit !== 'none'
|
|
455
459
|
|| config.mcpServers?.count !== 0
|
|
456
460
|
|| config.mcpServers?.keySha256?.length !== 0
|
|
457
461
|
|| config.plugins?.count !== 0
|
|
458
462
|
|| config.plugins?.keySha256?.length !== 0
|
|
459
|
-
|| config.modelProviders?.count !== 0
|
|
460
|
-
|| config.modelProviders?.keySha256?.length !== 0
|
|
461
463
|
) {
|
|
462
464
|
throw new CodexPreflightError(
|
|
463
|
-
'Codex expected policy is outside the
|
|
465
|
+
'Codex expected policy is outside the supported static policies',
|
|
464
466
|
'CODEX_STATIC_PROFILE_MISMATCH',
|
|
465
467
|
);
|
|
466
468
|
}
|
|
469
|
+
exact(config.modelProviders, expectedProviders, 'model providers');
|
|
467
470
|
if (!Array.isArray(config.permissionProfiles)) {
|
|
468
471
|
throw new TypeError(
|
|
469
472
|
'Codex preflight expected config permission profiles must be an array',
|
|
@@ -479,14 +482,25 @@ function assertExpectedPolicy(profile) {
|
|
|
479
482
|
configured.length !== 1
|
|
480
483
|
|| listed.length !== 1
|
|
481
484
|
|| configured[0].extends !== null
|
|
482
|
-
|| configured[0].networkEnabled !==
|
|
485
|
+
|| configured[0].networkEnabled !== trusted
|
|
483
486
|
|| listed[0].allowed !== true
|
|
484
487
|
) {
|
|
485
488
|
throw new CodexPreflightError(
|
|
486
|
-
'Codex expected permission profile is not uniquely allowed
|
|
489
|
+
'Codex expected permission profile is not uniquely allowed with the required network policy',
|
|
487
490
|
'CODEX_STATIC_PROFILE_MISMATCH',
|
|
488
491
|
);
|
|
489
492
|
}
|
|
493
|
+
if (trusted) {
|
|
494
|
+
exact(configured[0].filesystem, [{
|
|
495
|
+
rootSha256: digest(':root'),
|
|
496
|
+
access: 'write',
|
|
497
|
+
}], 'trusted filesystem');
|
|
498
|
+
exact(
|
|
499
|
+
configured[0].filesystemSha256,
|
|
500
|
+
digest({ glob_scan_max_depth: null, ':root': 'write' }),
|
|
501
|
+
'trusted filesystem digest',
|
|
502
|
+
);
|
|
503
|
+
}
|
|
490
504
|
}
|
|
491
505
|
|
|
492
506
|
function paginationCursor(value) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"cliVersion": "codex-cli 0.
|
|
3
|
-
"binarySha256": "
|
|
2
|
+
"cliVersion": "codex-cli 0.167.2",
|
|
3
|
+
"binarySha256": "97bc82fd46f117cf10efb95e6ff0c81dc4784f5797bcdc2cb75093ba09e4def0",
|
|
4
4
|
"binarySha256ByTarget": {
|
|
5
|
-
"aarch64-apple-darwin": "
|
|
6
|
-
"x86_64-unknown-linux-musl": "
|
|
5
|
+
"aarch64-apple-darwin": "97bc82fd46f117cf10efb95e6ff0c81dc4784f5797bcdc2cb75093ba09e4def0",
|
|
6
|
+
"x86_64-unknown-linux-musl": "a9672d0fa0dd8fcf8cad136fa0d056b914bc046f5ac3d78f4a5cf390655af56b"
|
|
7
7
|
},
|
|
8
|
-
"generatedProtocolV2CanonicalSha256": "
|
|
8
|
+
"generatedProtocolV2CanonicalSha256": "ca9811bd8310c9576f2acc1c37ba132afeef49c0cdbc3e02908b64ad12126163",
|
|
9
9
|
"requestIdTypes": [
|
|
10
10
|
"integer",
|
|
11
11
|
"string"
|
|
@@ -172,7 +172,10 @@
|
|
|
172
172
|
"configWarning",
|
|
173
173
|
"account/rateLimits/updated",
|
|
174
174
|
"remoteControl/status/changed",
|
|
175
|
-
"mcpServer/startupStatus/updated"
|
|
175
|
+
"mcpServer/startupStatus/updated",
|
|
176
|
+
"thread/readState/changed",
|
|
177
|
+
"account/updated",
|
|
178
|
+
"turn/moderationMetadata"
|
|
176
179
|
],
|
|
177
180
|
"deniedServerRequests": {
|
|
178
181
|
"item/commandExecution/requestApproval": {
|
|
@@ -247,5 +250,9 @@
|
|
|
247
250
|
"no active turn to interrupt"
|
|
248
251
|
]
|
|
249
252
|
},
|
|
250
|
-
"provenance": "Curated positive production subset derived from the pinned experimental v2 schema;
|
|
253
|
+
"provenance": "Curated positive production subset derived from the pinned experimental v2 schema; candidate canonical/raw schema hashes are independently regenerated by codex-runtime-schema-probe.mjs; historical U1 fixtures remain versioned.",
|
|
254
|
+
"codeModeHostSha256ByTarget": {
|
|
255
|
+
"aarch64-apple-darwin": "45acdb759c3ac0a6b30a5107329b364b7ac1579f2cdf270997f03bc8d6365ef6",
|
|
256
|
+
"x86_64-unknown-linux-musl": "007c62795a7215c27ee85486ecb95e714b33118a2d18c6d7b09b0d9793c72ff4"
|
|
257
|
+
}
|
|
251
258
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { createHash } = require('node:crypto');
|
|
4
|
+
const { createReadStream, lstatSync, realpathSync } = require('node:fs');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
|
|
7
|
+
function mismatch() {
|
|
8
|
+
return Object.assign(new Error('pinned Codex code-mode companion or selection layout changed'), {
|
|
9
|
+
code: 'CODEX_BINARY_MISMATCH',
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function absent(file) {
|
|
14
|
+
try { lstatSync(file); throw mismatch(); } catch (error) {
|
|
15
|
+
if (error.code !== 'ENOENT') throw error;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function fingerprint(binary) {
|
|
20
|
+
const dir = path.dirname(binary);
|
|
21
|
+
if (path.basename(dir) === 'codex-resources'
|
|
22
|
+
|| (path.basename(dir) === 'MacOS' && path.basename(path.dirname(dir)) === 'Contents'
|
|
23
|
+
&& path.basename(path.dirname(path.dirname(dir))) === 'CodexCLI.app')) throw mismatch();
|
|
24
|
+
// Upstream prefers packaged resources over the standalone sibling. Only the
|
|
25
|
+
// standalone layout is admitted, so later metadata cannot redirect execution.
|
|
26
|
+
absent(path.join(dir, 'codex-resources'));
|
|
27
|
+
absent(path.join(dir, 'codex-package.json'));
|
|
28
|
+
if (path.basename(dir) === 'bin') {
|
|
29
|
+
absent(path.join(path.dirname(dir), 'codex-package.json'));
|
|
30
|
+
absent(path.join(path.dirname(dir), 'codex-resources'));
|
|
31
|
+
}
|
|
32
|
+
const helper = path.join(dir, 'codex-code-mode-host');
|
|
33
|
+
if (realpathSync(helper) !== helper) throw mismatch();
|
|
34
|
+
let component = path.parse(helper).root;
|
|
35
|
+
for (const part of helper.slice(component.length).split(path.sep).filter(Boolean)) {
|
|
36
|
+
component = path.join(component, part);
|
|
37
|
+
const stat = lstatSync(component);
|
|
38
|
+
if (stat.isSymbolicLink() || ![0, process.getuid?.()].includes(stat.uid)
|
|
39
|
+
|| (stat.mode & 0o022) !== 0) throw mismatch();
|
|
40
|
+
}
|
|
41
|
+
const stat = lstatSync(helper, { bigint: true });
|
|
42
|
+
if (!stat.isFile() || stat.nlink !== 1n || (stat.mode & 0o111n) === 0n) throw mismatch();
|
|
43
|
+
return {
|
|
44
|
+
path: helper,
|
|
45
|
+
identity: ['dev', 'ino', 'size', 'mtimeNs', 'ctimeNs', 'mode', 'uid', 'nlink']
|
|
46
|
+
.map(key => stat[key].toString()).join(':'),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function attestRuntimeCompanion(binary, sha256) {
|
|
51
|
+
try {
|
|
52
|
+
const before = fingerprint(binary);
|
|
53
|
+
const hash = createHash('sha256');
|
|
54
|
+
for await (const chunk of createReadStream(before.path)) hash.update(chunk);
|
|
55
|
+
if (hash.digest('hex') !== sha256 || fingerprint(binary).identity !== before.identity) throw mismatch();
|
|
56
|
+
return Object.freeze({ binary, path: before.path, sha256, identity: before.identity });
|
|
57
|
+
} catch { throw mismatch(); }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function assertRuntimeCompanion(binding) {
|
|
61
|
+
try {
|
|
62
|
+
if (fingerprint(binding.binary).identity !== binding.identity) throw mismatch();
|
|
63
|
+
} catch { throw mismatch(); }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = { attestRuntimeCompanion, assertRuntimeCompanion };
|
package/lib/process/factory.js
CHANGED
|
@@ -124,6 +124,7 @@ function deepFreeze(value) {
|
|
|
124
124
|
|
|
125
125
|
function expectedStaticThreadPolicy(profile) {
|
|
126
126
|
const config = profile.expectedConfig;
|
|
127
|
+
const trusted = profile.permissionProfileId === 'polygram-trusted';
|
|
127
128
|
const permissionProfiles = Array.isArray(config?.permissionProfiles)
|
|
128
129
|
? config.permissionProfiles
|
|
129
130
|
: [];
|
|
@@ -131,19 +132,19 @@ function expectedStaticThreadPolicy(profile) {
|
|
|
131
132
|
({ id }) => id === profile.permissionProfileId,
|
|
132
133
|
);
|
|
133
134
|
if (
|
|
134
|
-
config?.modelProvider
|
|
135
|
+
!['openai', 'cliproxyapi'].includes(config?.modelProvider)
|
|
135
136
|
|| config?.approvalPolicy !== 'never'
|
|
136
137
|
|| config?.approvalsReviewer !== 'user'
|
|
137
138
|
|| config?.defaultPermissions !== profile.permissionProfileId
|
|
138
139
|
|| selectedProfiles.length !== 1
|
|
139
|
-
|| selectedProfiles[0].networkEnabled !==
|
|
140
|
+
|| selectedProfiles[0].networkEnabled !== trusted
|
|
140
141
|
) {
|
|
141
142
|
throw codexConfigurationError(
|
|
142
143
|
'resolved profile does not encode the required thread policy',
|
|
143
144
|
);
|
|
144
145
|
}
|
|
145
146
|
return deepFreeze({
|
|
146
|
-
modelProvider:
|
|
147
|
+
modelProvider: config.modelProvider,
|
|
147
148
|
approvalPolicy: 'never',
|
|
148
149
|
approvalsReviewer: 'user',
|
|
149
150
|
runtimeWorkspaceRoots: {
|
|
@@ -152,7 +153,7 @@ function expectedStaticThreadPolicy(profile) {
|
|
|
152
153
|
createHash('sha256').update(profile.cwd).digest('hex'),
|
|
153
154
|
],
|
|
154
155
|
},
|
|
155
|
-
sandbox: {
|
|
156
|
+
sandbox: trusted ? { type: 'dangerFullAccess' } : {
|
|
156
157
|
type: 'workspaceWrite',
|
|
157
158
|
networkAccess: false,
|
|
158
159
|
excludeSlashTmp: true,
|
|
@@ -125,7 +125,12 @@ function buildHookSettings({ ndjsonPath, helperPath = HOOK_HELPER_ABS_PATH } = {
|
|
|
125
125
|
for (const evt of HOOK_EVENTS) {
|
|
126
126
|
hooks[evt] = (evt === 'PreToolUse' || evt === 'PostToolUse') ? matched('.*') : unmatched();
|
|
127
127
|
}
|
|
128
|
-
|
|
128
|
+
// Claude Code delivers SendMessage traffic from other same-user sessions
|
|
129
|
+
// into this one unless told otherwise. A bot session takes input only
|
|
130
|
+
// from its own transport, so it refuses that traffic outright. `refuse`
|
|
131
|
+
// from `--settings` outranks user settings; only managed policy can
|
|
132
|
+
// override it.
|
|
133
|
+
return { hooks, crossSessionInbound: 'refuse' };
|
|
129
134
|
}
|
|
130
135
|
|
|
131
136
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shumkov/orchestra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Transport-agnostic session engine for Claude Code and the native Codex app-server: spawn, steer, supervise, observe turns, and recover.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "index.js",
|