claude-dev-env 2.17.0 → 2.18.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 (25) hide show
  1. package/.agents/skills/orchestrator/SKILL.md +6 -4
  2. package/.agents/skills/orchestrator-refresh/SKILL.md +9 -5
  3. package/.agents/skills/team-advisor/SKILL.md +5 -5
  4. package/_shared/advisor/AGENTS.md +5 -5
  5. package/_shared/advisor/advisor-protocol.md +54 -31
  6. package/_shared/advisor/reference/advisor-block.md +5 -1
  7. package/_shared/advisor/reference/consult-format.md +1 -1
  8. package/_shared/advisor/reference/identity.md +28 -0
  9. package/_shared/advisor/reference/lifecycle.md +8 -1
  10. package/_shared/advisor/reference/sol-rung.md +12 -7
  11. package/_shared/advisor/reference/spawn-walk-log.md +6 -5
  12. package/_shared/advisor/reference/third-party-bind.md +5 -6
  13. package/_shared/advisor/reference/warm-up.md +9 -2
  14. package/_shared/advisor/scripts/codex_sol_advisor.py +66 -11
  15. package/_shared/advisor/scripts/config/advisor_scripts_constants/advisor_route_constants.py +9 -0
  16. package/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py +16 -4
  17. package/_shared/advisor/scripts/config/advisor_scripts_constants/sol_advisor_constants.py +11 -10
  18. package/_shared/advisor/scripts/model_tier_run_validator.py +50 -23
  19. package/_shared/advisor/scripts/tests/test_codex_sol_advisor.py +108 -3
  20. package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +171 -82
  21. package/_shared/advisor/scripts/tests/test_tier_model_ids.py +43 -0
  22. package/_shared/advisor/scripts/tier_model_ids.py +75 -7
  23. package/_shared/pr-loop/worker-spawn.md +4 -3
  24. package/docs/references/team-advisor-skill.md +2 -2
  25. package/package.json +1 -1
@@ -122,9 +122,11 @@ pending, or when the tool is `CronCreate`.
122
122
  `rearm_pending` when already active, but still do not re-arm.)
123
123
  2. **Bind the shared advisor before any executor.** Follow
124
124
  [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)
125
- end to end: detect the host profile, compute the floor from the
125
+ end to end: name the session identity, compute the floor from the
126
126
  orchestrator consumer set — this session plus every tier in the
127
- routing table (its Model floor section) — walk the ladder top-down,
127
+ routing table (its Model floor section) — walk the ladder for that
128
+ host (Claude: Fable first, then Sol when Fable is out of usage;
129
+ Codex: Sol in-session; ThirdParty: headless Fable then Sol),
128
130
  and fail closed when nothing binds. This session owns the advisor's
129
131
  whole lifecycle (its Lifecycle ownership section); executors only ever
130
132
  message the warm agent or report here, and an executor that finds the
@@ -261,8 +263,8 @@ Routing rules:
261
263
  way — the coding spawn stops and the orchestrator reports it.
262
264
  - Host detection follows
263
265
  [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)
264
- (Host profiles section, `detect_host_profile`) — the sole detection
265
- system, with no second one.
266
+ (Host profiles section, `resolve_session_identity` then
267
+ `detect_host_profile`) — the sole detection system, with no second one.
266
268
  - Resume a warm workflow agent before creating a new workflow run when
267
269
  the warm agent holds the relevant context.
