@sabaiway/agent-workflow-kit 23.3.1 → 23.4.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  3. package/SKILL.md +1 -1
  4. package/bridges/antigravity-cli-bridge/SKILL.md +2 -2
  5. package/bridges/antigravity-cli-bridge/bin/agy-review-harness.test.mjs +7 -1
  6. package/bridges/antigravity-cli-bridge/bin/agy-review-honesty.test.mjs +2 -1
  7. package/bridges/antigravity-cli-bridge/bin/agy-review-model-screen.test.mjs +2 -1
  8. package/bridges/antigravity-cli-bridge/bin/agy-review.sh +18 -10
  9. package/bridges/antigravity-cli-bridge/bin/agy-review.test.mjs +50 -50
  10. package/bridges/antigravity-cli-bridge/bin/agy.sh +6 -2
  11. package/bridges/antigravity-cli-bridge/bin/agy.test.mjs +5 -5
  12. package/bridges/antigravity-cli-bridge/capability.json +2 -2
  13. package/bridges/antigravity-cli-bridge/references/models-and-flags.md +1 -1
  14. package/bridges/antigravity-cli-bridge/setup/README.md +1 -1
  15. package/bridges/codex-cli-bridge/SKILL.md +1 -1
  16. package/bridges/codex-cli-bridge/bin/codex-exec-jev.test.mjs +73 -93
  17. package/bridges/codex-cli-bridge/bin/codex-exec.sh +7 -3
  18. package/bridges/codex-cli-bridge/bin/codex-exec.test.mjs +6 -10
  19. package/bridges/codex-cli-bridge/bin/codex-fixtures-harness.test.mjs +77 -0
  20. package/bridges/codex-cli-bridge/bin/codex-fixtures.test.mjs +215 -0
  21. package/bridges/codex-cli-bridge/bin/codex-model-posture.test.mjs +18 -18
  22. package/bridges/codex-cli-bridge/bin/codex-review-honesty.test.mjs +2 -1
  23. package/bridges/codex-cli-bridge/bin/codex-review-jev.test.mjs +13 -13
  24. package/bridges/codex-cli-bridge/bin/codex-review.sh +17 -10
  25. package/bridges/codex-cli-bridge/bin/codex-review.test.mjs +30 -29
  26. package/bridges/codex-cli-bridge/capability.json +1 -1
  27. package/bridges/typesafe-jev-bridge/SKILL.md +19 -12
  28. package/bridges/typesafe-jev-bridge/bin/jev-ask-harness.test.mjs +109 -0
  29. package/bridges/typesafe-jev-bridge/bin/jev-ask.sh +9 -4
  30. package/bridges/typesafe-jev-bridge/bin/jev-ask.test.mjs +108 -104
  31. package/bridges/typesafe-jev-bridge/bin/jev-client.mjs +27 -13
  32. package/bridges/typesafe-jev-bridge/capability.json +11 -1
  33. package/capability.json +1 -1
  34. package/package.json +1 -1
  35. package/references/modes/bridge-settings.md +6 -5
  36. package/tools/bridge-settings-read.mjs +8 -3
  37. package/tools/bridge-settings.mjs +28 -43
  38. package/tools/detect-backends.mjs +1 -1
  39. package/tools/manifest/schema.md +4 -1
  40. package/tools/manifest/validate.mjs +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sabaiway/agent-workflow-kit",
3
- "version": "23.3.1",
3
+ "version": "23.4.0",
4
4
  "description": "Portable, cross-agent memory & workflow for AI coding agents — Claude Code, Codex, Cursor, Devin Desktop. One command deploys an AGENTS.md entry point + docs/ai context with cap/archive/index enforcement into any repo.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -2,15 +2,16 @@
2
2
 
3
3
  <!-- opt-in-capability: codex-fast -->
4
4
 
5
- The reader + consent-gated **writer** for the **host-level** bridge settings file — the answer to *"turn on the codex Fast tier (or another bridge knob) once, predictably, so it survives kit upgrades."* The four bridge wrappers read `${XDG_CONFIG_HOME:-~/.config}/agent-workflow/bridge-settings.conf` (`KEY=VALUE` lines, **parsed never sourced**); this is the ONLY writer for it. The file lives **outside every kit-managed tree**, so a kit refresh never writes or clobbers it — upgrade-survival is structural (D2). It **previews by default**; `--apply` writes. Hand-editing the file stays fully supported — this is an offered convenience, never a lock.
5
+ The reader + consent-gated **writer** for the **host-level** bridge settings file — the answer to *"turn on the codex Fast tier (or another bridge knob) once, predictably, so it survives kit upgrades."* The four bridge wrappers and the judge's wrapper read `${XDG_CONFIG_HOME:-~/.config}/agent-workflow/bridge-settings.conf` (`KEY=VALUE` lines, **parsed never sourced**); this is the ONLY writer for it. The file lives **outside every kit-managed tree**, so a kit refresh never writes or clobbers it — upgrade-survival is structural (D2). It **previews by default**; `--apply` writes. Hand-editing the file stays fully supported — this is an offered convenience, never a lock.
6
6
 
