@andorra-labs/code 0.1.10 → 0.1.11
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/README.md +28 -208
- package/THIRD_PARTY_NOTICES.md +15 -0
- package/dist/src/agent-execution.js +36 -0
- package/dist/src/app-server/protocol.d.ts +1 -0
- package/dist/src/app-server.d.ts +34 -1
- package/dist/src/app-server.js +264 -54
- package/dist/src/automation-service.js +1 -1
- package/dist/src/browser-session.d.ts +8 -0
- package/dist/src/browser-session.js +27 -1
- package/dist/src/browser-ui/app.js +237 -15
- package/dist/src/browser-ui/index.html +5 -5
- package/dist/src/browser-ui/style.css +110 -65
- package/dist/src/browser-ui/tokens.css +27 -26
- package/dist/src/coding-tools.d.ts +24 -0
- package/dist/src/coding-tools.js +71 -8
- package/dist/src/command-screens.js +1 -1
- package/dist/src/commands.js +1 -1
- package/dist/src/completion-gates.d.ts +42 -7
- package/dist/src/completion-gates.js +55 -9
- package/dist/src/completion.d.ts +8 -0
- package/dist/src/completion.js +19 -1
- package/dist/src/dashboard-view.js +2 -2
- package/dist/src/deadline.js +4 -0
- package/dist/src/graph-manager-chat.js +13 -13
- package/dist/src/graph-runner.js +39 -2
- package/dist/src/graph-server.js +9 -9
- package/dist/src/graph-sync.d.ts +8 -0
- package/dist/src/graph-sync.js +54 -3
- package/dist/src/graph-tool.js +1 -1
- package/dist/src/graph-ui/app.js +262 -93
- package/dist/src/graph-ui/controls.css +43 -22
- package/dist/src/graph-ui/controls.js +31 -1
- package/dist/src/graph-ui/embed.js +62 -13
- package/dist/src/graph-ui/icons.js +4 -0
- package/dist/src/graph-ui/index.html +3 -3
- package/dist/src/graph-ui/manager-state.js +2 -2
- package/dist/src/graph-ui/manager.css +19 -18
- package/dist/src/graph-ui/manager.js +11 -11
- package/dist/src/graph-ui/skill-picker.js +1 -1
- package/dist/src/graph-ui/studio-canvas.js +8 -8
- package/dist/src/graph-ui/studio.css +18 -15
- package/dist/src/graph-ui/studio.js +92 -35
- package/dist/src/graph-ui/style.css +122 -79
- package/dist/src/graph-ui/theme.js +2 -2
- package/dist/src/graph-ui/tokens.css +33 -29
- package/dist/src/graphs.d.ts +3 -2
- package/dist/src/graphs.js +3 -2
- package/dist/src/membership-errors.d.ts +7 -1
- package/dist/src/membership-errors.js +9 -3
- package/dist/src/pull-requests.d.ts +42 -6
- package/dist/src/pull-requests.js +11 -3
- package/dist/src/react-runtime.js +121 -14
- package/dist/src/read-document-doc.d.ts +20 -0
- package/dist/src/read-document-doc.js +524 -0
- package/dist/src/read-document-docx.d.ts +21 -0
- package/dist/src/read-document-docx.js +584 -0
- package/dist/src/read-document-text.d.ts +29 -0
- package/dist/src/read-document-text.js +67 -0
- package/dist/src/read-document-tool.d.ts +48 -0
- package/dist/src/read-document-tool.js +162 -0
- package/dist/src/read-document.d.ts +78 -0
- package/dist/src/read-document.js +353 -0
- package/dist/src/read-image.d.ts +29 -2
- package/dist/src/read-image.js +42 -17
- package/dist/src/runtime.d.ts +19 -0
- package/dist/src/runtime.js +10 -1
- package/dist/src/session-changes.d.ts +6 -1
- package/dist/src/session-changes.js +13 -5
- package/dist/src/side-panel.d.ts +6 -1
- package/dist/src/side-panel.js +12 -10
- package/dist/src/skills/bundled/create-skill/SKILL.md +1 -1
- package/dist/src/skills/bundled/diagram/SKILL.md +1 -1
- package/dist/src/skills/bundled/graph-manager/SKILL.md +37 -3
- package/dist/src/skills/bundled/graph-manager/patterns.md +27 -0
- package/dist/src/skills/bundled/provenance.json +4 -4
- package/dist/src/skills/runtime-skills.js +3 -3
- package/dist/src/stall-recovery.d.ts +6 -2
- package/dist/src/stall-recovery.js +7 -2
- package/dist/src/terminal-ui.js +2 -2
- package/dist/src/time-limit.d.ts +53 -0
- package/dist/src/time-limit.js +79 -0
- package/dist/src/tools.js +92 -7
- package/dist/src/transcript.js +1 -1
- package/dist/src/types.d.ts +6 -0
- package/dist/src/usage-analytics.d.ts +3 -1
- package/dist/src/usage-analytics.js +16 -2
- package/package.json +6 -26
- package/docs/README.md +0 -36
- package/docs/agents/README.md +0 -62
- package/docs/agents/install-for-agents.md +0 -56
- package/docs/agents/mcp-server.md +0 -212
- package/docs/agents/subagent-mode.md +0 -149
- package/docs/concepts/README.md +0 -47
- package/docs/concepts/jev-actionable-routing.md +0 -113
- package/docs/concepts/jev-decision-thresholds.md +0 -412
- package/docs/concepts/jev-efficiency.md +0 -217
- package/docs/concepts/jev-eval-2026-11-01.md +0 -78
- package/docs/concepts/limits.md +0 -52
- package/docs/concepts/memory.md +0 -10
- package/docs/concepts/security.md +0 -50
- package/docs/concepts/workspace-instructions.md +0 -29
- package/docs/getting-started/README.md +0 -82
- package/docs/getting-started/accounts.md +0 -78
- package/docs/getting-started/configure-providers.md +0 -132
- package/docs/guides/README.md +0 -13
- package/docs/guides/browser.md +0 -39
- package/docs/guides/desktop-app.md +0 -414
- package/docs/guides/extensions.md +0 -102
- package/docs/guides/graph-builder.md +0 -116
- package/docs/guides/headless.md +0 -46
- package/docs/guides/tui.md +0 -75
- package/docs/guides/update.md +0 -70
- package/docs/guides/web-search.md +0 -51
- package/docs/guides/windows-code-signing.md +0 -319
- package/docs/llms.txt +0 -45
- package/docs/reference/README.md +0 -7
- package/docs/reference/cli.md +0 -76
- package/docs/reference/config.md +0 -91
- package/docs/reference/slash-commands.md +0 -59
- package/docs/superpowers/plans/2026-11-01-claude-console-sign-in.md +0 -111
- package/docs/superpowers/plans/2026-11-01-jev-node-opt-in.md +0 -910
- package/docs/superpowers/plans/2026-11-02-workflow-pane.md +0 -398
- package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +0 -125
- package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +0 -295
- package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +0 -203
- package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +0 -79
- package/docs/superpowers/specs/2026-10-31-work-line-summary-design.md +0 -50
- package/docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md +0 -176
- package/docs/superpowers/specs/2026-11-01-jev-node-opt-in-design.md +0 -164
- package/docs/superpowers/specs/2026-11-01-pr-section-design.md +0 -111
- package/docs/superpowers/specs/2026-11-02-workflow-pane-design.md +0 -130
- package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +0 -206
- package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +0 -291
- package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +0 -182
- package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +0 -156
- package/scripts/jev-efficiency-eval.mjs +0 -187
- package/scripts/jev-efficiency-live.mjs +0 -193
- package/scripts/zcode-engine-replay.mjs +0 -223
- package/tests/agent-centric-mcp-test-plan.md +0 -208
- package/tests/analytics-settings-test-plan.md +0 -165
- package/tests/browser-cli-smoke.mjs +0 -276
- package/tests/browser-test-plan.md +0 -280
- package/tests/chat-side-panel-test-plan.md +0 -309
- package/tests/decision-engine-test-plan.md +0 -163
- package/tests/default-active-jev-test-plan.md +0 -85
- package/tests/harness-extensions-test-plan.md +0 -113
- package/tests/jev-all-decisions-test-plan.md +0 -156
- package/tests/jev-efficiency/criteria.json +0 -158
- package/tests/jev-efficiency/workloads.mjs +0 -242
- package/tests/jev-efficiency-test-plan.md +0 -198
- package/tests/permissions-sandbox-probe.mjs +0 -74
- package/tests/permissions-test-plan.md +0 -191
- package/tests/product-telemetry-test-plan.md +0 -536
- package/tests/thinking-stream-preview-test-plan.md +0 -136
- package/tests/zcode-react-engine-test-plan.md +0 -396
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
# Subagent mode: Andorra as a subagent for another agent
|
|
2
|
-
|
|
3
|
-
Claude CLI, Codex CLI and any other agent that speaks MCP (or can run a command) can run Andorra as
|
|
4
|
-
a **subagent**: the host names a provider/model, gives a task, and receives the result of one
|
|
5
|
-
Andorra Agent run.
|
|
6
|
-
|
|
7
|
-
Two surfaces, one behaviour:
|
|
8
|
-
|
|
9
|
-
| Surface | For hosts that | Run it with |
|
|
10
|
-
| --- | --- | --- |
|
|
11
|
-
| MCP tools | speak MCP (Claude CLI, Codex CLI) | `andorra mcp-server --stdio` |
|
|
12
|
-
| CLI command | spawn a process (Bash, a script, CI) | `andorra subagent --prompt "…"` |
|
|
13
|
-
|
|
14
|
-
Both run **only the built-in Andorra Agent graph** — the single-agent harness. There is no
|
|
15
|
-
graph selection: a subagent run is one Andorra Agent, working in one workspace, on one task.
|
|
16
|
-
|
|
17
|
-
## The provider/model is mandatory
|
|
18
|
-
|
|
19
|
-
A subagent run names the provider and model it uses. There are three ways to supply them:
|
|
20
|
-
|
|
21
|
-
1. **Per call** — `provider` and `model` on the call (`andorra subagent --provider local --model
|
|
22
|
-
my-model`). The call's pick wins.
|
|
23
|
-
2. **The saved setting** — `/subagent` in the TUI, or Settings → Runtime → External subagent in
|
|
24
|
-
the desktop app. It names one provider and one model, and every subagent run uses it.
|
|
25
|
-
3. **Neither** — the run does not start. The reply is a `PROVIDER_NOT_SET` error carrying every
|
|
26
|
-
configured provider with its models:
|
|
27
|
-
|
|
28
|
-
```json
|
|
29
|
-
{
|
|
30
|
-
"ok": false,
|
|
31
|
-
"error": {
|
|
32
|
-
"code": "PROVIDER_NOT_SET",
|
|
33
|
-
"message": "No provider/model is set for Andorra external subagent runs. Ask the user which provider and model to use from the list, then retry with provider and model.",
|
|
34
|
-
"providers": [
|
|
35
|
-
{ "id": "local", "type": "openai-compatible", "models": ["my-model", "other-model"] },
|
|
36
|
-
{ "id": "anthropic", "type": "anthropic", "models": ["claude-sonnet-4-6"] }
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
**The host's job.** The agent that called the tool is the one that asks its own user: show the
|
|
43
|
-
list, ask which provider and model to use, and call again with the pair. The user's answer is
|
|
44
|
-
either sent with the retry (per call) or saved in Andorra's settings once, for every later run.
|
|
45
|
-
|
|
46
|
-
## MCP tools
|
|
47
|
-
|
|
48
|
-
Register the server with the host (field names vary by client):
|
|
49
|
-
|
|
50
|
-
```json
|
|
51
|
-
{
|
|
52
|
-
"mcpServers": {
|
|
53
|
-
"andorra-code": {
|
|
54
|
-
"command": "andorra",
|
|
55
|
-
"args": ["mcp-server", "--stdio"]
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
For a checkout, the command is `node <checkout>/dist/src/cli.js mcp-server --stdio`.
|
|
62
|
-
|
|
63
|
-
| Tool | Input | Answers |
|
|
64
|
-
| --- | --- | --- |
|
|
65
|
-
| `andorra_subagent_start` | `prompt` (required), `provider?`, `model?`, `permissions?` (`full-access` \| `read-only`), `workspace?` | `{ runId, sessionId, provider, model, permissions }` |
|
|
66
|
-
| `andorra_subagent_status` | `runId` (required) | the run: state, current node, recent events |
|
|
67
|
-
| `andorra_subagent_result` | `runId` (required), `waitMs?` (0–60000) | the finished result, or `running` |
|
|
68
|
-
| `andorra_subagent_cancel` | `runId` (required) | `{ cancelled }` |
|
|
69
|
-
|
|
70
|
-
The run is asynchronous on purpose: an Andorra Agent run takes minutes, and a host's MCP tool
|
|
71
|
-
timeout is usually shorter. Start it, poll `andorra_subagent_status` with the `runId` the start
|
|
72
|
-
returned, and collect it with `andorra_subagent_result` and the same id. Every control call names
|
|
73
|
-
the run it is about, so a call that arrives late cannot report or stop the run that replaced it.
|
|
74
|
-
|
|
75
|
-
Only one subagent run is live per Andorra process; a second start is refused with
|
|
76
|
-
`RUN_IN_PROGRESS` until the first finishes or is cancelled.
|
|
77
|
-
|
|
78
|
-
## CLI command
|
|
79
|
-
|
|
80
|
-
```sh
|
|
81
|
-
andorra subagent --prompt "Fix the failing test" --provider local --model my-model
|
|
82
|
-
andorra subagent --prompt "Add the missing endpoint" --provider local --model my-model --read-only
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Stdout carries exactly one JSON line: the run result, or the `PROVIDER_NOT_SET` envelope. Progress
|
|
86
|
-
notes go to stderr. `--graph` is not accepted — the graph is always the Andorra Agent harness.
|
|
87
|
-
|
|
88
|
-
| Exit code | Meaning |
|
|
89
|
-
| --- | --- |
|
|
90
|
-
| `0` | The run succeeded. |
|
|
91
|
-
| `1` | The run failed, or no provider/model was set. |
|
|
92
|
-
| `130` | Cancelled (Ctrl+C). |
|
|
93
|
-
| `143` | Terminated (SIGTERM), including a termination that arrived while the run's records were being written. |
|
|
94
|
-
|
|
95
|
-
## What the run may do
|
|
96
|
-
|
|
97
|
-
- **The workspace is the working directory** (or the `workspace` argument). The run reads, writes
|
|
98
|
-
and runs commands there, exactly as it would in the terminal.
|
|
99
|
-
- **Writes are allowed by default.** A subagent is an Andorra Agent; a run that cannot write
|
|
100
|
-
cannot do the work. Pass `permissions: "read-only"` (or `--read-only`) to deny every mutation.
|
|
101
|
-
The host is the one that decides to spawn it.
|
|
102
|
-
- **The permission is one of two values.** `full-access` and `read-only` are the whole
|
|
103
|
-
vocabulary, and a value outside them is refused rather than rounded up to full access: a
|
|
104
|
-
caller that tried to restrict a run must not be handed the mutations it was withholding.
|
|
105
|
-
- **The permission outlives the run.** The permission the host chose is recorded with the attempt,
|
|
106
|
-
so a read-only subagent that is later resumed — from the desktop, after a crash — is read-only
|
|
107
|
-
again, whatever the workspace's own permission is set to. A resume that names a permission of
|
|
108
|
-
its own still wins.
|
|
109
|
-
- **One run at a time, and one graph.** A subagent run never edits graphs, never spawns further
|
|
110
|
-
subagents, and never selects a graph. The slot is the process's rather than a connection's: an
|
|
111
|
-
embedded host that builds several backends still gets one run per workspace, because two of them
|
|
112
|
-
working the same files would write over each other.
|
|
113
|
-
- **A task is bounded.** A run accepts a task of up to 100,000 characters, the same bound the
|
|
114
|
-
engine's own run path applies. A longer one is refused before anything is written, whichever
|
|
115
|
-
surface asked for it.
|
|
116
|
-
- **A model identifier is bounded.** A model named by the call is held to the same 500 characters
|
|
117
|
-
a saved model identifier is, and it is refused before the run record is written.
|
|
118
|
-
|
|
119
|
-
## Where the run is recorded
|
|
120
|
-
|
|
121
|
-
Every subagent run is an ordinary Andorra run: it writes a run record and a session under the
|
|
122
|
-
installation home, so the work is visible in the Runs view and in the session list, and a crash is
|
|
123
|
-
classified by the same recovery as any other attempt. The run record carries `subagent: true` and
|
|
124
|
-
the permission the run was bound to.
|
|
125
|
-
|
|
126
|
-
A finished run leaves no conversation behind: the checkpoint a stopped attempt needs is deleted
|
|
127
|
-
once the attempt succeeds, because a successful run has nothing to resume. A journal append the
|
|
128
|
-
file refuses (a full disk, most often) is held and written once appends succeed again, and a
|
|
129
|
-
node's failed checkpoint write is healed by its next successful one. An attempt that stopped while
|
|
130
|
-
something was still missing is marked (`runs/<runId>.journal-error` or `.checkpoint-error`, and
|
|
131
|
-
`journalIntegrity` or `checkpointIntegrity` on the record). A resume of it still goes ahead, because
|
|
132
|
-
a session must always be resumable, and the resumed attempt opens with a warning that a step may
|
|
133
|
-
repeat.
|
|
134
|
-
|
|
135
|
-
The run's own record is durable as it goes: an event is on disk before the run moves on, and the
|
|
136
|
-
checkpoint is written before the run advances past the tool call it describes. A process killed
|
|
137
|
-
mid-run therefore leaves a record that says what had already happened, and a resume of it does
|
|
138
|
-
not repeat the work.
|
|
139
|
-
|
|
140
|
-
The reported totals are the attempt's whole spend: the preflight that probes the model before the
|
|
141
|
-
first node runs is a model call too, so its requests and tokens are counted beside the graph's
|
|
142
|
-
own calls — including when the probe reached the provider and failed.
|
|
143
|
-
|
|
144
|
-
## See also
|
|
145
|
-
|
|
146
|
-
- [MCP server](mcp-server.md) — the graph-authoring tools of the same server.
|
|
147
|
-
- [Headless mode](../guides/headless.md) — one-shot runs without a subagent contract.
|
|
148
|
-
- [ADR 0020](../../design/decisions/0020-external-subagent-mode.md) — why the provider is mandatory
|
|
149
|
-
and why the graph is fixed.
|
package/docs/concepts/README.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Concepts
|
|
2
|
-
|
|
3
|
-
## The graph is the harness
|
|
4
|
-
|
|
5
|
-
Andorra Code does not hide your work inside one opaque agent loop. A task runs on a **graph** you can see and edit: nodes that do work, and typed edges that route results.
|
|
6
|
-
|
|
7
|
-
```text
|
|
8
|
-
andorra
|
|
9
|
-
↓
|
|
10
|
-
TUI coding client ───┐
|
|
11
|
-
│
|
|
12
|
-
andorra graph ├──► Andorra Code Runtime ───► pinned harness graph
|
|
13
|
-
↓ │
|
|
14
|
-
Browser Graph Builder ───┤
|
|
15
|
-
│
|
|
16
|
-
andorra mcp-server --stdio ───┘
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Three surfaces drive the same runtime: the `andorra` TUI, the browser Graph Builder, and the local MCP server. All operate on the same graph store, node definitions, provider/model registry, and execution semantics. The Graph Builder is the editor for people; the MCP server is the editor for agents (see [Agent MCP server](../agents/mcp-server.md)).
|
|
20
|
-
|
|
21
|
-
### Agent nodes
|
|
22
|
-
|
|
23
|
-
Each Agent node is a full autonomous ReAct loop: it receives a task, thinks, calls tools, and finishes with a validated completion object `{ "summary": "...", "tests": [] }`. Every Agent owns an independent executor invocation with its own instruction, model, tool permissions, and completion outcomes (such as `pass`/`fail` or custom names).
|
|
24
|
-
|
|
25
|
-
### The Orchestrator
|
|
26
|
-
|
|
27
|
-
Graphs can start with an optional Orchestrator. It researches the codebase, asks you about requirements and design choices, then hands the confirmed task — with relevant files, acceptance criteria, and verification requirements — to its configured successor. Routing is expressed as named outcomes with written criteria, not keyword matching. In headless mode an Orchestrator run returns `needs_clarification` because the intake answer is interactive.
|
|
28
|
-
|
|
29
|
-
### Control flow
|
|
30
|
-
|
|
31
|
-
Condition routes on output fields (true/false ports), Loop repeats until an outcome or output matches (bounded by Maximum attempts; exhaustion stops instead of reporting success), and Parallel runs downstream Agents concurrently or as isolated read-only copies. Join all/any synchronizes branches. Cycles require a finite graph visit limit. Ordinary top-level stages run serially.
|
|
32
|
-
|
|
33
|
-
### Typed handoffs
|
|
34
|
-
|
|
35
|
-
Edges carry explicit input mappings — `$source.output.field` or `$run.input.task` references, or constants — instead of forwarding raw transcripts. Conversation reuse between Agent stages is a separate, explicit setting.
|
|
36
|
-
|
|
37
|
-
### Revisions
|
|
38
|
-
|
|
39
|
-
Saved graphs are immutable revisions. A published revision is never rewritten: a pinned run keeps describing the graph it started with, and editing produces the next revision. Selecting `default` always runs the single Andorra Agent harness, signed in or not; the Orchestrator → Andorra Agent workflow is the paid `:andorra` graph, and older bundled default revisions (1–6) remain available for compatibility. Graph Studio shows `default` at its latest revision (7), the same single Andorra Agent that Default runs; revision 6 is the Orchestrator workflow the `:andorra` preset uses.
|
|
40
|
-
|
|
41
|
-
## How a task actually runs
|
|
42
|
-
|
|
43
|
-
- **Tools.** Provider-visible coding tools are `Read`, `Write`, `Edit`, `Glob`, `Grep`, `Bash`, and `PowerShell`. CodeGraph/`repo_explore` is attempted before `Grep` for source-discovery tasks; native text search is the fallback. Shell handles Git, package managers, and tests. `Read` shows an image file (PNG, JPEG, GIF, WebP, BMP) to the model as a picture, downscaled to 1568 px on its longest edge; when the model endpoint refuses image input, the run drops the images, says so in the transcript and continues on text.
|
|
44
|
-
- **Approvals.** Under the default Ask-for-approval mode, edits inside the workspace and sandboxed shell commands run without a prompt, actions outside the sandbox ask first, and YOLO (Full Access) approves everything for the session. See [Security and permissions](security.md).
|
|
45
|
-
- **Context.** Reads, searches, and output are bounded; stale discovery output shrinks deterministically; older exchanges compact semantically under context pressure. Every ReAct iteration resends the whole conversation, so cumulative token totals measure repeated context, not one giant prompt.
|
|
46
|
-
- **Memory.** No persistent memory service ships with Andorra; CodeGraph indexes current code structure and local command lessons carry shell fixes between runs. See [Memory](memory.md).
|
|
47
|
-
- **Workspace instructions.** `ANDORRA.md` at the project root steers every agent. See [Workspace instructions](workspace-instructions.md).
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Actionable JEV routing and independent optimizations
|
|
2
|
-
|
|
3
|
-
This extends the guarded check-and-finish implementation from #410. It does not
|
|
4
|
-
replace the executor, approvals, capability checks, completion guards, or provider
|
|
5
|
-
continuation protocol. New tool-menu routing is opt-in; no live performance claim
|
|
6
|
-
is made by this change.
|
|
7
|
-
|
|
8
|
-
## Separate controls
|
|
9
|
-
|
|
10
|
-
The installation's `efficiency` object accepts:
|
|
11
|
-
|
|
12
|
-
```json
|
|
13
|
-
{
|
|
14
|
-
"deterministicContinuations": true,
|
|
15
|
-
"jevFactInterpretation": true,
|
|
16
|
-
"jevPreflight": true,
|
|
17
|
-
"toolMenuRouting": { "mode": "shadow", "topK": 2, "minSavingsChars": 2048 }
|
|
18
|
-
}
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
`deterministicContinuations: true` enables guarded prepared checks and completion
|
|
22
|
-
without requiring JEV or sign-in. Explicit false disables that optimization.
|
|
23
|
-
Omission preserves #410's facts-mode behavior. `jevFactInterpretation: false`
|
|
24
|
-
keeps local evidence and continuations but never calls the remote fact service.
|
|
25
|
-
True still requires an active authorized facts-mode decision manager. Neither
|
|
26
|
-
setting grants execution permission or manufactures a verification result.
|
|
27
|
-
|
|
28
|
-
`jevPreflight: false` disables preflight only. It does not disable the independent
|
|
29
|
-
fact or tool-menu paths. With preflight enabled, facts-mode questions are filtered
|
|
30
|
-
by their actual consumers: unavailable retrieval, disabled/unresolvable model
|
|
31
|
-
routing, and absent delegation roles do not merit a request. If no questions
|
|
32
|
-
remain, `decision.skipped` is recorded without a provider dispatch.
|
|
33
|
-
|
|
34
|
-
Explicit answer-only/no-tools tasks omit finish-planning machinery and menu
|
|
35
|
-
classification. This is an optimization eligibility rule, not a replacement for
|
|
36
|
-
normal instruction compliance or permission enforcement.
|
|
37
|
-
|
|
38
|
-
The five older efficiency switches retain their existing defaults and semantics.
|
|
39
|
-
Do not use their all-on combination to attribute a result solely to JEV.
|
|
40
|
-
|
|
41
|
-
## Tool-menu contract
|
|
42
|
-
|
|
43
|
-
`src/decision/routeTools.ts` is a pure deterministic consumer of bounded evidence.
|
|
44
|
-
It does not call a provider or execute a tool. The host constructs descriptors
|
|
45
|
-
from the already-permitted menu. Core read/search/edit/shell capabilities, unknown
|
|
46
|
-
tools, hidden compatibility entries, explicitly named node tools and historical
|
|
47
|
-
tool calls are retained. Optional known bundles cover git, codegraph, memory,
|
|
48
|
-
web, browser, subagents and artifacts. Dependencies are host-owned: optional
|
|
49
|
-
roots retain core; a subagent bundle retains an available artifact bundle.
|
|
50
|
-
|
|
51
|
-
`toolMenuRouting.mode` is `off` (default), `shadow`, or `lean`. A single boundary
|
|
52
|
-
classification sees the redacted bounded task and fixed short bundle descriptions,
|
|
53
|
-
not full schemas, handlers, credentials, costs, or eval labels. It selects the
|
|
54
|
-
requested operation/deliverable, not just the next preliminary read. Ambiguous
|
|
55
|
-
multi-capability requirements retain the normal menu.
|
|
56
|
-
|
|
57
|
-
The request pins `jev-1.13.0` and question/policy version 1. The host requires the
|
|
58
|
-
exact closed option set, finite probabilities, a distribution summing to one,
|
|
59
|
-
a leading selected option, and the model/version pin. It never normalizes an
|
|
60
|
-
invalid distribution or lowers completion thresholds to force interventions.
|
|
61
|
-
Policy filters by confidence/relevance, orders eligible roots by schema size,
|
|
62
|
-
and applies dependency closure. Top K bounds roots, not prerequisites. Pinned
|
|
63
|
-
capabilities are not evicted to meet a budget.
|
|
64
|
-
|
|
65
|
-
Uncertainty, clarification, invalid responses, missing prerequisites, inadequate
|
|
66
|
-
schema reduction, service failure and unsupported older deployments all retain
|
|
67
|
-
the original permitted menu. Cancellation and changed task/permission revisions
|
|
68
|
-
cannot apply stale selection. The menu stays stable during the invocation;
|
|
69
|
-
existing `restore_tools` can restore omitted permitted schemas without granting
|
|
70
|
-
new authority. Unknown custom/MCP tools are deliberately not trimmed by name
|
|
71
|
-
heuristics. This first version routes coarse known bundles, not arbitrary tools.
|
|
72
|
-
|
|
73
|
-
`minSavingsChars` is a conservative schema-size threshold including recovery
|
|
74
|
-
schema/notice allowance. It is not a token count, a monetary model, or proof that
|
|
75
|
-
the extra request pays off. `pinnedTools` is a bounded optional host-supplied list;
|
|
76
|
-
the node executor adds explicit configured tools automatically. Historical calls
|
|
77
|
-
are retained to avoid invalidating provider tool-call history.
|
|
78
|
-
|
|
79
|
-
## Evidence and accounting
|
|
80
|
-
|
|
81
|
-
Local checks run before semantic interpretation. Exact owned pass/fail evidence
|
|
82
|
-
needs no JEV request. Unknown, stale, truncated, denied or skipped-only evidence
|
|
83
|
-
cannot become a positive check merely because an optimization is enabled.
|
|
84
|
-
|
|
85
|
-
Continuation events include `evidenceSource: deterministic | jev`. A prepared
|
|
86
|
-
check is a local continuation; completion is JEV-supported only when the current
|
|
87
|
-
verification/task evidence it consumes actually came from JEV. These are observed
|
|
88
|
-
model-call bypasses, not counterfactual net savings. A bypass can coexist with
|
|
89
|
-
higher total tokens if preparing it cost more or the model took another path.
|
|
90
|
-
|
|
91
|
-
Hosted transports emit logical decisions, actual client HTTP dispatches, and
|
|
92
|
-
provider-reported usage separately. The proxy retains safe usage even when a
|
|
93
|
-
provider response fails validation. Missing usage/model metadata remains unknown.
|
|
94
|
-
The existing per-run circuit prevents repeated fact failures; menu classification
|
|
95
|
-
also has a per-run circuit and a bounded deadline. No retries are added to repair
|
|
96
|
-
malformed probability distributions.
|
|
97
|
-
|
|
98
|
-
## Deployment and validation
|
|
99
|
-
|
|
100
|
-
Deploy the updated account proxy through the existing reviewed process before
|
|
101
|
-
expecting the new `toolMenu` contract to work. This source change does not deploy
|
|
102
|
-
AWS infrastructure. An older proxy's 400/404/422 yields unsupported protocol and
|
|
103
|
-
keeps the full menu. Existing auth, membership, quota and egress boundaries stay
|
|
104
|
-
in force; only host-approved metadata is sent.
|
|
105
|
-
|
|
106
|
-
Start with shadow mode, then run the paired experiments in
|
|
107
|
-
[`eval/EXPERIMENTS.md`](../../eval/EXPERIMENTS.md). Compare lean against the same
|
|
108
|
-
local-only baseline, preserving success rate and including routing costs,
|
|
109
|
-
restorations, cache changes and failures. Do not enable lean by default until
|
|
110
|
-
full runtime/CLI verification and repeated representative evaluations pass.
|
|
111
|
-
|
|
112
|
-
See [`tests/jev-actionable-routing-test-plan.md`](../../tests/jev-actionable-routing-test-plan.md)
|
|
113
|
-
for regression, service-compatibility and rollout checks.
|