@orkestrel/scaffold 0.0.5 → 0.0.7

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.
@@ -212,7 +212,7 @@ verifies its CLI is present before running and stops with a deviation report nam
212
212
  fallback when it is not. Benches are cross-provider reach only: a model native to the running
213
213
  harness never crosses a bridge.
214
214
 
215
- Three bench laws apply to every external engine:
215
+ Four bench laws apply to every external engine:
216
216
 
217
217
  - **Transport by work class.** A short interactive exchange (one bounded question or a
218
218
  follow-up on a live thread, expected to finish in about two minutes) may use an MCP
@@ -221,19 +221,27 @@ Three bench laws apply to every external engine:
221
221
  session invisibly, while a journal survives any client-side failure.
222
222
  - **Journal first.** Every bench invocation leaves a tailable on-disk record under
223
223
  `tmp/<bench>/` (`tmp/codex/`, `tmp/cursor/`): the brief as a file, the event stream or
224
- output log, and the final answer. The user tails the journal for live progress; the
225
- journal's mtime is the liveness signal; the session id in the journal head is the recovery
226
- handle. Briefs never travel as fragile shell arguments.
224
+ output log, and the final answer. Every long exec also carries exactly one Monitor on its
225
+ journal a filtered tail that emits milestones (commands run, files changed, agent
226
+ messages, terminal states) and never the raw event firehose — so progress arrives in the
227
+ conversation while the journal stays tailable for depth. The filter exits on the exec's
228
+ terminal event, so the monitor's lifecycle matches the exec's and no watcher outlives its
229
+ subject. The journal's mtime is the liveness signal; the session id in the journal head is
230
+ the recovery handle. Briefs never travel as fragile shell arguments.
231
+ - **Tracked, never loose.** Every bench unit is registered in the session task registry at
232
+ launch — subject, journal path, session id — and completed there at acceptance, so "what is
233
+ running" always has a first-class answer instead of a recollection of a command.
227
234
  - **Ephemeral journals.** Everything under `tmp/` is unit evidence, never committed. Bridges
228
235
  never delete journals; the Orchestrator sweeps `tmp/codex/` and `tmp/cursor/` once at
229
236
  campaign acceptance, after the final gate evidence is recorded. A journal surviving past
230
237
  its campaign is residue.
231
238
 
232
- For a long-running bridge exec the Orchestrator arms a stall watcher on the journal
233
- (file-exists on the final answer, mtime-stall threshold of a few minutes) instead of trusting
234
- the bridge to report failure a wedged bridge is silent, and silence must never read as
235
- progress. A stalled journal follows the deviation ladder, with the session id from the
236
- journal head as the recovery handle.
239
+ Every long bench exec is launched by the Orchestrator as a harness-tracked background command
240
+ under a hard time cap, never detached from inside a bridge agent: the harness owns the
241
+ lifecycle, completion re-invokes the session, and the cap kills a wedged bench loudly instead
242
+ of trusting the bridge to report its own failure. A wedged bridge is silent, and silence must
243
+ never read as progress. A stalled journal or a cap-killed exec follows the deviation ladder,
244
+ with the session id from the journal head as the recovery handle.
237
245
 
238
246
  ### Cursor Grok
239
247
 
@@ -244,6 +252,10 @@ journal head as the recovery handle.
244
252
  `"$LOCALAPPDATA/cursor-agent/agent.cmd"` — verified with `--version` before first use. Long
245
253
  briefs are written to `tmp/cursor/<unit>-brief.md` and the prompt points at the file. The
246
254
  tee'd log is the bench's journal.
255
+ - A long ask-mode run obeys the same launch, stream, and ledger discipline as a Codex exec:
256
+ the Orchestrator starts it as a harness-tracked background command under a time cap,
257
+ registers the unit in the task registry, and arms one Monitor on the tee'd log for
258
+ milestones. The `grok` bridge drafts the brief; it never detaches a run and ends its turn.
247
259
  - Read-only. `--force` never appears. Nothing it returns is applied.
248
260
  - Read the exact model id from `agent models` and store it in `CURSOR_GROK_MODEL`. Never guess
249
261
  or substitute.
@@ -260,11 +272,12 @@ journal head as the recovery handle.
260
272
  - Reached from Claude Code only through the `codex` role, on journaled, resumable
261
273
  `codex exec`; in a Codex session these are native agents.
262
274
  - **Every run is journaled and resumable.** `--json` streams the event log to