7
- **The knobs are the bundled bridges' own `settings` blocks** (manifest-as-source, D6) — the tool never invents a key or a value rule, and what it writes always passes the wrappers' own validation. **The model keys set each bridge's host posture** — the model every run of that bridge uses (codex: and its effort); a set one is checked against the models the installed CLI offers **before anything is written**. Run **`/agent-workflow-kit bridge-settings`** (`node ${CLAUDE_SKILL_DIR}/tools/bridge-settings.mjs`) to see the live list and the models on offer; today:
7
+ **The knobs are the bundled bridges' own `settings` blocks** (manifest-as-source, D6) — the tool never invents a key or a value rule, and what it writes always passes the wrappers' own validation. **The model keys set each bridge's host posture** — the model every run of that bridge uses (codex: and its effort); a set one is checked against the models the installed CLI offers, or for the judge's `JEV_MODEL`, the versions in its manifest's `offered` list, **before anything is written**. Run **`/agent-workflow-kit bridge-settings`** (`node ${CLAUDE_SKILL_DIR}/tools/bridge-settings.mjs`) to see the live list and the models on offer; today:
8
8
 
9
9
  | key | bridge | values | note |
10
10
  |---|---|---|---|
11
11
  | `CODEX_MODEL` | codex | a model the installed codex offers | the host posture's model; default `gpt-6.1-sol`. |
12
12
  | `CODEX_EFFORT` | codex | an effort that model offers | the host posture's reasoning effort; default `high`. |
13
13
  | `AGY_MODEL` | agy | a display string the installed agy offers | the host posture's model; default `Gemini 3.8 Flash (High)`. |
14
+ | `JEV_MODEL` | the judge | a version its manifest offers | the judge's model; default the manifest's `posture.model`. |
14
15
  | `CODEX_SERVICE_TIER` | codex | `priority` | **SPEND KNOB** — the "Fast" tier: "2x speed, **increased usage**" in the codex catalog's own words for gpt-6.1-sol (cache fetched 2026-10-03); it states no credit-rate figure; quality-neutral (same model). Default unset ⇒ standard tier. |
15
16
  | `CODEX_HARD_TIMEOUT` | codex | integer `1..86400` | hard wall-clock cap (seconds) via `timeout(1)`. |
16
17
  | `CODEX_REVIEW_MAX_TOTAL_BYTES` | codex | integer `1..100000000` | codex-review payload size above which the diff rides a temp file (never truncated). |
@@ -20,11 +21,11 @@ The reader + consent-gated **writer** for the **host-level** bridge settings fil
20
21
 
21
22
  **Invocations:**
22
23
 
23
- 1. **Read** — `node ${CLAUDE_SKILL_DIR}/tools/bridge-settings.mjs [--json]` prints every knob's **effective value + source** (`env` / `file` / `default`; a model key's `environment` / `setting` / `default`, as the wrappers' banner names it), each bridge's host posture with the models its installed CLI offers (read with `codex debug models` / `agy models`, never a model run; an unreadable or missing CLI is one stated line, exit 0), and flags any unknown/duplicate/malformed lines. Read-only.
24
+ 1. **Read** — `node ${CLAUDE_SKILL_DIR}/tools/bridge-settings.mjs [--json]` prints every knob's **effective value + source** (`env` / `file` / `default`; a model key's `environment` / `setting` / `default`, as the wrappers' banner names it), each codex/agy bridge's host posture with the models its installed CLI offers (read with `codex debug models` / `agy models`, never a model run; an unreadable or missing CLI is one stated line, exit 0), and the judge's host posture with the offered versions from its manifest (no CLI run), and flags any unknown/duplicate/malformed lines. Read-only.
24
25
  2. **Preview a change** — `--set KEY=VALUE` (or `--unset KEY`) prints `before → after` and writes **nothing**. Re-run with **`--apply`** to write. Multiple `--set`/`--unset` ops apply in one atomic write.
25
26
  3. **`--apply`** writes via the hardened out-of-tree atomic writer (creates the dir + file on first use; symlink/parent/TOCTOU-safe; last-writer-wins). It touches **only** the `KEY=` line it owns — every comment / blank / other line is preserved verbatim.
26
27
 