268
270
  - Review and verification workflows apply the [review guide](../reviews/SKILL.md#review-workflow).
@@ -10,10 +10,10 @@ description: >-
10
10
 
11
11
  # Orchestrator Refresh
12
12
 
13
- Detect the host profile first (see Host profiles in
13
+ Name the session identity first (see Host profiles in
14
14
  [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)).
15
15
  Re-assert the discipline for that host only — do not invent an Agent-tool
16
- Claude `session-advisor` spawn on a third-party host.
16
+ Claude `session-advisor` spawn on a Codex or third-party host.
17
17
 
18
18
  ## 0. status_gate first (deterministic)
19
19
 
@@ -94,9 +94,13 @@ once, and reports the unreachable advisor.
94
94
  the protocol's warm-up rule states;
95
95
  `hooks/blocking/fable_spawn_gate.py` denies a fable spawn whose
96
96
  prompt lacks it.
97
- - **Third-party host:** advisor is a max-tier Claude CLI bind owned
98
- by this session (`claude_chain_runner.py`, Fable high then Opus
99
- max). Do **not** spawn `session-advisor` via Agent. Executors
97
+ - **Codex host:** advisor is a native in-session Sol subagent owned
98
+ by this session. Do **not** spawn Claude `session-advisor` via
99
+ Agent. Executors consult that Sol subagent in-session. If Sol does
100
+ not bind, fail closed.
101
+ - **Third-party host:** advisor is a Claude CLI bind owned
102
+ by this session (`claude_chain_runner.py`, Fable then Sol when Fable
103
+ is out of usage, both at `ADVISOR_EFFORT`). Do **not** spawn `session-advisor` via Agent. Executors
100
104
  report blockers here; consult the CLI advisor and relay signals.
101
105
  If the CLI bind is unreachable, fail closed — do not answer the
102
106
  four signals as this third-party session.
@@ -16,15 +16,15 @@ One warm advisor at the strongest tier this session can reach. This session is t
16
16
  | Doc | Holds |
17
17
  |---|---|
18
18
  | [`docs/references/advisor-tool.md`](../../docs/references/advisor-tool.md) | **Consult cadence and weight** — when to call, hard rule before first write, how to treat advice. Read this for every consult. |
19
- | [`~/.claude/_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md) | **Bind and lifecycle** — host detect, model floor, warm-up, CLI fallback; its read map routes each moment to a `reference/` detail file. |
19
+ | [`~/.claude/_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md) | **Bind and lifecycle** — session identity, host detect, model floor, warm-up, CLI fallback; its read map routes each moment to a `reference/` detail file. |
20
20
  | [`agents/session-advisor.md`](../../agents/session-advisor.md) | **Reply contract** — ENDORSE / CORRECTION / PLAN / STOP; SendMessage only. |
21
21
  | [`reference/advisor-docs-review.md`](reference/advisor-docs-review.md) | Anthropic advisor-tool source facts: measured effects, Sonnet steering, cost levers, failure modes. Background — read it when tuning the bind, not on every consult. |
22
22
 
23
23
  ## Bind
24
24
 
25
- 1. Detect the host profile first (protocol **Host profiles**), then walk the model floor.
26
- 2. Floor: the stronger of Opus and this session's own tier on Claude; Opus floor with Fable first on a third-party host.
27
- 3. Name: `team-advisor-agent` on Claude (Agent spawn of `session-advisor`); one CLI `session_id` on a third-party host via the protocol Claude-chain.
25
+ 1. Name the session identity first (protocol **Host profiles**), then walk the model floor.
26
+ 2. Claude: Fable first in-session at `ADVISOR_EFFORT` (default low). When Fable is out of usage, bind Sol at the same effort. Codex: Sol in-session. Third-party: headless Fable then Sol. When the host's walk fails, fail closed.
27
+ 3. Name: `team-advisor-agent` on Claude (Agent spawn of `session-advisor`); a native Sol subagent on Codex; one CLI `session_id` on a third-party host via the protocol Claude-chain.
28
28
  4. A Fable-tier spawn or re-spawn carries the exact token `FABLE-SPAWN-AUTHORIZED` in its prompt (protocol warm-up; `fable_spawn_gate` requires it).
29
29
  5. Skip the multi-consumer "who you are" opener — sole consumer.
30
30
  6. When the bind or reply path fails, fail closed and report to the user. On a third-party host, only the bound Claude advisor issues ENDORSE / CORRECTION / PLAN / STOP.
@@ -41,6 +41,6 @@ Aim for two consults on a normal task: one after orientation and one after write
41
41
 
42
42
  ## Constraints
43
43
 
44
- - One bind per session; this session owns spawn or CLI bind, drift re-bind, and shutdown.
44
+ - One bind per session; this session owns spawn, in-session Sol spawn, or CLI bind, drift re-bind, and shutdown.
45
45
  - Bind at or above the protocol floor for this host.
46
46
  - The advisor only answers (messaging); the session runs tools and posts.
@@ -2,21 +2,21 @@
2
2
 
3
3
  Warm-advisor bind-and-consult protocol shared by `team-advisor`, `orchestrator`, `orchestrator-refresh`, and every executor subagent `orchestrator` routes work to. Changes here affect all of these simultaneously — treat this as a breaking-change surface.
4
4
 
5
- Host profile (Claude vs third-party) is detected first; Claude walks the multi-tier Agent spawn ladder (CLI chain as fallback), a third-party host binds a max-tier Claude advisor through the CLI Claude-chain (fail closed when the chain cannot serve) with a separate executor paste block.
5
+ Host profile is resolved from session identity first (Claude, Codex, or neither). Claude walks Fable then Sol in-session (CLI chain as the Fable fallback). Codex walks Sol in-session. A third-party host binds Fable through the CLI Claude-chain (fail closed when Fable and Sol cannot serve) with a separate executor paste block.
6
6
 
7
7
  ## Key documents
8
8
 
9
9
  | File | Purpose |
10
10
  |---|---|
11
- | `advisor-protocol.md` | Router with a moment-keyed read map: host profiles first, model floor, warm-up and consult standing rules, lifecycle ownership, Advisor-block assembly rule, and the shared CLI Claude-chain — each with a stub pointing at its `reference/` detail file |
11
+ | `advisor-protocol.md` | Router with a moment-keyed read map: session identity and host profiles first, model floor, warm-up and consult standing rules, lifecycle ownership, Advisor-block assembly rule, and the shared CLI Claude-chain — each with a stub pointing at its `reference/` detail file |
12
12
 
13
13
  ## Subdirectory
14
14
 
15
15
  | Entry | Description |
16
16
  |---|---|
17
- | `scripts/` | `model_tier_run_validator.py` (spawn-walk log checks, including optional Sol), `codex_sol_advisor.py` (read-only Sol xhigh bind and resume), `tier_model_ids.py` (Claude aliases, Codex model ids, and host detection), and `advisor_scripts_constants` under `scripts/config/` (ladder, bind tokens, aliases, host profiles, and SendMessage wait bound) |
18
- | `reference/` | Progressive-disclosure detail behind protocol stub sections: `warm-up.md`, `third-party-bind.md`, `sol-rung.md`, `consult-format.md`, `advisor-block.md`, `lifecycle.md`, `cli-chain.md`, and `spawn-walk-log.md` |
17
+ | `scripts/` | `model_tier_run_validator.py` (spawn-walk log checks, including Codex Sol-first and optional Sol), `codex_sol_advisor.py` (read-only Sol bind and resume at shared `ADVISOR_EFFORT`), `tier_model_ids.py` (Claude aliases, Codex model ids, session identity, and host detection), and `advisor_scripts_constants` under `scripts/config/` (ladder, bind tokens, aliases, host profiles, identity tokens, shared effort, and SendMessage wait bound) |
18
+ | `reference/` | Progressive-disclosure detail behind protocol stub sections: `identity.md`, `warm-up.md`, `third-party-bind.md`, `sol-rung.md`, `consult-format.md`, `advisor-block.md`, `lifecycle.md`, `cli-chain.md`, and `spawn-walk-log.md` |
19
19
 
20
20
  ## Breaking-change rule
21
21
 
22
- A change to host detection, the model-floor rule, the charter template, either host's Advisor block, or lifecycle ownership in `advisor-protocol.md` requires updating every consuming skill (`team-advisor`, `orchestrator`, `orchestrator-refresh`) in the same commit.
22
+ A change to session identity, host detection, the model-floor rule, the charter template, any host's Advisor block, or lifecycle ownership in `advisor-protocol.md` requires updating every consuming skill (`team-advisor`, `orchestrator`, `orchestrator-refresh`) in the same commit.
@@ -2,8 +2,9 @@
2
2
 
3
3
  Shared spawn-once, consult-by-message protocol for a warm advisor. Two skills depend on this: `team-advisor` (binds the advisor for its own consulting session) and `orchestrator` (binds the same advisor and lets its own routed executor subagents consult it too). Executor spawn prompts are a third consumer, via the assembled Advisor block.
4
4
 
5
- **First step of every bind:** detect the host profile (next section).
6
- Walk the model-floor ladder, spawn `session-advisor`, or open the CLI fallback only after the host is known.
5
+ **First step of every bind:** name the session identity and resolve the host profile (next section).
6
+ Walk the model-floor ladder, spawn the in-session advisor, or open the CLI fallback only after the host is known.
7
+ On a Codex host, skip straight to **Host profiles → Codex host**.
7
8
  On a third-party host, skip straight to **Host profiles → Third-party host**.
8
9
  On Claude, continue with **Model floor** and the rest of this document.
9
10
 
@@ -13,9 +14,11 @@ The sections below hold the standing rules; open a reference file at the moment
13
14
 
14
15
  | Moment | Open |
15
16
  |---|---|
17
+ | Naming the session identity | [`reference/identity.md`](reference/identity.md) — Claude, Codex, or neither |
16
18
  | Binding on a Claude host | [`reference/warm-up.md`](reference/warm-up.md) — spawn fields, Fable token, charter |
19
+ | Binding on a Codex host | [`reference/identity.md`](reference/identity.md) — in-session Sol spawn |
17
20
  | Binding from a third-party host | [`reference/third-party-bind.md`](reference/third-party-bind.md) — CLI bind steps, fail-closed rule |
18
- | `ADVISOR_SOL_XHIGH` is set | [`reference/sol-rung.md`](reference/sol-rung.md) — preflight, bind, fallback |
21
+ | Fable is out of usage | [`reference/sol-rung.md`](reference/sol-rung.md) — Sol fallback at shared effort |
19
22
  | Composing a consult | [`reference/consult-format.md`](reference/consult-format.md) — packet, new-evidence and report-back rules |
20
23
  | Assembling an executor spawn prompt | [`reference/advisor-block.md`](reference/advisor-block.md) — the paste parts |
21
24
  | Advisor drifts, dies, or the task pivots | [`reference/lifecycle.md`](reference/lifecycle.md) — re-spawn and re-bind steps |
@@ -24,59 +27,75 @@ The sections below hold the standing rules; open a reference file at the moment
24
27
 
25
28
  ## Host profiles
26
29
 
27
- Detect the host profile **before** any model-floor walk. Source of truth for names and detection: `HOST_PROFILE_CLAUDE`, `HOST_PROFILE_THIRD_PARTY`, `ALL_HOST_PROFILES`, and `detect_host_profile(...)` in `$HOME/.claude/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py` and `tier_model_ids.py`.
30
+ Name the session identity **before** any model-floor walk. Source of truth for names and detection: `HOST_PROFILE_CLAUDE`, `HOST_PROFILE_CODEX`, `HOST_PROFILE_THIRD_PARTY`, `ALL_HOST_PROFILES`, `resolve_session_identity(...)`, and `detect_host_profile(...)` in `$HOME/.claude/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py` and `tier_model_ids.py`.
31
+ Identity tokens and bind paths: [`reference/identity.md`](reference/identity.md).
28
32
 
29
- Detection order:
33
+ Session identity:
30
34
 
31
- 1. `ADVISOR_HOST_PROFILE=ThirdParty` or `=Claude` (explicit override; any letter case).
35
+ 1. Call `resolve_session_identity` with the session's named identity.
36
+ 2. A `codex` token selects Codex. A `claude` token selects Claude. Any other identity selects ThirdParty.
37
+ 3. When both tokens appear, Codex wins.
38
+
39
+ Mechanical override for scripts:
40
+
41
+ 1. `ADVISOR_HOST_PROFILE=ThirdParty` or `=Claude` or `=Codex` (explicit override; any letter case).
32
42
  2. `THIRD_PARTY=1` (or `true` / `yes` / `on`) — a third-party (non-Claude) harness.
33
43
  3. Default: Claude.
34
44
 
35
- ### Sol rung — any host
45
+ ### Shared effort — any host
46
+
47
+ Fable and Sol both read `ADVISOR_EFFORT` (`low`, `medium`, `high`, `xhigh`, `max`). The default is `low`.
48
+ Pass `--effort <level>` on the Sol helper to set effort for that Sol run.
49
+ Pass `--effort <level>` on the Claude CLI bind for Fable. An unset or unrecognized value uses `low`.
50
+
51
+ ### Sol rung
36
52
 
37
- An optional **sol xhigh** rung sits above the Claude ladder on every host, switched by the flag `ADVISOR_SOL_XHIGH=1` (or `true` / `yes` / `on`), set in the environment or by the consuming skill's invocation.
38
- Flag off: the walk starts at the host's Claude ladder, Fable first.
39
- Flag on: run the Codex preflight and bind per [`reference/sol-rung.md`](reference/sol-rung.md); a failed preflight falls back to the Claude ladder.
53
+ On Claude and ThirdParty: when Fable is out of usage, bind Sol through the Codex helper.
54
+ Open that attempt with `ADVISOR_SOL=1` (or `true` / `yes` / `on`) in the environment, or pass `--enable-sol` on the helper invocation.
55
+ Flag off both ways: fail closed when Fable did not bind.
56
+ Flag on: run the Codex preflight and bind per [`reference/sol-rung.md`](reference/sol-rung.md); a failed preflight fails closed when Fable did not bind.
57
+
58
+ On Codex: Sol is the in-session default. The `ADVISOR_SOL` flag is not required. Fail closed when that spawn does not bind.
40
59
 
41
60
  ### Claude host
42
61
 
43
- Use the **Model floor** ladder below (sol when flagged, then Fable Opus).
62
+ Use the **Model floor** ladder below (Fable first, then Sol when Fable is out of usage).
44
63
  Warm-up spawns `subagent_type: session-advisor` via the Agent tool; consults go through `SendMessage` to that warm agent.
45
64
  Assemble and paste each executor's Advisor block per the **Advisor block** section.
46
65
 
66
+ ### Codex host
67
+
68
+ Spawn a native in-session Sol subagent at `resolve_codex_model_id("Sol")`.
69
+ Walk `candidate_tiers = ["Sol"]`. Record `{tier: "Sol", result: "spawned"}` on success.
70
+ **Fail closed:** when Sol does not bind, set `selected_tier = null` and a `fallback_reason`, report that the advisor is unreachable, and **stop**.
71
+ Do not walk Fable on a Codex host. Consults stay in-session with that Sol subagent.
72
+ Assemble and paste each executor's Advisor block per the **Advisor block** section.
73
+
47
74
  ### Third-party host
48
75
 
49
- On a third-party (non-Claude) harness, the shared CLI Claude-chain is the one path to a Claude advisor: bind a **max-tier Claude advisor** through it, per [`reference/third-party-bind.md`](reference/third-party-bind.md).
76
+ On a third-party (non-Claude, non-Codex) harness, the shared CLI Claude-chain is the one path to a Claude advisor: bind Fable through it, per [`reference/third-party-bind.md`](reference/third-party-bind.md).
50
77
  The bound Claude session is the advisor; this third-party session stays the executor.
51
- Floor **Opus**; walk `candidate_tiers = ["Fable", "Opus"]` with `own_tier = Opus`; the sol rung binds ahead of the chain when open.
78
+ Walk `candidate_tiers = ["Fable"]`. When Fable is out of usage, the sol rung binds after Fable (`candidate_tiers = ["Fable", "Sol"]`).
52
79
  **Fail closed:** when every candidate fails, set `selected_tier = null` and a `fallback_reason`, report that the advisor is unreachable, and **stop** — ENDORSE / CORRECTION / PLAN / STOP come only from a bound advisor.
53
80
  Executors report to the orchestrating session; that session consults the bound advisor and relays the four-signal reply.
54
81
 
55
82
  ## Model floor
56
83
 
57
- **Claude host:** the advisor's model tier must be at or above the highest tier of any consumer that will reach it. Each consuming skill supplies its own consumer set when computing the floor:
58
- - `team-advisor`: the sole consumer is the calling session itself, so the floor is the stronger of Opus and that session's own tier.
59
- - `orchestrator`: the consumer set is the orchestrating session plus every tier named in its routing table, so the floor is the stronger of Opus and the max of those.
60
-
61
- Whatever the consumer set, the floor sits at Opus or above — use the stronger of Opus and the strongest consumer tier.
62
-
63
- **Third-party host:** the CLI advisor floor is fixed at **Opus** (walk Fable → Opus only), whatever the session's own tier.
64
-
65
- Ladder, strongest first: sol (flag-gated, Codex CLI) → `Fable` → `Opus`.
66
- Advisors bind at Opus or above; `Sonnet` and `Haiku` are executor tiers only.
84
+ On Claude and ThirdParty the advisor ladder is `Fable` first, then sol (flag-gated, Codex CLI) when Fable is out of usage.
85
+ On Codex the walk is Sol only, in-session.
86
+ Opus is not an advisor candidate. `Sonnet` and `Haiku` are executor tiers only.
87
+ Consumer `own_tier` is recorded on the spawn-walk log; it does not add Opus to the advisor walk.
67
88
  Tier names are canonical Title Case; the validator accepts any letter case and normalizes to Title Case.
68
- Read the floor tier the lower bound only then try binds top-down, stopping at the floor tier.
69
- Each try resolves its candidate tier to the short model alias via the tier-to-alias map in [`reference/cli-chain.md`](reference/cli-chain.md).
70
- The advisor is created at `selected_tier` the first ladder tier that binds which may sit above the floor.
71
- When even the floor tier fails on a Claude host, move to the **CLI chain** fallback below.
72
- On a third-party host the CLI chain is already the primary path, so floor failure fails closed per **Host profiles → Third-party host**.
89
+ Try binds top-down. Each try resolves its candidate tier to the short model alias via the tier-to-alias map in [`reference/cli-chain.md`](reference/cli-chain.md).
90
+ The advisor is created at `selected_tier` the first ladder tier that binds.
91
+ When Fable fails on a Claude host, try Sol if the flag is on, else fail closed. The CLI chain is the Fable bind path on a third-party host and the Claude-host fallback for Fable; it does not bind Opus as advisor.
92
+ On a Codex host a failed Sol spawn fails closed per **Host profiles Codex host**.
93
+ On a third-party host the CLI chain is already the primary path, so a failed Fable (and Sol, when enabled) walk fails closed per **Host profiles → Third-party host**.
73
94
 
74
95
  Emit a structured spawn-walk log so the walk can be checked mechanically: [`reference/spawn-walk-log.md`](reference/spawn-walk-log.md).
75
96
  The validator checks ladder shape only; host policy sits on top.
76
97
 
77
- **Equal-tier pairings.** Bind a same-tier advisor when the goal is an independent second pass.
78
- For irreversible or security-sensitive work, pair a top-tier executor with a top-tier advisor for independent frontier review.
79
- The floor rule holds — the advisor sits at or above the strongest consumer's tier — and an equal-tier bind sits inside that bound.
98
+ **Equal-tier pairings.** Bind Fable for an independent second pass on irreversible or security-sensitive work. The advisor is Fable or Sol.
80
99
 
81
100
  ## Warm-up (once per session)
82
101
 
@@ -84,6 +103,8 @@ On a **Claude host**, walk the candidate tiers top-down, spawning `session-advis
84
103
  A **Fable**-tier try carries the exact token `FABLE-SPAWN-AUTHORIZED` in its prompt — `hooks/blocking/fable_spawn_gate.py` denies a Fable-tier spawn without it.
85
104
  Full spawn fields and the charter template: [`reference/warm-up.md`](reference/warm-up.md).
86
105
 
106
+ On a **Codex host**, spawn a native in-session Sol subagent with the same charter. Bind fields: [`reference/identity.md`](reference/identity.md) and [`reference/warm-up.md`](reference/warm-up.md).
107
+
87
108
  On a **third-party host**, bind per [`reference/third-party-bind.md`](reference/third-party-bind.md) and charter the CLI session with the same charter — the reply contract is the same, and consults travel through the CLI runner.
88
109
 
89
110
  ## Consulting the warm agent
@@ -115,6 +136,8 @@ Modes and failover, the tier-to-alias table, brief piping, and `--resume` sessio
115
136
 
116
137
  **Third-party host:** the primary bind and consult path; the walk order and fail-closed rule live in [`reference/third-party-bind.md`](reference/third-party-bind.md).
117
138
 
139
+ **Codex host:** do not use this runner as the primary path. Sol binds in-session.
140
+
118
141
  **Claude host:** fall back to this runner exactly when one of these holds:
119
142
  - The Agent-tool spawn errors at every candidate tier down to the floor — the tool itself is unavailable.
120
143
  - `SendMessage` to the shared advisor errors, or draws no reply within the bound in `ADVISOR_SENDMESSAGE_REPLY_WAIT_SECONDS` (120) in `$HOME/.claude/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py`, and a re-spawn also fails.
@@ -12,10 +12,14 @@ The consult rules it restates are owned by [`consult-format.md`](consult-format.
12
12
 
13
13
  > A shared session advisor named `<name>` is reachable via SendMessage; send each consult to it directly by that name.
14
14
 
15
+ ## Transport preamble — Codex host
16
+
17
+ > A shared session advisor named `<name>` is reachable as a native Codex Sol subagent; send each consult to it in-session by that name.
18
+
15
19
  ## Transport preamble — third-party host
16
20
 
17
21
  > The orchestrating session owns a standing advisor for this run.
18
- > The advisor chain, strongest first: sol xhigh through the Codex CLI when the sol flag and its preflight open that rung, then Claude Fable at effort high, then Claude Opus at effort xhigh through the CLI Claude-chain.
22
+ > The advisor chain: Claude Fable, then Sol through the Codex CLI when Fable is out of usage and the sol flag and its preflight open that rung. Both rungs use `ADVISOR_EFFORT` (default low). When neither binds, there is no advisor.
19
23
  > The orchestrating session is your one path to it: send each consult as a report to the session that assigned you, and it relays the advisor's reply.
20
24
 
21
25
  ## Shared core — every host
@@ -37,5 +37,5 @@ After a CORRECTION or PLAN, your next consult on that topic opens with what happ
37
37
 
38
38
  Address a CORRECTION before treating the plan or the work as done, whether it names a wrong step or a risk worth closing.
39
39
  Report a STOP, or a consult that finds the advisor unreachable, upward: team-advisor's sole consumer is the session itself, so it reports to the user; orchestrator's executors report to the orchestrating session, which decides.
40
- When the advisor becomes unreachable, report that to the session that owns its lifecycle ([`lifecycle.md`](lifecycle.md)); that session alone decides whether to respawn (Claude Agent or third-party CLI re-bind).
40
+ When the advisor becomes unreachable, report that to the session that owns its lifecycle ([`lifecycle.md`](lifecycle.md)); that session alone decides whether to respawn (Claude Agent, Codex native Sol, or third-party CLI re-bind).
41
41
  A third-party host that cannot re-bind follows the fail-closed rule in [`third-party-bind.md`](third-party-bind.md).
@@ -0,0 +1,28 @@
1
+ # Session identity
2
+
3
+ Detail behind the **Host profiles** section of [`advisor-protocol.md`](../advisor-protocol.md).
4
+ Open this when binding the advisor and the session must name its identity.
5
+
6
+ ## Resolve the profile
7
+
8
+ Call `resolve_session_identity` from `$HOME/.claude/_shared/advisor/scripts/tier_model_ids.py` with the session's named identity.
9
+
10
+ | Identity text | Host profile | Bind path |
11
+ |---|---|---|
12
+ | a `codex` token | Codex | In-session Sol spawn |
13
+ | a `claude` token | Claude | In-session Fable spawn of `session-advisor` |
14
+ | any other identity | ThirdParty | Headless CLI chain |
15
+
16
+ When both `codex` and `claude` tokens appear, Codex wins. Empty text is ThirdParty.
17
+
18
+ ## Bind path
19
+
20
+ **Claude.** Spawn `subagent_type: session-advisor` at Fable through the Agent tool. When Fable is out of usage, bind Sol through the Codex helper if `ADVISOR_SOL` is on. Fail closed when neither binds.
21
+
22
+ **Codex.** Spawn a native in-session Sol subagent at `resolve_codex_model_id("Sol")` (`gpt-5.6-sol`). Walk `candidate_tiers = ["Sol"]`. Record `{tier: "Sol", result: "spawned"}` on success. The `ADVISOR_SOL` flag is not required. Fail closed when Sol does not bind. Do not walk Fable on a Codex host.
23
+
24
+ **ThirdParty.** Bind Fable through the CLI Claude-chain. When Fable is out of usage, bind Sol through the Codex helper if `ADVISOR_SOL` is on. Fail closed when neither binds.
25
+
26
+ ## Mechanical override
27
+
28
+ Scripts that cannot self-identify read `detect_host_profile`. `ADVISOR_HOST_PROFILE` accepts `Claude`, `Codex`, or `ThirdParty`. `THIRD_PARTY=1` selects ThirdParty. The default is Claude.
@@ -12,10 +12,17 @@ One shared advisor exists per orchestrated session, owned by the session that sp
12
12
  **Re-spawn on drift.** If a reply shows the agent working from a stale picture, or the session pivots to an unrelated task, the owning session ends that agent and spawns a fresh one with a new charter.
13
13
  A **Fable**-tier re-spawn carries the exact token `FABLE-SPAWN-AUTHORIZED` in that fresh prompt, as a Fable-tier warm-up try does.
14
14
 
15
+ ## Codex host
16
+
17
+ The session that spawns the shared Sol subagent owns its whole lifecycle — spawn, drift-respawn, and shutdown.
18
+ Every other consumer reaches it by message alone; spawn, respawn, and shutdown belong to the owning session.
19
+
20
+ **Re-spawn on drift.** If a reply shows the agent working from a stale picture, or the session pivots to an unrelated task, the owning session ends that agent and spawns a fresh native Sol subagent with a new charter.
21
+
15
22
  ## Third-party host
16
23
 
17
24
  The orchestrating session owns the Claude CLI advisor bind for the whole run — first bind, re-bind on drift or lost `session_id`, and fail-closed report when the chain cannot serve.
18
25
 
19
26
  **Re-bind on drift.** If a reply shows a stale picture, the task pivots, or `--resume` fails after a usage-limit failover (session stores are per binary/account), re-bind through `claude_chain_runner.py` with the charter plus a compact recap of consults so far.
20
- Capture the new `session_id`, and log a fresh Fable→Opus walk with `result: "cli"` on success.
27
+ Capture the new `session_id`, and log a fresh Fable walk with `result: "cli"` on success, then Sol when that rung is open.
21
28
  Executors keep reporting to the orchestrating session; advisor binding stays with that session alone.
@@ -1,14 +1,19 @@
1
1
  # Sol rung
2
2
 
3
- Detail behind the **Host profiles → Sol rung — any host** section of [`advisor-protocol.md`](../advisor-protocol.md).
4
- Open this when `ADVISOR_SOL_XHIGH` is set and a bind is starting.
3
+ Detail behind the **Host profiles → Sol rung** section of [`advisor-protocol.md`](../advisor-protocol.md).
4
+ Open this when Fable is out of usage on a Claude or ThirdParty host and a Sol fallback bind is starting.
5
+ On a Codex host, Sol is the in-session default; see [`identity.md`](identity.md).
5
6
 
6
7
  ## Flag
7
8
 
8
- `ADVISOR_SOL_XHIGH=1` (or `true` / `yes` / `on`) opens the rung. Two channels exist: set the variable in the helper's process environment, or pass `--enable-sol` on the helper invocation — the CLI flag opens the rung for that run without touching the environment.
9
- Flag off both ways: the walk starts at the host's Claude ladder, Fable first.
9
+ `ADVISOR_SOL=1` (or `true` / `yes` / `on`) opens the Sol fallback after Fable is out of usage. Two channels exist: set the variable in the helper's process environment, or pass `--enable-sol` on the helper invocation — the CLI flag opens the rung for that run without touching the environment.
10
+ Flag off both ways: fail closed when Fable did not bind.
10
11
  A Windows `setx` write only updates the persisted user environment; only a process started after that write inherits the new value, so an already-running session either sets the flag in its own invoking process environment or passes `--enable-sol`.
11
12
 
13
+ ## Effort
14
+
15
+ `ADVISOR_EFFORT` selects Codex `model_reasoning_effort` for Sol and `--effort` for Fable: `low`, `medium`, `high`, `xhigh`, or `max`. The default is `low`, which sends `model_reasoning_effort="low"`. Pass `--effort <level>` on the helper to set effort for that Sol run without changing the environment. An unset or unrecognized value uses `low`.
16
+
12
17
  Every fallback reply carries a `fallback_kind` field: `declined` when policy closed the rung (flag off, usage meter at or below the gate) and `broken` when the Sol path itself failed (missing executable, spawn error, timeout, malformed reply). A `broken` fallback is a defect to report, not a routing outcome.
13
18
 
14
19
  ## Preflight
@@ -23,12 +28,12 @@ Repo home: `packages/claude-dev-env/_shared/pr-loop/scripts/`.
23
28
 
24
29
  The shared entry point is `~/.claude/_shared/advisor/scripts/codex_sol_advisor.py`; it calls the installed probe and owns Sol bind or resume parsing. Bind with `python ~/.claude/_shared/advisor/scripts/codex_sol_advisor.py --bind --cwd <repo-root>` and pipe the charter on stdin. Resume with `--resume <session_id>` and pipe the delta consult on stdin.
25
30
 
26
- The gate passes only when the probe exits 0, `percent_left` is finite numeric data, and `percent_left` is strictly greater than `WEEKLY_USAGE_GATE_THRESHOLD_PERCENT` from the existing probe. The exact-threshold case selects Fable.
31
+ The gate passes only when the probe exits 0, `percent_left` is finite numeric data, and `percent_left` is strictly greater than `WEEKLY_USAGE_GATE_THRESHOLD_PERCENT` from the existing probe. The exact-threshold case fails closed when Fable did not bind.
27
32
 
28
33
  ## Branches
29
34
 
30
- **Preflight pass** — bind one Codex CLI session at `gpt-5.6-sol` with `model_reasoning_effort="xhigh"`, `--sandbox read-only`, and JSON output. The helper receives the standing-reviewer charter on stdin and returns only parsed ENDORSE / CORRECTION / PLAN / STOP guidance with a session ID.
35
+ **Preflight pass** — bind one Codex CLI session at `gpt-5.6-sol` with `model_reasoning_effort` set from `ADVISOR_EFFORT` (default `low`), `--sandbox read-only`, and JSON output. The helper receives the standing-reviewer charter on stdin and returns only parsed ENDORSE / CORRECTION / PLAN / STOP guidance with a session ID.
31
36
 
32
- **Preflight fail** — probe failure, non-zero exit, timeout, missing or malformed usage, `null`, non-finite usage, or usage at or below the threshold selects Fable and continues the normal walk.
37
+ **Preflight fail** — probe failure, non-zero exit, timeout, missing or malformed usage, `null`, non-finite usage, or usage at or below the threshold fails closed when Fable did not bind.
33
38
 
34
39
  The helper owns the Sol attempt and returns an explicit fallback result. The consuming advisor path owns the Fable bind. Apply the same gate to every Sol attempt, including resume.
@@ -6,10 +6,11 @@ Detail behind the **Model floor** section of [`advisor-protocol.md`](../advisor-
6
6
 
7
7
  Write the log as JSON with these field names:
8
8
 
9
- - `own_tier` — the floor tier.
10
- - `candidate_tiers` — the ladder slice down to that floor.
11
- - `sol_enabled` — a boolean recorded before candidate selection; `true` adds Sol ahead of the Claude ladder and `false` walks the Claude ladder alone.
12
- - `attempts` — one `{tier, result}` entry appended as each bind try happens; `result` is `codex` only for Sol, `spawned` for a Claude Agent spawn, `cli` for a CLI Claude-chain bind, or a failure reason such as `unavailable`.
9
+ - `own_tier` — the consuming session's tier (recorded; it does not add Opus to the advisor walk).
10
+ - `host_profile` — `Claude`, `Codex`, or `ThirdParty`. Omit to default to `Claude`.
11
+ - `candidate_tiers` — on Claude and ThirdParty, Fable, plus Sol when `sol_enabled` is true. On Codex, Sol only.
12
+ - `sol_enabled` — a boolean recorded before candidate selection; on Claude and ThirdParty, `true` adds Sol after Fable and `false` walks Fable alone. On Codex this flag does not change the walk.
13
+ - `attempts` — one `{tier, result}` entry appended as each bind try happens; `result` is `codex` for a Sol helper bind, `spawned` for an in-session spawn (Claude Agent or Codex native Sol), `cli` for a CLI Claude-chain bind, or a failure reason such as `unavailable`.
13
14
  - `selected_tier` — the tier of the first successful bind (first `codex`, `spawned`, or `cli` entry), or `null` paired with a `fallback_reason` string when none bound.
14
15
 
15
16
  ## Log path
@@ -27,5 +28,5 @@ Exit code `1` means a ladder invariant failed.
27
28
  Exit code `2` means the path or JSON was unusable.
28
29
  The same checks are available in-process via `validate_model_tier_run(run)`.
29
30
 
30
- The validator checks ladder shape only: the candidate slice, the order of bind tries, and the success-token rules per tier. Sol is attempted before Fable when `sol_enabled` is true. `selected_tier: "Sol"` requires `result: "codex"`; `result: "codex"` requires Sol.
31
+ The validator checks ladder shape only: the candidate slice, the order of bind tries, and the success-token rules per tier and host. On Claude and ThirdParty, Sol is attempted after Fable when `sol_enabled` is true, and `selected_tier: "Sol"` requires `result: "codex"`. On Codex, the walk is Sol only, and `result: "spawned"` or `result: "codex"` counts as success.
31
32
  Host policy sits on top of it — see the Model floor section of the protocol.
@@ -1,21 +1,20 @@
1
1
  # Third-party bind
2
2
 
3
3
  Detail behind the **Host profiles → Third-party host** section of [`advisor-protocol.md`](../advisor-protocol.md).
4
- Open this when binding or re-binding the advisor from a third-party (non-Claude) harness.
4
+ Open this when binding or re-binding the advisor from a third-party (non-Claude, non-Codex) harness.
5
5
 
6
6
  ## Bind steps
7
7
 
8
- 1. Detect the host profile first (protocol **Host profiles**).
9
- 2. Set the advisor floor to **Opus** so the walk is `candidate_tiers = ["Fable", "Opus"]` with `own_tier = Opus`. The sol rung ([`sol-rung.md`](sol-rung.md)) governs whether sol xhigh binds ahead of the chain.
8
+ 1. Name the session identity first (protocol **Host profiles**). This path is for a ThirdParty profile.
9
+ 2. Walk `candidate_tiers = ["Fable"]`. When Fable is out of usage, the sol rung ([`sol-rung.md`](sol-rung.md)) binds Sol after Fable (`candidate_tiers = ["Fable", "Sol"]`).
10
10
  3. **CLI bind (primary path):** for each candidate top-down, pipe a charter file into:
11
11
 
12
12
  ```
13
13
  python "$HOME/.claude/scripts/claude_chain_runner.py" --routing-mode ordered_account -- -p --model <alias> --effort <effort> --output-format json
14
14
  ```
15
15
 
16
- Use `--model fable --effort high` on Fable; use `--model opus --effort xhigh` on Opus.
16
+ Use `--model fable --effort` with the value of `ADVISOR_EFFORT` (default `low`) on Fable.
17
17
  User-facing wording follows [`rules/asd-ste100-language.md`](../../../rules/asd-ste100-language.md).
18
- The caller picks the Fable effort from task scope; when the caller cannot judge scope well enough to pick, it asks the user through AskUserQuestion before binding, and defaults to `high` when no caller choice arrives.
19
18
  A root advisor bind uses `--routing-mode ordered_account` — walk order, failover, and the `advisor_blocked` terminal status are in [`cli-chain.md`](cli-chain.md).
20
19
  4. Stop at the first successful bind.
21
20
  Record `{tier, result: "cli"}` and set `selected_tier` to that tier.
@@ -27,4 +26,4 @@ Open this when binding or re-binding the advisor from a third-party (non-Claude)
27
26
  ## Session model field
28
27
 
29
28
  Resolve a third-party session's own model field with `resolve_cli_model_id("ThirdParty")` → `third-party` when a host model alias is required.
30
- The **advisor** bind uses Fable/Opus aliases only.
29
+ The **advisor** bind uses the Fable alias. Sol binds through the Codex helper.
@@ -1,14 +1,14 @@
1
1
  # Warm-up spawn fields and charter
2
2
 
3
3
  Detail behind the **Warm-up** section of [`advisor-protocol.md`](../advisor-protocol.md).
4
- Open this when binding the warm advisor on a Claude host, and for the charter text on either host.
4
+ Open this when binding the warm advisor on a Claude host or a Codex host, and for the charter text on every host.
5
5
 
6
6
  ## Spawn fields — Claude host
7
7
 
8
8
  The consuming skill's session walks the candidate tiers top-down. For each try, spawn with:
9
9
 
10
10
  - `subagent_type: session-advisor` (see [`agents/session-advisor.md`](../../../agents/session-advisor.md) for the full signal contract).
11
- - `model`: the short alias for that try's candidate tier via `resolve_cli_model_id` (alias table: [`cli-chain.md`](cli-chain.md)) — for example `opus`. The floor is the lower bound of the walk; the walk tries stronger tiers first.
11
+ - `model`: the short alias for that try's candidate tier via `resolve_cli_model_id` (alias table: [`cli-chain.md`](cli-chain.md)) — for example `fable`. The walk tries Fable first, then Sol when that rung is open.
12
12
  - `name`: a name the session and every consumer will use to reach it (e.g. `team-advisor-agent`).
13
13
  - `run_in_background: true`.
14
14
  - `prompt`: the charter below. A **Fable**-tier try carries the exact token `FABLE-SPAWN-AUTHORIZED` in that prompt — `hooks/blocking/fable_spawn_gate.py` denies every `Agent` or `Task` spawn at `model: fable` whose prompt lacks that token. A try at any other tier needs no token.
@@ -29,6 +29,13 @@ State plainly:
29
29
 
30
30
  The agent finishes its first turn standing by. `SendMessage` alone resumes it; between consults it waits quietly.
31
31
 
32
+ ## Codex host
33
+
34
+ Spawn a native in-session Sol subagent at `resolve_codex_model_id("Sol")` (`gpt-5.6-sol`) with the charter as its prompt.
35
+ Record `{tier: "Sol", result: "spawned"}` on success. Fail closed when that spawn does not bind.
36
+ The `ADVISOR_SOL` flag is not required. Do not walk Fable. Consults stay in-session with that Sol subagent.
37
+ Identity routing: [`identity.md`](identity.md).
38
+
32
39
  ## Third-party host
33
40
 
34
41
  Bind per [`third-party-bind.md`](third-party-bind.md) and charter the CLI session with the same charter — the reply contract is the same, and consults travel through the CLI runner.