claude-dev-env 2.36.0 → 4.0.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/.agents/skills/_shared/advisor/scripts/README.md +1 -1
- package/.agents/skills/team-advisor/SKILL.md +11 -11
- package/_shared/advisor/advisor-protocol.md +51 -51
- package/_shared/advisor/reference/advisor-block.md +9 -9
- package/_shared/advisor/reference/astra-rung.md +39 -0
- package/_shared/advisor/reference/identity.md +4 -4
- package/_shared/advisor/reference/lifecycle.md +6 -6
- package/_shared/advisor/reference/spawn-walk-log.md +9 -9
- package/_shared/advisor/reference/third-party-bind.md +11 -11
- package/_shared/advisor/reference/warm-up.md +13 -13
- package/_shared/advisor/scripts/codex_astra_advisor.py +308 -0
- package/_shared/advisor/scripts/codex_astra_preflight.py +115 -0
- package/_shared/advisor/scripts/codex_astra_reply.py +159 -0
- package/_shared/advisor/scripts/config/advisor_scripts_constants/advisor_route_constants.py +3 -3
- package/_shared/advisor/scripts/config/advisor_scripts_constants/astra_advisor_constants.py +38 -0
- package/_shared/advisor/scripts/model_tier_run_validator.py +17 -18
- package/_shared/advisor/scripts/tests/test_codex_astra_advisor.py +271 -0
- package/_shared/advisor/scripts/tests/test_codex_astra_preflight.py +24 -0
- package/_shared/advisor/scripts/tests/test_codex_astra_reply.py +42 -0
- package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +55 -30
- package/_shared/advisor/scripts/tests/test_tier_model_ids.py +14 -4
- package/_shared/pr-loop/scripts/pr_loop_shared_constants/terminology_sweep_constants.py +14 -0
- package/_shared/pr-loop/scripts/terminology_sweep.py +138 -50
- package/_shared/pr-loop/scripts/tests/test_terminology_sweep.py +13 -1
- package/docs/references/team-advisor-skill.md +3 -3
- package/hooks/validators/README.md +35 -1
- package/package.json +1 -1
- package/scripts/check.ps1 +18 -6
- package/scripts/policy_lint/adapter_detectors.py +42 -2
- package/scripts/policy_lint/adapters.py +24 -0
- package/scripts/policy_lint/config/constants.py +11 -0
- package/scripts/policy_lint/engine.py +1 -1
- package/scripts/policy_lint/model.py +1 -0
- package/scripts/policy_lint/registry.py +10 -1
- package/scripts/repository_checks/__init__.py +1 -0
- package/scripts/repository_checks/claude_md.py +108 -0
- package/scripts/repository_checks/config/__init__.py +1 -0
- package/scripts/repository_checks/config/constants.py +150 -0
- package/scripts/repository_checks/env_var_documentation.py +243 -0
- package/scripts/repository_checks/hook_modules.py +34 -0
- package/scripts/repository_checks/models.py +37 -0
- package/scripts/repository_checks/package_inventory.py +118 -0
- package/scripts/repository_checks/pytest_testpaths.py +84 -0
- package/scripts/repository_checks/reporting.py +39 -0
- package/scripts/repository_checks/runner.py +93 -0
- package/scripts/repository_checks/tracked_secrets.py +147 -0
- package/scripts/repository_checks/tracked_tree.py +28 -0
- package/scripts/repository_policy.py +120 -0
- package/scripts/tests/repository_policy_test_support.py +89 -0
- package/scripts/tests/test_cde_lint.py +25 -1
- package/scripts/tests/test_claude_md.py +68 -0
- package/scripts/tests/test_env_var_documentation.py +133 -0
- package/scripts/tests/test_hook_modules.py +17 -0
- package/scripts/tests/test_models.py +26 -0
- package/scripts/tests/test_package_inventory.py +96 -0
- package/scripts/tests/test_policy_lint_rules_registry.py +117 -0
- package/scripts/tests/test_pytest_testpaths.py +66 -0
- package/scripts/tests/test_reporting.py +54 -0
- package/scripts/tests/test_repository_policy.py +71 -0
- package/scripts/tests/test_runner.py +59 -0
- package/scripts/tests/test_tracked_secrets.py +175 -0
- package/scripts/tests/test_tracked_tree.py +28 -0
- package/_shared/advisor/reference/sol-rung.md +0 -39
- package/_shared/advisor/scripts/codex_sol_advisor.py +0 -581
- package/_shared/advisor/scripts/config/advisor_scripts_constants/sol_advisor_constants.py +0 -38
- package/_shared/advisor/scripts/tests/test_codex_sol_advisor.py +0 -740
|
@@ -16,23 +16,23 @@ One warm advisor at the strongest tier this session can reach. This session is t
|
|
|
16
16
|
|
|
17
17
|
| Doc | Holds |
|
|
18
18
|
|---|---|
|
|
19
|
-
| [`docs/references/advisor-tool.md`](../../docs/references/advisor-tool.md) | **Consult cadence and weight
|
|
20
|
-
| [`~/.claude/_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md) | **Bind and lifecycle
|
|
21
|
-
| [`agents/session-advisor.md`](../../agents/session-advisor.md) | **Reply contract
|
|
22
|
-
| [`reference/advisor-docs-review.md`](reference/advisor-docs-review.md) | Anthropic advisor-tool source facts: measured effects, Sonnet steering, cost levers, failure modes. Background
|
|
19
|
+
| [`docs/references/advisor-tool.md`](../../docs/references/advisor-tool.md) | **Consult cadence and weight.** When to call, the hard rule before first write, and how to treat advice. Read this for every consult. |
|
|
20
|
+
| [`~/.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. |
|
|
21
|
+
| [`agents/session-advisor.md`](../../agents/session-advisor.md) | **Reply contract.** ENDORSE / CORRECTION / PLAN / STOP. SendMessage only. |
|
|
22
|
+
| [`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. |
|
|
23
23
|
|
|
24
24
|
## Bind
|
|
25
25
|
|
|
26
26
|
1. Name the session identity first (protocol **Host profiles**), then walk the model floor.
|
|
27
|
-
2. Claude: Fable first in-session at `ADVISOR_EFFORT` (default low). When Fable is out of usage, bind
|
|
28
|
-
3. Name: `team-advisor-agent` on Claude (Agent spawn of `session-advisor`); a native
|
|
27
|
+
2. Claude: Fable first in-session at `ADVISOR_EFFORT` (default low). When Fable is out of usage, bind Astra at the same effort. Codex: Astra in-session. Third-party: headless Fable then Astra. When the host's walk fails, fail closed.
|
|
28
|
+
3. Name: `team-advisor-agent` on Claude (Agent spawn of `session-advisor`); a native Astra subagent on Codex; one CLI `session_id` on a third-party host via the protocol Claude-chain or Astra helper.
|
|
29
29
|
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).
|
|
30
|
-
5. Skip the multi-consumer "who you are" opener
|
|
31
|
-
6. When the bind or reply path fails, fail closed and report to the user. On a third-party host, only the bound
|
|
30
|
+
5. Skip the multi-consumer "who you are" opener. This session is the sole consumer.
|
|
31
|
+
6. When the bind or reply path fails, fail closed and report to the user. On a third-party host, only the bound advisor issues ENDORSE / CORRECTION / PLAN / STOP.
|
|
32
32
|
|
|
33
|
-
**GOTCHA (Cursor / ThirdParty +
|
|
33
|
+
**GOTCHA (Cursor / ThirdParty + Astra):** when the walk reaches Astra or the user asks for Astra, first tool call is `python ~/.claude/_shared/advisor/scripts/codex_astra_advisor.py --bind --enable-astra --cwd <repo-root>` with the charter on stdin. Do not use Agent or Task. Do not search for a probe path. Details: [`third-party-bind.md`](../../_shared/advisor/reference/third-party-bind.md) GOTCHA and [`astra-rung.md`](../../_shared/advisor/reference/astra-rung.md).
|
|
34
34
|
|
|
35
|
-
Full walk, charter, consult packet,
|
|
35
|
+
Full walk, charter, consult packet, Astra routing, and drift re-bind live in the protocol read map and its `reference/` files.
|
|
36
36
|
|
|
37
37
|
## Consult
|
|
38
38
|
|
|
@@ -44,6 +44,6 @@ Aim for two consults on a normal task: one after orientation and one after write
|
|
|
44
44
|
|
|
45
45
|
## Constraints
|
|
46
46
|
|
|
47
|
-
- One bind per session; this session owns spawn, in-session
|
|
47
|
+
- One bind per session; this session owns spawn, in-session Astra spawn, or CLI bind, drift re-bind, and shutdown.
|
|
48
48
|
- Bind at or above the protocol floor for this host.
|
|
49
49
|
- The advisor only answers (messaging); the session runs tools and posts.
|
|
@@ -13,20 +13,20 @@ On Claude, continue with **Model floor** and the rest of this document.
|
|
|
13
13
|
|
|
14
14
|
## Read map
|
|
15
15
|
|
|
16
|
-
The sections below hold the standing rules
|
|
16
|
+
The sections below hold the standing rules. Open a reference file at the moment its row names.
|
|
17
17
|
|
|
18
18
|
| Moment | Open |
|
|
19
19
|
|---|---|
|
|
20
|
-
| Naming the session identity | [`reference/identity.md`](reference/identity.md)
|
|
21
|
-
| Binding on a Claude host | [`reference/warm-up.md`](reference/warm-up.md)
|
|
22
|
-
| Binding on a Codex host | [`reference/identity.md`](reference/identity.md)
|
|
23
|
-
| Binding from a third-party host | [`reference/third-party-bind.md`](reference/third-party-bind.md)
|
|
24
|
-
| Fable is out of usage | [`reference/
|
|
25
|
-
| Composing a consult | [`reference/consult-format.md`](reference/consult-format.md)
|
|
26
|
-
| Assembling an executor spawn prompt | [`reference/advisor-block.md`](reference/advisor-block.md)
|
|
27
|
-
| Advisor drifts, dies, or the task pivots | [`reference/lifecycle.md`](reference/lifecycle.md)
|
|
28
|
-
| Logging or checking a bind walk | [`reference/spawn-walk-log.md`](reference/spawn-walk-log.md)
|
|
29
|
-
| Any CLI call to a Claude advisor | [`reference/cli-chain.md`](reference/cli-chain.md)
|
|
20
|
+
| Naming the session identity | [`reference/identity.md`](reference/identity.md): Claude, Codex, or neither |
|
|
21
|
+
| Binding on a Claude host | [`reference/warm-up.md`](reference/warm-up.md): spawn fields, Fable token, charter |
|
|
22
|
+
| Binding on a Codex host | [`reference/identity.md`](reference/identity.md): in-session Astra spawn |
|
|
23
|
+
| Binding from a third-party host | [`reference/third-party-bind.md`](reference/third-party-bind.md): CLI bind steps, fail-closed rule |
|
|
24
|
+
| Fable is out of usage | [`reference/astra-rung.md`](reference/astra-rung.md): Astra fallback at shared effort |
|
|
25
|
+
| Composing a consult | [`reference/consult-format.md`](reference/consult-format.md): packet, new-evidence and report-back rules |
|
|
26
|
+
| Assembling an executor spawn prompt | [`reference/advisor-block.md`](reference/advisor-block.md): the paste parts |
|
|
27
|
+
| Advisor drifts, dies, or the task pivots | [`reference/lifecycle.md`](reference/lifecycle.md): re-spawn and re-bind steps |
|
|
28
|
+
| Logging or checking a bind walk | [`reference/spawn-walk-log.md`](reference/spawn-walk-log.md): record shape, validator |
|
|
29
|
+
| Any CLI call to a Claude advisor | [`reference/cli-chain.md`](reference/cli-chain.md): runner modes, alias table, resume |
|
|
30
30
|
|
|
31
31
|
## Host profiles
|
|
32
32
|
|
|
@@ -42,95 +42,95 @@ Session identity:
|
|
|
42
42
|
Mechanical override for scripts:
|
|
43
43
|
|
|
44
44
|
1. `ADVISOR_HOST_PROFILE=ThirdParty` or `=Claude` or `=Codex` (explicit override; any letter case).
|
|
45
|
-
2. `THIRD_PARTY=1` (or `true` / `yes` / `on`)
|
|
45
|
+
2. `THIRD_PARTY=1` (or `true` / `yes` / `on`) selects a third-party (non-Claude) harness.
|
|
46
46
|
3. Default: Claude.
|
|
47
47
|
|
|
48
|
-
### Shared effort
|
|
48
|
+
### Shared effort, any host
|
|
49
49
|
|
|
50
|
-
Fable and
|
|
51
|
-
Pass `--effort <level>` on the
|
|
50
|
+
Fable and Astra both read `ADVISOR_EFFORT` (`low`, `medium`, `high`, `xhigh`, `max`). The default is `low`.
|
|
51
|
+
Pass `--effort <level>` on the Astra helper to set effort for that Astra run.
|
|
52
52
|
Pass `--effort <level>` on the Claude CLI bind for Fable. An unset or unrecognized value uses `low`.
|
|
53
53
|
|
|
54
|
-
###
|
|
54
|
+
### Astra rung
|
|
55
55
|
|
|
56
|
-
On Claude and ThirdParty: when Fable is out of usage, bind
|
|
57
|
-
Open that attempt with `
|
|
56
|
+
On Claude and ThirdParty: when Fable is out of usage, bind Astra through the Codex helper.
|
|
57
|
+
Open that attempt with `ADVISOR_ASTRA=1` (or `true` / `yes` / `on`) in the environment, or pass `--enable-astra` on the helper invocation.
|
|
58
58
|
Flag off both ways: fail closed when Fable did not bind.
|
|
59
|
-
Flag on: run the Codex preflight and bind per [`reference/
|
|
59
|
+
Flag on: run the Codex preflight and bind per [`reference/astra-rung.md`](reference/astra-rung.md); a failed preflight fails closed when Fable did not bind.
|
|
60
60
|
|
|
61
|
-
On Codex:
|
|
61
|
+
On Codex: Astra is the in-session default. The `ADVISOR_ASTRA` flag is not required. Fail closed when that spawn does not bind.
|
|
62
62
|
|
|
63
63
|
### Claude host
|
|
64
64
|
|
|
65
|
-
Use the **Model floor** ladder below (Fable first, then
|
|
66
|
-
Warm-up spawns `subagent_type: session-advisor` via the Agent tool; consults go through `SendMessage` to that warm agent.
|
|
65
|
+
Use the **Model floor** ladder below (Fable first, then Astra when Fable is out of usage).
|
|
66
|
+
Warm-up spawns `subagent_type: session-advisor` via the Agent tool for Fable; consults go through `SendMessage` to that warm agent. Astra uses the Codex helper.
|
|
67
67
|
Assemble and paste each executor's Advisor block per the **Advisor block** section.
|
|
68
68
|
|
|
69
69
|
### Codex host
|
|
70
70
|
|
|
71
|
-
Spawn a native in-session
|
|
72
|
-
Walk `candidate_tiers = ["
|
|
73
|
-
**Fail closed:** when
|
|
74
|
-
Do not walk Fable on a Codex host. Consults stay in-session with that
|
|
71
|
+
Spawn a native in-session Astra subagent at `resolve_codex_model_id("Astra")`.
|
|
72
|
+
Walk `candidate_tiers = ["Astra"]`. Record `{tier: "Astra", result: "spawned"}` on success.
|
|
73
|
+
**Fail closed:** when Astra does not bind, set `selected_tier = null` and a `fallback_reason`, report that the advisor is unreachable, and **stop**.
|
|
74
|
+
Do not walk Fable on a Codex host. Consults stay in-session with that Astra subagent.
|
|
75
75
|
Assemble and paste each executor's Advisor block per the **Advisor block** section.
|
|
76
76
|
|
|
77
77
|
### Third-party host
|
|
78
78
|
|
|
79
79
|
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).
|
|
80
80
|
The bound Claude session is the advisor; this third-party session stays the executor.
|
|
81
|
-
Walk `candidate_tiers = ["Fable"]`. When Fable is out of usage, the
|
|
82
|
-
**Cursor
|
|
83
|
-
**Fail closed:** when every candidate fails, set `selected_tier = null` and a `fallback_reason`, report that the advisor is unreachable, and **stop
|
|
81
|
+
Walk `candidate_tiers = ["Fable"]`. When Fable is out of usage, the Astra rung binds after Fable (`candidate_tiers = ["Fable", "Astra"]`).
|
|
82
|
+
**Cursor Astra first shot:** when the walk reaches Astra (or the user asks for Astra), bind through `codex_astra_advisor.py --bind --enable-astra` on the first tool call (see the GOTCHA in [`reference/third-party-bind.md`](reference/third-party-bind.md)). Do not use the Agent tool, and do not hunt a probe path.
|
|
83
|
+
**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.
|
|
84
84
|
Executors report to the orchestrating session; that session consults the bound advisor and relays the four-signal reply.
|
|
85
85
|
|
|
86
86
|
## Model floor
|
|
87
87
|
|
|
88
|
-
On Claude and ThirdParty the advisor ladder is `Fable` first, then
|
|
89
|
-
On Codex the walk is
|
|
88
|
+
On Claude and ThirdParty the advisor ladder is `Fable` first, then Astra (flag-gated, Codex CLI) when Fable is out of usage.
|
|
89
|
+
On Codex the walk is Astra only, in-session.
|
|
90
90
|
Opus is not an advisor candidate. `Sonnet` and `Haiku` are executor tiers only.
|
|
91
91
|
Consumer `own_tier` is recorded on the spawn-walk log; it does not add Opus to the advisor walk.
|
|
92
92
|
Tier names are canonical Title Case; the validator accepts any letter case and normalizes to Title Case.
|
|
93
|
-
Try binds top-down.
|
|
94
|
-
The advisor is created at `selected_tier
|
|
95
|
-
When Fable fails on a Claude host, try
|
|
96
|
-
On a Codex host a failed
|
|
97
|
-
On a third-party host the CLI chain is already the primary path, so a failed Fable (and
|
|
93
|
+
Try binds top-down. Fable resolves to the short model alias in [`reference/cli-chain.md`](reference/cli-chain.md); Astra resolves through `resolve_codex_model_id("Astra")` to `gpt-6-astra`.
|
|
94
|
+
The advisor is created at `selected_tier`, the first ladder tier that binds.
|
|
95
|
+
When Fable fails on a Claude host, try Astra 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.
|
|
96
|
+
On a Codex host a failed Astra spawn fails closed per **Host profiles → Codex host**.
|
|
97
|
+
On a third-party host the CLI chain is already the primary path, so a failed Fable (and Astra, when enabled) walk fails closed per **Host profiles → Third-party host**.
|
|
98
98
|
|
|
99
99
|
Emit a structured spawn-walk log so the walk can be checked mechanically: [`reference/spawn-walk-log.md`](reference/spawn-walk-log.md).
|
|
100
100
|
The validator checks ladder shape only; host policy sits on top.
|
|
101
101
|
|
|
102
|
-
**Equal-tier pairings.** Bind Fable for an independent second pass on irreversible or security-sensitive work. The advisor is Fable or
|
|
102
|
+
**Equal-tier pairings.** Bind Fable for an independent second pass on irreversible or security-sensitive work. The advisor is Fable or Astra.
|
|
103
103
|
|
|
104
104
|
## Warm-up (once per session)
|
|
105
105
|
|
|
106
|
-
On a **Claude host**,
|
|
107
|
-
A **Fable**-tier try carries the exact token `FABLE-SPAWN-AUTHORIZED` in its prompt
|
|
106
|
+
On a **Claude host**, spawn `session-advisor` at the Fable alias with the charter as its prompt. When Fable is out of usage and the Astra rung is open, bind Astra through the Codex helper instead.
|
|
107
|
+
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.
|
|
108
108
|
Full spawn fields and the charter template: [`reference/warm-up.md`](reference/warm-up.md).
|
|
109
109
|
|
|
110
|
-
On a **Codex host**, spawn a native in-session
|
|
110
|
+
On a **Codex host**, spawn a native in-session Astra subagent with the same charter. Bind fields: [`reference/identity.md`](reference/identity.md) and [`reference/warm-up.md`](reference/warm-up.md).
|
|
111
111
|
|
|
112
|
-
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
|
|
112
|
+
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.
|
|
113
113
|
|
|
114
114
|
## Consulting the warm agent
|
|
115
115
|
|
|
116
|
-
Send a consult at the trigger points `docs/references/advisor-tool.md` **When to call** defines
|
|
116
|
+
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.
|
|
117
117
|
The paste parts in [`reference/advisor-block.md`](reference/advisor-block.md) restate them for executors.
|
|
118
118
|
|
|
119
|
-
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
|
|
119
|
+
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).
|
|
120
120
|
Consult briefs embed the `docs/references/advisor-tool.md` **Brevity cue** line, sized per that section.
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
A CORRECTION names a wrong step or a risk worth closing. Address it before treating the plan or the work as done.
|
|
123
123
|
Route a STOP, or an unreachable advisor, upward per [`reference/consult-format.md`](reference/consult-format.md).
|
|
124
124
|
|
|
125
|
-
## Advisor block
|
|
125
|
+
## Advisor block
|
|
126
126
|
|
|
127
|
-
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
|
|
127
|
+
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 the weak-executor add-on for an executor at Sonnet or below.
|
|
128
128
|
Paste the assembled block at the **top** of the spawn prompt, ahead of any other sentence that mentions the advisor.
|
|
129
|
-
The assembled block is self-contained
|
|
129
|
+
The assembled block is self-contained. The executor receives this text alone.
|
|
130
130
|
|
|
131
131
|
## Lifecycle ownership
|
|
132
132
|
|
|
133
|
-
The session that binds the advisor owns its whole lifecycle
|
|
133
|
+
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.
|
|
134
134
|
Drift signals and the per-host re-spawn / re-bind steps: [`reference/lifecycle.md`](reference/lifecycle.md).
|
|
135
135
|
|
|
136
136
|
## CLI chain
|
|
@@ -140,14 +140,14 @@ Modes and failover, the tier-to-alias table, brief piping, and `--resume` sessio
|
|
|
140
140
|
|
|
141
141
|
**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).
|
|
142
142
|
|
|
143
|
-
**Codex host:** do not use this runner as the primary path.
|
|
143
|
+
**Codex host:** do not use this runner as the primary path. Astra binds in-session.
|
|
144
144
|
|
|
145
145
|
**Claude host:** fall back to this runner exactly when one of these holds:
|
|
146
|
-
- The Agent-tool spawn errors at every candidate tier down to the floor
|
|
146
|
+
- The Agent-tool spawn errors at every candidate tier down to the floor. The tool itself is unavailable.
|
|
147
147
|
- `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.
|
|
148
148
|
- The running session is itself a subagent barred from spawning further agents.
|
|
149
149
|
|
|
150
150
|
## State the mechanism
|
|
151
151
|
|
|
152
|
-
One warm agent, addressed by name, whose transcript accumulates across consults
|
|
152
|
+
One warm agent, addressed by name, whose transcript accumulates across consults. Each consult sends only the delta since the last one.
|
|
153
153
|
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.
|
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
Detail behind the **Advisor block** section of [`advisor-protocol.md`](../advisor-protocol.md).
|
|
4
4
|
Open this when assembling the block for an executor spawn prompt.
|
|
5
5
|
|
|
6
|
-
Assembly order: one transport preamble picked by host profile, then the shared core, then
|
|
6
|
+
Assembly order: one transport preamble picked by host profile, then the shared core, then the weak-executor add-on for an executor at Sonnet or below.
|
|
7
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
|
|
8
|
+
The assembled block is self-contained. The executor receives this text alone, so every path it names is absolute.
|
|
9
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
10
|
|
|
11
|
-
## Transport preamble
|
|
11
|
+
## Transport preamble for a Claude host
|
|
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
|
|
15
|
+
## Transport preamble for a Codex host
|
|
16
16
|
|
|
17
|
-
> A shared session advisor named `<name>` is reachable as a native Codex
|
|
17
|
+
> A shared session advisor named `<name>` is reachable as a native Codex Astra subagent; send each consult to it in-session by that name.
|
|
18
18
|
|
|
19
|
-
## Transport preamble
|
|
19
|
+
## Transport preamble for a third-party host
|
|
20
20
|
|
|
21
21
|
> The orchestrating session owns a standing advisor for this run.
|
|
22
|
-
> The advisor chain: Claude Fable, then
|
|
22
|
+
> The advisor chain: Claude Fable, then Astra through the Codex CLI when Fable is out of usage and the Astra flag and its preflight open that rung. Both rungs use `ADVISOR_EFFORT` (default low). When neither binds, there is no advisor.
|
|
23
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.
|
|
24
24
|
|
|
25
|
-
## Shared core
|
|
25
|
+
## Shared core for every host
|
|
26
26
|
|
|
27
27
|
> 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.
|
|
28
28
|
> 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.
|
|
@@ -31,7 +31,7 @@ The consult rules it restates are owned by [`consult-format.md`](consult-format.
|
|
|
31
31
|
> Replies open with one of ENDORSE, CORRECTION, PLAN, or STOP — treat CORRECTION and PLAN as actions to take.
|
|
32
32
|
> 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.
|
|
33
33
|
|
|
34
|
-
## Weak-executor add-on
|
|
34
|
+
## Weak-executor add-on for Sonnet or below, either host
|
|
35
35
|
|
|
36
36
|
> Send your first consult right after orientation and before your first write.
|
|
37
37
|
> 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.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Astra rung
|
|
2
|
+
|
|
3
|
+
Detail behind the **Host profiles → Astra 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 an Astra fallback bind is starting.
|
|
5
|
+
On a Codex host, Astra is the in-session default. See [`identity.md`](identity.md).
|
|
6
|
+
|
|
7
|
+
## Flag
|
|
8
|
+
|
|
9
|
+
`ADVISOR_ASTRA=1` (or `true` / `yes` / `on`) opens the Astra fallback after Fable is out of usage. Set the variable in the helper's process environment, or pass `--enable-astra` 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.
|
|
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-astra`.
|
|
12
|
+
|
|
13
|
+
## Effort
|
|
14
|
+
|
|
15
|
+
`ADVISOR_EFFORT` selects Codex `model_reasoning_effort` for Astra 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 Astra run without changing the environment. An unset or unrecognized value uses `low`.
|
|
16
|
+
|
|
17
|
+
Every fallback reply carries a `fallback_kind` field. `declined` means policy closed the rung (flag off, usage meter at or below the gate). `broken` means the Astra path itself failed (missing executable, spawn error, timeout, malformed reply). A `broken` fallback is a defect to report.
|
|
18
|
+
|
|
19
|
+
## Preflight
|
|
20
|
+
|
|
21
|
+
Flag on: run the Codex preflight first.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
python ~/.claude/_shared/pr-loop/scripts/codex_usage_probe.py
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**GOTCHA. Probe path.** That installed path is the only one. `codex_astra_advisor.resolve_usage_probe_path` builds `~/.claude/_shared/pr-loop/scripts/codex_usage_probe.py` and stops. Do not hunt `skills/codex-review/`, Codex worktrees under `C:\dev\.codex\worktrees\`, or other copies. Repo home: `packages/claude-dev-env/_shared/pr-loop/scripts/`.
|
|
28
|
+
|
|
29
|
+
The shared entry point is `~/.claude/_shared/advisor/scripts/codex_astra_advisor.py`. It calls the installed probe and owns Astra bind or resume parsing. Bind with `python ~/.claude/_shared/advisor/scripts/codex_astra_advisor.py --bind --enable-astra --cwd <repo-root>` and pipe the charter on stdin. Resume with `--resume <session_id>` and pipe the delta consult on stdin.
|
|
30
|
+
|
|
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.
|
|
32
|
+
|
|
33
|
+
## Branches
|
|
34
|
+
|
|
35
|
+
**Preflight pass.** Bind one Codex CLI session at `gpt-6-astra` 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.
|
|
36
|
+
|
|
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.
|
|
38
|
+
|
|
39
|
+
The helper owns the Astra attempt and returns an explicit fallback result. The consuming advisor path owns the Fable bind. Apply the same gate to every Astra attempt, including resume.
|
|
@@ -9,7 +9,7 @@ Call `resolve_session_identity` from `$HOME/.claude/_shared/advisor/scripts/tier
|
|
|
9
9
|
|
|
10
10
|
| Identity text | Host profile | Bind path |
|
|
11
11
|
|---|---|---|
|
|
12
|
-
| a `codex` token | Codex | In-session
|
|
12
|
+
| a `codex` token | Codex | In-session Astra spawn |
|
|
13
13
|
| a `claude` token | Claude | In-session Fable spawn of `session-advisor` |
|
|
14
14
|
| any other identity | ThirdParty | Headless CLI chain |
|
|
15
15
|
|
|
@@ -17,11 +17,11 @@ When both `codex` and `claude` tokens appear, Codex wins. Empty text is ThirdPar
|
|
|
17
17
|
|
|
18
18
|
## Bind path
|
|
19
19
|
|
|
20
|
-
**Claude.** Spawn `subagent_type: session-advisor` at Fable through the Agent tool. When Fable is out of usage, bind
|
|
20
|
+
**Claude.** Spawn `subagent_type: session-advisor` at Fable through the Agent tool. When Fable is out of usage, bind Astra through the Codex helper if `ADVISOR_ASTRA` is on. Fail closed when neither binds.
|
|
21
21
|
|
|
22
|
-
**Codex.** Spawn a native in-session
|
|
22
|
+
**Codex.** Spawn a native in-session Astra subagent at `resolve_codex_model_id("Astra")` (`gpt-6-astra`). Walk `candidate_tiers = ["Astra"]`. Record `{tier: "Astra", result: "spawned"}` on success. The `ADVISOR_ASTRA` flag is not required. Fail closed when Astra does not bind. Do not walk Fable on a Codex host.
|
|
23
23
|
|
|
24
|
-
**ThirdParty.** Bind Fable through the CLI Claude-chain. When Fable is out of usage, bind
|
|
24
|
+
**ThirdParty.** Bind Fable through the CLI Claude-chain. When Fable is out of usage, bind Astra through the Codex helper if `ADVISOR_ASTRA` is on. Fail closed when neither binds.
|
|
25
25
|
|
|
26
26
|
## Mechanical override
|
|
27
27
|
|
|
@@ -5,7 +5,7 @@ Open this when the advisor drifts, dies, or the task pivots.
|
|
|
5
5
|
|
|
6
6
|
## Claude host
|
|
7
7
|
|
|
8
|
-
The session that spawns the shared advisor owns its whole lifecycle
|
|
8
|
+
The session that spawns the shared advisor owns its whole lifecycle: spawn, drift-respawn, and shutdown.
|
|
9
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
10
|
One shared advisor exists per orchestrated session, owned by the session that spawned it.
|
|
11
11
|
|
|
@@ -14,15 +14,15 @@ A **Fable**-tier re-spawn carries the exact token `FABLE-SPAWN-AUTHORIZED` in th
|
|
|
14
14
|
|
|
15
15
|
## Codex host
|
|
16
16
|
|
|
17
|
-
The session that spawns the shared
|
|
17
|
+
The session that spawns the shared Astra subagent owns its whole lifecycle: spawn, drift-respawn, and shutdown.
|
|
18
18
|
Every other consumer reaches it by message alone; spawn, respawn, and shutdown belong to the owning session.
|
|
19
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
|
|
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 Astra subagent with a new charter.
|
|
21
21
|
|
|
22
22
|
## Third-party host
|
|
23
23
|
|
|
24
|
-
The orchestrating session owns the
|
|
24
|
+
The orchestrating session owns the CLI advisor bind for the whole run: first bind, re-bind on drift or lost `session_id`, and fail-closed report when the bound path cannot serve.
|
|
25
25
|
|
|
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.
|
|
27
|
-
Capture the new `session_id`, and log a fresh Fable walk with `result: "cli"` on success, then
|
|
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 Fable through `claude_chain_runner.py` with the charter plus a compact recap of consults so far.
|
|
27
|
+
Capture the new `session_id`, and log a fresh Fable walk with `result: "cli"` on success, then Astra when that rung is open. An Astra re-bind uses `codex_astra_advisor.py --bind --enable-astra` with the same charter and recap, and records `result: "codex"` on success.
|
|
28
28
|
Executors keep reporting to the orchestrating session; advisor binding stays with that session alone.
|
|
@@ -6,16 +6,16 @@ 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
|
|
10
|
-
- `host_profile
|
|
11
|
-
- `candidate_tiers
|
|
12
|
-
- `
|
|
13
|
-
- `attempts
|
|
14
|
-
- `selected_tier
|
|
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 Astra when `astra_enabled` is true. On Codex, Astra only.
|
|
12
|
+
- `astra_enabled`: a boolean recorded before candidate selection. On Claude and ThirdParty, `true` adds Astra 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 an Astra helper bind, `spawned` for an in-session spawn (Claude Agent or Codex native Astra), `cli` for a CLI Claude-chain bind, or a failure reason such as `unavailable`.
|
|
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.
|
|
15
15
|
|
|
16
16
|
## Log path
|
|
17
17
|
|
|
18
|
-
Write to a path the session controls
|
|
18
|
+
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.
|
|
19
19
|
|
|
20
20
|
## Validator
|
|
21
21
|
|
|
@@ -28,5 +28,5 @@ Exit code `1` means a ladder invariant failed.
|
|
|
28
28
|
Exit code `2` means the path or JSON was unusable.
|
|
29
29
|
The same checks are available in-process via `validate_model_tier_run(run)`.
|
|
30
30
|
|
|
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,
|
|
32
|
-
Host policy sits on top of it
|
|
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, Astra is attempted after Fable when `astra_enabled` is true, and `selected_tier: "Astra"` requires `result: "codex"`. On Codex, the walk is Astra only, and `result: "spawned"` or `result: "codex"` counts as success.
|
|
32
|
+
Host policy sits on top of it. See the Model floor section of the protocol.
|
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
Detail behind the **Host profiles → Third-party host** section of [`advisor-protocol.md`](../advisor-protocol.md).
|
|
4
4
|
Open this when binding or re-binding the advisor from a third-party (non-Claude, non-Codex) harness.
|
|
5
5
|
|
|
6
|
-
## GOTCHA
|
|
6
|
+
## GOTCHA: Cursor Astra first shot
|
|
7
7
|
|
|
8
|
-
Cursor is a third-party host. When the walk reaches
|
|
8
|
+
Cursor is a third-party host. When the walk reaches Astra (`ADVISOR_ASTRA=1` / `--enable-astra` after Fable is out of usage, or the user asks for Astra), bind Astra on the **first** tool call through the headless Codex helper. Do not use the Agent or Task tool, do not spawn Grok as a substitute, and do not search the filesystem for `codex_usage_probe.py`.
|
|
9
9
|
|
|
10
10
|
```
|
|
11
|
-
python "$HOME/.claude/_shared/advisor/scripts/
|
|
11
|
+
python "$HOME/.claude/_shared/advisor/scripts/codex_astra_advisor.py" --bind --enable-astra --cwd <repo-root>
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Pipe the standing-reviewer charter on stdin. Persist `session_id` from the JSON reply. Later consults: `--resume <session_id>` with the delta on stdin. Capture helper / `codex` stdout as UTF-8 on Windows (`encoding="utf-8"`, `errors="replace"`). Probe path and preflight: [`
|
|
14
|
+
Pipe the standing-reviewer charter on stdin. Persist `session_id` from the JSON reply. Later consults: `--resume <session_id>` with the delta on stdin. Capture helper / `codex` stdout as UTF-8 on Windows (`encoding="utf-8"`, `errors="replace"`). Probe path and preflight: [`astra-rung.md`](astra-rung.md).
|
|
15
15
|
|
|
16
|
-
When the
|
|
16
|
+
When the Astra flag is off, follow the Claude-chain steps below.
|
|
17
17
|
|
|
18
18
|
## Bind steps
|
|
19
19
|
|
|
20
20
|
1. Name the session identity first (protocol **Host profiles**). This path is for a ThirdParty profile.
|
|
21
|
-
2. Walk `candidate_tiers = ["Fable"]`. When Fable is out of usage, the
|
|
22
|
-
3. **CLI bind (primary path):** for
|
|
21
|
+
2. Walk `candidate_tiers = ["Fable"]`. When Fable is out of usage, the Astra rung ([`astra-rung.md`](astra-rung.md)) binds Astra after Fable (`candidate_tiers = ["Fable", "Astra"]`).
|
|
22
|
+
3. **CLI bind (primary path):** for Fable, pipe a charter file into:
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
python "$HOME/.claude/scripts/claude_chain_runner.py" --routing-mode ordered_account -- -p --model <alias> --effort <effort> --output-format json
|
|
@@ -27,15 +27,15 @@ When the Sol flag is off, follow the Claude-chain steps below.
|
|
|
27
27
|
|
|
28
28
|
Use `--model fable --effort` with the value of `ADVISOR_EFFORT` (default `low`) on Fable.
|
|
29
29
|
User-facing wording follows [`rules/asd-ste100-language.md`](../../../rules/asd-ste100-language.md).
|
|
30
|
-
A root advisor bind uses `--routing-mode ordered_account
|
|
30
|
+
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).
|
|
31
31
|
4. Stop at the first successful bind.
|
|
32
|
-
Record `{tier, result: "cli"}` and set `selected_tier` to that tier.
|
|
32
|
+
Record `{tier, result: "cli"}` for Fable or `{tier: "Astra", result: "codex"}` for the Astra helper, and set `selected_tier` to that tier.
|
|
33
33
|
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).
|
|
34
|
-
Run every bind and every later consult with cwd set to the repo root the work is for
|
|
34
|
+
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
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**. ENDORSE / CORRECTION / PLAN / STOP come only from a bound advisor.
|
|
36
36
|
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.
|
|
37
37
|
|
|
38
38
|
## Session model field
|
|
39
39
|
|
|
40
40
|
Resolve a third-party session's own model field with `resolve_cli_model_id("ThirdParty")` → `third-party` when a host model alias is required.
|
|
41
|
-
The **advisor** bind uses the Fable alias.
|
|
41
|
+
The **advisor** bind uses the Fable alias. Astra binds through the Codex helper.
|
|
@@ -3,39 +3,39 @@
|
|
|
3
3
|
Detail behind the **Warm-up** section of [`advisor-protocol.md`](../advisor-protocol.md).
|
|
4
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
|
-
## Spawn fields
|
|
6
|
+
## Spawn fields for a Claude host
|
|
7
7
|
|
|
8
|
-
The consuming skill's session
|
|
8
|
+
The consuming skill's session tries Fable first. 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
|
|
11
|
+
- `model`: the short alias via `resolve_cli_model_id("Fable")` (alias table: [`cli-chain.md`](cli-chain.md)): `fable`. When Fable is out of usage and the Astra rung is open, continue with the Codex helper in [`astra-rung.md`](astra-rung.md) as the Astra fallback.
|
|
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
|
-
- `prompt`: the charter below. A **Fable**-tier try carries the exact token `FABLE-SPAWN-AUTHORIZED` in that prompt
|
|
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
15
|
|
|
16
|
-
Stop at the first successful
|
|
16
|
+
Stop at the first successful bind. That try's tier is `selected_tier`; the warm advisor lives at that tier for the rest of the session.
|
|
17
17
|
|
|
18
18
|
## Charter (the spawn prompt)
|
|
19
19
|
|
|
20
|
-
The charter states
|
|
20
|
+
The charter states the agent's role, the repo path, and the session's current goal in two or three sentences. The agent is a standing reviewer. It answers only via SendMessage. File edits and commands are out of its scope.
|
|
21
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
22
|
State plainly:
|
|
23
23
|
|
|
24
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
|
|
26
|
-
- Treat each consult on its own terms, keyed to the sender's stated assignment. Different consumers' consults will interleave in this one transcript
|
|
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
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
|
|
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`. Nothing else on that line. Standing by after the bind is itself an `ENDORSE` of the charter, stated as that first line.
|
|
29
29
|
|
|
30
30
|
The agent finishes its first turn standing by. `SendMessage` alone resumes it; between consults it waits quietly.
|
|
31
31
|
|
|
32
32
|
## Codex host
|
|
33
33
|
|
|
34
|
-
Spawn a native in-session
|
|
35
|
-
Record `{tier: "
|
|
36
|
-
The `
|
|
34
|
+
Spawn a native in-session Astra subagent at `resolve_codex_model_id("Astra")` (`gpt-6-astra`) with the charter as its prompt.
|
|
35
|
+
Record `{tier: "Astra", result: "spawned"}` on success. Fail closed when that spawn does not bind.
|
|
36
|
+
The `ADVISOR_ASTRA` flag is not required. Do not walk Fable. Consults stay in-session with that Astra subagent.
|
|
37
37
|
Identity routing: [`identity.md`](identity.md).
|
|
38
38
|
|
|
39
39
|
## Third-party host
|
|
40
40
|
|
|
41
|
-
Bind per [`third-party-bind.md`](third-party-bind.md) and charter the CLI session with the same charter
|
|
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.
|