@sabaiway/agent-workflow-kit 23.9.0 → 23.11.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/CHANGELOG.md +49 -0
- package/README.md +1 -1
- package/SKILL.md +1 -1
- package/bridges/codex-cli-bridge/SKILL.md +5 -5
- package/bridges/codex-cli-bridge/bin/codex-exec-jev.test.mjs +3 -2
- package/bridges/codex-cli-bridge/bin/codex-exec.sh +6 -6
- package/bridges/codex-cli-bridge/bin/codex-exec.test.mjs +5 -5
- package/bridges/codex-cli-bridge/bin/codex-model-posture.test.mjs +29 -29
- package/bridges/codex-cli-bridge/bin/codex-review-jev.test.mjs +3 -2
- package/bridges/codex-cli-bridge/bin/codex-review.sh +6 -6
- package/bridges/codex-cli-bridge/bin/codex-review.test.mjs +6 -6
- package/bridges/codex-cli-bridge/capability.json +4 -4
- package/bridges/codex-cli-bridge/references/driving-codex.md +1 -1
- package/bridges/codex-cli-bridge/references/sandbox-and-flags.md +2 -2
- package/bridges/codex-cli-bridge/setup/README.md +1 -1
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/modes/bridge-settings.md +2 -2
- package/references/modes/gates.md +1 -1
- package/references/modes/now.md +1 -1
- package/references/modes/procedures.md +1 -1
- package/references/modes/recommendations.md +2 -2
- package/tools/gates-init.mjs +3 -3
- package/tools/now-render.mjs +1 -1
- package/tools/procedures.mjs +5 -11
- package/tools/recommendations.mjs +4 -4
- package/tools/source-size/help.mjs +8 -7
- package/tools/source-size/index.mjs +1 -0
- package/tools/source-size/limits.mjs +8 -2
- package/tools/source-size/piles.mjs +2 -2
- package/tools/source-size/reason.mjs +0 -1
- package/tools/source-size/record.mjs +6 -13
- package/tools/source-size/setup.mjs +2 -2
- package/tools/source-size-config.mjs +29 -41
- package/tools/source-size-core.mjs +3 -2
- package/tools/source-size-judge.mjs +11 -28
- package/tools/source-size-refusal.mjs +1 -1
- package/tools/source-size-report.mjs +24 -27
- package/tools/source-size-runs.mjs +31 -24
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,55 @@ Semantically versioned ([semver](https://semver.org)), newest first. The `versio
|
|
|
4
4
|
is the current release. `upgrade` mode reads a project's `docs/ai/.workflow-version` and applies
|
|
5
5
|
every `migrations/<version>-<slug>.md` newer than it, in semver order.
|
|
6
6
|
|
|
7
|
+
## 23.11.0 — codex runs the newest model, gpt-6.2-sol, by default (AD-239)
|
|
8
|
+
|
|
9
|
+
**After `/agent-workflow-kit upgrade` (or `init`), a host that sets neither a codex model nor an effort runs
|
|
10
|
+
`codex-exec` and `codex-review` on `gpt-6.2-sol` at effort `high`.** Before, the bridge ran `gpt-6.1-sol`, which
|
|
11
|
+
codex now calls the previous generation. The codex bridge goes to 6.1.0, and your next `init` or upgrade refreshes it where you placed it.
|
|
12
|
+
|
|
13
|
+
- **A model you set in the bridge settings file still wins.** A `CODEX_MODEL` in the environment that differs from
|
|
14
|
+
the host posture is a one-off, and only a probe (`CODEX_PROBE=1`, never a nonced `codex-exec` dispatch) runs one.
|
|
15
|
+
If you exported `CODEX_MODEL=gpt-6.1-sol` with no settings line, every run that is not a probe is now refused
|
|
16
|
+
before anything is spent (exit 2). Keep that model with
|
|
17
|
+
`/agent-workflow-kit bridge-settings --set CODEX_MODEL=gpt-6.1-sol --apply`, then unset `CODEX_MODEL` in your shell.
|
|
18
|
+
- **If a run uses `gpt-6.2-sol` and your installed codex lists its models without it**, the run is refused before
|
|
19
|
+
anything is spent (exit 2), with the models it offers and a remedy naming one of them. Update the codex CLI to get
|
|
20
|
+
the new model, or set a model it offers: `/agent-workflow-kit bridge-settings --set CODEX_MODEL=<model> --apply`.
|
|
21
|
+
Where the catalog cannot be read, the run skips this check with one warning; the one-off rule still applies, and
|
|
22
|
+
codex itself refuses a model it does not serve.
|
|
23
|
+
- **The Fast tier's description** ("2x speed, increased usage", `CODEX_SERVICE_TIER=priority`) is quoted again from
|
|
24
|
+
the codex catalog for `gpt-6.2-sol`, as read on 2026-11-18; it is still off unless you turn it on.
|
|
25
|
+
- `/agent-workflow-kit bridge-settings`, the kit README, the posture line and the bridge's own texts name
|
|
26
|
+
`gpt-6.2-sol` as the codex default. Effort, the Fast tier, the catalog check and the one-off rule are unchanged.
|
|
27
|
+
|
|
28
|
+
## 23.10.0 — a line added inside a file's limits no longer stops the size check (AD-238)
|
|
29
|
+
|
|
30
|
+
**After `/agent-workflow-kit upgrade`, the size check no longer sums the lines of each declared root.** Before, a
|
|
31
|
+
regeneration recorded each root's line sum under `aggregate`, and one line added to any file, however far within its
|
|
32
|
+
limits, stopped the check and asked a reason for growth no single file shows.
|
|
33
|
+
|
|
34
|
+
- **No per-root line sum is judged or recorded.** A file within its limits is no finding, however the root grows;
|
|
35
|
+
every per-file and layout record keeps its ratchet, and files per root still stops a growing root where layout is
|
|
36
|
+
recorded.
|
|
37
|
+
- **An existing record keeps working.** A minted config that still holds `aggregate` gets one warning about it on
|
|
38
|
+
every check that judges it, with the paste-ready `--write-baseline` line, which needs no reason where nothing else
|
|
39
|
+
rises. That regeneration drops the sum, printing one `<root>: aggregate lines <n> → none` line per root.
|
|
40
|
+
- **Every regeneration writes config schema 3**, which is schema 2 with no `aggregate`. The reader takes schemas 1,
|
|
41
|
+
2 and 3. A write that changes the file's schema prints `moved from schema <from> to schema <to> in this write`, and
|
|
42
|
+
the first write of an absent config prints `written at schema 3 in this write`; each adds that a kit that predates
|
|
43
|
+
that schema stops by name until that copy is upgraded.
|
|
44
|
+
- **A clone or a vendored copy on kit 23.9.0 or earlier stops by name** on a config written at schema 3
|
|
45
|
+
(`"schema" must be 1 or 2, got 3`, exit 2) until that copy is upgraded. Before the write, the kit says so only in
|
|
46
|
+
the deployed sum's warning; after it, in the line above.
|
|
47
|
+
- **A config with a file record and no sum is judged**, where it stopped before as half-written: a config is absent,
|
|
48
|
+
authored (no `baseline`) or minted (`baseline` present).
|
|
49
|
+
- **The verbatim move of a minted schema-1 config** (by `--adopt`, or by a `--write-baseline` that refuses a raise)
|
|
50
|
+
writes schema 2 where the file holds `aggregate`, which it carries as it is, and schema 3 where it holds none; an
|
|
51
|
+
admitted regeneration of a schema-1 config lands on schema 3.
|
|
52
|
+
- **Fixed:** a directory named `constructor` no longer stops the size check where layout is judged.
|
|
53
|
+
- The green practice line, the procedures block, the `now` CAMPAIGN line, `--help` and the advisor's texts no longer
|
|
54
|
+
state a sum or a half-written record.
|
|
55
|
+
|
|
7
56
|
## 23.9.0 — a failed coverage check shows what failed and the fix first (AD-237)
|
|
8
57
|
|
|
9
58
|
**After `/agent-workflow-kit upgrade`, a red `coverage-check.mjs --check` run opens with its failure, and so do a
|
package/README.md
CHANGED
|
@@ -268,7 +268,7 @@ file), or run the guarded `/agent-workflow-kit uninstall`.
|
|
|
268
268
|
| `/agent-workflow-kit agents` | Claude Code · opt-in | **subagent vehicles** — places the five bundled subagent definitions into `.claude/agents/`: **four read-only vehicles + one full-tool `executor`**. **No read-only vehicle gets `Bash`**, and that is the load-bearing property: a read-only fan-out on a full-tool subagent shells out for facts it could have read, and every shelled command is an approval prompt you never needed to see. Three of the four ride a **cheap model** (haiku, low effort) for mechanical work — extraction sweeps, changelog fact-skeletons, gate-failure triage; the fourth, **`review-lens`**, is an ADDITIONAL independent read-only review opinion on code your configured backends have already seen (never a replacement for your plan or diff review recipe, advisory like every review; an epic is reviewed by the lens alone, whatever `epic.review` resolves to). The fifth, **`executor`** (all tools; model and effort from `docs/ai/vehicles.json`), is the ONE vehicle with a shell and the instrument behind the **Subagent** recipe: dispatched only for a bounded, file-disjoint execution / authoring / routine slice you verify afterwards — never for read-only work, never as a review backend, and it never commits. Its state (`placed` / `customized` / `unusable` / `missing`) is what a `subagent` slot's readiness resolves from. Writing code and running gates stay off the four read-only vehicles; the executor carries a bounded slice you re-verify on your main lane, and every vehicle's output is verified. Preview by default (`--apply` writes); every kit agent file (the five bundled names and each configured roster-derived lens) is **written current with no question** — an absent one placed, a differing one written with the body the kit writes for it, the executor's and the bundled `review-lens`'s (opus / high by default, set in the file's optional `review-lens` section) derived from `docs/ai/vehicles.json`, no copy kept; a link at a kit agent path stops the run naming it, nothing written; a vehicle of your own goes in `.claude/agents/<name>.local.md` with a `name:` of its own; never touches `settings*.json`, never commits. |
|
|
269
269
|
| `/agent-workflow-kit hook` | Claude Code · opt-in | **gate-approval hook** — places a self-contained PreToolUse hook (`.claude/hooks/`) and wires it into `.claude/settings.json`: a Bash command **byte-identical** to a gate you declared in `docs/ai/gates.json` (run from the project root) is auto-approved — no prompt, no idle; a seeded read-only command carrying a runtime residual (output redirection, command substitution, `--output` writes) now **asks** even where an allow rule would have silently passed it (proven live — hook `ask` overrides an allow rule). Detection is a conservative string scan, so it over-asks on a byte that is ordinary text — searching for `=>`, or a read wearing `2>/dev/null`, prompts. That is a documented open limit: 4.1.0 built three mechanisms to narrow it and removed all three in review, each counterexample kept as a test (see Mode: hook). Exact matches only, never patterns; never `deny`; a broken `gates.json` only disables auto-approval, never the guard. An opt-in **read-lane** (`--read-lane` → `docs/ai/lanes.json`, a **separate** file from `gates.json`) additionally auto-approves *compounds* of seeded read-only commands carrying no shell metaprogramming; `--apply --read-lane` verifies the placed hook is current first. Within a hook you wired, its file is placed when absent and written with the kit's body when it differs, with no question and no copy kept (the upgrade's `gate-hook.not-current`); a hook of your own goes in `.claude/hooks/<name>.local.mjs`, which you wire. Preview by default; never writes `settings.local.json`; never commits. |
|
|
270
270
|
| `/agent-workflow-kit state-block-guard` | Claude Code · opt-in | **closing-block detector** — a `Stop` hook that reads the turn's final assistant message and warns when the closing state block is defective: the «what I need from you» slot answering *nothing* (a turn that ENDS always needs a resume, so the answer is false, not merely unhelpful), or a first-person promise of imminent work in a turn that is over. Judged on the slot's first clause, so a real ask followed by a clause break and "nothing else" passes, and a promise gated on something named passes; matching is word-bounded and Unicode-aware, quoted and fenced examples are stripped, and the last STARTED block decides — an incomplete tail counts as no block rather than falling back to an earlier one. A message carrying no block at all is silent unless you pass `--require-block` — this kit does not mandate the block, and a hook that runs every turn must not warn every turn. The judgement is lexical and the mode doc names every residual it leaves. **Detection, never prevention** — a `Stop` hook cannot un-send the message it judges; what it buys is that a silent recurrence becomes a visible one. Warns via `systemMessage` and **exits 0 on every path**: never `deny`, never blocks the stop, never re-enters the model. Reads nothing but the message, makes no network call, approves nothing. Its writer is `tools/state-block-hook.mjs`: it places the self-contained hook and merges its `Stop` entry into `.claude/settings.json` by the three merge cases, keeping every foreign hook — the agent applies it on the chat yes after the danger check. Within the wired hook its runtime file is written with the kit's body when absent or differing, with no question (the upgrade's `state-block.not-current`); a hook of your own goes in `.claude/hooks/<name>.local.mjs`, which you wire. |
|
|
271
|
-
| `/agent-workflow-kit bridge-settings` | opt-in, any time | **host-level bridge settings** — read or change the bridges' `KEY=VALUE` config file (`${XDG_CONFIG_HOME:-~/.config}/agent-workflow/bridge-settings.conf`), the **one place a knob survives kit upgrades** (it lives outside every kit tree; a refresh never touches it, and now states loudly if it ever overwrote a local edit). The **model each bridge runs**: `CODEX_MODEL` + `CODEX_EFFORT` (default `gpt-6.
|
|
271
|
+
| `/agent-workflow-kit bridge-settings` | opt-in, any time | **host-level bridge settings** — read or change the bridges' `KEY=VALUE` config file (`${XDG_CONFIG_HOME:-~/.config}/agent-workflow/bridge-settings.conf`), the **one place a knob survives kit upgrades** (it lives outside every kit tree; a refresh never touches it, and now states loudly if it ever overwrote a local edit). The **model each bridge runs**: `CODEX_MODEL` + `CODEX_EFFORT` (default `gpt-6.2-sol` at `high`) and `AGY_MODEL` (default `Gemini 3.8 Flash (High)`) — the read-out shows the models each installed CLI offers, and a set one is checked against that list before anything is written. The judge's `JEV_MODEL` defaults to its manifest's `posture.model` and is checked against the versions its manifest offers. Other knobs: the **codex Fast tier** (`CODEX_SERVICE_TIER=priority` — "2x speed, **increased usage**" in the catalog's own words, quality-neutral, default off — a consented spend), the codex/agy hard timeouts, the codex review byte cap, and `AGY_REVIEW_MAX_TOTAL_BYTES` (the ceiling on what an oversized agy code review may feed before it refuses pre-spend). `AGY_REVIEW_ALLOW_ADDDIR` is a **retired** compatibility key: still recognized so an existing line never warns as unknown, but it arms nothing — the writer refuses to set it and `--unset` clears it. Allowed keys + value rules come from the bundled bridge manifests. **Previews by default**; refuses an unknown key, an out-of-range value, a model or effort the catalog does not offer, or a duplicate-carrying file; writes atomically (symlink/TOCTOU-safe). Never commits, never runs a model (only the read-only catalog commands). |
|
|
272
272
|
| `/agent-workflow-kit autonomy-doctor` | opt-in, any time | **guarded sandbox provisioner "doctor"** — can this machine run the Claude sandbox, and (only with your consent) fix it: macOS Seatbelt built-in / Linux+WSL2 needs `bwrap`+`socat` / native Windows → WSL2. Flagless = **FS-only preview** (the diagnosis, the exact absolute-path command it WOULD run, the exact `--apply <pm>:<pkgs>` consent tuple — runs nothing, never claims ready); `--verify` runs the unprivileged proof (a `bwrap` user-namespace smoke + `socat -V`) — the **only** source of a Linux "ready (verified)" claim; `--apply <pm>:<pkgs>` is the consent-gated privileged install (the tuple must equal the previewed plan; everything executed resolves to absolute paths inside `/usr/bin:/bin:/usr/sbin:/sbin`; the exact command is re-printed immediately before execution), then verifies. Honest loud degrades (unknown PM, untrusted location, nested-sandbox INDETERMINATE, root-unproven) and a stated restart step. Sits **outside every velocity auto-approve tier**; never auto-runs, never writes repo files, never commits. |
|
|
273
273
|
|
|
274
274
|
It **never auto-commits** and **never overwrites** an existing `AGENTS.md` without asking (its kit
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: agent-workflow-kit
|
|
|
3
3
|
description: Deploy or upgrade a portable AI-agent memory-and-workflow system in any project. Use when the user wants to bootstrap `docs/ai/` + an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) + cap/archive/index enforcement in a new or existing repo, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-kit` / `/agent-workflow-kit upgrade`. Triggers on phrases like "set up the memory system", "deploy the AI workflow here", "bootstrap docs/ai", "upgrade the workflow". New to the epic, story and task tier? Run `/agent-workflow-kit tier`. A typed decision with a confidence from Jev? Run `/agent-workflow-kit jev`.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
metadata:
|
|
6
|
-
version: '23.
|
|
6
|
+
version: '23.11.0'
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# agent-workflow-kit
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: codex-cli-bridge
|
|
3
3
|
description: Delegate work to the OpenAI Codex CLI (`codex`) under a ChatGPT subscription — run plan/instruction EXECUTION in a sandboxed workspace, or get a read-only ADVISORY review of a plan or working-tree diff — as a second delegated-execution backend beside Antigravity. Use when the user wants to hand a bounded coding task or plan to `codex exec`, get a second-opinion review from codex, install or authenticate Codex CLI, understand its sandbox/network/approval policy, drive codex efficiently from the main agent (exec vs review, resume, the commit boundary), bridge project context (`AGENTS.md`) into codex, or troubleshoot codex flags, models, auth, or its no-TTY headless behaviour.
|
|
4
4
|
metadata:
|
|
5
|
-
version: '6.0
|
|
5
|
+
version: '6.1.0'
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# codex-cli-bridge
|
|
@@ -51,7 +51,7 @@ this skill. Both wrappers enforce the subscription path before invoking codex:
|
|
|
51
51
|
|
|
52
52
|
Delegated codex work runs on the **host posture**: `CODEX_MODEL` and `CODEX_EFFORT` from the bridge
|
|
53
53
|
settings file `${XDG_CONFIG_HOME:-~/.config}/agent-workflow/bridge-settings.conf`, else the built-in
|
|
54
|
-
default `gpt-6.
|
|
54
|
+
default `gpt-6.2-sol` / `high`. **`/agent-workflow-kit bridge-settings`** shows the models the
|
|
55
55
|
installed `codex` offers and sets the host posture (checked against that list before it writes).
|
|
56
56
|
Before any run is spent the wrappers check the effective model and
|
|
57
57
|
effort against the installed CLI's catalog (`codex debug models`, the entries offered for listing): a
|
|
@@ -79,7 +79,7 @@ a precomputed review diff, `resume` instead of re-sending context), never from a
|
|
|
79
79
|
|
|
80
80
|
| Variable | Default | Effect |
|
|
81
81
|
|---|---|---|
|
|
82
|
-
| `CODEX_MODEL` | the setting, else `gpt-6.
|
|
82
|
+
| `CODEX_MODEL` | the setting, else `gpt-6.2-sol` | model passed to `-m`; an environment value off the host posture is a one-off, REFUSED unless `CODEX_PROBE=1` |
|
|
83
83
|
| `CODEX_EFFORT` | the setting, else `high` | reasoning effort (`-c model_reasoning_effort=…`); an environment value off the host posture is a one-off, REFUSED unless `CODEX_PROBE=1` |
|
|
84
84
|
|
|
85
85
|
`codex --version` reports the CLI version, **not** the model list. Quota is metered in **messages**
|
|
@@ -169,10 +169,10 @@ anything that would defeat a policy is guarded — see [§ Models](#models-the-h
|
|
|
169
169
|
|
|
170
170
|
| Variable | Default | Effect |
|
|
171
171
|
|---|---|---|
|
|
172
|
-
| `CODEX_MODEL` | the setting, else `gpt-6.
|
|
172
|
+
| `CODEX_MODEL` | the setting, else `gpt-6.2-sol` | model; off the host posture REFUSED unless `CODEX_PROBE=1` |
|
|
173
173
|
| `CODEX_EFFORT` | the setting, else `high` | reasoning effort; off the host posture REFUSED unless `CODEX_PROBE=1` |
|
|
174
174
|
| `CODEX_HARD_TIMEOUT` | `3600` (exec) / `1800` (review) | hard wall-clock cap (seconds) via `timeout`/`gtimeout`; exit 124/137 ⇒ "exceeded hard cap". No `timeout` binary ⇒ a nonce-less exec warns loudly + runs uncapped, a **nonced** exec REFUSES pre-spend (an accounted dispatch that cannot be capped can never honour the terminal-exit rule), and `codex-review` REFUSES pre-spend (fail-closed preflight). |
|
|
175
|
-
| `CODEX_SERVICE_TIER` | unset (standard tier) | **SPEND knob**: `priority` (catalog name "Fast") = "2x speed, **increased usage**" in the codex catalog's own words for gpt-6.
|
|
175
|
+
| `CODEX_SERVICE_TIER` | unset (standard tier) | **SPEND knob**: `priority` (catalog name "Fast") = "2x speed, **increased usage**" in the codex catalog's own words for gpt-6.2-sol (cache fetched 2026-11-18); it states no credit-rate figure — quality-neutral (same model). codex accepts any `-c service_tier` string silently (probe-verified), so the wrapper validates: an unsupported value warns and runs standard. Env or settings file. |
|
|
176
176
|
| `CODEX_SESSION_FILE` | `./.codex-last-session` | where `codex-exec` records the session id and where `--resume-last` reads it |
|
|
177
177
|
| `CODEX_REVIEW_MAX_TOTAL_BYTES` | `1500000` | `codex-review code`: above this the assembled diff goes via a git-dir temp file instead of inline — never truncated |
|
|
178
178
|
| `AW_REVIEW_NONCE` | unset | the flow dispatch nonce (safe grammar `[A-Za-z0-9._-]{1,64}` — anything else refuses pre-spend). `codex-review … --nonce <n>` is the plain-argument equivalent (one seam; flag and a non-empty env must agree, a disagreeing pair refuses pre-spend) — the lane for hosts whose dispatch policy has no env-prefix form. When supplied, a successful review first mints the finding MANIFEST `agent-workflow-finding-manifest-codex-<nonce>.json` beside the receipts file (atomic, no-clobber, ORDERED before the receipt append) — a failed mint EXCLUDES the receipt, so a nonce-supplied dispatch never lands a receipt without its readable manifest; nonce-less runs add no nonce field and mint nothing (the `wrapperVersion` field every receipt carries moves with each release) |
|
|
@@ -8,6 +8,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
8
8
|
import { makeFixtureRepo, openSuiteScopes } from './codex-fixtures-harness.test.mjs';
|
|
9
9
|
const stripGitLocationEnv = (env) => Object.fromEntries(Object.entries(env).filter(([key]) => !/^[Gg][Ii][Tt]_/.test(key)));
|
|
10
10
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const MANIFEST = JSON.parse(readFileSync(join(HERE, '..', 'capability.json'), 'utf8'));
|
|
11
12
|
const EXEC = join(HERE, 'codex-exec.sh');
|
|
12
13
|
const HOSTS = 'api.typesafe.ai,docs.typesafe.ai';
|
|
13
14
|
const childEnv = (home, env = {}) => ({ ...stripGitLocationEnv(env), HOME: home, XDG_CONFIG_HOME: join(home, '.config'),
|
|
@@ -19,7 +20,7 @@ const FAKE_CODEX = [
|
|
|
19
20
|
'st() { if [[ -n "${!1+x}" ]]; then printf "[%s]" "${!1}"; else printf unset; fi; }', 'rec() { echo "$1 key=$(st TYPESAFE_API_KEY) openai=$(st OPENAI_API_KEY) codex=$(st CODEX_API_KEY) foo=$(st FOO_API_KEY) base=$(st OPENAI_BASE_URL) bar=$(st BAR_API_KEY)" >>"$CODEX_FAKE_LOG"; }',
|
|
20
21
|
'case "${1:-}" in', ' login) rec login; echo "Logged in using ChatGPT"; exit 0 ;;',
|
|
21
22
|
' --version) rec version; echo "${CODEX_FAKE_VERSION-codex-cli 0.160.0}"; exit 0 ;;', ' debug) rec catalog; cat <<EOF',
|
|
22
|
-
|
|
23
|
+
`{"models":[{"slug":"${MANIFEST.posture.model}","priority":1,"visibility":"list","default_reasoning_level":"low","supported_reasoning_levels":[{"effort":"low"},{"effort":"medium"},{"effort":"high"}]}]}`,
|
|
23
24
|
'EOF', ' exit 0 ;;', 'esac', 'rec run',
|
|
24
25
|
'{ for a in "$@"; do echo "$a"; done; } >"$CODEX_FAKE_ARGV"', 'cat >"$CODEX_FAKE_STDIN"',
|
|
25
26
|
'out=""; prev=""; for a in "$@"; do if [[ "$prev" == "-o" ]]; then out="$a"; fi; prev="$a"; done', 'if [[ -n "$out" ]]; then echo "${CODEX_FAKE_FINAL:-FAKE_FINAL}" >"$out"; fi',
|
|
@@ -113,7 +114,7 @@ const assertFallback = (r) => {
|
|
|
113
114
|
assert.equal(c['sandbox_workspace_write.network_access'], 'false');
|
|
114
115
|
};
|
|
115
116
|
const bannerOf = (r) => r.stderr.split('\n').find((line) => line.startsWith('exec posture: ')) ?? '';
|
|
116
|
-
const banner = (sandboxValue, jev, session = 'fresh') =>
|
|
117
|
+
const banner = (sandboxValue, jev, session = 'fresh') => `exec posture: model=${MANIFEST.posture.model} effort=high tier=standard `
|
|
117
118
|
+ `sandbox=${sandboxValue} session=${session} jev=${jev} source=model:default,effort:default timeout=3600s`;
|
|
118
119
|
const unreachable = (reason) => banner('workspace-write', `unreachable (${reason})`);
|
|
119
120
|
const KEYS = { TYPESAFE_API_KEY: 'jev-key', OPENAI_API_KEY: 'sk-live', CODEX_API_KEY: 'ck', FOO_API_KEY: 'foo', OPENAI_BASE_URL: 'http://proxy' };
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# bypasses shell functions) — the orchestrator owns the commit boundary.
|
|
22
22
|
#
|
|
23
23
|
# Host posture (hard rule): delegated codex work runs on the host posture — CODEX_MODEL and
|
|
24
|
-
# CODEX_EFFORT from the bridge settings file, else the built-in default gpt-6.
|
|
24
|
+
# CODEX_EFFORT from the bridge settings file, else the built-in default gpt-6.2-sol at effort high
|
|
25
25
|
# (`/agent-workflow-kit bridge-settings` shows the models offered and sets one) — checked against the
|
|
26
26
|
# installed CLI's catalog before any spend. A run on anything else is a one-off, refused unless
|
|
27
27
|
# it is a probe (CODEX_PROBE=1); a nonced dispatch never runs a one-off. Economy comes from
|
|
@@ -240,7 +240,7 @@ Notes:
|
|
|
240
240
|
|
|
241
241
|
Settings file (KEY=VALUE, parsed never sourced; env wins over file, file wins over built-in default):
|
|
242
242
|
${XDG_CONFIG_HOME:-~/.config}/agent-workflow/bridge-settings.conf
|
|
243
|
-
CODEX_SERVICE_TIER — service tier: 'priority' (Fast — "2x speed, increased usage", the codex catalog's own words for gpt-6.
|
|
243
|
+
CODEX_SERVICE_TIER — service tier: 'priority' (Fast — "2x speed, increased usage", the codex catalog's own words for gpt-6.2-sol, cache fetched 2026-11-18; it states no credit-rate figure); a consented SPEND knob, default off (standard tier)
|
|
244
244
|
CODEX_HARD_TIMEOUT — hard wall-clock cap, integer seconds 1..86400 (built-in default 3600)
|
|
245
245
|
|
|
246
246
|
Environment: CODEX_HARD_TIMEOUT (seconds, default 3600), CODEX_PROBE=1 (throwaway probe only), AW_DISPATCH_NONCE (delegation dispatch nonce — mints the exec receipt; the --nonce <n> flag is its plain-argument equivalent), AW_DELEGATION_STORE (absolute delegation-store path; its dirname is where the receipt lands).
|
|
@@ -252,7 +252,7 @@ esac
|
|
|
252
252
|
|
|
253
253
|
# This wrapper's applied settings-file subset (see the shared reader block below).
|
|
254
254
|
AW_SETTINGS_APPLIED="CODEX_SERVICE_TIER CODEX_HARD_TIMEOUT"
|
|
255
|
-
DEFAULT_CODEX_MODEL="gpt-6.
|
|
255
|
+
DEFAULT_CODEX_MODEL="gpt-6.2-sol"
|
|
256
256
|
DEFAULT_CODEX_EFFORT="high"
|
|
257
257
|
# This wrapper's filesystem part of the permissions profile `jev` (the shared block below): the whole disk read,
|
|
258
258
|
# writes to the temp dirs and the repository root the wrapper preflights and runs from (P3).
|
|
@@ -470,8 +470,8 @@ CODEX_HARD_TIMEOUT="${CODEX_HARD_TIMEOUT:-3600}"
|
|
|
470
470
|
# Codex service tier (quality-neutral speed knob): default EMPTY ⇒ no
|
|
471
471
|
# service_tier flag (standard tier) — enabling Fast is a consented per-host SPEND act, never a
|
|
472
472
|
# silent default. The only server-catalog tier id on this subscription is 'priority' (catalog
|
|
473
|
-
# display name "Fast": "2x speed, increased usage" in the catalog's own words for gpt-6.
|
|
474
|
-
# fetched 2026-
|
|
473
|
+
# display name "Fast": "2x speed, increased usage" in the catalog's own words for gpt-6.2-sol, cache
|
|
474
|
+
# fetched 2026-11-18; it states no credit-rate figure; quality-neutral — same model). codex itself
|
|
475
475
|
# accepts ANY -c service_tier string silently (probe-verified), so
|
|
476
476
|
# the wrapper validates the effective value: an unsupported one warns and runs on the standard
|
|
477
477
|
# tier — a typo can never silently masquerade as Fast.
|
|
@@ -513,7 +513,7 @@ CHATGPT_LOGIN_GUARD="Logged in using ChatGPT"
|
|
|
513
513
|
# receipt this wrapper mints; scripts/release/version-sync.mjs bumps it under the one-anchor-per-file
|
|
514
514
|
# rule, so a release can never leave it behind (the AD-053 drift class).
|
|
515
515
|
AW_RECEIPT_BACKEND="codex"
|
|
516
|
-
AW_BRIDGE_VERSION="6.0
|
|
516
|
+
AW_BRIDGE_VERSION="6.1.0" # aw-version-anchor
|
|
517
517
|
# The kill grace handed to timeout(1) as --kill-after, and recorded in the receipt as killGraceS:
|
|
518
518
|
# ONE constant, so the number the ledger checks against the dispatch deadline is the number the run
|
|
519
519
|
# actually applied.
|
|
@@ -13,6 +13,7 @@ import { makeFixtureRepo } from './codex-fixtures-harness.test.mjs';
|
|
|
13
13
|
|
|
14
14
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
15
15
|
const WRAPPER = join(HERE, 'codex-exec.sh');
|
|
16
|
+
const MANIFEST = JSON.parse(readFileSync(join(HERE, '..', 'capability.json'), 'utf8'));
|
|
16
17
|
|
|
17
18
|
// A hermetic fake `codex`: answers `login status` and `debug models`, captures argv/env/stdin to the
|
|
18
19
|
// files named by CODEX_FAKE_*, honours -o by writing a final-message file, and
|
|
@@ -25,7 +26,7 @@ const FAKE_CODEX = [
|
|
|
25
26
|
'if [[ "${1:-}" == "login" ]]; then echo "${CODEX_FAKE_LOGIN:-Logged in using ChatGPT}"; exit 0; fi',
|
|
26
27
|
'if [[ "${1:-}" == "--version" ]]; then echo "codex-cli ${CODEX_FAKE_VERSION:-0.160.0}"; exit 0; fi',
|
|
27
28
|
'if [[ "${1:-}" == "debug" ]]; then cat <<EOF',
|
|
28
|
-
|
|
29
|
+
`{"models":[{"slug":"${MANIFEST.posture.model}","priority":1,"visibility":"list","default_reasoning_level":"low","supported_reasoning_levels":[{"effort":"low"},{"effort":"medium"},{"effort":"high"}]},{"slug":"gpt-6-astra","priority":2,"visibility":"list","default_reasoning_level":"medium","supported_reasoning_levels":[{"effort":"medium"},{"effort":"high"}]}]}`,
|
|
29
30
|
'EOF',
|
|
30
31
|
'exit 0; fi',
|
|
31
32
|
'if [[ -n "${CODEX_FAKE_STDERR:-}" ]]; then echo "$CODEX_FAKE_STDERR" >&2; fi',
|
|
@@ -642,7 +643,7 @@ describe('codex-exec.sh — preflight (unchanged invariants)', { concurrency: 2
|
|
|
642
643
|
|
|
643
644
|
describe('codex-exec.sh — resume entrypoint restates every invariant (3.1)', { concurrency: 2 }, () => {
|
|
644
645
|
const RESUME_INVARIANTS = [
|
|
645
|
-
/(^|\n)resume(\n|$)/, /(^|\n)--ignore-user-config(\n|$)/,
|
|
646
|
+
/(^|\n)resume(\n|$)/, /(^|\n)--ignore-user-config(\n|$)/, new RegExp(`(^|\\n)${MANIFEST.posture.model.replaceAll('.', '\\.')}(\\n|$)`),
|
|
646
647
|
/model_reasoning_effort=high/, /sandbox_mode=workspace-write/,
|
|
647
648
|
/approval_policy=never/, /sandbox_workspace_write\.network_access=false/,
|
|
648
649
|
];
|
|
@@ -969,7 +970,6 @@ describe('codex-exec.sh — session id absent', { concurrency: 2 }, () => {
|
|
|
969
970
|
// git-shim heredoc's own `case` arms are NOT CLI modes and must be skipped).
|
|
970
971
|
// Helpers are inline — each bridge test file stays standalone (mirror byte-equality).
|
|
971
972
|
|
|
972
|
-
const MANIFEST = JSON.parse(readFileSync(join(HERE, '..', 'capability.json'), 'utf8'));
|
|
973
973
|
const EXEC_CONTRACT = MANIFEST.roles.execute.contract;
|
|
974
974
|
const norm = (s) => s.replace(/\s+/g, ' ').trim();
|
|
975
975
|
const setEq = (got, want, msg) => assert.deepEqual([...got].sort(), [...want].sort(), msg);
|
|
@@ -1522,7 +1522,7 @@ describe('codex-exec.sh — dispatch-posture labeling (D5, AD-061)', { concurren
|
|
|
1522
1522
|
assert.equal(r.status, 0, r.stderr);
|
|
1523
1523
|
const lines = banners(r.stderr);
|
|
1524
1524
|
assert.equal(lines.length, 1, 'EXACTLY ONE banner line per run');
|
|
1525
|
-
assert.equal(lines[0], `exec posture: model
|
|
1525
|
+
assert.equal(lines[0], `exec posture: model=${MANIFEST.posture.model} effort=high tier=standard sandbox=workspace-write session=fresh jev=unreachable (repository under ${root}) source=model:default,effort:default timeout=3600s`);
|
|
1526
1526
|
});
|
|
1527
1527
|
|
|
1528
1528
|
it('an ARMED Fast tier rides the banner (tier=priority)', async () => {
|
|
@@ -2020,7 +2020,7 @@ describe('codex-exec.sh — the pre-spend reservation (D1/D8)', { concurrency: 2
|
|
|
2020
2020
|
assert.equal(r.status, 71, r.stderr);
|
|
2021
2021
|
assert.equal(held.state, 'reserved');
|
|
2022
2022
|
assert.equal(held.wrapperVersion, MANIFEST.version, 'the receipt stamps the bridge version version-sync bumps');
|
|
2023
|
-
assert.deepEqual(held.posture,
|
|
2023
|
+
assert.deepEqual(held.posture, MANIFEST.posture);
|
|
2024
2024
|
assert.equal(held.capS, 3600);
|
|
2025
2025
|
assert.equal(held.killGraceS, 15);
|
|
2026
2026
|
assert.match(held.contractDigest, /^[0-9a-f]{64}$/);
|
|
@@ -51,7 +51,7 @@ const entry = (slug, priority, efforts, level = 'medium', visibility = 'list') =
|
|
|
51
51
|
slug, priority, visibility, default_reasoning_level: level, supported_reasoning_levels: efforts.map((effort) => ({ effort })),
|
|
52
52
|
});
|
|
53
53
|
const ALL = ['low', 'medium', 'high', 'xhigh'];
|
|
54
|
-
const STANDARD = { models: [entry(
|
|
54
|
+
const STANDARD = { models: [entry(MANIFEST.posture.model, 1, ALL, 'low'), entry('gpt-6-astra', 2, ALL), entry('gpt-6-luna', 3, ['low', 'medium', 'high'])] };
|
|
55
55
|
const HOST_SETTING = 'CODEX_MODEL=gpt-6-luna\nCODEX_EFFORT=medium\n';
|
|
56
56
|
|
|
57
57
|
const { repos, tmp, profileSkip } = await openSuiteScopes('codex-model-posture');
|
|
@@ -138,19 +138,19 @@ const assertRefusedUnspent = (r) => {
|
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
describe('a fresh host runs the built-in default — spec:bridge-model/S1', () => {
|
|
141
|
-
it('codex-exec and codex-review run gpt-6.
|
|
141
|
+
it('codex-exec and codex-review run gpt-6.2-sol at effort high and the banner names source default', { skip: profileSkip }, () => {
|
|
142
142
|
const exec = drive(sandbox({ root: repos }), FRESH_EXEC);
|
|
143
|
-
assertRan(exec, 'gpt-6.
|
|
144
|
-
assert.equal(bannerOf(exec.stderr), 'exec posture: model=gpt-6.
|
|
143
|
+
assertRan(exec, 'gpt-6.2-sol', 'high');
|
|
144
|
+
assert.equal(bannerOf(exec.stderr), 'exec posture: model=gpt-6.2-sol effort=high tier=standard sandbox=jev-profile session=fresh '
|
|
145
145
|
+ 'jev=api.typesafe.ai,docs.typesafe.ai source=model:default,effort:default timeout=3600s');
|
|
146
146
|
const review = drive(sandbox(), PLAN_REVIEW);
|
|
147
|
-
assertRan(review, 'gpt-6.
|
|
148
|
-
assert.equal(bannerOf(review.stderr), 'review posture: model=gpt-6.
|
|
147
|
+
assertRan(review, 'gpt-6.2-sol', 'high');
|
|
148
|
+
assert.equal(bannerOf(review.stderr), 'review posture: model=gpt-6.2-sol effort=high tier=standard jev=api.typesafe.ai,docs.typesafe.ai source=model:default,effort:default timeout=1800s');
|
|
149
149
|
});
|
|
150
150
|
it('a codex-exec fallback run keeps the same model fields, sandbox=workspace-write and jev=unreachable before source=', () => {
|
|
151
151
|
const exec = drive(sandbox(), FRESH_EXEC, { CODEX_FAKE_VERSION: '0.159.0' });
|
|
152
|
-
assertRan(exec, 'gpt-6.
|
|
153
|
-
assert.equal(bannerOf(exec.stderr), 'exec posture: model=gpt-6.
|
|
152
|
+
assertRan(exec, 'gpt-6.2-sol', 'high');
|
|
153
|
+
assert.equal(bannerOf(exec.stderr), 'exec posture: model=gpt-6.2-sol effort=high tier=standard sandbox=workspace-write session=fresh jev=unreachable (codex 0.159.0 below 0.160.0) source=model:default,effort:default timeout=3600s');
|
|
154
154
|
});
|
|
155
155
|
});
|
|
156
156
|
|
|
@@ -168,8 +168,8 @@ describe('the setting is the host posture of every codex wrapper — spec:bridge
|
|
|
168
168
|
describe('an environment value equal to the host posture is no one-off — spec:bridge-model/S3', () => {
|
|
169
169
|
const cases = [
|
|
170
170
|
['the setting restated in the env', HOST_SETTING, { CODEX_MODEL: 'gpt-6-luna', CODEX_EFFORT: 'medium' }, 'gpt-6-luna', 'medium', 'model:environment,effort:environment'],
|
|
171
|
-
[
|
|
172
|
-
['explicitly empty env keys on a fresh host', undefined, { CODEX_MODEL: '', CODEX_EFFORT: '' },
|
|
171
|
+
[`env ${MANIFEST.posture.model} on a fresh host`, undefined, { CODEX_MODEL: MANIFEST.posture.model }, MANIFEST.posture.model, 'high', 'model:environment,effort:default'],
|
|
172
|
+
['explicitly empty env keys on a fresh host', undefined, { CODEX_MODEL: '', CODEX_EFFORT: '' }, MANIFEST.posture.model, 'high', 'model:environment,effort:environment'],
|
|
173
173
|
];
|
|
174
174
|
for (const [label, settings, env, model, effort, source] of cases) {
|
|
175
175
|
for (const parent of [FRESH_EXEC, PLAN_REVIEW]) {
|
|
@@ -183,9 +183,9 @@ describe('an environment value equal to the host posture is no one-off — spec:
|
|
|
183
183
|
});
|
|
184
184
|
|
|
185
185
|
const ONE_OFFS = [
|
|
186
|
-
[
|
|
186
|
+
[`env ${MANIFEST.posture.model}`, { CODEX_MODEL: MANIFEST.posture.model }, MANIFEST.posture.model, 'medium'],
|
|
187
187
|
['env CODEX_EFFORT=high alone', { CODEX_EFFORT: 'high' }, 'gpt-6-luna', 'high'],
|
|
188
|
-
['an explicitly empty CODEX_MODEL=', { CODEX_MODEL: '' },
|
|
188
|
+
['an explicitly empty CODEX_MODEL=', { CODEX_MODEL: '' }, MANIFEST.posture.model, 'medium'],
|
|
189
189
|
['an explicitly empty CODEX_EFFORT=', { CODEX_EFFORT: '' }, 'gpt-6-luna', 'high'],
|
|
190
190
|
];
|
|
191
191
|
|
|
@@ -222,7 +222,7 @@ describe('a nonced probe one-off is refused; a probe review keeps its nonce —
|
|
|
222
222
|
it(`${label}: a probe one-off is refused before any reservation`, () => {
|
|
223
223
|
const sb = sandbox({ settings: HOST_SETTING });
|
|
224
224
|
writeFileSync(join(sb.repo, 'task.md'), CONTRACT);
|
|
225
|
-
const r = drive(sb, [EXEC, args], { ...env, CODEX_PROBE: '1', CODEX_MODEL:
|
|
225
|
+
const r = drive(sb, [EXEC, args], { ...env, CODEX_PROBE: '1', CODEX_MODEL: MANIFEST.posture.model });
|
|
226
226
|
assertRefusedUnspent(r);
|
|
227
227
|
assert.match(r.stderr, /cannot carry a dispatch nonce/);
|
|
228
228
|
assert.equal(existsSync(join(sb.repo, '.git', 'agent-workflow-exec-receipt-5-codex-n1.json')), false);
|
|
@@ -237,8 +237,8 @@ describe('a nonced probe one-off is refused; a probe review keeps its nonce —
|
|
|
237
237
|
assert.deepEqual(receipt.posture, { model: 'gpt-6-luna', effort: 'medium', tier: null });
|
|
238
238
|
});
|
|
239
239
|
it('a probe review one-off keeps its --nonce', () => {
|
|
240
|
-
const r = drive(sandbox({ settings: HOST_SETTING }), [REVIEW, ['plan', 'plan.md', '--nonce', 'n1']], { CODEX_PROBE: '1', CODEX_MODEL:
|
|
241
|
-
assertRan(r,
|
|
240
|
+
const r = drive(sandbox({ settings: HOST_SETTING }), [REVIEW, ['plan', 'plan.md', '--nonce', 'n1']], { CODEX_PROBE: '1', CODEX_MODEL: MANIFEST.posture.model });
|
|
241
|
+
assertRan(r, MANIFEST.posture.model, 'medium');
|
|
242
242
|
});
|
|
243
243
|
});
|
|
244
244
|
|
|
@@ -253,7 +253,7 @@ describe('a model or effort flag after -- is refused pre-spend — spec:bridge-m
|
|
|
253
253
|
});
|
|
254
254
|
|
|
255
255
|
describe('a model the catalog does not offer is refused with the offered list — spec:bridge-model/S8', () => {
|
|
256
|
-
const offered =
|
|
256
|
+
const offered = `offered: ${MANIFEST.posture.model}, gpt-6-astra, gpt-6-luna`;
|
|
257
257
|
const sources = [['the setting', { settings: 'CODEX_MODEL=gpt-unknown\n' }, {}], ['the environment', {}, { CODEX_MODEL: 'gpt-unknown' }]];
|
|
258
258
|
for (const [label, options, env] of sources) {
|
|
259
259
|
for (const parent of [FRESH_EXEC, PLAN_REVIEW]) {
|
|
@@ -263,7 +263,7 @@ describe('a model the catalog does not offer is refused with the offered list
|
|
|
263
263
|
assertRefusedUnspent(r);
|
|
264
264
|
assert.match(r.stderr, /CODEX_MODEL='gpt-unknown' .*not a model the installed codex offers/);
|
|
265
265
|
assert.ok(r.stderr.includes(offered), r.stderr);
|
|
266
|
-
assert.match(r.stderr, remedyRe(sb,
|
|
266
|
+
assert.match(r.stderr, remedyRe(sb, MANIFEST.posture.model, 'high'));
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
269
|
}
|
|
@@ -275,23 +275,23 @@ describe('a model the catalog does not offer is refused with the offered list
|
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
277
|
it('the default is restored even when another offered slug has a smaller priority number', () => {
|
|
278
|
-
const sb = sandbox({ settings: 'CODEX_MODEL=gpt-unknown\n', catalog: { models: [entry('gpt-6-luna', 0, ALL), entry(
|
|
279
|
-
assert.match(drive(sb, FRESH_EXEC).stderr, remedyRe(sb,
|
|
278
|
+
const sb = sandbox({ settings: 'CODEX_MODEL=gpt-unknown\n', catalog: { models: [entry('gpt-6-luna', 0, ALL), entry(MANIFEST.posture.model, 1, ALL, 'low')] } });
|
|
279
|
+
assert.match(drive(sb, FRESH_EXEC).stderr, remedyRe(sb, MANIFEST.posture.model, 'high'));
|
|
280
280
|
});
|
|
281
281
|
it('the default itself is refused when not offered; the remedy is the smallest-priority entry whole', () => {
|
|
282
282
|
const sb = sandbox({ catalog: { models: [entry('gpt-6-astra', 5, ALL), entry('gpt-6-luna', 2, ['low', 'medium'], 'low')] } });
|
|
283
283
|
const r = drive(sb, FRESH_EXEC);
|
|
284
284
|
assertRefusedUnspent(r);
|
|
285
|
-
assert.match(r.stderr,
|
|
285
|
+
assert.match(r.stderr, new RegExp(`CODEX_MODEL='${quote(MANIFEST.posture.model)}' \\(default\\)`));
|
|
286
286
|
assert.match(r.stderr, remedyRe(sb, 'gpt-6-luna', 'low'));
|
|
287
287
|
});
|
|
288
288
|
it('on a mixed catalog only visibility=list entries count — a hidden slug is refused and never named', () => {
|
|
289
|
-
const mixed = { models: [entry('gpt-secret', 0, ALL, 'xhigh', 'hide'), entry('gpt-6-luna', 2, ALL), entry(
|
|
289
|
+
const mixed = { models: [entry('gpt-secret', 0, ALL, 'xhigh', 'hide'), entry('gpt-6-luna', 2, ALL), entry(MANIFEST.posture.model, 3, ['low', 'medium'], 'low')] };
|
|
290
290
|
const sb = sandbox({ settings: 'CODEX_MODEL=gpt-secret\n', catalog: mixed });
|
|
291
291
|
const r = drive(sb, FRESH_EXEC);
|
|
292
292
|
assertRefusedUnspent(r);
|
|
293
293
|
const afterRefusal = r.stderr.slice(r.stderr.indexOf('offered:'));
|
|
294
|
-
assert.ok(afterRefusal.includes(
|
|
294
|
+
assert.ok(afterRefusal.includes(`offered: gpt-6-luna, ${MANIFEST.posture.model}`), r.stderr);
|
|
295
295
|
assert.doesNotMatch(afterRefusal, /gpt-secret/);
|
|
296
296
|
assert.match(r.stderr, remedyRe(sb, 'gpt-6-luna', 'medium'));
|
|
297
297
|
});
|
|
@@ -305,7 +305,7 @@ describe('an effort the model does not offer is refused the same way — spec:br
|
|
|
305
305
|
assertRefusedUnspent(r);
|
|
306
306
|
assert.match(r.stderr, /CODEX_EFFORT='xhigh' \(setting\) is not an effort the installed codex offers for gpt-6-luna/);
|
|
307
307
|
assert.ok(r.stderr.includes('offered: low, medium, high'), r.stderr);
|
|
308
|
-
assert.match(r.stderr, remedyRe(sb,
|
|
308
|
+
assert.match(r.stderr, remedyRe(sb, MANIFEST.posture.model, 'high'));
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
});
|
|
@@ -316,15 +316,15 @@ describe('an unreadable catalog is one stderr line and the run proceeds — spec
|
|
|
316
316
|
['a timed-out read', { fakeTimeout: true }, { CODEX_FAKE_CATALOG_SLEEP: '5' }],
|
|
317
317
|
['output that is not JSON', { catalogText: 'not json at all' }, {}],
|
|
318
318
|
['JSON without models[]', { catalog: { data: [] } }, {}],
|
|
319
|
-
['a catalog that offers no model', { catalog: { models: [entry(
|
|
319
|
+
['a catalog that offers no model', { catalog: { models: [entry(MANIFEST.posture.model, 1, ALL, 'low', 'hide')] } }, {}],
|
|
320
320
|
['an offered entry without a slug', { catalog: { models: [{ ...entry('', 0, ALL), slug: undefined }, entry('gpt-6-luna', 2, ALL)] } }, {}],
|
|
321
|
-
['the effective entry without supported_reasoning_levels', { catalog: { models: [{ slug:
|
|
321
|
+
['the effective entry without supported_reasoning_levels', { catalog: { models: [{ slug: MANIFEST.posture.model, priority: 1, visibility: 'list', default_reasoning_level: 'low' }] } }, {}],
|
|
322
322
|
];
|
|
323
323
|
for (const [label, options, env] of unreadable) {
|
|
324
324
|
for (const parent of [FRESH_EXEC, PLAN_REVIEW]) {
|
|
325
325
|
it(`${label} on ${parent[0] === EXEC ? 'codex-exec' : 'codex-review'}`, () => {
|
|
326
326
|
const r = drive(sandbox(options), parent, env);
|
|
327
|
-
assertRan(r,
|
|
327
|
+
assertRan(r, MANIFEST.posture.model, 'high');
|
|
328
328
|
assert.equal(r.stderr.split('\n').filter((line) => /catalog/.test(line)).length, 1, r.stderr);
|
|
329
329
|
assert.match(r.stderr, /^warning: the codex model catalog is unreadable \(.+\) — the run proceeds/m);
|
|
330
330
|
});
|
|
@@ -342,7 +342,7 @@ describe('an unreadable catalog is one stderr line and the run proceeds — spec
|
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
const r = drive(sb, FRESH_EXEC, { PATH: `${sb.bin}:${farm}` });
|
|
345
|
-
assertRan(r,
|
|
345
|
+
assertRan(r, MANIFEST.posture.model, 'high');
|
|
346
346
|
assert.match(r.log, /^catalog /m);
|
|
347
347
|
assert.match(bannerOf(r.stderr), / timeout=uncapped$/);
|
|
348
348
|
});
|
|
@@ -356,7 +356,7 @@ describe('the catalog read follows the subscription guard and ignores a user con
|
|
|
356
356
|
mkdirSync(codexHome);
|
|
357
357
|
writeFileSync(join(codexHome, 'config.toml'), 'model_provider = "their-proxy"\n');
|
|
358
358
|
const r = drive(sb, parent, { CODEX_HOME: codexHome, OPENAI_API_KEY: 'sk-live', FOO_API_KEY: 'foo', OPENAI_BASE_URL: 'http://proxy' });
|
|
359
|
-
assertRan(r,
|
|
359
|
+
assertRan(r, MANIFEST.posture.model, 'high');
|
|
360
360
|
assert.match(r.log, new RegExp(`^catalog argv=\\[.*\\] home=${quote(codexHome)} keys=unset,unset,unset$`, 'm'));
|
|
361
361
|
});
|
|
362
362
|
}
|
|
@@ -370,7 +370,7 @@ describe('a settings-file model value with a control byte or an empty one falls
|
|
|
370
370
|
for (const [label, settings] of values) {
|
|
371
371
|
it(`${label}: each key warns without the raw byte and the run takes the built-in default`, () => {
|
|
372
372
|
const r = drive(sandbox({ settings }), FRESH_EXEC);
|
|
373
|
-
assertRan(r,
|
|
373
|
+
assertRan(r, MANIFEST.posture.model, 'high');
|
|
374
374
|
assert.equal(r.stderr.includes(ESC), false, 'no raw control byte reaches stderr');
|
|
375
375
|
assert.match(r.stderr, /warning: CODEX_MODEL in bridge settings file .* built-in default/);
|
|
376
376
|
assert.match(r.stderr, /warning: CODEX_EFFORT in bridge settings file .* built-in default/);
|
|
@@ -11,6 +11,7 @@ import { makeFixtureRepo, openSuiteScopes } from './codex-fixtures-harness.test.
|
|
|
11
11
|
const stripGitLocationEnv = (env) => Object.fromEntries(Object.entries(env).filter(([key]) => !/^[Gg][Ii][Tt]_/.test(key)));
|
|
12
12
|
|
|
13
13
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const MANIFEST = JSON.parse(readFileSync(join(HERE, '..', 'capability.json'), 'utf8'));
|
|
14
15
|
const REVIEW = join(HERE, 'codex-review.sh');
|
|
15
16
|
const HOSTS = 'api.typesafe.ai,docs.typesafe.ai';
|
|
16
17
|
const childEnv = (home, env = {}) => ({ ...stripGitLocationEnv(env), HOME: home, XDG_CONFIG_HOME: join(home, '.config'),
|
|
@@ -28,7 +29,7 @@ const FAKE_CODEX = [
|
|
|
28
29
|
' login) rec login; echo "Logged in using ChatGPT"; exit 0 ;;',
|
|
29
30
|
' --version) rec version; echo "${CODEX_FAKE_VERSION-codex-cli 0.160.0}"; exit 0 ;;',
|
|
30
31
|
' debug) rec catalog; cat <<EOF',
|
|
31
|
-
|
|
32
|
+
`{"models":[{"slug":"${MANIFEST.posture.model}","priority":1,"visibility":"list","default_reasoning_level":"low","supported_reasoning_levels":[{"effort":"low"},{"effort":"medium"},{"effort":"high"}]}]}`,
|
|
32
33
|
'EOF',
|
|
33
34
|
' exit 0 ;;',
|
|
34
35
|
'esac',
|
|
@@ -148,7 +149,7 @@ const assertFallback = (r) => {
|
|
|
148
149
|
assert.equal(r.argv[r.argv.indexOf('--sandbox') + 1], 'read-only', r.argv.join(' '));
|
|
149
150
|
};
|
|
150
151
|
const bannerOf = (r) => r.stderr.split('\n').find((line) => line.startsWith('review posture: ')) ?? '';
|
|
151
|
-
const banner = (jev) => `review posture: model
|
|
152
|
+
const banner = (jev) => `review posture: model=${MANIFEST.posture.model} effort=high tier=standard jev=${jev} source=model:default,effort:default timeout=1800s`;
|
|
152
153
|
const KEYS = { TYPESAFE_API_KEY: 'jev-key', OPENAI_API_KEY: 'sk-live', CODEX_API_KEY: 'ck', FOO_API_KEY: 'foo', OPENAI_BASE_URL: 'http://proxy' };
|
|
153
154
|
const PASSED = 'key=[jev-key] openai=unset codex=unset foo=unset base=unset bar=unset';
|
|
154
155
|
const runEnv = (r) => (r.spawns.find(([kind]) => kind === 'run') ?? [])[1];
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
# back as a validated JSON object, with a raw-text fallback.
|
|
25
25
|
#
|
|
26
26
|
# Auth/policy: subscription-only, identical to codex-exec.sh. The review runs on the host
|
|
27
|
-
# posture — the built-in default gpt-6.
|
|
27
|
+
# posture — the built-in default gpt-6.2-sol at effort high unless the user set another with
|
|
28
28
|
# `/agent-workflow-kit bridge-settings` (advisory findings still bear on what ships, so the same
|
|
29
29
|
# one-off refusal applies; CODEX_PROBE=1 is the one route to a one-off, and a probe receipt never
|
|
30
30
|
# attests).
|
|
@@ -166,7 +166,7 @@ Receipt:
|
|
|
166
166
|
|
|
167
167
|
Settings file (KEY=VALUE, parsed never sourced; env wins over file, file wins over built-in default):
|
|
168
168
|
${XDG_CONFIG_HOME:-~/.config}/agent-workflow/bridge-settings.conf
|
|
169
|
-
CODEX_SERVICE_TIER — service tier: 'priority' (Fast — "2x speed, increased usage", the codex catalog's own words for gpt-6.
|
|
169
|
+
CODEX_SERVICE_TIER — service tier: 'priority' (Fast — "2x speed, increased usage", the codex catalog's own words for gpt-6.2-sol, cache fetched 2026-11-18; it states no credit-rate figure); a consented SPEND knob, default off (standard tier)
|
|
170
170
|
CODEX_HARD_TIMEOUT — hard wall-clock cap, integer seconds 1..86400 (built-in default 1800)
|
|
171
171
|
CODEX_REVIEW_MAX_TOTAL_BYTES — inline-payload cap, integer bytes 1..100000000 (default 1500000); above it the diff rides via a git-dir temp file
|
|
172
172
|
|
|
@@ -202,7 +202,7 @@ esac
|
|
|
202
202
|
|
|
203
203
|
# This wrapper's applied settings-file subset (see the shared reader block below).
|
|
204
204
|
AW_SETTINGS_APPLIED="CODEX_SERVICE_TIER CODEX_HARD_TIMEOUT CODEX_REVIEW_MAX_TOTAL_BYTES"
|
|
205
|
-
DEFAULT_CODEX_MODEL="gpt-6.
|
|
205
|
+
DEFAULT_CODEX_MODEL="gpt-6.2-sol"
|
|
206
206
|
DEFAULT_CODEX_EFFORT="high"
|
|
207
207
|
# This wrapper's filesystem part of the permissions profile `jev` (the shared block below): the whole disk read
|
|
208
208
|
# and no write entry at all (P14: the tree, .git and /tmp refused writes).
|
|
@@ -416,7 +416,7 @@ aw_scrub_billing_keys() {
|
|
|
416
416
|
# Review-receipt identity (AD-038). AW_BRIDGE_VERSION mirrors this bridge's SKILL.md/capability.json
|
|
417
417
|
# version (drift-guarded by codex-review.test.mjs against capability.json).
|
|
418
418
|
AW_RECEIPT_BACKEND="codex"
|
|
419
|
-
AW_BRIDGE_VERSION="6.0
|
|
419
|
+
AW_BRIDGE_VERSION="6.1.0" # aw-version-anchor
|
|
420
420
|
# Generous hard cap for a slow review at the host posture's effort (subscription latency varies).
|
|
421
421
|
CODEX_HARD_TIMEOUT="${CODEX_HARD_TIMEOUT:-1800}"
|
|
422
422
|
# Above this assembled-payload size (bytes), the diff goes via a git-dir-local temp
|
|
@@ -431,8 +431,8 @@ AW_REVIEW_MAP_BUDGET_BYTES=1500000
|
|
|
431
431
|
# Codex service tier (quality-neutral speed knob): default EMPTY ⇒ no
|
|
432
432
|
# service_tier flag (standard tier) — enabling Fast is a consented per-host SPEND act, never a
|
|
433
433
|
# silent default. The only server-catalog tier id on this subscription is 'priority' (catalog
|
|
434
|
-
# display name "Fast": "2x speed, increased usage" in the catalog's own words for gpt-6.
|
|
435
|
-
# fetched 2026-
|
|
434
|
+
# display name "Fast": "2x speed, increased usage" in the catalog's own words for gpt-6.2-sol, cache
|
|
435
|
+
# fetched 2026-11-18; it states no credit-rate figure; quality-neutral — same model). codex itself
|
|
436
436
|
# accepts ANY -c service_tier string silently (probe-verified), so
|
|
437
437
|
# the wrapper validates the effective value: an unsupported one warns and runs on the standard
|
|
438
438
|
# tier — a typo can never silently masquerade as Fast.
|
|
@@ -13,6 +13,7 @@ import { makeFixtureRepo } from './codex-fixtures-harness.test.mjs';
|
|
|
13
13
|
|
|
14
14
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
15
15
|
const WRAPPER = join(HERE, 'codex-review.sh');
|
|
16
|
+
const MANIFEST = JSON.parse(readFileSync(join(HERE, '..', 'capability.json'), 'utf8'));
|
|
16
17
|
|
|
17
18
|
// Same hermetic fake `codex` as codex-exec.test.mjs (kept inline so each bridge
|
|
18
19
|
// test file is standalone — no shared helper grows the byte-identical mirror set).
|
|
@@ -22,7 +23,7 @@ const FAKE_CODEX = [
|
|
|
22
23
|
'if [[ "${1:-}" == "login" ]]; then echo "${CODEX_FAKE_LOGIN:-Logged in using ChatGPT}"; exit 0; fi',
|
|
23
24
|
'if [[ "${1:-}" == "--version" ]]; then echo "codex-cli ${CODEX_FAKE_VERSION:-0.160.0}"; exit 0; fi',
|
|
24
25
|
'if [[ "${1:-}" == "debug" ]]; then [[ -z "${CODEX_FAKE_NO_CATALOG:-}" ]] || exit 1; cat <<EOF',
|
|
25
|
-
|
|
26
|
+
`{"models":[{"slug":"${MANIFEST.posture.model}","priority":1,"visibility":"list","default_reasoning_level":"low","supported_reasoning_levels":[{"effort":"low"},{"effort":"medium"},{"effort":"high"}]},{"slug":"gpt-6-astra","priority":2,"visibility":"list","default_reasoning_level":"medium","supported_reasoning_levels":[{"effort":"medium"},{"effort":"high"}]}]}`,
|
|
26
27
|
'EOF',
|
|
27
28
|
'exit 0; fi',
|
|
28
29
|
': "${CODEX_FAKE_ARGV:=/dev/null}"',
|
|
@@ -612,7 +613,6 @@ describe('codex-review.sh — assemble & output edge cases', { concurrency: 2 },
|
|
|
612
613
|
// (source-level reverse guard), (c) each declared mode is really accepted.
|
|
613
614
|
// Helpers are inline — each bridge test file stays standalone (mirror byte-equality).
|
|
614
615
|
|
|
615
|
-
const MANIFEST = JSON.parse(readFileSync(join(HERE, '..', 'capability.json'), 'utf8'));
|
|
616
616
|
const REVIEW_CONTRACT = MANIFEST.roles.review.contract;
|
|
617
617
|
const norm = (s) => s.replace(/\s+/g, ' ').trim();
|
|
618
618
|
const setEq = (got, want, msg) => assert.deepEqual([...got].sort(), [...want].sort(), msg);
|
|
@@ -1635,8 +1635,8 @@ describe('codex-review.sh — dispatch-posture labeling (D5)', { concurrency: 2
|
|
|
1635
1635
|
const receipts = readReceipts(sb.repo);
|
|
1636
1636
|
rmSync(sb.root, { recursive: true, force: true });
|
|
1637
1637
|
assert.equal(r.status, 0, r.stderr);
|
|
1638
|
-
assert.match(r.stderr,
|
|
1639
|
-
assert.deepEqual(receipts[0].posture,
|
|
1638
|
+
assert.match(r.stderr, new RegExp(String.raw`review posture: model=${MANIFEST.posture.model.replaceAll('.', '\\.')} effort=high tier=standard jev=(api\.typesafe\.ai,docs\.typesafe\.ai|unreachable \(.*\)) source=model:default,effort:default`), 'the banner states the actual run posture');
|
|
1639
|
+
assert.deepEqual(receipts[0].posture, MANIFEST.posture, 'banner ↔ receipt parity (standard tier = null)');
|
|
1640
1640
|
assert.deepEqual(Object.keys(receipts[0]), Object.keys(RECEIPT_FIXTURE), 'fixture key set + order');
|
|
1641
1641
|
});
|
|
1642
1642
|
|
|
@@ -1646,7 +1646,7 @@ describe('codex-review.sh — dispatch-posture labeling (D5)', { concurrency: 2
|
|
|
1646
1646
|
const receipts = readReceipts(sb.repo);
|
|
1647
1647
|
rmSync(sb.root, { recursive: true, force: true });
|
|
1648
1648
|
assert.equal(r.status, 0, r.stderr);
|
|
1649
|
-
assert.match(r.stderr,
|
|
1649
|
+
assert.match(r.stderr, new RegExp(String.raw`review posture: model=${MANIFEST.posture.model.replaceAll('.', '\\.')} effort=high tier=priority`));
|
|
1650
1650
|
assert.equal(receipts[0].posture.tier, 'priority');
|
|
1651
1651
|
});
|
|
1652
1652
|
|
|
@@ -1678,7 +1678,7 @@ describe('codex-review.sh — dispatch-posture labeling (D5)', { concurrency: 2
|
|
|
1678
1678
|
const receipts = readReceipts(sb.repo);
|
|
1679
1679
|
rmSync(sb.root, { recursive: true, force: true });
|
|
1680
1680
|
assert.equal(r.status, 0, r.stderr);
|
|
1681
|
-
assert.match(r.stderr,
|
|
1681
|
+
assert.match(r.stderr, new RegExp(String.raw`^review posture: model=${MANIFEST.posture.model.replaceAll('.', '\\.')} effort=high tier=standard jev=(api\.typesafe\.ai,docs\.typesafe\.ai|unreachable \(.*\)) source=model:default,effort:default timeout=1800s$`, 'm'));
|
|
1682
1682
|
assert.deepEqual(Object.keys(receipts[0].posture), ['model', 'effort', 'tier'], 'timeout never enters the receipt posture');
|
|
1683
1683
|
});
|
|
1684
1684
|
|