27
- **Precedence at run time:** explicit env (even empty — `KEY=` disables the knob for one run) **>** this file **>** the wrapper's built-in default. So an operator can always override one run without editing the file; the reader shows which source wins. A model key is the exception: an environment value off the host posture is a one-off, which `codex-exec`, `codex-review` and `agy-review` refuse unless it is a probe (the bridge-model contract).
28
+ **Precedence at run time:** explicit env (even empty — `KEY=` disables the knob for one run) **>** this file **>** the wrapper's built-in default. So an operator can always override one run without editing the file; the reader shows which source wins. For codex and agy, a model key is the exception: an environment value off the host posture is a one-off, which `codex-exec`, `codex-review` and `agy-review` refuse unless it is a probe (the bridge-model contract). An environment `JEV_MODEL` is that run's version, turned away by the judge's wrapper when its manifest does not offer it; a version other than the default marks the notes uncalibrated.
28
29
 
29
30
  **Refusals (the guarded contract):** an **unknown key** or an **invalid / out-of-range value** (a model key: empty, padded with whitespace, or carrying a control byte) → exit `2` (nothing read of the file, nothing written). A **model the catalog does not offer**, or a codex **effort that model does not offer**, → exit `2` with the offered list, nothing written; an unreadable catalog leaves the value unchecked and says so. A file that already carries **duplicate keys** → exit `1`, named and left **byte-untouched** (fix the duplicates by hand first — the writer never edits blindly around them). A **symlinked / non-regular / unreadable** settings file → exit `1` (refuses to write through it). `--apply` with `--dry-run`, a duplicate op for one key, or a malformed `--set` → usage exit `2`.
30
31
 
@@ -32,4 +33,4 @@ The reader + consent-gated **writer** for the **host-level** bridge settings fil
32
33
 
33
34
  Output is **English/structured** — **localize it to the user's conversational language** when you narrate.
34
35
 
35
- **Invariants:** writer (writes only the host settings file — outside any project/kit tree) · never commits · never runs a model (only the two read-only catalog commands) · previews by default · allowlist + value rules from the bundled manifests · a model key is judged against its bridge's catalog before any write · the host file survives every kit refresh.
36
+ **Invariants:** writer (writes only the host settings file — outside any project/kit tree) · never commits · never runs a model (only the two read-only catalog commands) · the judge's catalog read runs no CLI · previews by default · allowlist + value rules from the bundled manifests · a model key is judged against its bridge's catalog before any write · the host file survives every kit refresh.
@@ -39,7 +39,7 @@ const bridgeDirs = (ctx) =>
39
39
  .filter((m) => m.kind === 'execution-backend')
40
40
  .map((m) => ({ name: m.name, dir: join(ctx.bundleRoot ?? DEFAULT_BUNDLE_ROOT, m.name) }));
41
41
 
42
- // Load the union of both bridges' `settings` blocks → a Map keyed by settings key, each entry carrying
42
+ // Load the union of the bundled bridges' `settings` blocks → a Map keyed by settings key, each entry carrying
43
43
  // its typed rule + the owning bridge. A missing/corrupt bundle is a loud STOP (a writer cannot be
44
44
  // honored without a trustworthy allowlist; a reader/snapshot caller catches it to degrade). The
45
45
  // registry is validated at build time (manifest validate --strict + the mirror drift-guard); here we
@@ -75,7 +75,9 @@ export const allowedLabel = (entry) => {
75
75
  case 'integer': return `integer ${entry.min}..${entry.max}`;
76
76
  case 'duration': return 'duration (e.g. 5m, 30m, 90s — a unit is required, nonzero)';
77
77
  case 'boolean': return '"0" | "1"';
78
- case 'posture': return 'a value the installed CLI offers (checked when set)';
78
+ case 'posture': return Array.isArray(entry.offered)
79
+ ? entry.offered.map((value) => `"${value}"`).join(' | ')
80
+ : 'a value the installed CLI offers (checked when set)';
79
81
  default: return entry.kind;
80
82
  }
81
83
  };