263
- `tmp/codex/<unit>.jsonl` (gitignored; the user tails it live for progress nobody polls),
264
- `--output-last-message` captures the final answer as a file, and the session id from the
265
- journal head goes in every bridge report so follow-ups continue the same session via
266
- `codex exec resume <session-id>` with context intact. `--output-schema` is available when
267
- the Orchestrator wants a machine-checkable return shape.
275
+ `tmp/codex/<unit>.jsonl` (gitignored; the Monitor emits its milestones and the user tails it
276
+ for depth — nobody polls), `--output-last-message` captures the final answer as a file, and
277
+ the session id from the journal head goes in the unit's task registry entry and every bridge
278
+ report so follow-ups continue the same session via `codex exec resume <session-id>` with
279
+ context intact. `--output-schema` is available when the Orchestrator wants a
280
+ machine-checkable return shape.
268
281
  - **Transport is chosen by work class.** The MCP wiring (`.mcp.json` registers
269
282
  `codex mcp-server`; verified tools `codex` to start a session, `codex-reply` to continue
270
283
  one; settings enable project MCP servers without prompting, so the wiring works headless —
@@ -272,13 +285,27 @@ journal head as the recovery handle.
272
285
  short interactive exchanges only, and the bridge persists the thread id to
273
286
  `tmp/codex/<unit>.session` the moment a response carries it — an interrupted MCP call with
274
287
  no persisted id is unrecoverable and treated as failed. Long-running work (audits,
275
- implementation units) always uses the journaled CLI: the brief at
276
- `tmp/codex/<unit>-brief.md`, one `codex exec --json` streaming to `tmp/codex/<unit>.jsonl`
277
- with `--output-last-message`, foreground when it fits the shell cap, backgrounded with the
278
- turn ended when it may not the harness re-invocation is the wait; placeholder loops and
279
- wait-promise reports are deviations. Recovery ladder on interruption: persisted-id
280
- `codex-reply` re-emission fresh CLI session with the same brief file for an interrupted
281
- CLI exec, the journal survives and the Orchestrator chooses resume or fresh.
288
+ implementation units) always uses the journaled CLI, and the Orchestrator — never a bridge
289
+ agent launches it as a harness-tracked background command: the brief at
290
+ `tmp/codex/<unit>-brief.md`, then one
291
+ `timeout <cap> codex exec --json < /dev/null > tmp/codex/<unit>.jsonl` with
292
+ `--output-last-message`, started through the shell's background-task mechanism so the exec
293
+ appears in the session's task list, its completion re-invokes the session, and the cap kills
294
+ a wedged bench loudly. Stdin is always closed with `< /dev/null`: a background-launched exec
295
+ can inherit an open stdin pipe and wedge forever at "Reading additional input from stdin..."
296
+ before its first event, and a cap kill is the only thing that would ever surface it.
297
+ The journal remains the durable, resumable record and the session id the recovery handle. A
298
+ bridge that backgrounds an exec and ends its turn orphans it — no owner, no completion
299
+ signal, no death notice — so bridges keep two jobs only: drafting briefs and short MCP
300
+ exchanges. Placeholder wait loops and wait-promise reports are deviations. Every exec names
301
+ its working directory with `-C`, and an exec rooted outside a trusted git repository dies at
302
+ launch unless `--skip-git-repo-check` is passed, so cross-repo and fleet-container work
303
+ rooted outside a checkout always passes it. A launch is not a launch until the journal grows
304
+ past its header: the Orchestrator confirms the event stream advanced beyond the
305
+ session-configured head before recording the exec started, and treats an instantly-dead
306
+ journal as a failed launch whose tail is the evidence. Recovery ladder on interruption:
307
+ persisted-id `codex-reply` re-emission → fresh CLI session with the same brief file → for an
308
+ interrupted CLI exec, the journal survives and the Orchestrator chooses resume or fresh.
282
309
  - **The inverse bridge exists too:** Claude Code exposes `claude mcp serve`, registered in
283
310
  Codex's global config (`codex mcp add claude -- claude mcp serve`) so Codex-primary
284
311
  sessions reach Claude/Opus as first-class MCP tools instead of shelling to the CLI.
@@ -288,6 +315,11 @@ journal head as the recovery handle.
288
315
  - `implementer` runs `gpt-5.6-sol` at high effort with `--sandbox workspace-write` in the
289
316
  main checkout as the sole writer from a clean committed baseline, for bounded
290
317
  implementation.
318
+ - **The exec sandbox denies network** (`--unshare-net`). Any unit that needs the registry or
319
+ any other remote endpoint — lockfile generation, real installs, live fetches — belongs to
320
+ the Orchestrator's own tracked commands or a network-capable native agent, never to a Codex
321
+ exec. A Sol exec observed hanging on `npm` until its cap fires is the signature of this
322
+ misroute, not of a slow bench.
291
323
  - Raise the analyst to `xhigh` only for a stated hard reasoning need. `gpt-5.6-terra` serves
