@andorra-labs/code 0.1.9 → 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 +56 -0
- package/dist/src/app-server/protocol.d.ts +109 -1
- package/dist/src/app-server/protocol.js +8 -1
- package/dist/src/app-server.d.ts +59 -1
- package/dist/src/app-server.js +418 -63
- package/dist/src/auth/index.d.ts +1 -1
- package/dist/src/auth/index.js +1 -1
- package/dist/src/auth/store.d.ts +17 -1
- package/dist/src/auth/store.js +25 -2
- 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 +255 -33
- package/dist/src/browser-ui/index.html +9 -9
- package/dist/src/browser-ui/style.css +110 -65
- package/dist/src/browser-ui/tokens.css +27 -26
- package/dist/src/cli.js +10 -5
- 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.d.ts +1 -1
- package/dist/src/commands.js +2 -2
- package/dist/src/completion-gates.d.ts +42 -7
- package/dist/src/completion-gates.js +55 -9
- package/dist/src/completion.d.ts +9 -1
- package/dist/src/completion.js +20 -2
- package/dist/src/dashboard-view.js +2 -2
- package/dist/src/deadline.js +4 -0
- package/dist/src/decision/checks.js +1 -1
- package/dist/src/file-diff.d.ts +105 -0
- package/dist/src/file-diff.js +244 -0
- package/dist/src/graph-manager-chat.js +4 -4
- package/dist/src/graph-runner.js +39 -2
- 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 +303 -129
- 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 +56 -7
- package/dist/src/graph-ui/icons.js +5 -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 +5 -5
- package/dist/src/graph-ui/skill-picker.js +5 -5
- package/dist/src/graph-ui/studio-canvas.js +16 -16
- package/dist/src/graph-ui/studio.css +18 -15
- package/dist/src/graph-ui/studio.js +99 -42
- package/dist/src/graph-ui/style.css +125 -80
- package/dist/src/graph-ui/theme.js +2 -2
- package/dist/src/graph-ui/tokens.css +33 -29
- package/dist/src/graphs.d.ts +10 -3
- package/dist/src/graphs.js +15 -4
- package/dist/src/mcp.d.ts +75 -0
- package/dist/src/mcp.js +240 -8
- package/dist/src/membership-errors.d.ts +7 -1
- package/dist/src/membership-errors.js +9 -3
- package/dist/src/provider-keys.d.ts +5 -1
- package/dist/src/provider-keys.js +7 -3
- package/dist/src/provider-settings.d.ts +4 -1
- package/dist/src/provider-settings.js +46 -5
- package/dist/src/pull-requests.d.ts +42 -6
- package/dist/src/pull-requests.js +11 -3
- package/dist/src/qa/guidance.js +6 -19
- package/dist/src/qa/index.d.ts +0 -2
- package/dist/src/qa/index.js +0 -2
- package/dist/src/qa/profile/QaProfile.d.ts +5 -1
- package/dist/src/qa/profile/QaProfile.js +6 -2
- package/dist/src/qa/tools.d.ts +19 -1
- package/dist/src/qa/tools.js +20 -145
- package/dist/src/react-runtime.js +134 -16
- 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/remote/engine-pool.js +18 -6
- package/dist/src/runtime.d.ts +19 -0
- package/dist/src/runtime.js +10 -1
- package/dist/src/screen-selection.d.ts +38 -0
- package/dist/src/screen-selection.js +103 -0
- package/dist/src/session-changes.d.ts +122 -0
- package/dist/src/session-changes.js +804 -0
- 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 +15 -0
- package/dist/src/stall-recovery.js +17 -0
- package/dist/src/telemetry/schema.d.ts +1 -1
- package/dist/src/telemetry/schema.js +1 -2
- package/dist/src/terminal-ui.d.ts +64 -20
- package/dist/src/terminal-ui.js +312 -82
- package/dist/src/time-limit.d.ts +53 -0
- package/dist/src/time-limit.js +79 -0
- package/dist/src/tool-diff-stats.d.ts +9 -0
- package/dist/src/tool-diff-stats.js +20 -0
- package/dist/src/tool-names.d.ts +1 -1
- package/dist/src/tool-result-filter.js +1 -1
- package/dist/src/tools.js +118 -9
- package/dist/src/transcript.d.ts +11 -0
- package/dist/src/transcript.js +15 -3
- package/dist/src/types.d.ts +12 -0
- package/dist/src/usage-analytics.d.ts +3 -1
- package/dist/src/usage-analytics.js +16 -2
- package/package.json +6 -26
- package/dist/src/qa/api/http-runner.d.ts +0 -3
- package/dist/src/qa/api/http-runner.js +0 -47
- package/dist/src/qa/git/ChangeDetector.d.ts +0 -26
- package/dist/src/qa/git/ChangeDetector.js +0 -177
- package/dist/src/qa/git/DiffReviewer.d.ts +0 -28
- package/dist/src/qa/git/DiffReviewer.js +0 -115
- package/dist/src/qa/orchestrator/ChangeClassifier.d.ts +0 -14
- package/dist/src/qa/orchestrator/ChangeClassifier.js +0 -28
- package/dist/src/qa/orchestrator/MergeGate.d.ts +0 -14
- package/dist/src/qa/orchestrator/MergeGate.js +0 -40
- package/dist/src/qa/orchestrator/QaOrchestrator.d.ts +0 -79
- package/dist/src/qa/orchestrator/QaOrchestrator.js +0 -373
- package/dist/src/qa/runners/CommandRunner.d.ts +0 -22
- package/dist/src/qa/runners/CommandRunner.js +0 -96
- package/dist/src/qa/runners/TestRunner.d.ts +0 -21
- package/dist/src/qa/runners/TestRunner.js +0 -66
- package/dist/src/qa/runtime/RuntimeSmoke.d.ts +0 -11
- package/dist/src/qa/runtime/RuntimeSmoke.js +0 -78
- package/dist/src/qa/runtime-detect.d.ts +0 -10
- package/dist/src/qa/runtime-detect.js +0 -72
- package/dist/src/qa/security/DependencyScanner.d.ts +0 -19
- package/dist/src/qa/security/DependencyScanner.js +0 -167
- package/dist/src/qa/security/SecretScanner.d.ts +0 -3
- package/dist/src/qa/security/SecretScanner.js +0 -55
- 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,212 +0,0 @@
|
|
|
1
|
-
# Agent-centric MCP for Andorra Code
|
|
2
|
-
|
|
3
|
-
## How it works
|
|
4
|
-
|
|
5
|
-
Andorra Code ships a **local stdio MCP server** for agents that author and inspect graphs from outside Andorra, such as Claude Code, Codex, Hermes and OpenClaw. **This is the supported surface for an outside agent to create or edit a graph.** Agents running inside one of Andorra's own graph nodes do not need it: the engine gives them the same graph operations as its built-in `graphs` tool (see [Inside Andorra](#inside-andorra-the-built-in-graphs-tool)). The [Graph Builder](../guides/graph-builder.md) is the same authoring capability for people, and both write to the same graph store; an agent should not drive that browser UI to author a graph. The server does **not** execute an arbitrary authored graph, and it opens no network listener. It
|
|
6
|
-
does run one fixed graph — the bundled Andorra Agent harness — for hosts that want Andorra as
|
|
7
|
-
a subagent (see [Subagent mode](subagent-mode.md)). That fixed harness is the only execution the
|
|
8
|
-
server does: no surface of it selects a graph, and the run it does make permits writes by
|
|
9
|
-
default, so a host that exposes the server to an agent is granting that agent write access to
|
|
10
|
-
the workspace it names.
|
|
11
|
-
|
|
12
|
-
1. An MCP client starts Andorra with the command below, discovers the tools, and reads the graph architecture resource.
|
|
13
|
-
2. The agent lists valid providers and graphs, starts a new or existing ephemeral graph draft, and creates or edits nodes and links.
|
|
14
|
-
3. Each Agent node authored through MCP must name a configured provider ID. Older published graphs may inherit the session provider; this does not change their persisted semantics.
|
|
15
|
-
4. The agent validates the draft. Missing provider and outcome edges receive named error codes with node IDs and ports.
|
|
16
|
-
5. The agent publishes. Publication saves the next immutable revision locally and then synchronizes to the cloud in the background, so a successful publication is locally durable but is **not** cloud confirmation.
|
|
17
|
-
|
|
18
|
-
### Installation and MCP clients
|
|
19
|
-
|
|
20
|
-
Build/install Andorra Code, sign in to your Andorra account to edit graphs (a free account holds one custom graph of up to three nodes), and configure providers from Andorra's /providers screen. Then connect the server from the agent host:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install
|
|
24
|
-
npm run build
|
|
25
|
-
andorra login
|
|
26
|
-
andorra
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Illustrative client configuration (adapt the field names to the MCP host's format):
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"mcpServers": {
|
|
34
|
-
"andorra-code": {
|
|
35
|
-
"command": "andorra",
|
|
36
|
-
"args": ["mcp-server", "--stdio"]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
For a repository checkout, an equivalent executable is node <checkout>/dist/src/cli.js mcp-server --stdio. The protocol is stdin/stdout; do not parse the process's stdout as human terminal text. Don't accidentally configure the same server as a recursively self-launched Andorra runtime tool.
|
|
43
|
-
|
|
44
|
-
## MCP subagent tools
|
|
45
|
-
|
|
46
|
-
Four tools run Andorra as a subagent for the calling agent. They execute the bundled Software
|
|
47
|
-
Engineer graph and nothing else: no graph is named, offered or selectable.
|
|
48
|
-
|
|
49
|
-
| Tool | Input | Answers |
|
|
50
|
-
| --- | --- | --- |
|
|
51
|
-
| `andorra_subagent_start` | `prompt` (required), `provider?`, `model?`, `permissions?` (`full-access` or `read-only`), `workspace?` | the run's id, session id, provider, model and permissions |
|
|
52
|
-
| `andorra_subagent_status` | `runId` (required) | the run: state, current node, recent events |
|
|
53
|
-
| `andorra_subagent_result` | `runId` (required), `waitMs?` (0–60000) | the finished result, or `running` |
|
|
54
|
-
| `andorra_subagent_cancel` | `runId` (required) | whether a run was cancelled |
|
|
55
|
-
|
|
56
|
-
A provider/model is mandatory. Without one the start is refused with `PROVIDER_NOT_SET` and the
|
|
57
|
-
error carries every configured provider with its models, so the calling agent can show the list to
|
|
58
|
-
its user and retry with the choice. The full contract is in [Subagent mode](subagent-mode.md).
|
|
59
|
-
|
|
60
|
-
## Inside Andorra: the built-in `graphs` tool
|
|
61
|
-
|
|
62
|
-
An agent running in an Andorra graph node gets every graph operation below as one built-in tool, `graphs`, with no server to configure and no `andorra` command needed on PATH. It calls `graphs` with `action` set to the operation's name and the operation's arguments in `args`:
|
|
63
|
-
|
|
64
|
-
```json
|
|
65
|
-
{ "action": "andorra_graph_begin", "args": { "mode": "create", "id": "qa-flow", "name": "QA Flow" } }
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
- The tool runs the same backend as this server, in the engine's own process. It is loaded the first time a graph action runs, shared by every task in that process, and closed after an hour without graph actions; tasks that never touch graphs pay nothing beyond its one schema.
|
|
69
|
-
- Like other external tools it needs a node with shell permission and is not given to delegated subagents.
|
|
70
|
-
- `andorra_graph_publish`, `andorra_graph_delete` and `andorra_graph_restore` ask for permission like an automation change, and are refused in plan mode. Drafts and reads do not ask.
|
|
71
|
-
- The session, project and subagent tools stay MCP-only.
|
|
72
|
-
|
|
73
|
-
## MCP graph tools
|
|
74
|
-
|
|
75
|
-
| Tool | Purpose |
|
|
76
|
-
| --- | --- |
|
|
77
|
-
| andorra_graph_guide | Returns the architecture, examples, node ports and machine-readable error contract |
|
|
78
|
-
| andorra_providers_list | Provider IDs, models and types, **no credentials** |
|
|
79
|
-
| andorra_graphs_list | List published graph IDs, names and revisions; deleted graphs only with `includeDeleted: true` |
|
|
80
|
-
| andorra_graph_get | Read the exact saved latest or selected immutable revision, without editor-only migration |
|
|
81
|
-
| andorra_graph_begin | Begin new or existing graph draft (mode create/edit, id, name for create); returns draftId |
|
|
82
|
-
| andorra_graph_node_upsert | Create/replace a whole node with prompt, provider, completion, permissions and other settings |
|
|
83
|
-
| andorra_graph_node_patch | Change a node's prompt/instruction/systemPrompt, provider, model or completion without replacing unrelated fields |
|
|
84
|
-
| andorra_graph_node_remove | Remove a non-entry node and its edges |
|
|
85
|
-
| andorra_graph_edge_upsert | Create/update an edge source -> target with an explicit named outcome |
|
|
86
|
-
| andorra_graph_edge_remove | Delete an edge by ID |
|
|
87
|
-
| andorra_graph_patch | Set entry, name, limits, schemas, widgets and metadata |
|
|
88
|
-
| andorra_graph_validate | Validate without saving; return all missing-provider and missing-outcome issues, plus structural error |
|
|
89
|
-
| andorra_graph_publish | Validate and save the next immutable revision, or report revision conflict |
|
|
90
|
-
| andorra_graph_discard | Drop an uncommitted draft |
|
|
91
|
-
| andorra_graph_delete | Soft-delete a graph (`id`, `expectedRevision`, `confirm` repeating the id) after the user confirms in chat |
|
|
92
|
-
| andorra_graph_restore | Restore a soft-deleted graph (`id`, `expectedRevision`) |
|
|
93
|
-
|
|
94
|
-
Graph architecture is also exposed as a resource with URI andorra://graph/architecture. A third-party agent should read this before trying to design workflows. Agent completion outcomes may be pass/fail or custom names, Condition uses true/false ports, Loop uses body/done ports and bounded iteration counts, Approval uses approved/rejected, and Join all cannot wait for mutually exclusive branches. All nodes must be reachable from entry and every declared required outcome must route. See the resource for the full node and edge rules.
|
|
95
|
-
|
|
96
|
-
### Example authoring sequence
|
|
97
|
-
|
|
98
|
-
1. Call andorra_providers_list and use one of its IDs (the value "local" below is only an example).
|
|
99
|
-
2. Call andorra_graph_begin with:
|
|
100
|
-
|
|
101
|
-
```json
|
|
102
|
-
{"mode":"create","id":"ci-qa","name":"CI QA"}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
3. Call andorra_graph_node_upsert with the returned draftId:
|
|
106
|
-
|
|
107
|
-
```json
|
|
108
|
-
{
|
|
109
|
-
"draftId": "<draftId>",
|
|
110
|
-
"node": {
|
|
111
|
-
"id": "check",
|
|
112
|
-
"name": "Run QA",
|
|
113
|
-
"type": "agent",
|
|
114
|
-
"provider": "local",
|
|
115
|
-
"instruction": "Run tests and report pass or fail with evidence.",
|
|
116
|
-
"completion": {"mode": "outcomes", "outcomes": ["pass", "fail"]}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
4. Create two End nodes (IDs accepted, review). Call andorra_graph_patch with patch {"entry":"check"}.
|
|
122
|
-
5. Call andorra_graph_edge_upsert twice:
|
|
123
|
-
|
|
124
|
-
```json
|
|
125
|
-
{"draftId":"<draftId>","edge":{"id":"pass-edge","source":"check","outcome":"pass","target":"accepted"}}
|
|
126
|
-
```
|
|
127
|
-
```json
|
|
128
|
-
{"draftId":"<draftId>","edge":{"id":"fail-edge","source":"check","outcome":"fail","target":"review"}}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
6. Call andorra_graph_validate. After valid=true, call andorra_graph_publish.
|
|
132
|
-
|
|
133
|
-
To make a Loop, create a Loop node with loop.maxIterations and link its body and done ports. Node visits are unlimited by default: `graph.limits.maxNodeVisits` is absent, and `0` there means the same thing. A graph with a return connection still needs a ceiling, so set `graph.limits.maxNodeVisits` high enough for each cycle/reentry, or set `graph.limits.wallTimeMs` to bound the run by the clock instead. The existing graph validator remains the authority for reachable links, cycles, schemas and Join dependencies.
|
|
134
|
-
|
|
135
|
-
### Deleting and restoring a graph
|
|
136
|
-
|
|
137
|
-
Deleting is a soft delete. `andorra_graph_delete` publishes the next revision with `metadata.deletedAt` set; no file is removed, and every earlier revision stays stored locally and in the cloud. Cloud sync carries that revision to the account's other machines like any publish. Removing the files instead would not work: sync restores every graph the account holds.
|
|
138
|
-
|
|
139
|
-
A deleted graph leaves `andorra_graphs_list` (unless `includeDeleted` is true), `/graph`, the desktop graph picker and the Graph Builder, and new runs refuse it with "Graph <name> was deleted. Restore it before running it." A saved default selection that names it falls back to the Default graph until it is restored. Sessions that already ran it keep resuming. `andorra_graph_get` still reads it and reports `deletedAt`; `andorra_graph_begin` with `mode=edit` refuses it.
|
|
140
|
-
|
|
141
|
-
`andorra_graph_restore` publishes the next revision without the marker. A deleted graph still counts toward a free account's one custom graph, so a free account restores it rather than replacing it.
|
|
142
|
-
|
|
143
|
-
Refusals: `DEFAULT_GRAPH` (the Default graph or the Andorra preset), `CONFIRMATION_MISMATCH` (`confirm` is not the id), `GRAPH_IN_USE` (an automation runs the graph; `automations` lists them), `GRAPH_DELETED` (already deleted, or an edit of a deleted graph), `GRAPH_NOT_DELETED` (restore of a live graph), and `REVISION_CONFLICT` when `expectedRevision` is not the latest. `metadata.deletedAt` is reserved: `andorra_graph_patch`, publishing and Graph Builder saves refuse it (`RESERVED_METADATA`), so a graph is deleted only through the delete tool.
|
|
144
|
-
|
|
145
|
-
### Validation errors
|
|
146
|
-
|
|
147
|
-
Every MCP tool returns a JSON text payload with ok/data or ok/error. A failed call sets MCP isError=true. For example, omitting a fail branch yields:
|
|
148
|
-
|
|
149
|
-
```json
|
|
150
|
-
{
|
|
151
|
-
"ok": false,
|
|
152
|
-
"error": {
|
|
153
|
-
"code": "NODE_ROUTE_MISSING",
|
|
154
|
-
"nodeId": "check",
|
|
155
|
-
"port": "fail",
|
|
156
|
-
"message": "Node check: fail does not have a valid path. Please set a valid path for fail.",
|
|
157
|
-
"issues": [
|
|
158
|
-
{"code":"NODE_ROUTE_MISSING","nodeId":"check","port":"fail","message":"Node check: fail does not have a valid path. Please set a valid path for fail."}
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Creating or modifying an Agent node without a provider returns NODE_PROVIDER_MISSING with nodeId and the text "Provider not set. Please select a valid provider." Untouched Agent nodes in previously saved graphs can continue to inherit the session provider; renaming the graph or changing an edge does not require backfilling their providers. Invalid explicit provider IDs return NODE_PROVIDER_INVALID. Other distinct errors include GRAPH_NOT_FOUND (unknown published graph ID/revision), EDGE_SOURCE_MISSING, EDGE_TARGET_MISSING, EDGE_OUTCOME_INVALID, EDGE_DUPLICATE, NODE_NOT_FOUND, ENTRY_NOT_FOUND, DRAFT_NOT_FOUND, AUTH_CHANGED (account switched during entitlement verification), and REVISION_CONFLICT. The latter is corrected by reopening latest, replaying the changes and publishing again: no silent overwrite. `GRAPH_INVALID` is reserved for actual graph-validator failures. Failures reading installation data instead return `STORAGE_ERROR` (filesystem access) or `BACKEND_ERROR` (unexpected backend/configuration failure), including for non-graph MCP tools; these errors do not instruct an agent to repair a graph.
|
|
165
|
-
|
|
166
|
-
Drafts belong to the MCP process and expire after one hour since last use; a maximum of 24 are permitted. Exiting the MCP process discards any unpublished work. Cloud save and other GUI edits are reconciled by expected revision when publishing.
|
|
167
|
-
|
|
168
|
-
## MCP sessions and monitoring
|
|
169
|
-
|
|
170
|
-
| Tool | Function |
|
|
171
|
-
| --- | --- |
|
|
172
|
-
| andorra_projects_list | List registered projects and workspaces discovered from saved sessions |
|
|
173
|
-
| andorra_sessions_list | Filter all local saved sessions by projectName, projectPath, status, lookbackMinutes, updatedAfter, updatedBefore, includeArchived, offset and limit |
|
|
174
|
-
| andorra_session_get | Fetch one session's status and bounded recent turn excerpts (historyLimit max 20) |
|
|
175
|
-
| andorra_sessions_attention | Find required_input and incomplete sessions for a supervising agent |
|
|
176
|
-
|
|
177
|
-
Session status values:
|
|
178
|
-
- **completed** — latest saved attempt succeeded; missing completion status means normal success
|
|
179
|
-
- **pending** — empty session with no attempted turn
|
|
180
|
-
- **running** — an active run with a living owner and no currently pending interaction
|
|
181
|
-
- **required_input** — a live approval or question, or a stopped needs_clarification attempt
|
|
182
|
-
- **incomplete** — cancelled/interrupted/exhausted/infrastructure failure, or a saved running marker with no live owner
|
|
183
|
-
|
|
184
|
-
Examples:
|
|
185
|
-
- Sessions for a project: {"projectName":"SparkAccel"}
|
|
186
|
-
- Sessions updated in the last 15 minutes: {"lookbackMinutes":15}
|
|
187
|
-
- Human feedback needed for a project: andorra_sessions_attention with {"projectName":"SparkAccel","lookbackMinutes":120}
|
|
188
|
-
- All incomplete sessions: andorra_sessions_list with {"status":"incomplete"}
|
|
189
|
-
- Latest 25 completed sessions in one workspace: {"projectPath":"/path/to/project","status":"completed","limit":25}
|
|
190
|
-
|
|
191
|
-
Filtering by projectName uses an exact case-insensitive display-name match, and resolves an unregistered workspace by its folder name. Duplicate display names fail with AMBIGUOUS_PROJECT so an agent can specify projectPath instead. Result pages include total and nextOffset, limit max 100. Archived records are included by default; set includeArchived=false to exclude them.
|
|
192
|
-
|
|
193
|
-
The app-server persists a minimal per-run sidecar during a pending **question** or **approval**, then removes it once settled. It contains the kind, a bounded prompt, IDs and timestamp, never tool arguments or provider credentials. A sidecar only signals live required input when the run claim is active; a stale file does not create a false request. A terminal-only CLI prompt does not currently use this app-server sidecar, so those live waits may be reported as running until an outcome is saved.
|
|
194
|
-
|
|
195
|
-
A Hermes/OpenClaw supervisor can poll andorra_sessions_attention and notify the user when session ID/status/run ID changes. **Andorra MCP does not itself schedule polling or send alerts.** That belongs to the external agent. The server only inspects sessions persisted in the local ANDORRACODE_HOME. It does not aggregate histories from other remote-workspace hosts, and does not expose an MCP tool for automatically approving or answering a user question.
|
|
196
|
-
|
|
197
|
-
## Behavior guarantees
|
|
198
|
-
|
|
199
|
-
- **Revisions are immutable.** `andorra_graph_get` returns the unchanged published snapshot for the selected revision. Older schema revisions are not automatically migrated in read results; only `andorra_graph_begin mode=edit` produces an editor-ready draft for modification. This prevents an external agent from reasoning about an Orchestrator or route that did not exist in the requested immutable revision.
|
|
200
|
-
- **The account is rechecked.** `andorra_graphs_list`, `andorra_graph_get`, and graph draft initialization recheck the current authenticated account after their storage reads. If you sign out or switch accounts in that window, the call fails closed with `AUTH_CHANGED` instead of disclosing the former account's graphs. A `revision` passed to `andorra_graph_get` must be a positive safe integer: invalid values such as `"1"`, `null`, fractions, and zero return `INVALID_ARGUMENTS` rather than silently selecting the latest revision.
|
|
201
|
-
- **A crashed run is reported as such.** A run that dies before its turn is saved is reported as `incomplete` with a `crashedAttempt` run ID and timestamp, instead of continuing to show the older `completed` turn. Crash markers hold IDs and timestamps only, never task data or credentials, and only the newest unresolved marker per session is kept.
|
|
202
|
-
- **Providers are rechecked before publishing.** A removed provider profile cannot be published, and a graph published after a provider reload still names the provider that was checked.
|
|
203
|
-
|
|
204
|
-
## Security and limitations
|
|
205
|
-
|
|
206
|
-
- Only trusted local MCP clients should launch the server. Session names, tasks and summarized content may reveal confidential project details.
|
|
207
|
-
- Graph access requires a signed-in account that the membership service has confirmed — free accounts within the free graph allowance, legacy and paid accounts without it — with a verdict bound to the **same account subject** that owns the graph directory; an account switch during verification or pre-publish synchronization fails closed. Provider credentials are not returned. Providers are rechecked after pre-publish synchronization so a removed profile cannot be published.
|
|
208
|
-
- Edits are drafts until publication. Graph revisions are immutable and conflict-protected. The graph authoring tools never execute submitted code.
|
|
209
|
-
- The subagent tools execute only the bundled Andorra Agent graph, and only with a provider and model the caller named (or the saved `externalSubagent` setting). They never edit a graph, never select one, and never run a paid or custom workflow.
|
|
210
|
-
- Graph publication is local-first; cloud sync can be delayed. The returned sync state describes whether it is pending/offline.
|
|
211
|
-
- Open interactive inputs are recognized from the app-server sidecars, not every possible terminal prompt.
|
|
212
|
-
- Session scope is local; remote-workspace/global session aggregation and streaming notifications are future extensions.
|
|
@@ -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.
|