@@ -180,13 +182,16 @@ const REFUSED = (key, v) => ({ value: null, source: 'default', configuredIn: 'en
180
182
  // (AGY_MODEL: no model, agy's own settings decide); else a non-empty, control-free file value; else the
181
183
  // default. Its sources are the wrappers' banner words: default, setting, environment.
182
184
  const EMPTY_ENV_DROPS_MODEL = new Set(['AGY_MODEL']);
185
+ const JUDGE_MODEL_KEY = 'JEV_MODEL';
183
186
  const postureOf = (entry, parsed, getenv) => {
184
187
  const key = entry.key;
185
188
  if (Object.prototype.hasOwnProperty.call(getenv, key)) {
186
189
  const v = getenv[key];
187
190
  if (v === '' && EMPTY_ENV_DROPS_MODEL.has(key)) return { value: null, source: 'environment', configuredIn: 'env', note: `the env ${key}= drops the model — agy's own settings decide` };
188
191
  if (v === '') return { value: entry.default, source: 'environment', configuredIn: 'env', note: `the env ${key}= selects the built-in default` };
189
- if (hasControlByte(v)) return { value: null, source: 'environment', configuredIn: 'env', note: `env value "${safeShow(v)}" carries control bytes for ${key} — ${entry.bridge === 'antigravity-cli-bridge'
192
+ if (hasControlByte(v)) return { value: null, source: 'environment', configuredIn: 'env', note: `env value "${safeShow(v)}" carries control bytes for ${key} — ${key === JUDGE_MODEL_KEY
193
+ ? `${entry.appliesTo.join(', ')} refuses the run before any request`
194
+ : entry.bridge === 'antigravity-cli-bridge'
190
195
  ? 'agy-review refuses the run pre-spend; agy-run has no control-byte screen and refuses it only through its catalog check (it runs it when the catalog is unreadable)'
191
196
  : 'the codex wrappers refuse the run pre-spend'}` };
192
197
  return { value: v, source: 'environment', configuredIn: 'env' };
@@ -1,35 +1,9 @@
1
1
  #!/usr/bin/env node
2
- // bridge-settings.mjs — the reader + consent-gated WRITER for the host-level bridge settings file
3
- // (bridges 2.3.0, D6). The four bridge wrappers READ ${XDG_CONFIG_HOME:-~/.config}/agent-workflow/
4
- // bridge-settings.conf (KEY=VALUE lines, parsed never sourced; env > file > built-in default); this is
5
- // the ONLY writer for it. It lives OUTSIDE every kit-managed tree, so a kit refresh never touches it
6
- // (D2 — upgrade-survival is structural). The allowlist + typed validation come from the BUNDLED bridge
7
- // manifests' `settings` blocks (manifest-as-source): the tool never invents a key or a value rule, and
8
- // what it writes always passes the wrappers' own aw_settings_valid (the shared settingValueValid).
9
- //
10
- // Posture (D3, guarded): PREVIEW BY DEFAULT; --apply writes. It refuses an unknown key, an invalid /
11
- // out-of-range value, and — loudly, naming the key — a file that already carries DUPLICATE keys (it
12
- // never emits duplicates and never edits blindly around them). It touches only the KEY= line it owns,
13
- // preserving every comment/blank/other line verbatim, and creates the dir + file on first apply via
14
- // the hardened out-of-tree atomic writer (symlink/parent/TOCTOU-safe). The model keys (kind `posture`,
15
- // spec bridge-settings) are settable: the read-out shows each bridge's host posture and the models its
16
- // installed CLI offers, and a set naming a model key is judged against that bridge's catalog before
17
- // any write. It runs only the catalog commands, never a model. CODEX_SERVICE_TIER carries the
18
- // credit-rate caveat wherever it renders (from the manifest `effect`).
19
- //
20
- // Output is ENGLISH/structured (repo-artifact Hard Constraint); the agent localizes when narrating.
21
- // Exit codes: 0 success (reader, preview, or apply); 2 usage (bad args / unknown key / invalid value /
22
- // a model or effort the catalog does not offer); 1 precondition STOP (duplicate-carrying / symlinked /
23
- // unreadable file, a write STOP) or a corrupt bundle (cannot determine the allowlist).
24
- // main(argv, ctx) → Promise of { code, stdout, stderr }; getenv / home / bundleRoot / fs and the
25
- // catalog bounds are injectable for host-independent tests.
26
- //
27
- // Dependency-free, Node >= 22. No side effects on import (the isDirectRun idiom).
28
2
 
29
3
  import { isDirectRun } from './direct-run.mjs';
30
4
  import { settingValueValid } from './manifest/validate.mjs';
31
5
  import { writeHostConfigFileAtomic } from './atomic-write.mjs';
32
- import { readCatalogs } from './bridge-catalog.mjs';
6
+ import { CATALOG_BOUNDS_MS, readCatalogs } from './bridge-catalog.mjs';
33
7
  import {
34
8
  SETTINGS_SUBDIR, SETTINGS_FILENAME, fail, loadRegistry, allowedLabel, settingsDir, settingsPath,
35
9
  joinLines, readFileState, parseSettings, duplicateKeys, effectiveOf, displayValue,
@@ -39,6 +13,16 @@ import {
39
13
 
40
14
  const slotOf = (key) => (key.endsWith('_EFFORT') ? 'effort' : 'model');
41
15
  const postureBridges = (registry) => [...new Set([...registry.values()].filter((e) => e.kind === 'posture').map((e) => e.bridge))];
16
+ const usesOfferedCatalog = (entry) => Object.hasOwn(entry, 'offered') || !Object.hasOwn(CATALOG_BOUNDS_MS, entry.bridge);
17
+ const readPostureCatalogs = async (bridges, registry, ctx) => {
18
+ const models = bridges.map((bridge) => [...registry.values()].find((entry) => entry.bridge === bridge && entry.kind === 'posture' && slotOf(entry.key) === 'model'));
19
+ const catalogs = await readCatalogs(models.filter((entry) => !usesOfferedCatalog(entry)).map((entry) => entry.bridge), ctx);
20
+ return Object.fromEntries(models.map((entry) => [entry.bridge, usesOfferedCatalog(entry)
21
+ ? Array.isArray(entry.offered) && entry.offered.length > 0 && entry.offered.every((model) => typeof model === 'string' && settingValueValid(entry, model))
22
+ ? { state: 'offered', cause: null, entries: entry.offered.map((model) => ({ model })) }
23
+ : { state: 'unreadable', cause: 'the bundled manifest has no usable offered list', entries: [] }
24
+ : catalogs[entry.bridge]]));
25
+ };
42
26
 
43
27
  // One bridge's posture as { model: {key, value, source, note}, effort?: … } under the given env.
44
28
  const postureOfBridge = (registry, parsed, getenv, bridge) => Object.fromEntries([...registry.values()]
@@ -57,7 +41,7 @@ const catalogWarning = (bridge, catalog) => (catalog.state === 'not-installed'
57
41
  : `⚠ ${bridge}: the model catalog is unreadable (${catalog.cause}) — the offered list is unknown`);
58
42
 
59
43
  const renderPosture = (registry, parsed, getenv, catalogs) => {
60
- const lines = ['', ' host posture (the model each bridge runs; the offered models are read from the installed CLI, none is run):'];
44
+ const lines = ['', ' host posture (the model each bridge runs; offered models come from the installed CLI or the bundled manifest, none is run):'];
61
45
  for (const bridge of postureBridges(registry)) {
62
46
  const p = postureOfBridge(registry, parsed, getenv, bridge);
63
47
  const effort = p.effort ? ` · effort ${showModel(p.effort.value)} [${p.effort.source}]` : '';
@@ -80,7 +64,7 @@ const judgePosture = async (ops, registry, newLines, ctx) => {
80
64
  const bridges = [...new Set(ops.map((op) => registry.get(op.key)).filter((e) => e.kind === 'posture').map((e) => e.bridge))];
81
65
  if (!bridges.length) return [];
82
66
  const after = parseSettings(joinLines(newLines));
83
- const catalogs = await readCatalogs(bridges, ctx);
67
+ const catalogs = await readPostureCatalogs(bridges, registry, ctx);
84
68
  const unchecked = [];
85
69
  for (const bridge of bridges) {
86
70
  const { model, effort } = postureOfBridge(registry, after, {}, bridge);
@@ -90,7 +74,7 @@ const judgePosture = async (ops, registry, newLines, ctx) => {
90
74
  continue;
91
75
  }
92
76
  const entry = catalog.entries.find((e) => e.model === model.value);
93
- if (!entry) throw fail(2, `${model.key}=${model.value} is not a model the installed ${bridge} catalog offers — refusing before any write. Offered: ${catalog.entries.map((e) => e.model).join(', ')}`);
77
+ if (!entry) throw fail(2, `${model.key}=${model.value} is not a model the ${bridge} catalog offers — refusing before any write. Offered: ${catalog.entries.map((e) => e.model).join(', ')}`);
94
78
  if (effort && entry.efforts === null) unchecked.push(`${bridge}: the effort was not checked — the catalog entry for ${model.value} lists no efforts; the wrapper checks it at run time`);
95
79
  else if (effort && !entry.efforts.includes(effort.value)) {
96
80
  throw fail(2, `${effort.key}=${effort.value} is not an effort the installed ${bridge} catalog offers for ${model.value} — refusing before any write. Offered: ${entry.efforts.join(', ')}`);
@@ -253,22 +237,22 @@ const changeLine = (c) => {
253
237
  return ` ${c.key}: ${b} → ${a}`;
254
238
  };
255
239
 
256
- // A model key's env value off the host posture is a one-off the wrappers refuse (spec bridge-model),
257
- // so its shadow line says that instead of "it wins".
258
240
  const SHADOW_EFFECT = {
259
241
  'codex-cli-bridge': 'an environment value off the host posture is a one-off, which codex-exec and codex-review refuse unless CODEX_PROBE=1; unset it.',
260
242
  'antigravity-cli-bridge': 'an environment value off the host posture (an empty one included) is a one-off, which agy-review refuses unless AGY_PROBE=1 (agy-run, the probe role, runs it); unset it.',
261
243
  };
262
- const shadowLine = (entry) => ` ⚠ ${entry.key} is currently set in the environment — ${entry.kind === 'posture'
263
- ? SHADOW_EFFECT[entry.bridge] : 'the env value overrides the file for this session (unset it, or it wins until you do).'}`;
244
+ const shadowLine = (entry, getenv) => ` ⚠ ${entry.key} is currently set in the environment — ${entry.kind === 'posture'
245
+ ? usesOfferedCatalog(entry)
246
+ ? getenv[entry.key] === '' ? 'the empty value selects the default for that run; unset it.' : `the value ${JSON.stringify(getenv[entry.key])} runs for that run; the judge's wrapper turns it away unless the manifest's offered list includes it; a version other than the default marks the notes uncalibrated; unset it.`
247
+ : SHADOW_EFFECT[entry.bridge] : 'the env value overrides the file for this session (unset it, or it wins until you do).'}`;
264
248
 
265
- const renderWriter = ({ registry, changes, wrote, path, willWrite, envShadows, caveats, unchecked }) => {
249
+ const renderWriter = ({ registry, changes, wrote, path, willWrite, envShadows, caveats, unchecked, getenv }) => {
266
250
  const lines = [];
267
251
  lines.push(wrote ? `wrote ${path}` : 'bridge-settings — preview (nothing written; re-run with --apply to write)');
268
252
  for (const c of changes) lines.push(changeLine(c));
269
253
  for (const cav of caveats) lines.push(` ↳ ${cav}`);
270
254
  for (const u of unchecked) lines.push(` ⚠ ${u}`);
271
- for (const key of envShadows) lines.push(shadowLine(registry.get(key)));
255
+ for (const key of envShadows) lines.push(shadowLine(registry.get(key), getenv));
272
256
  if (!wrote && willWrite) lines.push('', `re-run with --apply to write ${path}.`);
273
257
  if (!wrote && !willWrite) lines.push(' no change — the file already reads this way.');
274
258
  return lines.join('\n');
@@ -283,7 +267,7 @@ const HELP = `bridge-settings — read / write the host-level bridge settings fi
283
267
  Usage:
284
268
  node bridge-settings.mjs show every knob's effective value + source, each
285
269
  bridge's model (codex: and effort) and the models
286
- its installed CLI offers
270
+ its installed CLI or bundled manifest offers
287
271
  node bridge-settings.mjs --set KEY=VALUE preview a change (writes nothing)
288
272
  node bridge-settings.mjs --set KEY=VALUE --apply write the change (atomic; creates the file on first use)
289
273
  node bridge-settings.mjs --unset KEY [--apply] return a knob to its built-in default
@@ -292,9 +276,10 @@ Usage:
292
276
  keys (preserved verbatim), never writes
293
277
 
294
278
  Precedence at run time: explicit env (even empty: KEY= disables) > this file > the wrapper's built-in
295
- default. Allowed keys + value rules come from the bundled bridge manifests. CODEX_MODEL, CODEX_EFFORT
296
- and AGY_MODEL set each bridge's host posture; a set of one is checked against that bridge's installed
297
- CLI catalog before anything is written (an unreadable catalog leaves it unchecked, and says so). The
279
+ default. Allowed keys + value rules come from the bundled bridge manifests. Model keys (codex: and
280
+ effort) set each bridge's host posture; a set is checked against that bridge's catalog before any
281
+ write. The judge's model uses its bundled manifest's offered list, with no CLI or time bound.
282
+ An unreadable catalog leaves the value unchecked, and says so. The
298
283
  command runs only the catalog commands, never a model. This host file survives every kit upgrade —
299
284
  a kit refresh never writes or clobbers it.
300
285
 
@@ -322,7 +307,7 @@ export const main = async (argv = [], ctx = {}) => {
322
307
  if (ops.length === 0) {
323
308
  const fileState = readFileState(path, ctx);
324
309
  const parsed = parseSettings(fileState.text ?? '');
325
- const catalogs = await readCatalogs(postureBridges(registry), ctx);
310
+ const catalogs = await readPostureCatalogs(postureBridges(registry), registry, ctx);
326
311
  const stdout = json
327
312
  ? JSON.stringify(buildReaderJson(registry, parsed, fileState, ctx, path, catalogs), null, 2)
328
313
  : renderReader(registry, parsed, fileState, ctx, path, catalogs);
@@ -367,7 +352,7 @@ export const main = async (argv = [], ctx = {}) => {
367
352
  if (!apply || noop) {
368
353
  const stdout = json
369
354
  ? JSON.stringify(jsonBody(false), null, 2)
370
- : renderWriter({ registry, changes, wrote: false, path, willWrite: !noop, envShadows, caveats, unchecked });
355
+ : renderWriter({ registry, changes, wrote: false, path, willWrite: !noop, envShadows, caveats, unchecked, getenv });
371
356
  return { code: 0, stdout, stderr: '' };
372
357
  }
373
358
 
@@ -375,7 +360,7 @@ export const main = async (argv = [], ctx = {}) => {
375
360
  writeHostConfigFileAtomic(settingsDir(ctx), SETTINGS_FILENAME, body, ctx, { noun: 'the bridge settings file' });
376
361
  const stdout = json
377
362
  ? JSON.stringify(jsonBody(true), null, 2)
378
- : renderWriter({ registry, changes, wrote: true, path, willWrite: false, envShadows, caveats, unchecked });
363
+ : renderWriter({ registry, changes, wrote: true, path, willWrite: false, envShadows, caveats, unchecked, getenv });
379
364
  return { code: 0, stdout, stderr: '' };
380
365
  } catch (err) {
381
366
  return { code: err.exitCode ?? 1, stdout: '', stderr: `bridge-settings: ${err.message}` };
@@ -146,7 +146,7 @@ const RAW_BACKENDS = [
146
146
  ],
147
147
  receipt: "side effect — a successful review appends one JSON receipt line to <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides; plan/diff outside a git tree: warn + skip unless overridden): fingerprint = sha256 over the canonical uncommitted-state payload (staged diff + unstaged diff + untracked-not-ignored contents — the review-payload domain; never-committable untracked paths — character/block devices, FIFOs, sockets — are excluded from the domain entirely, untracked symlinks/directories ride as name-only notes) in code mode, the artifact-file sha256 in plan/diff mode; durationS = integer wall-clock seconds from CLI start through verdict parsing and the wrapper prints review duration: <n>s; blocking = the count of numbered items in the first ### Blocking section; artifactPath = the normalized realpath on plan/diff receipts only (repo-relative inside the work tree, absolute otherwise), while a double quote, backslash or control byte refuses pre-spend because the receipt encoder cannot carry it; verdict recorded verbatim from the mandated '### Verdict' section (SHIP / SHIP WITH NITS / REWORK); grounded = whether a NON-EMPTY --facts payload was supplied (code mode refuses pre-spend without one — no run, no receipt — unless --ungrounded/AGY_PROBE=1; in plan/diff an empty payload records grounded:false — fail-closed, the state gate rejects it), factsHash = sha256 of the facts payload; a continuation receipt is fresh:false (informational-only — it cannot attest the folded tree); probe = whether the run relaxed the quality guards (AGY_PROBE=1), written on EVERY receipt so it self-declares — the kit's review-state gate rejects a probe-marked receipt (a probe review never attests) and equally rejects an unmarked one (silence is not a declaration); posture = the ACTUAL run posture {model} (agy has no tier), written on EVERY receipt (D5) — the gate rejects a receipt with an absent/invalid posture (a pre-D5 wrapper minted it; re-run the review), one stderr banner line states the same posture, a one-off model (an explicitly empty AGY_MODEL included) refuses pre-spend unless AGY_PROBE=1, and a model string carrying control bytes refuses pre-spend in every mode; delivery = how the change set REACHED the model, currently emitted as 'inline' (the whole set rode one prompt — proven by construction) or 'fed' (a chunked feed whose per-part echo proof verified); REQUIRED on every agy code receipt and its ABSENCE is what stops a pre-fed-lane receipt attesting, while the gate accepts any well-formed declaration rather than a particular value; absent by construction on plan/diff/continuation receipts, which carry no change set; a run whose output carries NO recognized '### Verdict' section — empty output included — exits 4 with NO receipt (D4: a FAILED review to RE-RUN, never a fatal session error); when the dispatch nonce seam is supplied — the AW_REVIEW_NONCE environment value or its plain-argument equivalent --nonce <n> (one seam: the flag assigns the same value; supplying both with different values refuses pre-spend) — under the safe grammar [A-Za-z0-9._-]{1,64} (anything else refuses pre-spend), the wrapper first mints the finding MANIFEST {schema, backend, nonce, fingerprint, findings} beside the receipts file (agent-workflow-finding-manifest-<backend>-<nonce>.json; atomic, no-clobber — a byte-identical rewrite is an idempotent no-op, different bytes refuse loudly) ORDERED before the receipt append — a failed manifest write EXCLUDES the receipt append, so a nonce-supplied dispatch can never land a receipt without its readable manifest; a nonce-less invocation adds NO nonce field and mints NO finding manifest (the existing wrapperVersion field still changes with each bridge release); a write failure warns, never fails the review",
148
148
  notes: [
149
- 'transport: every review dispatch drives the CLI in --output-format json (plus --disable-slash-commands) and the returned envelope is parsed in node (bin/agy-envelope.mjs) — the operator-facing invocations and flags above do NOT change, and on a ZERO exit the wrapper still PRINTS the review text, never JSON. A missing or unreadable envelope on a zero exit is a loud failure with NO receipt, never a downgraded verdict and never a fallback to raw-stdout parsing; a non-zero CLI exit keeps its own code and message, and publishes the captured stdout unchanged from the SINGLE dispatch or the FINAL fed turn (which may therefore be a JSON or partial payload — the envelope is parsed only on a zero exit); an INTERMEDIATE feed turn is the exception, its output stays private (Invariant E) and its failure prints only a named error. Enforced by a PRE-SPEND capability probe, not a version floor: agy --help must advertise --output-format and --disable-slash-commands, node must be >= 22, and bin/agy-envelope.mjs must be present — otherwise the review refuses before any run is spent and names the missing capability',
149
+ 'transport: every review dispatch drives the CLI in --output-format json (plus --disable-slash-commands) and the returned envelope is parsed in node (bin/agy-envelope.mjs) — the operator-facing invocations and flags above do NOT change, and on a ZERO exit the wrapper still PRINTS the review text, never JSON. A missing or unreadable envelope on a zero exit is a loud failure with NO receipt, never a downgraded verdict and never a fallback to raw-stdout parsing; a non-zero CLI exit keeps its own code and message, and publishes the captured stdout unchanged from the SINGLE dispatch or the FINAL fed turn (which may therefore be a JSON or partial payload — the envelope is parsed only on a zero exit); an INTERMEDIATE feed turn is the exception, its output stays private (Invariant E) and its failure prints only a named error. Enforced by a PRE-SPEND capability probe, not a version floor: agy --help must advertise --output-format and --disable-slash-commands, node must be >= 22.21, and bin/agy-envelope.mjs must be present — otherwise the review refuses before any run is spent and names the missing capability',
150
150
  'pre-dispatch host-diff: before the FIRST dispatch of this bridge, diff the hosts of the services its manifest names against the live sandbox allow-list — a missing host is surfaced to the maintainer BEFORE dispatching, never fired into a known prompt',
151
151
  'the review posture banner appends a banner-only source=model:<s> field — where the model came from: default, setting or environment — then a banner-only timeout=<duration> field — exactly the duration agy-run hands to timeout(1); the hard-timeout preflight fails CLOSED when no timeout/gtimeout binary exists (the wrapper refuses by name before any CLI run, so an uncapped review run can no longer happen), and neither field enters the receipt posture or the D5 banner↔receipt parity',
152
152
  'quote the posture banner verbatim when labeling this dispatch — the banner is the machine-stated posture; a prose re-type drifts',
@@ -79,9 +79,12 @@ this block). Each entry:
79
79
  - `default` (string|null, **required property** — a missing key fails validation) — `null` = no
80
80
  file default, the wrapper built-ins apply (state them in `effect`); a non-null default must
81
81
  itself pass the kind's validation.
82
+ - `offered` (string[], optional; `posture` only) — when present, a non-empty array of distinct
83
+ strings, each passing the posture value rule, that contains the entry's string `default`.
84
+ On another kind, or in any other shape (`null` included), it makes the manifest invalid.
82
85
  - `appliesTo` (string[], required) — the wrapper `cmd` names (from `roles.*.cmd` of THIS
83
86
  manifest) that APPLY the key. Every wrapper still RECOGNIZES the whole family registry (the
84
- union of both bridges' `settings` keys) and skips other wrappers' keys silently.
87
+ union of every bundled bridge's `settings` keys) and skips other wrappers' keys silently.
85
88
  - `effect` (string, required) — what the knob does, incl. built-in defaults and any spend/risk
86
89
  caveat (the credit-rate caveat rides here for the tier knob).
87
90
  - `retired` (string, optional; **>= 20 chars when present**) — the STATED reason a key is kept only
@@ -610,6 +610,16 @@ export const validateManifest = (skillDir, options = {}) => {
610
610
  if (!cmds.has(c)) errors.push(`${at}.appliesTo names "${c}" which is no roles.*.cmd of this manifest`);
611
611
  }
612
612
  }
613
+ if (Object.hasOwn(entry, 'offered')) {
614
+ const offered = entry.offered;
615
+ const validOffered = entry.kind === 'posture' && Array.isArray(offered) && offered.length > 0
616
+ && offered.every((value) => typeof value === 'string' && settingValueValid(entry, value))
617
+ && new Set(offered).size === offered.length
618
+ && typeof entry.default === 'string' && offered.includes(entry.default);
619
+ if (!validOffered) {
620
+ errors.push(`${at}.offered (${JSON.stringify(entry.key)}) must be a non-empty array of unique posture values containing the string default (posture kind only)`);
621
+ }
622
+ }
613
623
  if (!SETTING_KINDS.has(entry.kind)) {
614
624
  errors.push(`${at}.kind must be one of enum|integer|duration|boolean|posture`);
615
625
  return; // the typed checks below are meaningless without a kind