claude-dev-env 2.10.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +1 -1
- package/_shared/advisor/CLAUDE.md +3 -2
- package/_shared/advisor/advisor-protocol.md +74 -108
- package/_shared/advisor/reference/advisor-block.md +37 -0
- package/_shared/advisor/reference/cli-chain.md +45 -0
- package/_shared/advisor/reference/consult-format.md +41 -0
- package/_shared/advisor/reference/lifecycle.md +21 -0
- package/_shared/advisor/reference/sol-rung.md +34 -0
- package/_shared/advisor/reference/spawn-walk-log.md +31 -0
- package/_shared/advisor/reference/third-party-bind.md +30 -0
- package/_shared/advisor/reference/warm-up.md +34 -0
- package/_shared/advisor/scripts/codex_sol_advisor.py +514 -0
- package/_shared/advisor/scripts/config/advisor_scripts_constants/advisor_route_constants.py +21 -0
- package/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py +19 -17
- package/_shared/advisor/scripts/config/advisor_scripts_constants/sol_advisor_constants.py +33 -0
- package/_shared/advisor/scripts/model_tier_run_validator.py +32 -9
- package/_shared/advisor/scripts/tests/test_codex_sol_advisor.py +636 -0
- package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +79 -0
- package/_shared/advisor/scripts/tests/test_tier_model_ids.py +39 -17
- package/_shared/advisor/scripts/tier_model_ids.py +24 -0
- package/commands/CLAUDE.md +1 -0
- package/commands/sr-loop.md +48 -0
- package/docs/references/CLAUDE.md +2 -1
- package/docs/references/advisor-tool.md +26 -8
- package/docs/references/team-advisor-skill.md +3 -3
- package/docs/references/weak-executor-advisor.md +91 -0
- package/hooks/blocking/test_fable_spawn_gate.py +18 -11
- package/package.json +1 -1
- package/skills/_shared/advisor/CLAUDE.md +1 -1
- package/skills/_shared/advisor/scripts/README.md +2 -0
- package/skills/grokify/SKILL.md +1 -1
- package/skills/grokify/templates/handoff-template.md +2 -2
- package/skills/orchestrator/SKILL.md +5 -4
- package/skills/team-advisor/SKILL.md +7 -4
- package/skills/team-advisor/reference/advisor-docs-review.md +207 -0
- package/skills/usage-pause/SKILL.md +1 -1
- package/skills/usage-pause/scripts/resolve_usage_window.py +32 -4
- package/skills/usage-pause/scripts/test_resolve_usage_window.py +26 -0
- package/skills/usage-pause/scripts/usage_pause_constants/resolve_usage_window_constants.py +3 -1
package/CLAUDE.md
CHANGED
|
@@ -18,7 +18,7 @@ A runtime value that is itself private — a host, an SSH user or port, an owner
|
|
|
18
18
|
| `/team-advisor` skill | Standing warm advisor bind (map: `docs/references/team-advisor-skill.md`) |
|
|
19
19
|
| `~/.claude/_shared/advisor/advisor-protocol.md` | Host bind, model floor, lifecycle |
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Use `/team-advisor` under the rules in `advisor-tool.md` for every advisor consultation.
|
|
22
22
|
|
|
23
23
|
## Files and workspaces
|
|
24
24
|
|
|
@@ -8,13 +8,14 @@ Host profile (Claude vs third-party) is detected first; Claude walks the multi-t
|
|
|
8
8
|
|
|
9
9
|
| File | Purpose |
|
|
10
10
|
|---|---|
|
|
11
|
-
| `advisor-protocol.md` |
|
|
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 |
|
|
12
12
|
|
|
13
13
|
## Subdirectory
|
|
14
14
|
|
|
15
15
|
| Entry | Description |
|
|
16
16
|
|---|---|
|
|
17
|
-
| `scripts/` | `model_tier_run_validator.py` (spawn-walk log checks), `
|
|
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` |
|
|
18
19
|
|
|
19
20
|
## Breaking-change rule
|
|
20
21
|
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
# Advisor Protocol
|
|
2
2
|
|
|
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
|
|
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).
|
|
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.
|
|
7
|
+
On a third-party host, skip straight to **Host profiles → Third-party host**.
|
|
8
|
+
On Claude, continue with **Model floor** and the rest of this document.
|
|
9
|
+
|
|
10
|
+
## Read map
|
|
11
|
+
|
|
12
|
+
The sections below hold the standing rules; open a reference file at the moment its row names.
|
|
13
|
+
|
|
14
|
+
| Moment | Open |
|
|
15
|
+
|---|---|
|
|
16
|
+
| Binding on a Claude host | [`reference/warm-up.md`](reference/warm-up.md) — spawn fields, Fable token, charter |
|
|
17
|
+
| 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 |
|
|
19
|
+
| Composing a consult | [`reference/consult-format.md`](reference/consult-format.md) — packet, new-evidence and report-back rules |
|
|
20
|
+
| Assembling an executor spawn prompt | [`reference/advisor-block.md`](reference/advisor-block.md) — the paste parts |
|
|
21
|
+
| Advisor drifts, dies, or the task pivots | [`reference/lifecycle.md`](reference/lifecycle.md) — re-spawn and re-bind steps |
|
|
22
|
+
| Logging or checking a bind walk | [`reference/spawn-walk-log.md`](reference/spawn-walk-log.md) — record shape, validator |
|
|
23
|
+
| Any CLI call to a Claude advisor | [`reference/cli-chain.md`](reference/cli-chain.md) — runner modes, alias table, resume |
|
|
6
24
|
|
|
7
25
|
## Host profiles
|
|
8
26
|
|
|
@@ -14,147 +32,95 @@ Detection order:
|
|
|
14
32
|
2. `THIRD_PARTY=1` (or `true` / `yes` / `on`) — a third-party (non-Claude) harness.
|
|
15
33
|
3. Default: Claude.
|
|
16
34
|
|
|
17
|
-
###
|
|
35
|
+
### Sol rung — any host
|
|
18
36
|
|
|
19
|
-
|
|
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.
|
|
20
40
|
|
|
21
|
-
###
|
|
22
|
-
|
|
23
|
-
A third-party (non-Claude) harness cannot spawn a Claude `session-advisor` through the Agent tool. Bind a **max-tier Claude advisor** through the shared CLI Claude-chain. Do **not** treat this third-party session as the advisor.
|
|
24
|
-
|
|
25
|
-
1. Detect host profile first (this section).
|
|
26
|
-
2. Set the advisor floor to **Opus** so the walk is `candidate_tiers = ["Fable", "Opus"]` with `own_tier = Opus`. The walk never drops to Sonnet or Haiku on a third-party host.
|
|
27
|
-
3. **CLI bind (primary path):** for each candidate top-down, pipe a charter file into:
|
|
41
|
+
### Claude host
|
|
28
42
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
Use the **Model floor** ladder below (sol when flagged, then Fable → Opus).
|
|
44
|
+
Warm-up spawns `subagent_type: session-advisor` via the Agent tool; consults go through `SendMessage` to that warm agent.
|
|
45
|
+
Assemble and paste each executor's Advisor block per the **Advisor block** section.
|
|
32
46
|
|
|
33
|
-
|
|
34
|
-
4. Stop at the first successful bind. Record `{tier, result: "cli"}` and set `selected_tier` to that tier. Persist `session_id` from the JSON events (any event carries it; the runner also surfaces it on `ChainInvocationOutcome.session_id`; reply text is the `type == "result"` event's `.result` field). Run every bind and every later consult with cwd set to the repo root the work is for — Claude sessions are project-scoped by working directory.
|
|
35
|
-
5. **Fail closed:** when every candidate fails (chain exhausted, `advisor_blocked`, or model unavailable), set `selected_tier = null` and a `fallback_reason`, report that the advisor is unreachable, and **stop**. Do **not** answer ENDORSE / CORRECTION / PLAN / STOP as this third-party session. Do **not** self-endorse.
|
|
36
|
-
6. Paste the **Third-party host** Advisor block into every executor spawn prompt — never the Claude SendMessage block. Executors report to the orchestrating session; that session consults the bound Claude CLI advisor and relays the four-signal reply.
|
|
47
|
+
### Third-party host
|
|
37
48
|
|
|
38
|
-
|
|
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).
|
|
50
|
+
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.
|
|
52
|
+
**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
|
+
Executors report to the orchestrating session; that session consults the bound advisor and relays the four-signal reply.
|
|
39
54
|
|
|
40
55
|
## Model floor
|
|
41
56
|
|
|
42
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:
|
|
43
|
-
- `team-advisor`: the sole consumer is the calling session itself, so the floor is
|
|
44
|
-
- `orchestrator`: the consumer set is the orchestrating session plus every tier named in its routing table, so the floor is the max of those.
|
|
45
|
-
|
|
46
|
-
**Third-party host:** the CLI advisor floor is fixed at **Opus** (walk Fable → Opus only). The third-party session's own tier is not the advisor floor — see **Host profiles → Third-party host**.
|
|
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.
|
|
47
60
|
|
|
48
|
-
|
|
61
|
+
Whatever the consumer set, the floor sits at Opus or above — use the stronger of Opus and the strongest consumer tier.
|
|
49
62
|
|
|
50
|
-
|
|
63
|
+
**Third-party host:** the CLI advisor floor is fixed at **Opus** (walk Fable → Opus only), whatever the session's own tier.
|
|
51
64
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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.
|
|
67
|
+
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**.
|
|
55
73
|
|
|
56
|
-
|
|
74
|
+
Emit a structured spawn-walk log so the walk can be checked mechanically: [`reference/spawn-walk-log.md`](reference/spawn-walk-log.md).
|
|
75
|
+
The validator checks ladder shape only; host policy sits on top.
|
|
57
76
|
|
|
58
|
-
|
|
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.
|
|
59
80
|
|
|
60
81
|
## Warm-up (once per session)
|
|
61
82
|
|
|
62
|
-
On a **
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- `subagent_type: session-advisor` (see [`agents/session-advisor.md`](../../agents/session-advisor.md) for the full signal contract).
|
|
66
|
-
- `model`: the short alias for that attempt's candidate tier via `resolve_cli_model_id` (or the alias table under CLI chain) — for example `opus`, not Title Case `Opus`. The floor is only the lower bound of the walk; the walk still tries stronger tiers first.
|
|
67
|
-
- `name`: a name the session and every consumer will use to reach it (e.g. `team-advisor-agent`).
|
|
68
|
-
- `run_in_background: true`.
|
|
69
|
-
- `prompt`: the charter below. A **Fable**-tier attempt 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. An attempt at any other tier needs no token.
|
|
70
|
-
|
|
71
|
-
Stop at the first successful spawn. That attempt's tier is `selected_tier`; the warm agent lives at that tier for the rest of the session. If every candidate down to the floor fails, take the CLI fallback below.
|
|
72
|
-
|
|
73
|
-
Charter (the spawn prompt): the agent's role — standing reviewer, never edits files or runs commands, only answers via SendMessage — the repo path, and the session's current goal in two or three sentences. On a Fable-tier attempt, include the exact token `FABLE-SPAWN-AUTHORIZED` as plain text in this prompt (substring match; the gate does not verify who placed it). State plainly:
|
|
74
|
-
- Every consult carries: who is asking (name and assignment), what changed since their last consult, the live decision or question, and any load-bearing paths or excerpts.
|
|
75
|
-
- Reply via SendMessage to whoever sent the consult, by name — never route a reply through the spawning session or "main." Many different consumers may reach this one agent; each reply goes back to its own sender.
|
|
76
|
-
- Treat each consult on its own terms, keyed to the sender's stated assignment. Different consumers' consults will interleave in this one transcript — don't blend context across consumers unless a consult explicitly asks for that.
|
|
77
|
-
- If a consult re-raises a question already answered, with nothing new attached, reply by restating the prior answer and naming it as a restatement.
|
|
83
|
+
On a **Claude host**, walk the candidate tiers top-down, spawning `session-advisor` in the background at each candidate's alias with the charter as its prompt, stopping at the first successful spawn.
|
|
84
|
+
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
|
+
Full spawn fields and the charter template: [`reference/warm-up.md`](reference/warm-up.md).
|
|
78
86
|
|
|
79
|
-
|
|
87
|
+
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.
|
|
80
88
|
|
|
81
89
|
## Consulting the warm agent
|
|
82
90
|
|
|
83
|
-
Send a consult
|
|
84
|
-
|
|
85
|
-
- The consumer believes its assigned work is finished.
|
|
86
|
-
- A commit, push, or other hard-to-reverse action is about to run.
|
|
87
|
-
- The same failure has come back more than once, or progress has stalled.
|
|
88
|
-
- The chosen approach is being reconsidered.
|
|
89
|
-
|
|
90
|
-
Each consult carries, in order: who you are and your assignment (only needed on a shared advisor with multiple consumers — skip this for a single-consumer team-advisor session), the delta since your last consult (what was done, in order, with real output where it matters — never a full recap), the live decision or blocker, and any paths or excerpts needed to answer well.
|
|
91
|
-
|
|
92
|
-
**New-evidence rule.** Re-raise a question the advisor already answered only when you have something new to attach — the result of attempting the advised step, fresh tool output, or a changed constraint. Without new evidence, act on the standing answer.
|
|
93
|
-
|
|
94
|
-
**Report-back rule.** After a CORRECTION or PLAN, your next consult on that topic opens with what happened when you followed it.
|
|
95
|
-
|
|
96
|
-
Treat the reply as a serious second opinion: a CORRECTION — whether it names a wrong step or a risk worth closing — is something to address before treating the plan or the work as done. A STOP, or a consult that finds the advisor unreachable, is reported up rather than retried — 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. When the advisor becomes unreachable, report that to the session that owns its lifecycle (see below); that session alone decides whether to respawn (Claude Agent or third-party CLI re-bind). A third-party host that cannot re-bind fails closed and reports to the user — it does not answer the four signals as itself.
|
|
91
|
+
Send a consult at the trigger points `docs/references/advisor-tool.md` **When to call** defines — plan lock-in, believed completion, hard-to-reverse actions, repeated failure or stalled progress, and reconsidered approach.
|
|
92
|
+
The paste parts in [`reference/advisor-block.md`](reference/advisor-block.md) restate them for executors.
|
|
97
93
|
|
|
98
|
-
|
|
94
|
+
Each consult carries the sender's identity and assignment, the delta since the last consult, the live decision or blocker, and the paths or excerpts needed to answer well — full packet shape plus the new-evidence and report-back rules: [`reference/consult-format.md`](reference/consult-format.md).
|
|
95
|
+
Consult briefs embed the `docs/references/advisor-tool.md` **Brevity cue** line, sized per that section.
|
|
99
96
|
|
|
100
|
-
|
|
97
|
+
Treat the reply as a serious second opinion: a CORRECTION — whether it names a wrong step or a risk worth closing — is something to address before treating the plan or the work as done.
|
|
98
|
+
Route a STOP, or an unreachable advisor, upward per [`reference/consult-format.md`](reference/consult-format.md).
|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
## Advisor block — assemble and paste into every executor spawn prompt
|
|
103
101
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
> The orchestrating session owns a standing **Claude** advisor bound through the CLI Claude-chain (max tier: Fable high, then Opus max). There is no Agent-tool `session-advisor` and no SendMessage path to one. Report blockers and hard decisions to the **orchestrating session** (the session that assigned you) before locking in a nontrivial approach, once you believe your assignment is done, before any hard-to-reverse action, when the same failure repeats or progress has stalled, and when the chosen approach is being reconsidered. Open each report with who you are and your assignment, then: what you tried, the exact decision or blocker, and relevant paths or excerpts. Re-raise something already answered only when you have new evidence to attach — the result of trying prior advice, fresh output, or a changed constraint; otherwise act on the standing answer. After a CORRECTION or PLAN, your next report on that topic opens with what happened when you followed it. The orchestrating session consults the Claude CLI advisor and relays one of ENDORSE, CORRECTION, PLAN, or STOP — treat CORRECTION and PLAN as actions to take. On STOP, or if the orchestrating session reports the advisor unreachable, stop work and surface that upward; do not spawn a `session-advisor` agent yourself, and do not treat the third-party orchestrator's own judgment as an advisor signal.
|
|
102
|
+
Assemble each executor's block from the parts in [`reference/advisor-block.md`](reference/advisor-block.md), in order: one transport preamble picked by host profile, then the shared core, then — for an executor at Sonnet or below — the weak-executor add-on.
|
|
103
|
+
Paste the assembled block at the **top** of the spawn prompt, ahead of any other sentence that mentions the advisor.
|
|
104
|
+
The assembled block is self-contained — the executor receives this text alone.
|
|
109
105
|
|
|
110
106
|
## Lifecycle ownership
|
|
111
107
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
The session that spawns the shared advisor owns its whole lifecycle — spawn, drift-respawn, and shutdown. Every other consumer (executors, or any other consulting session) only ever sends it messages; none of them spawn, respawn, or shut it down themselves. One shared advisor exists per orchestrated session, owned by the session that spawned it.
|
|
115
|
-
|
|
116
|
-
**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, rather than forcing the old context to stretch across two different jobs. A **Fable**-tier re-spawn carries the exact token `FABLE-SPAWN-AUTHORIZED` in that fresh prompt, as a Fable-tier warm-up attempt does.
|
|
117
|
-
|
|
118
|
-
### Third-party host
|
|
119
|
-
|
|
120
|
-
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.
|
|
121
|
-
|
|
122
|
-
**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, capture the new `session_id`, and log a fresh Fable→Opus walk with `result: "cli"` on success. Executors keep reporting to the orchestrating session; they never bind a replacement advisor themselves.
|
|
108
|
+
The session that binds the advisor owns its whole lifecycle — first bind, drift re-spawn or re-bind, and shutdown; every other consumer reaches the advisor by message alone.
|
|
109
|
+
Drift signals and the per-host re-spawn / re-bind steps: [`reference/lifecycle.md`](reference/lifecycle.md).
|
|
123
110
|
|
|
124
111
|
## CLI chain
|
|
125
112
|
|
|
126
113
|
The shared runner is `python "$HOME/.claude/scripts/claude_chain_runner.py" [--routing-mode usage_ranked|ordered_account] -- <claude args...>`.
|
|
114
|
+
Modes and failover, the tier-to-alias table, brief piping, and `--resume` session handling: [`reference/cli-chain.md`](reference/cli-chain.md).
|
|
127
115
|
|
|
128
|
-
|
|
129
|
-
|---|---|---|---|
|
|
130
|
-
| Usage-ranked (default) | `--routing-mode usage_ranked` or omit the flag | Highest weekly remaining first (`claude_chain_usage` / usage-pause OAuth probe) | Usage-limit signature only |
|
|
131
|
-
| Ordered-account | `--routing-mode ordered_account` | Config list order in `~/.claude/claude-chain.json` | Usage-limit signature only; auth / timeout / config / other process errors → `advisor_blocked` |
|
|
116
|
+
**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).
|
|
132
117
|
|
|
133
|
-
**
|
|
134
|
-
|
|
135
|
-
**General chain calls** (non-root automation): keep the default usage-ranked mode so spare capacity on other accounts is preferred.
|
|
136
|
-
|
|
137
|
-
**Third-party host:** this runner is the **primary** advisor bind and consult path. Map each walk attempt to `--model <alias>` and the effort flags there. When the walk exhausts or returns `advisor_blocked`, fail closed.
|
|
138
|
-
|
|
139
|
-
**Claude host:** fall back to this runner when any of these holds, rather than on judgment call:
|
|
140
|
-
- The Agent-tool spawn errors at every candidate tier down to the floor — the tool itself, not just the top tier, is unavailable.
|
|
118
|
+
**Claude host:** fall back to this runner exactly when one of these holds:
|
|
119
|
+
- The Agent-tool spawn errors at every candidate tier down to the floor — the tool itself is unavailable.
|
|
141
120
|
- `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.
|
|
142
121
|
- The running session is itself a subagent barred from spawning further agents.
|
|
143
122
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
| Ladder tier (Title Case) | CLI / Agent `model` alias |
|
|
147
|
-
|---|---|
|
|
148
|
-
| Fable | `fable` |
|
|
149
|
-
| Opus | `opus` |
|
|
150
|
-
| Sonnet | `sonnet` |
|
|
151
|
-
| Haiku | `haiku` |
|
|
152
|
-
| ThirdParty (third-party session model field only; not an advisor walk tier) | `third-party` |
|
|
153
|
-
|
|
154
|
-
Resolve in code with `python -c "from tier_model_ids import resolve_cli_model_id; print(resolve_cli_model_id('Opus'))"` from `$HOME/.claude/_shared/advisor/scripts/` (any letter case accepted; unknown tiers raise `ValueError`). Write the charter or the consult brief to a temporary file under the job's own temporary directory (or the OS temp directory when no job directory exists) and pipe it in, rather than passing either as an inline argument, and drop that file once the consult completes.
|
|
155
|
-
|
|
156
|
-
Read the `session_id` out of the first call's JSON events and pass it to `-p --resume <session_id> --output-format json` on every later consult — `-p` stays on the resume call too, since it is still a non-interactive invocation. A usage-limit failover to the next binary in the chain does not carry the `session_id` forward: a session store belongs to the binary and account that minted it, so a `--resume` against the new binary can fail. Treat that failure as starting over, not as an error to retry — resend the charter plus a compact recap of the consults since the last one, capture the new `session_id` the fresh call returns, and continue from there.
|
|
157
|
-
|
|
158
|
-
## Mechanism, not a measured saving
|
|
123
|
+
## State the mechanism
|
|
159
124
|
|
|
160
|
-
One warm agent, addressed by name, whose transcript accumulates across consults — each consult sends only the delta since the last one.
|
|
125
|
+
One warm agent, addressed by name, whose transcript accumulates across consults — each consult sends only the delta since the last one.
|
|
126
|
+
A consuming skill's own text states this mechanism; a token or cost saving becomes a claim only after a measured comparison against cold spawns.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Advisor block parts
|
|
2
|
+
|
|
3
|
+
Detail behind the **Advisor block** section of [`advisor-protocol.md`](../advisor-protocol.md).
|
|
4
|
+
Open this when assembling the block for an executor spawn prompt.
|
|
5
|
+
|
|
6
|
+
Assembly order: one transport preamble picked by host profile, then the shared core, then — for an executor at Sonnet or below — the weak-executor add-on.
|
|
7
|
+
Paste the assembled block at the **top** of the spawn prompt, ahead of any other sentence that mentions the advisor.
|
|
8
|
+
The assembled block is self-contained — the executor receives this text alone, so every path it names is absolute.
|
|
9
|
+
The consult rules it restates are owned by [`consult-format.md`](consult-format.md); edit that file first and carry the change here.
|
|
10
|
+
|
|
11
|
+
## Transport preamble — Claude host
|
|
12
|
+
|
|
13
|
+
> A shared session advisor named `<name>` is reachable via SendMessage; send each consult to it directly by that name.
|
|
14
|
+
|
|
15
|
+
## Transport preamble — third-party host
|
|
16
|
+
|
|
17
|
+
> 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.
|
|
19
|
+
> 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
|
+
|
|
21
|
+
## Shared core — every host
|
|
22
|
+
|
|
23
|
+
> Consult before locking in a nontrivial approach, once you believe your assignment is done, before any hard-to-reverse action, when the same failure repeats or progress has stalled, and when the chosen approach is being reconsidered.
|
|
24
|
+
> Build the first consult with the complete format in `$HOME/.claude/_shared/advisor/reference/consult-format.md`: assignment, desired outcome, constraints and exclusions, actions taken in order, real output and current state, live decision or blocker, validation evidence, unresolved risks, and load-bearing paths or excerpts. Later consults carry only changed evidence.
|
|
25
|
+
> Re-raise something already answered only when you have new evidence to attach — the result of trying prior advice, fresh output, or a changed constraint; otherwise act on the standing answer.
|
|
26
|
+
> After a CORRECTION or PLAN, your next consult on that topic opens with what happened when you followed it.
|
|
27
|
+
> Replies open with one of ENDORSE, CORRECTION, PLAN, or STOP — treat CORRECTION and PLAN as actions to take.
|
|
28
|
+
> On STOP, or when the advisor is unreachable, stop and report that back to whoever assigned you; advisor binding and the four signals stay with the session that owns the advisor.
|
|
29
|
+
|
|
30
|
+
## Weak-executor add-on — Sonnet or below, either host
|
|
31
|
+
|
|
32
|
+
> Send your first consult right after orientation and before your first write.
|
|
33
|
+
> Send a completion consult once your writes and test output exist — that consult asks the advisor to hunt for missing requirements, untested behavior, wrong assumptions, unhandled edge cases, evidence gaps, and early completion claims.
|
|
34
|
+
> Consult before reaching for any task-list tool — the advisor's plan becomes the task list.
|
|
35
|
+
> Aim for two consults on a normal task: early orientation and completion review. Reserve a third for recovery or reconciliation, and add a consult when a material fork produces new evidence.
|
|
36
|
+
> Embed this line in each consult: `(Advisor: please keep your guidance under 80 words — I need a focused starting point, not a comprehensive plan.)`
|
|
37
|
+
> On a transient failure, retry once, then carry on with the evidence you have and record that you did.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# CLI Claude-chain
|
|
2
|
+
|
|
3
|
+
Detail behind the `## CLI chain` section of [`advisor-protocol.md`](../advisor-protocol.md).
|
|
4
|
+
The shared runner is `python "$HOME/.claude/scripts/claude_chain_runner.py" [--routing-mode usage_ranked|ordered_account] -- <claude args...>`.
|
|
5
|
+
|
|
6
|
+
## Modes
|
|
7
|
+
|
|
8
|
+
| Mode | Flag | Walk order | Failover |
|
|
9
|
+
|---|---|---|---|
|
|
10
|
+
| Usage-ranked (default) | `--routing-mode usage_ranked` or omit the flag | Highest weekly remaining first (`claude_chain_usage` / usage-pause OAuth probe) | Usage-limit signature only |
|
|
11
|
+
| Ordered-account | `--routing-mode ordered_account` | Config list order in `~/.claude/claude-chain.json` | Usage-limit signature only; auth / timeout / config / other process errors → `advisor_blocked` |
|
|
12
|
+
|
|
13
|
+
**Root advisor bind and consult** (the third-party host path): ordered-account mode. A non-usage failure terminates with `terminal_status=advisor_blocked`, exit code 4 on the CLI.
|
|
14
|
+
|
|
15
|
+
**General chain calls** (non-root automation): keep the default usage-ranked mode.
|
|
16
|
+
|
|
17
|
+
## Tier-to-alias map
|
|
18
|
+
|
|
19
|
+
Map `selected_tier` when one exists (the warm agent already bound at or above the floor).
|
|
20
|
+
Map the floor tier only when the walk exhausted with `selected_tier=null`.
|
|
21
|
+
Resolve that tier to its CLI / Agent model alias before the first call — the CLI `--model` flag and the Agent tool `model:` field take the short aliases below.
|
|
22
|
+
Source of truth: `ALL_CLI_MODEL_ID_BY_TIER` and `resolve_cli_model_id(tier)` in `advisor_scripts_constants` / the `tier_model_ids.py` helper.
|
|
23
|
+
|
|
24
|
+
| Ladder tier (Title Case) | CLI / Agent `model` alias |
|
|
25
|
+
|---|---|
|
|
26
|
+
| Fable | `fable` |
|
|
27
|
+
| Opus | `opus` |
|
|
28
|
+
| Sonnet | `sonnet` |
|
|
29
|
+
| Haiku | `haiku` |
|
|
30
|
+
| ThirdParty (third-party session model field only) | `third-party` |
|
|
31
|
+
|
|
32
|
+
`resolve_cli_model_id(tier)` accepts any letter case and raises `ValueError` on a tier outside the map.
|
|
33
|
+
|
|
34
|
+
## Brief piping
|
|
35
|
+
|
|
36
|
+
Write the charter or the consult brief to a temporary file under the job's own temporary directory (or the OS temp directory when no job directory exists) and pipe it in from that file.
|
|
37
|
+
Drop the file once the consult completes.
|
|
38
|
+
|
|
39
|
+
## Session resume
|
|
40
|
+
|
|
41
|
+
Read the `session_id` out of the first call's JSON events.
|
|
42
|
+
Pass it to `-p --resume <session_id> --output-format json` on every later consult — `-p` stays on the resume call too, since it is still a non-interactive invocation.
|
|
43
|
+
A session store belongs to the binary and account that minted it, so after a usage-limit failover to the next binary a `--resume` against it can fail.
|
|
44
|
+
Treat that failure as starting over.
|
|
45
|
+
Resend the charter plus a compact recap of the consults since the last one, capture the new `session_id` the fresh call returns, and continue from there.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Consult format
|
|
2
|
+
|
|
3
|
+
Detail behind the **Consulting the warm agent** section of [`advisor-protocol.md`](../advisor-protocol.md).
|
|
4
|
+
Open this when composing a consult or handling its reply.
|
|
5
|
+
|
|
6
|
+
## Packet
|
|
7
|
+
|
|
8
|
+
The first consult is complete and self-contained. It carries:
|
|
9
|
+
|
|
10
|
+
- Assignment and desired outcome
|
|
11
|
+
- Constraints and exclusions
|
|
12
|
+
- Actions taken in order
|
|
13
|
+
- Real output and current state
|
|
14
|
+
- Live decision or blocker
|
|
15
|
+
- Validation evidence
|
|
16
|
+
- Unresolved risks
|
|
17
|
+
- Load-bearing paths or excerpts
|
|
18
|
+
|
|
19
|
+
On a shared advisor with multiple consumers, open with who is asking and the assignment. A single-consumer team-advisor session may omit the identity opener while keeping the assignment.
|
|
20
|
+
|
|
21
|
+
Later consults carry only the delta: changed actions, new output, changed decisions, new validation, and newly discovered risks.
|
|
22
|
+
|
|
23
|
+
The completion consult carries the durable deliverable, test output, unresolved risks, evidence gaps, and any claim that the task is ready to close.
|
|
24
|
+
|
|
25
|
+
Consult briefs embed the [`docs/references/advisor-tool.md`](../../../docs/references/advisor-tool.md) **Brevity cue** line, sized per that section.
|
|
26
|
+
|
|
27
|
+
## New-evidence rule
|
|
28
|
+
|
|
29
|
+
Re-raise a question the advisor already answered only when you have something new to attach — the result of trying the advised step, fresh tool output, or a changed constraint.
|
|
30
|
+
Without new evidence, act on the standing answer.
|
|
31
|
+
|
|
32
|
+
## Report-back rule
|
|
33
|
+
|
|
34
|
+
After a CORRECTION or PLAN, your next consult on that topic opens with what happened when you followed it.
|
|
35
|
+
|
|
36
|
+
## Handling the reply
|
|
37
|
+
|
|
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
|
+
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).
|
|
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,21 @@
|
|
|
1
|
+
# Lifecycle detail
|
|
2
|
+
|
|
3
|
+
Detail behind the **Lifecycle ownership** section of [`advisor-protocol.md`](../advisor-protocol.md).
|
|
4
|
+
Open this when the advisor drifts, dies, or the task pivots.
|
|
5
|
+
|
|
6
|
+
## Claude host
|
|
7
|
+
|
|
8
|
+
The session that spawns the shared advisor owns its whole lifecycle — spawn, drift-respawn, and shutdown.
|
|
9
|
+
Every other consumer (executors, or any other consulting session) reaches it by message alone; spawn, respawn, and shutdown belong to the owning session.
|
|
10
|
+
One shared advisor exists per orchestrated session, owned by the session that spawned it.
|
|
11
|
+
|
|
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
|
+
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
|
+
|
|
15
|
+
## Third-party host
|
|
16
|
+
|
|
17
|
+
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
|
+
|
|
19
|
+
**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.
|
|
21
|
+
Executors keep reporting to the orchestrating session; advisor binding stays with that session alone.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Sol rung
|
|
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.
|
|
5
|
+
|
|
6
|
+
## Flag
|
|
7
|
+
|
|
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.
|
|
10
|
+
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
|
+
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
|
+
|
|
14
|
+
## Preflight
|
|
15
|
+
|
|
16
|
+
Flag on: run the Codex preflight first —
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
python ~/.claude/skills/codex-review/scripts/codex_usage_probe.py
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Repo home: `packages/claude-dev-env/skills/codex-review/scripts/`.
|
|
23
|
+
|
|
24
|
+
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
|
+
|
|
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.
|
|
27
|
+
|
|
28
|
+
## Branches
|
|
29
|
+
|
|
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.
|
|
31
|
+
|
|
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.
|
|
33
|
+
|
|
34
|
+
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.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Spawn-walk log
|
|
2
|
+
|
|
3
|
+
Detail behind the **Model floor** section of [`advisor-protocol.md`](../advisor-protocol.md).
|
|
4
|
+
|
|
5
|
+
## Record shape
|
|
6
|
+
|
|
7
|
+
Write the log as JSON with these field names:
|
|
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`.
|
|
13
|
+
- `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
|
+
## Log path
|
|
16
|
+
|
|
17
|
+
Write to a path the session controls — typically `<job-temp-dir>/model-tier-run.json`, or the OS temp directory when no job directory exists.
|
|
18
|
+
|
|
19
|
+
## Validator
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
python "$HOME/.claude/_shared/advisor/scripts/model_tier_run_validator.py" <path-to-model-tier-run.json>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Exit code `0` means every invariant holds.
|
|
26
|
+
Exit code `1` means a ladder invariant failed.
|
|
27
|
+
Exit code `2` means the path or JSON was unusable.
|
|
28
|
+
The same checks are available in-process via `validate_model_tier_run(run)`.
|
|
29
|
+
|
|
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
|
+
Host policy sits on top of it — see the Model floor section of the protocol.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Third-party bind
|
|
2
|
+
|
|
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.
|
|
5
|
+
|
|
6
|
+
## Bind steps
|
|
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.
|
|
10
|
+
3. **CLI bind (primary path):** for each candidate top-down, pipe a charter file into:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
python "$HOME/.claude/scripts/claude_chain_runner.py" --routing-mode ordered_account -- -p --model <alias> --effort <effort> --output-format json
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Use `--model fable --effort high` on Fable; use `--model opus --effort xhigh` on Opus.
|
|
17
|
+
Opus routing follows [`rules/opus5-communication-contract.md`](../../../rules/opus5-communication-contract.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
|
+
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
|
+
4. Stop at the first successful bind.
|
|
21
|
+
Record `{tier, result: "cli"}` and set `selected_tier` to that tier.
|
|
22
|
+
Persist `session_id` from the JSON events (any event carries it; the runner also surfaces it on `ChainInvocationOutcome.session_id`; reply text is the `type == "result"` event's `.result` field).
|
|
23
|
+
Run every bind and every later consult with cwd set to the repo root the work is for — Claude sessions are project-scoped by working directory.
|
|
24
|
+
5. **Fail closed:** when every candidate fails (chain exhausted, `advisor_blocked`, or model unavailable), 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.
|
|
25
|
+
6. Assemble and paste each executor's Advisor block from [`advisor-block.md`](advisor-block.md). Executors report to the orchestrating session; that session consults the bound advisor and relays the four-signal reply.
|
|
26
|
+
|
|
27
|
+
## Session model field
|
|
28
|
+
|
|
29
|
+
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.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Warm-up spawn fields and charter
|
|
2
|
+
|
|
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.
|
|
5
|
+
|
|
6
|
+
## Spawn fields — Claude host
|
|
7
|
+
|
|
8
|
+
The consuming skill's session walks the candidate tiers top-down. For each try, spawn with:
|
|
9
|
+
|
|
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.
|
|
12
|
+
- `name`: a name the session and every consumer will use to reach it (e.g. `team-advisor-agent`).
|
|
13
|
+
- `run_in_background: true`.
|
|
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.
|
|
15
|
+
|
|
16
|
+
Stop at the first successful spawn. That try's tier is `selected_tier`; the warm agent lives at that tier for the rest of the session.
|
|
17
|
+
|
|
18
|
+
## Charter (the spawn prompt)
|
|
19
|
+
|
|
20
|
+
The charter states: the agent's role — standing reviewer, answers only via SendMessage, with file edits and commands out of its scope — the repo path, and the session's current goal in two or three sentences.
|
|
21
|
+
On a Fable-tier try, include the exact token `FABLE-SPAWN-AUTHORIZED` as plain text in this prompt (substring match; the gate reads the token alone, wherever it came from).
|
|
22
|
+
State plainly:
|
|
23
|
+
|
|
24
|
+
- Every consult carries: who is asking (name and assignment), what changed since their last consult, the live decision or question, and any load-bearing paths or excerpts.
|
|
25
|
+
- Reply via SendMessage to whoever sent the consult, by name — each reply goes back to its own sender, and many different consumers may reach this one agent.
|
|
26
|
+
- Treat each consult on its own terms, keyed to the sender's stated assignment. Different consumers' consults will interleave in this one transcript — keep each consumer's context separate, and blend only when a consult explicitly asks for that.
|
|
27
|
+
- If a consult re-raises a question already answered, with nothing new attached, reply by restating the prior answer and naming it as a restatement.
|
|
28
|
+
- Every reply, including this first bind turn, opens its first line with exactly one of the four uppercase signal words — `ENDORSE`, `CORRECTION`, `PLAN`, `STOP` — and nothing else on that line. Standing by after the bind is itself an `ENDORSE` of the charter, stated as that first line.
|
|
29
|
+
|
|
30
|
+
The agent finishes its first turn standing by. `SendMessage` alone resumes it; between consults it waits quietly.
|
|
31
|
+
|
|
32
|
+
## Third-party host
|
|
33
|
+
|
|
34
|
+
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.
|