292
324
  only explicitly mechanical, taste-free roles. `gpt-5.6-luna` requires a proven repeatable,
293
325
  high-volume workload.
@@ -297,9 +329,17 @@ journal head as the recovery handle.
297
329
  - At the start of each live Cloud session the user runs `codex login --device-auth` and
298
330
  completes ChatGPT approval in the browser. `scripts/codex.sh` only reports readiness; it
299
331
  never installs, authenticates, logs out, reads the auth cache, or performs a model call.
300
- - If ChatGPT device login is unavailable or expires, the Codex bench is dark. Fall back to
301
- `planner`/`reviewer` (Opus 5) and `builder`, and say so. Never substitute an API key, access
302
- token, copied `auth.json`, or another login flow unless the user changes this policy.
332
+ - A probe that finds the binary present but authentication unavailable starts recovery in the
333
+ same turn instead of recording the bench dark and waiting: the Orchestrator backgrounds
334
+ `codex login --device-auth` with its output captured to `tmp/codex/login.log`, surfaces the
335
+ verification URL and one-time code to the user the moment they appear there, arms a watcher
336
+ on completion, and re-probes `codex login status` when it fires. The bench comes live
337
+ mid-session with no restart; a session that sits dark until the user asks for the login has
338
+ failed the probe, not the bench.
339
+ - If that recovery cannot complete — device login unavailable, declined, or expired — the
340
+ Codex bench is dark. Fall back to `planner`/`reviewer` (Opus 5) and `builder`, and say so.
341
+ Never substitute an API key, access token, copied `auth.json`, or another login flow unless
342
+ the user changes this policy.
303
343
 
304
344
  Codex environment defaults:
305
345
 
@@ -123,14 +123,14 @@ then runs the configured scoped checks that prove environment isolation.
123
123
  - Lint is a separate complementary gate; neither lint nor root checking replaces
124
124
  environment-isolation checks.
125
125
 
126
- | Scope | `lib` | `types` | Permitted host globals |
127
- | ---------------------------- | --------------------------------- | ----------------- | --------------------------------------------------- |
128
- | `src:core`, `app:core` | `["ESNext"]` | `[]` | None: no DOM, Node, host crypto, console, or timers |
129
- | `src:browser`, `app:browser` | `["ESNext","DOM","DOM.Iterable"]` | default | DOM; no Node |
130
- | `src:server`, `app:server` | `["ESNext"]` | `["node"]` | Node; no DOM |
131
- | `src:styles` | `["ESNext"]` | `["vite/client"]` | Vite SCSS module declaration only |
132
-
133
- Strict core is load-bearing. A host-dependent helper belongs in its host environment; for example, a `generateId` using host `crypto` belongs in server, not core.
126
+ | Scope | `lib` | `types` | Permitted host globals |
127
+ | ---------------------------- | --------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
128
+ | `src:core`, `app:core` | `["ESNext","WebWorker"]` | `[]` | WHATWG web interop: fetch family, streams, URL, Abort, encoders, crypto, timers, console, DOMException, structuredClone; no DOM, no Node |
129
+ | `src:browser`, `app:browser` | `["ESNext","DOM","DOM.Iterable"]` | default | DOM; no Node |
130
+ | `src:server`, `app:server` | `["ESNext"]` | `["node"]` | Node; no DOM |
131
+ | `src:styles` | `["ESNext"]` | `["vite/client"]` | Vite SCSS module declaration only |
132
+
133
+ Strict core is load-bearing. A host-dependent helper belongs in its host environment; for example, a `generateId` reading `node:crypto` belongs in server, not core. The worker-only globals — `name`, `onrtctransform`, `close`, `postMessage`, `dispatchEvent`, `location`, `onerror`, `onlanguagechange`, `onoffline`, `ononline`, `onrejectionhandled`, `onunhandledrejection`, `self`, `importScripts`, `fonts`, `caches`, `crossOriginIsolated`, `indexedDB`, `isSecureContext`, `origin`, `scheduler`, `createImageBitmap`, `reportError`, `cancelAnimationFrame`, `requestAnimationFrame`, `onmessage`, `onmessageerror`, `addEventListener`, and `removeEventListener` — are policy-fenced out of core sources, so the `WebWorker` declarations widen the interop surface without admitting a worker host.
134
134
 
135
135
  Build/check config alignment:
136
136