aptly 0.1.10 → 0.1.12
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.en.md +10 -10
- package/README.ja.md +10 -10
- package/README.md +10 -10
- package/README.zh-CN.md +10 -10
- package/dist/bin/aptly.js +21 -16
- package/dist/src/cli-help.js +12 -10
- package/dist/src/cli-input.d.ts +19 -1
- package/dist/src/cli-input.js +23 -11
- package/dist/src/policy-source.d.ts +3 -0
- package/dist/src/policy-source.js +11 -0
- package/dist/src/server.d.ts +1 -1
- package/dist/src/server.js +10 -1
- package/dist/src/setup.d.ts +21 -0
- package/dist/src/setup.js +349 -5
- package/dist/src/transmission-review-cli.d.ts +11 -0
- package/dist/src/transmission-review-cli.js +35 -0
- package/dist/src/update-notifier.js +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/ADVISORY_USAGE.md +1 -1
- package/docs/DRAFT_0_1_0.md +1 -1
- package/docs/guide/en/advanced.md +217 -0
- package/docs/guide/en/benchmarks.md +32 -0
- package/docs/guide/en/budget.md +45 -0
- package/docs/guide/en/configuration.md +104 -0
- package/docs/guide/en/installation.md +114 -0
- package/docs/guide/en/routing.md +61 -0
- package/docs/guide/en/statistics.md +43 -0
- package/docs/guide/en/transmission.md +71 -0
- package/docs/guide/en/troubleshooting.md +99 -0
- package/docs/guide/en.md +80 -505
- package/docs/guide/ja/advanced.md +217 -0
- package/docs/guide/ja/benchmarks.md +32 -0
- package/docs/guide/ja/budget.md +45 -0
- package/docs/guide/ja/configuration.md +104 -0
- package/docs/guide/ja/installation.md +114 -0
- package/docs/guide/ja/routing.md +61 -0
- package/docs/guide/ja/statistics.md +43 -0
- package/docs/guide/ja/transmission.md +71 -0
- package/docs/guide/ja/troubleshooting.md +99 -0
- package/docs/guide/ja.md +80 -505
- package/docs/guide/ko/advanced.md +217 -0
- package/docs/guide/ko/benchmarks.md +32 -0
- package/docs/guide/ko/budget.md +45 -0
- package/docs/guide/ko/configuration.md +104 -0
- package/docs/guide/ko/installation.md +114 -0
- package/docs/guide/ko/routing.md +61 -0
- package/docs/guide/ko/statistics.md +43 -0
- package/docs/guide/ko/transmission.md +71 -0
- package/docs/guide/ko/troubleshooting.md +99 -0
- package/docs/guide/ko.md +80 -505
- package/docs/guide/zh-CN/advanced.md +217 -0
- package/docs/guide/zh-CN/benchmarks.md +32 -0
- package/docs/guide/zh-CN/budget.md +45 -0
- package/docs/guide/zh-CN/configuration.md +104 -0
- package/docs/guide/zh-CN/installation.md +114 -0
- package/docs/guide/zh-CN/routing.md +61 -0
- package/docs/guide/zh-CN/statistics.md +43 -0
- package/docs/guide/zh-CN/transmission.md +71 -0
- package/docs/guide/zh-CN/troubleshooting.md +99 -0
- package/docs/guide/zh-CN.md +80 -505
- package/package.json +2 -1
package/docs/guide/en.md
CHANGED
|
@@ -6,508 +6,83 @@
|
|
|
6
6
|
|
|
7
7
|
Korean is the canonical documentation. This guide covers general Aptly installation and usage. Package availability does not establish model access for every account. Claude Code or Codex controls native subagent execution, approvals, sandboxing, and MCP permissions.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
The first command registers Claude Code and Codex and adds missing default environment settings. It preserves existing launch commands, environment whitelists, providers, custom candidates, and advisory policies. The second prompts for a value with hidden input and changes only the named variable. The third stores the API key in the OS credential store and connects it to the selected host at startup. Do not pass values as command arguments.
|
|
90
|
-
|
|
91
|
-
Both hosts are selected by default. Use `--client codex`, `--client claude`, or `--client all` to select targets. For example, enter a JSON string such as `["haiku","sonnet","opus"]` for Claude candidates.
|
|
92
|
-
|
|
93
|
-
```sh
|
|
94
|
-
aptly set env APTLY_CLAUDE_MODELS --client claude
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Use explicit `--stdin` for automation. This is a public-variable example; never put a real key in a `printf` command or shell history.
|
|
98
|
-
|
|
99
|
-
```sh
|
|
100
|
-
printf '%s\n' '["gpt-6.1-terra"]' | aptly set env APTLY_CODEX_MODELS --stdin
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Allowed public keys are `ROUTER_PROVIDER` (`fixture` or `decisions`), `APTLY_CLAUDE_MODELS`, `APTLY_CODEX_MODELS`, `CLAUDE_MODELS`, `CODEX_MODELS`, and `APTLY_MODEL_INFO_PATH`. Candidates must be JSON array strings of supported models. Invalid values, duplicates, and primary-name/alias conflicts are rejected. `[]` disables that host; a model-cache path must be absolute and inside a private directory. Managed ledger and Hook-policy paths cannot be changed through this command.
|
|
104
|
-
|
|
105
|
-
API keys are stored through macOS Keychain, an installed Linux `secret-tool`, or Windows Credential Manager. The Windows backend uses PowerShell and Win32 Generic credentials in the current-user scope, with a limit of 2,560 UTF-8 bytes. Windows CI verified synthetic key storage, lookup, update and deletion, Unicode paths, isolated host configuration, key references, and ACL preservation. It did not run actual Claude Code or Codex sessions on Windows. Unavailable credential stores return an error; there is no plaintext-file fallback. Keys use separate host accounts, while MCP files contain only `APTLY_SECRET_BACKEND=os` and `APTLY_SECRET_CLIENT` references. Once the OS source is selected, a missing or unreadable key does not silently fall back to another environment key. `set default` preserves existing wrapper/environment authentication; running `set env OPENAI_API_KEY` explicitly selects OS-store authentication.
|
|
106
|
-
|
|
107
|
-
Results contain host statuses and fixed error codes, never key values. Inspect each host when the result is `partial`. `credential_store_failed` requires checking store access/support; `credential_rollback_failed` requires checking whether the previous key was restored. A failed host restores its old key where possible. Do not interpret success on another host as an atomic success across all hosts.
|
|
108
|
-
|
|
109
|
-
A store timeout or malformed acknowledgement may occur after the OS has written the new value. On failure, Aptly attempts to restore the previous value (or remove the new entry if none existed), then reads it back. `credential_rollback_failed` is added to the original failure codes when recovery cannot be confirmed; do not assume either key is active. Check the OS credential store before retrying. This is best-effort recovery, not an atomic transaction across processes or hosts.
|
|
110
|
-
|
|
111
|
-
Restart MCP, then inspect `provider`, candidates, and `credential_status` with `get_routing_capabilities`. `os_store` means a key was loaded, not that the API authenticated it. Default and public-variable setup continue to preserve custom wrappers. API-key setup does not change host settings for an unverified launch path and restores that host's previous key where possible if storage was already attempted. Do not assume a new key automatically takes effect through an existing wrapper. These commands do not bypass Codex `/hooks` trust or host permissions.
|
|
112
|
-
|
|
113
|
-
### Recover an incompatible launcher
|
|
114
|
-
|
|
115
|
-
These options require Aptly 0.1.2 or later and are not in npm 0.1.1. To test from source, run `npm ci --ignore-scripts` and `npm run build`, then replace `aptly` below with `node bin/aptly.ts`.
|
|
116
|
-
|
|
117
|
-
Key setup diagnoses selected hosts before input or storage. If any host fails, it does not prompt or change any host. `--check` does not access keys or the credential store.
|
|
118
|
-
|
|
119
|
-
From Aptly 0.1.9, on Linux, `--check` also checks for an executable `secret-tool` and, when a safe explicit session-bus address and `gdbus` are available, reads bus metadata without activating or accessing the credential service. Confirmed failures report `secure_store_unavailable` with `secure_store_secret_tool_missing`, `secure_store_bus_missing`, or `secure_store_service_missing` before input. `secure_store_bus_unverified`, `secure_store_probe_unavailable`, and service-present or activatable unverified codes mean readiness is unknown; a running or activatable service does not prove it is unlocked or writable. Install `secret-tool` and a Secret Service provider, and run from the intended desktop session when needed. The actual store operation can still fail. For SSH or headless sessions, supply `OPENAI_API_KEY` securely to the host MCP process when `APTLY_SECRET_BACKEND` is absent; preserve an existing authentication wrapper or environment. `credential_node_mismatch`, `credential_server_mismatch`, and `credential_runtime_unsupported` identify incompatible Node paths, server paths, and OS-store support respectively.
|
|
120
|
-
|
|
121
|
-
If only Claude failed, diagnose that host and review migration only when `launcher_migration_available` is returned:
|
|
122
|
-
|
|
123
|
-
```sh
|
|
124
|
-
aptly set env OPENAI_API_KEY --client claude --check
|
|
125
|
-
aptly setup --client claude --migrate-launcher --dry-run
|
|
126
|
-
aptly setup --client claude --migrate-launcher
|
|
127
|
-
aptly set env OPENAI_API_KEY --client claude
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
`--dry-run` makes no changes. Migration replaces the Node/server paths of a receipt-matching, Aptly-owned standard registration with the current build. It preserves environment settings, Hooks, policy and other hosts, accesses no credentials, and never executes the old launcher. Custom wrappers and missing or modified ownership records are rejected. Review such registrations locally; use the wrapper's secure environment or a separately reviewed standard registration. Do not edit or delete ownership records to bypass validation.
|
|
131
|
-
|
|
132
|
-
From Aptly 0.1.9, `aptly setup --check --client codex|claude|all` reads the normal setup plan without writing files or creating directories. It is a snapshot, not a check of the running host. Only `--client` can be combined with `--check`. If `hook_policy_path_conflict` appears, review the selected host configuration directory and existing policy reference locally, then select the intended host directory before retrying. Setup preserves the existing configuration and does not move or copy the policy; launcher migration does not resolve this mismatch.
|
|
133
|
-
|
|
134
|
-
If `launcher_migration_not_owned` refers to a preserved registration (`mcp_created: false`), **Aptly 0.1.3 or later** offers the explicit `--include-existing` opt-in. Install 0.1.3 or later, then run:
|
|
135
|
-
|
|
136
|
-
```sh
|
|
137
|
-
aptly setup --client claude --migrate-launcher --include-existing --dry-run
|
|
138
|
-
aptly setup --client claude --migrate-launcher --include-existing
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Review the local registration first. A valid existing Aptly ownership receipt and matching managed environment additions, Hook, and policy are required. Only an absolute Node path with a single standard server path is accepted; wrappers and registrations without a receipt remain unsupported. This does not make the entire MCP registration Aptly-owned: later removal preserves the migrated launcher and original user settings. The option applies only to explicit single-client migration, never automatic installation.
|
|
142
|
-
|
|
143
|
-
A successful Codex configuration needs no reset. Retry only the affected host and restart MCP. Codex still requires `/hooks` trust review. Changes after diagnosis stop with `concurrent_configuration_change`. If recovery observes another key or cannot read the current key, it leaves the store unchanged and reports `credential_rollback_failed`. Files and the OS store do not form an atomic transaction; avoid concurrent configuration operations.
|
|
144
|
-
|
|
145
|
-
### Keys and restarting
|
|
146
|
-
|
|
147
|
-
Pass the classification key, `OPENAI_API_KEY`, through a secure environment or credential launcher to the MCP process. It is separate from host subscription login. Never write key values into command arguments, requests, configuration files, source, logs, or temporary files.
|
|
148
|
-
|
|
149
|
-
### MCP environment setup, step by step
|
|
150
|
-
|
|
151
|
-
Run `setup`, then merge the examples below into the existing `aptly` registration. Preserve `command`, `args`, credential launchers, `ROUTER_LEDGER_PATH`, and `APTLY_HOOK_POLICY_PATH`. Setup creates the private ledger/policy directories; a manual ledger path must be absolute and inside a user-owned directory with mode 700.
|
|
152
|
-
|
|
153
|
-
#### Configuration file locations
|
|
154
|
-
|
|
155
|
-
| Host | User registration used by Aptly |
|
|
156
|
-
|---|---|
|
|
157
|
-
| Codex | `$CODEX_HOME/config.toml`; `~/.codex/config.toml` when `CODEX_HOME` is unset |
|
|
158
|
-
| Claude Code | `mcpServers.aptly` in `~/.claude.json`; `.claude.json` inside `CLAUDE_CONFIG_DIR` when that directory is configured |
|
|
159
|
-
|
|
160
|
-
Claude Code stores Hooks in `~/.claude/settings.json` by default, or `$CLAUDE_CONFIG_DIR/settings.json` when `CLAUDE_CONFIG_DIR` is set. This is separate from MCP registration. If project `.mcp.json`, managed settings, or account-specific directories are in use, check the active entry in `/mcp` before editing or adding a registration.
|
|
161
|
-
|
|
162
|
-
#### Passing the API key
|
|
163
|
-
|
|
164
|
-
For a direct launch, enter the key in **Bash** without displaying or saving its value, then start the host from that shell. In zsh, run `bash` first:
|
|
165
|
-
|
|
166
|
-
```sh
|
|
167
|
-
read -rsp 'OpenAI API key: ' OPENAI_API_KEY
|
|
168
|
-
printf '\n'
|
|
169
|
-
export OPENAI_API_KEY
|
|
170
|
-
codex
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Replace `codex` with `claude` for Claude Code. This does not save the key permanently. A running GUI does not inherit another terminal’s environment; use its secure environment mechanism or preserve the existing credential launcher.
|
|
174
|
-
|
|
175
|
-
#### Codex example
|
|
176
|
-
|
|
177
|
-
Edit the existing `[mcp_servers.aptly]` tables; do not append duplicate tables. Add `OPENAI_API_KEY` to `env_vars` without removing existing entries. `env_vars` forwards named host variables; `.env` supplies fixed MCP values.
|
|
178
|
-
|
|
179
|
-
```toml
|
|
180
|
-
[mcp_servers.aptly]
|
|
181
|
-
env_vars = ["OPENAI_API_KEY"]
|
|
182
|
-
|
|
183
|
-
[mcp_servers.aptly.env]
|
|
184
|
-
ROUTER_PROVIDER = "decisions"
|
|
185
|
-
APTLY_CLAUDE_MODELS = '["haiku","sonnet","opus"]'
|
|
186
|
-
APTLY_CODEX_MODELS = '["gpt-6-luna","gpt-6.1-terra","gpt-6.1-sol"]'
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
#### Claude Code example
|
|
190
|
-
|
|
191
|
-
Merge these values into the existing `mcpServers.aptly.env` object:
|
|
192
|
-
|
|
193
|
-
```json
|
|
194
|
-
{
|
|
195
|
-
"ROUTER_PROVIDER": "decisions",
|
|
196
|
-
"APTLY_CLAUDE_MODELS": "[\"haiku\",\"sonnet\",\"opus\"]",
|
|
197
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\",\"gpt-6.1-terra\",\"gpt-6.1-sol\"]"
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
For direct launches, this optional reference forwards a key already present in the Claude Code environment. Do not add it to a credential-launcher setup. If the variable is missing, the key will not be supplied and the reference may remain unexpanded:
|
|
202
|
-
|
|
203
|
-
```json
|
|
204
|
-
{
|
|
205
|
-
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
|
|
206
|
-
}
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
Model candidates are **JSON strings**: leave them unset for defaults or use `[]` to disable that host’s recommendations. Aptly reads the MCP startup environment and does not load project `.env` files.
|
|
210
|
-
|
|
211
|
-
Restart the host or MCP server after changes. **In Codex, review and trust the new Hook through `/hooks`.** Check `/mcp` and `get_routing_capabilities` for `provider`, candidates, and `automatic_hook.mode`. This free query does not authenticate the key; `recommend_agent` may incur a charge. For `unauthorized`, check key forwarding; for `needs_context`, check the task summary.
|
|
212
|
-
|
|
213
|
-
See the official [Codex configuration reference](https://learn.chatgpt.com/docs/config-file/config-reference) and [Claude Code MCP guide](https://code.claude.com/docs/en/mcp) for configuration locations and environment forwarding.
|
|
214
|
-
|
|
215
|
-
### Skipping registration and removing it
|
|
216
|
-
|
|
217
|
-
```sh
|
|
218
|
-
APTLY_SKIP_SETUP=1 npm install -g aptly@latest
|
|
219
|
-
aptly setup --client codex --mode defaults
|
|
220
|
-
aptly remove --client all
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
`CI` or npm `--ignore-scripts` also skips registration. Use `setup` to register later. To change mode, remove the registration and run setup with the desired `--mode`; `advisory` only supplies advice. For `partial`, check each host’s error codes. Removal preserves user-modified entries and reports conflicts.
|
|
224
|
-
|
|
225
|
-
## Automatic Hook
|
|
226
|
-
|
|
227
|
-
**The following preflight, recommendation and observation behavior requires Aptly 0.1.4 or later.** The installed `PreToolUse` matcher routes supported Codex `spawn_agent` / `collaborationspawn_agent` / `Agent` and Claude Code `Agent` calls to local `route_spawn_hook` before native execution. The host must load and trust this Hook and connect its MCP server. Aptly cannot enforce interception in an unconfigured or unsupported host, or when MCP is unavailable; native execution remains the host's responsibility.
|
|
228
|
-
|
|
229
|
-
Local preflight checks explicit fields, roles/resume, policy, cache and budget. A new paid Decisions request is not required for every spawn. Model-only or effort-only Codex selections restrict candidates to matching allowlisted tuples; only the unspecified field can be filled. Both specified fields, unsupported values, fixed roles and resumed identities are preserved without classification. Input fields do not establish whether a choice came from the user or a host default.
|
|
230
|
-
|
|
231
|
-
Unspecified model/effort with `fork_turns: "all"` or omitted fork now reaches recommendation. It does **not** authorize history changes: Codex model/effort application still requires explicit `fork_turns: "none"`. Otherwise the Hook reports `inherited_context_application_unverified` and preserves the original arguments. Other history fields produce `history_semantics_unverified`; Claude application remains limited to general-purpose calls without history constraints. A recommendation may therefore be produced without being applied.
|
|
232
|
-
|
|
233
|
-
For opaque Codex messages, a concrete short task name such as `cleanup_merged_worktrees` can supply label-only advice. The short-name allowlist covers cleanup/remove/prune + merged + worktrees/branches, and review/fix/test + failing/broken/flaky + tests/builds; other names retain the descriptive six-word check. The body is never decoded or sent. This does not establish missing task details or permission to clean up. Inherited application is unverified for the target host, not universally impossible; public source support alone cannot certify the installed runtime.
|
|
234
|
-
|
|
235
|
-
For genuinely independent work, the caller can intentionally choose a fresh child and provide sufficient standalone task context. Aptly never changes `all` to `none`, removes history or rewrites a specified model/effort. [Synthetic inherited and fresh examples](../../examples/spawn-preflight.codex.json) show the distinct requests; they are not automatic retries. Never retry an uncertain paid call with a new ID.
|
|
236
|
-
|
|
237
|
-
`defaults` enables compatible argument updates; `advisory` supplies advice only. Inherited calls and partially specified calls may now share the same bounded task excerpt with Decisions even when application is blocked; history is not a privacy opt-out. Disabled policy, insufficient context, budget limits, failure and cancellation preserve execution constraints. Input, policy and catalog bindings, duplicate suppression and unknown-outcome protection remain in place. Fixture recommendations never rewrite native defaults. The strict evidence-based path without an automatic policy remains separate; host-internal patches stay paused.
|
|
238
|
-
|
|
239
|
-
| MCP tool | Purpose |
|
|
240
|
-
|---|---|
|
|
241
|
-
| `get_routing_capabilities` | Lists candidates, limits, provider, and Hook status without a paid API call |
|
|
242
|
-
| `recommend_agent` | Returns a direct recommendation for a task summary |
|
|
243
|
-
| `get_routing_precedence` | Explains preserved choices and unverified configuration sources for a call |
|
|
244
|
-
| `route_spawn_hook` | Selects defaults for eligible calls or passes advice only, according to the installed policy |
|
|
245
|
-
| `get_spawn_routing_observation` | Looks up one exact Hook invocation; never proves native execution |
|
|
246
|
-
| `prepare_spawn_context` | Registers a bounded description for one exact upcoming invocation |
|
|
247
|
-
| `cancel_spawn_context` | Revokes the description association, not native execution or a request already sent |
|
|
248
|
-
| `retry_spawn_recommendation` | Accepts one task-description supplement using a Hook-issued retry_id |
|
|
249
|
-
| `prepare_fresh_delegation` | Prepares a separate independent Codex call from completed inherited advice; never executes it |
|
|
250
|
-
|
|
251
|
-
### Confidence and abstention
|
|
252
|
-
|
|
253
|
-
`confidence` is metadata and has not been validated here as a calibrated probability of correctness. It is not currently used as an automatic-application threshold. Zero and low values are currently allowed when other application conditions hold. A missing value in a live Decisions response is rejected as an error; it remains optional in generic Router and stored results. `keep_current` and `needs_context` are separate outcomes with existing abstention and context-recovery rules. Explicit model, effort, history and permissions are preserved. A small classification pilot does not establish improved child-task quality or total cost.
|
|
254
|
-
|
|
255
|
-
<a id="budget-limits"></a>
|
|
256
|
-
|
|
257
|
-
### Budget limits and usage (0.1.8+)
|
|
258
|
-
|
|
259
|
-
Budget environment settings and usage status are supported from Aptly 0.1.8. `aptly set default` also fills missing budget environment settings for selected hosts. It adds no budget questionnaire, preserves existing values including explicit `0`, and does not reset usage, ledgers or caches. The existing transmission-scope question is separate. Existing registrations without budget variables also use the new runtime defaults after upgrade. The old implicit 20-call/50-call/$0.50 ceilings are not retained; configure any limits you require explicitly.
|
|
260
|
-
|
|
261
|
-
| Environment variable | Default | Meaning |
|
|
262
|
-
|---|---:|---|
|
|
263
|
-
| `APTLY_MAX_DAILY_CALLS` | `200` | Per-ledger UTC daily classification-attempt ceiling |
|
|
264
|
-
| `APTLY_MAX_TOTAL_CALLS` | `0` | Per-ledger cumulative attempt ceiling |
|
|
265
|
-
| `APTLY_MAX_ESTIMATED_USD` | `0` | Cumulative local reservation ceiling |
|
|
266
|
-
| `APTLY_ESTIMATED_CALL_USD` | `0.002` | Estimated dollars reserved for each new classification attempt |
|
|
267
|
-
|
|
268
|
-
Zero means unlimited for the three ceilings. The per-attempt reservation is a rate and must stay positive. Only literal `0` means unlimited; forms such as `0.0` and `0.00` are rejected. Unset uses defaults; empty, negative, malformed or exponent notation values are rejected. Calls use whole integers; money uses fixed decimal notation with at most six fractional digits. Maximum finite settings are 100,000 daily calls, 1,000,000 cumulative calls and 100 for monetary values. A finite cost ceiling must cover one reservation. Existing invalid settings are not silently overwritten.
|
|
269
|
-
|
|
270
|
-
```sh
|
|
271
|
-
aptly set env APTLY_MAX_DAILY_CALLS
|
|
272
|
-
aptly set env APTLY_MAX_TOTAL_CALLS
|
|
273
|
-
aptly set env APTLY_MAX_ESTIMATED_USD
|
|
274
|
-
aptly set env APTLY_ESTIMATED_CALL_USD
|
|
275
|
-
aptly budget status --client codex
|
|
276
|
-
aptly budget status --client claude
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
Setting commands support `--client codex|claude|all`, hidden input and explicit `--stdin`. Restart MCP after changes. Defaults also preserve existing Codex budget passthrough bindings in `env_vars` and Claude budget values observed in this CLI process environment, listed as `inherited`. Direct `recommend`/`capabilities` use the CLI process environment and do not automatically read host settings files. Status briefly holds the existing gate, so a concurrent request can receive temporary `ledger_locked`. Status is a snapshot of registration and permitted current environment settings, not verification of custom wrappers or the running host. It reads no keys, API or task text and creates no ledger or gate. Unlimited ceilings display `Unlimited` with `null` remaining. Sessions sharing a ledger share its budget; other ledgers and account-wide OpenAI usage are not aggregated.
|
|
280
|
-
|
|
281
|
-
`budget_exhausted` is local, not an OpenAI authentication or account-credit error. Direct/retry responses identify `budget_limit`; status lists `exhausted_by`. Reservations are not an actual billing cap and do not reset monthly. Changing the rate does not reprice past reservations; replacing a key or applying defaults does not refund them.
|
|
282
|
-
|
|
283
|
-
New pre-HTTP budget denials are not cached. Only verifiable known-unpaid legacy default-policy denials can be reevaluated with the same ID; completed recommendations, abstentions, context outcomes and `unknown` remain protected. Budget recovery does not extend the original five-minute retry reference or process lifetime and does not remove history or permission constraints. Arbitrary historical custom-policy digests are not guessed; do not bypass conflicts/unknowns with new IDs or ledger deletion.
|
|
284
|
-
|
|
285
|
-
<a id="execution-statistics"></a>
|
|
286
|
-
|
|
287
|
-
### Execution statistics (0.1.10 or later)
|
|
288
|
-
|
|
289
|
-
Execution statistics require Aptly 0.1.10 or later. Install a supported version or upgrade following [package updates](#package-updates), then use the examples below. An existing Aptly setup is required. Collection is initially POSIX-only; Windows collection is unsupported and normal Aptly use on Windows is unaffected.
|
|
290
|
-
|
|
291
|
-
```sh
|
|
292
|
-
aptly stats
|
|
293
|
-
aptly stats --today --client codex
|
|
294
|
-
aptly stats enable --client codex
|
|
295
|
-
aptly stats enable --client codex --codex-native-metadata
|
|
296
|
-
aptly stats disable --client codex
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
The command forms are `aptly stats [--today] [--client codex|claude|all]`, `aptly stats enable [--client] [--codex-native-metadata]` and `aptly stats disable [--client]`. Collection is off by default and postinstall does not enable it. Enable installs Aptly-owned command observers recorded separately in `stats-ownership.json`; it leaves the legacy receipt, MCP, launchers, keys, budget and transmission settings intact. Restart MCP and the host after enabling; for Codex, review native Hook trust in `/hooks`.
|
|
300
|
-
|
|
301
|
-
Disable turns collection off and removes only unchanged owned observers. Modified or custom observers are preserved with a warning; data and the key remain. `remove` validates and removes stats-owned definitions but keeps the data. Independently managed collectors and custom Hooks are not adopted automatically.
|
|
302
|
-
|
|
303
|
-
Private state uses `stats.sqlite`, `stats-config.json` and `stats-key` (an HMAC secret), separately from the budget ledger. Do not share the key. Records contain no task text, transcripts, raw IDs, paths, errors or credentials. Reading stats makes no API, key or credential-store calls, initializes nothing and runs no notifier.
|
|
304
|
-
|
|
305
|
-
The projection reports `model_match`, `model_mismatch`, `model_changed`, `unknown`, `pending`, `expired_pending` and `application_unconfirmed`; advisory is separate. `blocked`, `explicit_preserved` and `unbound` are excluded from denominators. Effective effort is never measured; configured effort is not actual effort. Claude aliases `haiku`, `sonnet`, `opus` and `fable` cannot be resolved to an actual canonical model and are `unknown`; only exact canonical models are supported, and observing a model does not guarantee all aliases match. These figures do not establish user acceptance or quality.
|
|
306
|
-
|
|
307
|
-
Direct advisory, retries and fresh unbound calls without native continuity are not joined by approximate timing. `--today` uses the UTC date when the binding was first created. Capacity is fixed at 10,000 delegations and 10,000 children, with no automatic pruning. Counts cover retained records, not lifetime totals; at capacity, new identities are dropped and the reached flag is set. Missing callbacks do not prove bypass. There are no token or cost rollups, live quota or savings figures.
|
|
308
|
-
|
|
309
|
-
Codex native metadata is off unless explicitly enabled. It reads SQLite native metadata by exact child ID only: no transcripts, repairs or app-server launch. Relocated `sqlite_home`, unsupported schemas or paths, and ambiguous joins yield unknown. A SQL read may update existing SHM read marks; it writes no rows or schema and does not intentionally create sidecars.
|
|
310
|
-
|
|
311
|
-
Collection is best effort: lost, delayed or capacity-dropped events can leave an incomplete model history. `model_match` means the retained evidence matches, not that every request used that model. Disabling Codex collection, removing setup or enabling without `--codex-native-metadata` revokes native metadata access. After changing the Node or package path, disable and re-enable collection to register current commands. An unavailable or corrupt store is preserved; review it locally rather than deleting the key or assuming zero usage.
|
|
312
|
-
|
|
313
|
-
<a id="outbound-data-and-disabling-automatic-sharing"></a>
|
|
314
|
-
|
|
315
|
-
### Decisions API transmission scope
|
|
316
|
-
|
|
317
|
-
The transmission commands in this section are supported from Aptly 0.1.7.
|
|
318
|
-
|
|
319
|
-
Transmission means **sending local task information to the OpenAI Decisions API**, not providing tasks to Aptly developers. Application mode `defaults/advisory` and transmission scope are independent. New registrations use v2 policy with `unselected` scope and make no automatic transmission. Interactive `aptly set default` asks only for unselected hosts; Enter selects `none`. Noninteractive runs and postinstall neither prompt nor count as consent.
|
|
320
|
-
|
|
321
|
-
```sh
|
|
322
|
-
aptly set transmission --show
|
|
323
|
-
aptly set transmission none
|
|
324
|
-
aptly set transmission description
|
|
325
|
-
aptly set transmission excerpt
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
The change commands above show alternatives; run only the one you want. Use `--client codex|claude|all` to select hosts. `none` disables automatic transmission and preserves the original call. `description` permits only a parent-supplied description. Without one, it requests context before calling the API and never falls back to native body or label. `defaults` denies the unresolved spawn; `advisory` supplies feedback only. `excerpt` permits existing native excerpts and explicit descriptions. Source, size and known-secret checks establish neither non-sensitive content nor user consent.
|
|
329
|
-
|
|
330
|
-
Existing v1 policies remain byte-identical and report `excerpt` with `legacy` provenance. An explicit change migrates the policy to v2 and updates its ownership receipt together. Modified policies and custom launchers are not silently adopted; conflicts preserve them. Keys, ledgers and unknown records are not deleted. Restart MCP after changes. Already-started transmission cannot be recalled; changed policy prevents in-flight results, retry and fresh preparation from applying. Do not bypass an old call-binding conflict with a new paid identity. Explicit `recommend_agent` and `aptly recommend` requests remain separate and are not prohibited by this automatic-transmission setting.
|
|
331
|
-
|
|
332
|
-
Manually setting `enabled: false` remains an emergency stop, but can conflict with ownership records. Use the commands above for normal changes and never edit ownership receipts to bypass checks.
|
|
333
|
-
|
|
334
|
-
### Outbound content and filtering limits
|
|
335
|
-
|
|
336
|
-
Under `excerpt` scope, Without prepared context, automatic classification `summary` is an **excerpt assembled from an accepted task label and the clipped first paragraph** of the body. It is not a semantic rewrite or anonymization. Its UTF-8 size is at most `min(4000, max_summary_bytes)`; this is not a limit on the whole HTTP request. The opaque-message fallback in Codex uses only a sufficiently descriptive `task_name`, without decoding or transmitting that body. Labels can also contain sensitive information.
|
|
337
|
-
|
|
338
|
-
A valid `prepare_spawn_context` description and fixed prefix replace the native excerpt for classification; registration itself makes no API call. After a needs-context response, `retry_spawn_recommendation` can classify one new supplement with a fixed prefix, without appending the earlier body. Both paths limit the raw description to `min(3800, max_summary_bytes - 96)` bytes and the prefixed summary to `min(4000, max_summary_bytes)` bytes. `prepare_fresh_delegation` itself reuses completed advice without another classification and returns standalone instructions as local next-call arguments. A Codex call submitted with the returned explicit model and effort is currently preserved by the Hook as `explicit_model`, without classification. Checking a later call does not imply another classification. None of these paths establishes that descriptions are non-sensitive or automatically anonymized.
|
|
339
|
-
|
|
340
|
-
Decisions receives `client`, `task.summary`, `task.operation`, `task.context_sufficient`, candidate profile IDs, model/effort descriptions, and configured model facts. The classification API key is sent in `Authorization`; the request ID is sent in `X-Client-Request-Id`. Automatic IDs are hashes; direct recommendation IDs are caller-supplied. Do not put secrets in IDs or candidate descriptions.
|
|
341
|
-
|
|
342
|
-
To disable automatic sharing, change **only `enabled` to `false`** in the existing private policy file referenced by `APTLY_HOOK_POLICY_PATH`. Preserve the other fields and ownership record. Subsequent automatic Hook calls preserve the original call before classification or creation of a call-binding file. This cannot undo a transmission already started or recall information received by the server. Editing a generated policy can cause ownership conflicts in setup, configuration, or removal commands; those commands do not overwrite the disabled policy. Do not edit ownership records to bypass the checks.
|
|
343
|
-
|
|
344
|
-
When the transmission scope permits it, `mode: advisory` still transmits classification data; it is not a privacy opt-out. Removing `APTLY_HOOK_POLICY_PATH` can activate the older strict path, so do not use removal as an alternative. `enabled: false` does not block explicit `recommend_agent` or `aptly recommend` requests.
|
|
345
|
-
|
|
346
|
-
For control over the shared summary, disable automatic sharing and write only the information needed for a direct recommendation. Aptly does not automatically fetch documents at URLs or attach source files mentioned in the summary. Checks for known key and Bearer patterns do not provide complete secret detection or establish that text is safe to transmit.
|
|
347
|
-
|
|
348
|
-
The ledger and Hook bindings store request metadata, hashes, and cached results, not task excerpts. Aptly diagnostics also exclude raw task text. The local Hook's `updatedInput` retains the original task so the host can continue execution. Aptly does not control the host's own transcript or log retention.
|
|
349
|
-
|
|
350
|
-
### Explicit description for opaque spawns (0.1.4+)
|
|
351
|
-
|
|
352
|
-
An integration that knows the real upcoming session/call IDs and exact original event can call `prepare_spawn_context({client, event, description})` on the same MCP process before the Hook. Describe purpose, scope, expected output, constraints and complexity; URLs alone do not fetch content. Only the bounded description and fixed prefix replace the task excerpt, not history, files or the opaque body. `cancel_spawn_context({client, event})` revokes it. Registration needs enabled automatic policy; `enabled: false` prevents sharing. Known-secret filters are incomplete.
|
|
353
|
-
|
|
354
|
-
Associations last five minutes, are immutable, and are limited to 128 per process. Changed, expired or cancelled associations block routing; an already evaluated call cannot acquire a richer-summary retry or new paid identity. A caller unable to obtain the actual upcoming event cannot use this handoff; shipped Hooks do not create descriptions or call IDs. Local `insufficient_context`, provider `provider_needs_context`, and native `inherited_context_application_unverified` are distinct. The [handoff contract](../SPAWN_CONTEXT.md) records a bounded native description-handoff check. It does not establish automatic description production or execution of the recommended model.
|
|
355
|
-
|
|
356
|
-
### Retry with additional context (0.1.5+)
|
|
357
|
-
|
|
358
|
-
When the automatic Hook returns `insufficient_context` or `provider_needs_context`, it provides a `retry_id` and recovery instructions. In `defaults` mode it denies that spawn; in `advisory` mode it only supplies feedback. The parent should describe purpose, scope, expected output and complexity using context it already has, then call `retry_spawn_recommendation({retry_id, description})` on the same MCP process within five minutes. No future native call ID is needed. Ask the user only for genuinely missing information.
|
|
359
|
-
|
|
360
|
-
One supplement is allowed per original call. Duplicate input reuses the cache; changed descriptions conflict. Stop if the retry still needs context or fails; never replace an uncertain paid request with a new ID. If `spawn_application` is `blocked`, report the constraint without applying the profile. Otherwise the parent must preserve explicit choices, history, roles and permissions when passing only unspecified model/effort to a new compatible native call. The Hook does not itself perform the parent's retry or native execution. The original `prepare_spawn_context` association stays immutable. See the [limits, costs and validation contract](../SPAWN_CONTEXT.md#one-context-supplement-after-a-hook-response).
|
|
361
|
-
|
|
362
|
-
The retry response includes `next_call.set_if_unspecified` with concrete fields for the next native call. It excludes already specified model/effort fields and never adds Claude effort. Blocked history/application results omit `next_call`. These fields are neither execution evidence nor permission approval.
|
|
363
|
-
|
|
364
|
-
Cache reuse requires a completed first result. An unknown outcome remains `outcome_unknown`; do not repeat a paid call with a new ID.
|
|
365
|
-
|
|
366
|
-
`context_retry_allowed: false` ends further context supplementation. For a compatible recommendation, `caller_review_required` means the parent reviews arguments; it does not request new user approval. Existing delegation authorization and host permission checks still apply.
|
|
367
|
-
|
|
368
|
-
### Automatic routing guarantees and blocked outcomes (0.1.5+)
|
|
369
|
-
|
|
370
|
-
The guarantee covers supported calls handled by an enabled, trusted Hook on a connected MCP process. Check `get_routing_capabilities.automatic_hook.guarantee` for this scope. The server cannot detect or enforce an absent, untrusted, disconnected or host-failed Hook; the host controls fallback. MCP connection status alone is not per-call routing evidence.
|
|
371
|
-
|
|
372
|
-
After a valid enabled policy and eligible call are established, `defaults` returns a deny decision and a safe reason for incompatible application, budget exhaustion, classification failure or unknown outcomes. Original arguments and constraints remain intact, but that spawn does not proceed. For unverified inherited history, report the constraint instead of silently running parent defaults or switching to `none`. `advisory` describes the limit without blocking. Missing/disabled policy, explicit tuples, fixed roles and resume remain intentional local preservation paths rather than blanket denials.
|
|
373
|
-
|
|
374
|
-
With a recovery ID, use `get_spawn_routing_observation({retry_id})` on the same MCP process, or use the existing `{client, event}` form. Mixed or partial forms are rejected. Original `awaiting_context` and `context_retry.outcome` are separate stages; rejected duplicates appear under `last_attempt` without replacing an earlier classification outcome. Lookups incur no paid request and do not renew retention. Execution always remains `not_observed`; neither advice nor argument updates establish actual child execution.
|
|
375
|
-
|
|
376
|
-
### Prepare a separate independent delegation (0.1.6+)
|
|
377
|
-
|
|
378
|
-
After a defaults Hook blocks inherited application, the caller may use `prepare_fresh_delegation` only when it can declare **the same independent task, no user-required inherited history, and complete standalone instructions**. Supply the Hook/retry `retry_id`, `task_name`, `standalone_task`, and `declaration: {independent_task:true, same_task:true, original_call_outcome:"blocked", history_requirement:"not_required", standalone_context_complete:true}` on the same process. It revalidates completed allowlisted advice without another classification.
|
|
379
|
-
|
|
380
|
-
The original inherited invocation stays blocked. Review the separate `next_call.arguments` and submit it under existing delegation authorization and normal host permission checks. It includes `fork_turns: "none"` and preserves model/effort choices. This is caller-declared intent, not verified user intent or execution evidence. Do not use it for required/unknown history, fixed roles, resume or unverified additional execution arguments. A reference binds one task; five-minute expiry, cancellation, policy/catalog changes and changes to the original invocation block preparation. It is not offered for nonblocking advisory paths. See the [contract and limits](../SPAWN_CONTEXT.md#intentional-fresh-delegation).
|
|
381
|
-
|
|
382
|
-
Use this only after the host reports the original call blocked. `original_call_outcome` values `executed` and `unknown` reject preparation. This is caller-declared, not server execution observation. Repeated identical preparation does not guarantee single child execution. The profile was selected from the original classification summary and must not be reused for a different task.
|
|
383
|
-
|
|
384
|
-
## Direct recommendations
|
|
385
|
-
|
|
386
|
-
The `recommend_agent` MCP tool and CLI `recommend` accept a task summary and recommend a profile. They do not spawn subagents. Pass this JSON as MCP tool arguments, or save it to a file and provide it to the CLI through standard input.
|
|
387
|
-
|
|
388
|
-
```json
|
|
389
|
-
{
|
|
390
|
-
"request_id": "demo-codex-sort-001",
|
|
391
|
-
"client": "codex",
|
|
392
|
-
"task": {
|
|
393
|
-
"summary": "Sort the supplied numbers [3, 1, 2] into ascending order. No files or network are needed.",
|
|
394
|
-
"operation": "analysis",
|
|
395
|
-
"context_sufficient": true
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
```sh
|
|
401
|
-
ROUTER_PROVIDER=fixture aptly recommend < request.json
|
|
402
|
-
aptly capabilities
|
|
403
|
-
aptly config codex
|
|
404
|
-
aptly config claude
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
Fixture returns test results generated by local rules without a key, network access, or subagent execution. These are not actual Decisions judgments or quality-test results. `config` only prints a manual MCP registration fragment; `setup` changes configuration. For actual API use, prepare the key, provider, and private ledger described above.
|
|
408
|
-
|
|
409
|
-
`task.operation` is one of `read_only`, `write`, `review`, or `analysis`. `context_sufficient` means the caller has provided the summary needed for the task; it does not verify host settings. Omitting `eligible_profile_ids` uses the active catalog for that client; specifying it narrows candidates within that catalog.
|
|
410
|
-
|
|
411
|
-
If any of `model_pinned`, `effort_pinned`, `role_pinned`, or `fork_inherits` in `constraints` is true, the existing selection is preserved. Omitting these means no preservation constraints were declared for this planning request. It does not certify that the actual host has no pins. Do not use `provenance_verified` in new requests.
|
|
412
|
-
|
|
413
|
-
| status | Next action |
|
|
414
|
-
|---|---|
|
|
415
|
-
| `recommended` | Review `profile` and decide separately whether to execute it in the existing host |
|
|
416
|
-
| `keep_current` | Preserve the explicit selection or defer the recommendation |
|
|
417
|
-
| `needs_context` | Supply the necessary summary details |
|
|
418
|
-
| `unavailable` | Check the predefined `reason` code. Do not automatically retry a paid request with an unknown outcome under a new ID |
|
|
419
|
-
|
|
420
|
-
The direct recommendation's `application: advisory_only` does not verify host settings or model access, or authorize execution. To retrieve a completed result again, keep the same ID, input, policy, and ledger. `unknown` means the outcome is uncertain; do not blindly retry with a new ID. A new request whose input has changed because context was added uses a different ID.
|
|
421
|
-
|
|
422
|
-
## Models and environment variables
|
|
423
|
-
|
|
424
|
-
There are six default profiles. Tiers are Aptly operational presets, not statements that the two providers' models have equivalent capabilities.
|
|
425
|
-
|
|
426
|
-
| Tier | Claude Code | Codex | Typical tasks |
|
|
427
|
-
|---|---|---|---|
|
|
428
|
-
| simple | `haiku` | `gpt-6-luna` / `max` | Extraction, format conversion, or small mechanical edits |
|
|
429
|
-
| routine | `sonnet` | `gpt-6.1-terra` / `high` | Context-aware writing or translation, or clearly scoped implementation |
|
|
430
|
-
| deep | `opus` | `gpt-6.1-sol` / `medium` | Cross-component debugging, architectural judgment, or in-depth review |
|
|
431
|
-
|
|
432
|
-
MCP `env` values are strings, so candidate arrays must also be passed as JSON strings.
|
|
433
|
-
|
|
434
|
-
```json
|
|
435
|
-
{
|
|
436
|
-
"env": {
|
|
437
|
-
"APTLY_CLAUDE_MODELS": "[\"haiku\", \"sonnet\", \"opus\"]",
|
|
438
|
-
"APTLY_CODEX_MODELS": "[\"gpt-6-luna\", \"gpt-6.1-terra\", \"gpt-6.1-sol\"]"
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
When unset, the defaults above apply; `[]` disables recommendations for that client. Empty strings, duplicates, unsupported models, and malformed JSON are errors. `CLAUDE_MODELS` and `CODEX_MODELS` are supported aliases, but setting both the primary name and its alias for the same provider is an error. Candidate configuration does not override existing choices or certify model access for an account.
|
|
444
|
-
|
|
445
|
-
### Official descriptions and caching
|
|
446
|
-
|
|
447
|
-
Decisions choices include the model name, Codex effort, official characteristics, and task-tier descriptions. Bundled descriptions are available at startup; documentation is not fetched on every recommendation. Refresh explicitly to incorporate the latest official Markdown. First create a private directory you own for the output file.
|
|
448
|
-
|
|
449
|
-
```sh
|
|
450
|
-
mkdir -m 700 /absolute/private-aptly-state
|
|
451
|
-
aptly catalog refresh --output /absolute/private-aptly-state/model-info.json
|
|
452
|
-
export APTLY_MODEL_INFO_PATH=/absolute/private-aptly-state/model-info.json
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
Refresh only reads the fixed [Claude model documentation](https://code.claude.com/docs/en/model-config.md) and [OpenAI model documentation](https://learn.chatgpt.com/docs/models.md), and requires no API key. It stores short, normalized model information and preserves the existing file on failure. The cache is read at startup; an invalid cache or one older than 7 days falls back to bundled descriptions. Restart MCP after refreshing. New models appearing in documentation are not automatically added to candidates, and account access is not certified.
|
|
456
|
-
|
|
457
|
-
## Providing context
|
|
458
|
-
|
|
459
|
-
When Codex passes a subagent `message` to the Hook as ciphertext, Aptly does not read or decrypt its body. It uses only a sufficiently descriptive plaintext `task_name` as a summary. Describe the task and its scope, for example `sort_supplied_numbers_3_1_2_ascending_without_tools`. Unsupported or ambiguous task names preserve the original model. Claude Code calls and calls that expose a plaintext body use a summary of the provided body.
|
|
460
|
-
|
|
461
|
-
Use `get_spawn_routing_observation` with the same `client` and exact original Hook `event` to query one invocation. It returns a redacted correlation ID, preflight, classification/cache outcome, recommendation, argument-update or blocked application, and `execution: not_observed`. `arguments_updated` only describes emitted Hook arguments, never an observed child model. Records are limited to 128 calls and 10 minutes in this MCP process; `not_observed` can also mean another process, restart, expiry, eviction or mismatched input. It does not prove global Hook bypass. The process-wide `automatic_hook.last_result` is removed. No raw task, path, session ID or credential is returned.
|
|
462
|
-
|
|
463
|
-
For direct recommendations, you can include repository and file URLs alongside a summary of the scope, size, and constraints derived from reading the documents. Sending a URL string differs from providing document contents. Aptly's classification request code does not fetch repository URLs or retrieve their contents. The caller performs any required retrieval and summarization.
|
|
464
|
-
|
|
465
|
-
The current automatic Hook has no field for passing a URL separately as plaintext. Do not assume that adding a URL to an encrypted `message` forwards it for classification. Direct MCP recommendation followed by passing the profile as native arguments is distinct from automatic Hook application.
|
|
466
|
-
|
|
467
|
-
## Cost benchmark
|
|
468
|
-
|
|
469
|
-
On 2026-11-05, the [English session-peer README](https://github.com/abruption/session-peer/blob/6e9efda7588e1df638748eeb7ad1b2707e0a3bf4/README.md) was used as the canonical source for reviewing its [Korean translation](https://github.com/abruption/session-peer/blob/6e9efda7588e1df638748eeb7ad1b2707e0a3bf4/README.ko.md). Each run received the same documents, totaling 17,964 bytes, and the same instructions to produce six suggested edits. The original files were not changed.
|
|
470
|
-
|
|
471
|
-
All three automatic Hook trials supplied with only the task name abstained with `needs_context`. Three `recommend_agent` requests with repository/file URLs, and three with URLs plus a document summary, all recommended Terra/high. The per-run averages below compare three actual Terra/high runs using the URL-plus-summary condition with the three immediately preceding Sol/high runs.
|
|
472
|
-
|
|
473
|
-
| Standard API cost conversion | Sol/high | Terra/high + classification | Reduction |
|
|
474
|
-
|---|---:|---:|---:|
|
|
475
|
-
| Observed cache usage included | $0.03229 | $0.01354 | 58.05% |
|
|
476
|
-
| All input priced as uncached | $0.11254 | $0.05363 | 52.35% |
|
|
477
|
-
|
|
478
|
-
These are USD conversions of measured native tokens at the [official Standard API rates](https://developers.openai.com/api/docs/pricing). They are not actual subscription invoices or measured quota deductions. The Terra figures include the [Decisions classification cost](https://developers.openai.com/api/docs/guides/decisions), $0.0000756 per run. The comparison covers the reviewing subagent and classification; document retrieval, context preparation, and main-agent research costs are excluded.
|
|
479
|
-
|
|
480
|
-
The measured workflow was **explicit MCP recommendation → native execution with the recommended profile passed as arguments**. It did not test automatic Hook URL retrieval or forwarding. The prior benchmark was reused as the control, with three samples per condition. Full-document reads, matching source quotes, and output structure were checked, but the results do not establish equal quality, statistical significance, or savings for other tasks.
|
|
481
|
-
|
|
482
|
-
### Interrupted processes and ledger locks
|
|
483
|
-
|
|
484
|
-
This locking design requires Aptly `0.1.2` or later and is not included in npm `0.1.1`. The JSON ledger keeps its request IDs, `unknown` records, completed cache, call counts, and reserved costs. Only persistent ledgers use Node.js 24's built-in SQLite. The adjacent `ledger.json.lock` remains after a normal exit; its presence alone does not mean an active lock. With the new design, process exit releases the OS lock so a later request can use the same ledger. It does not retry an existing uncertain ID or refund reserved costs.
|
|
485
|
-
|
|
486
|
-
Keep the ledger and lock in a private directory on a local filesystem that supports hard links, and use one canonical path for each ledger. Network shares, cloud-synced directories, and path aliases are outside the supported scope. Do not delete or replace the new lock or SQLite journal, or open them with another database tool while in use. Age and PID alone do not establish that an owner has exited.
|
|
487
|
-
|
|
488
|
-
An old empty `.lock` cannot establish whether its owner is still alive, so it is never initialized or removed automatically. Stop every relevant host, MCP process, and ledger-accessing process, including older versions, and upgrade all writers. Only after confirming that the file belongs to the legacy locking design may you quarantine that file and restart against the same JSON ledger path. Do not reset or delete the ledger, `unknown` records, costs, or completed results. If ownership or format is uncertain, leave access blocked and investigate.
|
|
489
|
-
|
|
490
|
-
## Diagnostics and development
|
|
491
|
-
|
|
492
|
-
```sh
|
|
493
|
-
aptly report --format both --output-dir reports
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
`report` creates private Markdown and JSON files with the same ID. Review them before sharing manually; they are not uploaded automatically. Do not include keys, personal paths, environment values, task bodies, or raw errors in attachments. A report does not establish successful API authentication or verification of the host's full configuration.
|
|
497
|
-
|
|
498
|
-
Use the following commands in a source checkout. Distinguish their paths from the installed CLI examples above.
|
|
499
|
-
|
|
500
|
-
```sh
|
|
501
|
-
npm ci --ignore-scripts --no-audit --no-fund
|
|
502
|
-
npm run typecheck
|
|
503
|
-
npm run build
|
|
504
|
-
ROUTER_PROVIDER=fixture node bin/aptly.ts recommend < examples/recommend.codex.json
|
|
505
|
-
ROUTER_PROVIDER=fixture node bin/aptly.ts recommend < examples/recommend.claude.json
|
|
506
|
-
npm test
|
|
507
|
-
npm run poc
|
|
508
|
-
npm run check:release
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
Default regression tests and fixture smoke tests run without paid APIs or actual subagents. Release checks inspect public files, private-data patterns, and the npm file allowlist; they do not publish or push to Git. The ledger supports completed-result reuse, prevention of retries for unknown outcomes, and guards on calls, latency, and estimated cost. It is not an actual billing cap.
|
|
512
|
-
|
|
513
|
-
Design notes, historical validation, and development history remain in other source-checkout documents. This multilingual guide is the reference for installation and everyday use; it does not turn historical research claims or unimplemented plans into current features.
|
|
9
|
+
For a first setup, read **Installation → Configuration → Automatic recommendations**.
|
|
10
|
+
|
|
11
|
+
## Topics
|
|
12
|
+
|
|
13
|
+
- [Installation and updates](en/installation.md)
|
|
14
|
+
- [Configuration and model candidates](en/configuration.md)
|
|
15
|
+
- [Automatic recommendations](en/routing.md)
|
|
16
|
+
- [Decisions API transmission](en/transmission.md)
|
|
17
|
+
- [Budget limits](en/budget.md)
|
|
18
|
+
- [Execution statistics](en/statistics.md)
|
|
19
|
+
- [Troubleshooting](en/troubleshooting.md)
|
|
20
|
+
- [Advanced MCP integration and development](en/advanced.md)
|
|
21
|
+
- [Measured costs](en/benchmarks.md)
|
|
22
|
+
|
|
23
|
+
## Previous links
|
|
24
|
+
|
|
25
|
+
Existing bookmark anchors remain available. Select an entry to open its section in the new topic page. This documentation move does not require setup or key re-entry.
|
|
26
|
+
|
|
27
|
+
<a id="installation"></a>
|
|
28
|
+
- [Installation](en/installation.md#guide-installation)
|
|
29
|
+
<a id="npm-install-script-approval"></a>
|
|
30
|
+
- [npm install-script approval](en/installation.md#guide-npm-install-scripts)
|
|
31
|
+
<a id="package-updates"></a>
|
|
32
|
+
- [Package updates](en/installation.md#guide-package-updates)
|
|
33
|
+
<a id="new-version-notifications"></a>
|
|
34
|
+
- [New-version notifications](en/installation.md#guide-version-notifications)
|
|
35
|
+
<a id="command-help-018"></a><a id="command-help"></a>
|
|
36
|
+
- [Command help (0.1.8+)](en/installation.md#guide-command-help)
|
|
37
|
+
<a id="configure-with-the-cli"></a>
|
|
38
|
+
- [Configure with the CLI](en/configuration.md#guide-cli-configuration)
|
|
39
|
+
<a id="recover-an-incompatible-launcher"></a>
|
|
40
|
+
- [Recover an incompatible launcher](en/troubleshooting.md#guide-launcher-recovery)
|
|
41
|
+
<a id="keys-and-restarting"></a>
|
|
42
|
+
- [Keys and restarting](en/configuration.md#guide-keys-and-restart)
|
|
43
|
+
<a id="mcp-environment-setup-step-by-step"></a>
|
|
44
|
+
- [MCP environment setup, step by step](en/advanced.md#guide-manual-mcp-setup)
|
|
45
|
+
<a id="configuration-file-locations"></a>
|
|
46
|
+
- [Configuration file locations](en/configuration.md#guide-host-config-locations)
|
|
47
|
+
<a id="passing-the-api-key"></a>
|
|
48
|
+
- [Passing the API key](en/advanced.md#guide-key-environment)
|
|
49
|
+
<a id="codex-example"></a>
|
|
50
|
+
- [Codex example](en/advanced.md#guide-codex-configuration)
|
|
51
|
+
<a id="claude-code-example"></a>
|
|
52
|
+
- [Claude Code example](en/advanced.md#guide-claude-configuration)
|
|
53
|
+
<a id="skipping-registration-and-removing-it"></a>
|
|
54
|
+
- [Skipping registration and removing it](en/installation.md#guide-skip-and-remove)
|
|
55
|
+
<a id="automatic-hook"></a>
|
|
56
|
+
- [Automatic Hook](en/routing.md#guide-automatic-routing)
|
|
57
|
+
<a id="confidence-and-abstention"></a>
|
|
58
|
+
- [Confidence and abstention](en/routing.md#guide-confidence-and-abstention)
|
|
59
|
+
<a id="budget-limits-and-usage-018"></a><a id="budget-limits"></a>
|
|
60
|
+
- [Budget limits and usage (0.1.8+)](en/budget.md#guide-budget-limits)
|
|
61
|
+
<a id="execution-statistics-0110-or-later"></a><a id="execution-statistics"></a>
|
|
62
|
+
- [Execution statistics (0.1.10 or later)](en/statistics.md#guide-execution-statistics)
|
|
63
|
+
<a id="decisions-api-transmission-scope"></a><a id="outbound-data-and-disabling-automatic-sharing"></a>
|
|
64
|
+
- [Decisions API transmission scope](en/transmission.md#guide-transmission-scope)
|
|
65
|
+
<a id="outbound-content-and-filtering-limits"></a>
|
|
66
|
+
- [Outbound content and filtering limits](en/transmission.md#guide-transmission-limits)
|
|
67
|
+
<a id="explicit-description-for-opaque-spawns-014"></a>
|
|
68
|
+
- [Explicit description for opaque spawns (0.1.4+)](en/advanced.md#guide-explicit-spawn-context)
|
|
69
|
+
<a id="retry-with-additional-context-015"></a>
|
|
70
|
+
- [Retry with additional context (0.1.5+)](en/advanced.md#guide-context-retry)
|
|
71
|
+
<a id="automatic-routing-guarantees-and-blocked-outcomes-015"></a>
|
|
72
|
+
- [Automatic routing guarantees and blocked outcomes (0.1.5+)](en/routing.md#guide-routing-guarantees)
|
|
73
|
+
<a id="prepare-a-separate-independent-delegation-016"></a>
|
|
74
|
+
- [Prepare a separate independent delegation (0.1.6+)](en/advanced.md#guide-fresh-delegation)
|
|
75
|
+
<a id="direct-recommendations"></a>
|
|
76
|
+
- [Direct recommendations](en/advanced.md#guide-direct-recommendations)
|
|
77
|
+
<a id="models-and-environment-variables"></a>
|
|
78
|
+
- [Models and environment variables](en/configuration.md#guide-models-and-environment)
|
|
79
|
+
<a id="official-descriptions-and-caching"></a>
|
|
80
|
+
- [Official descriptions and caching](en/advanced.md#guide-model-info-cache)
|
|
81
|
+
<a id="providing-context"></a>
|
|
82
|
+
- [Providing context](en/advanced.md#guide-context-delivery)
|
|
83
|
+
<a id="cost-benchmark"></a>
|
|
84
|
+
- [Cost benchmark](en/benchmarks.md#guide-cost-benchmarks)
|
|
85
|
+
<a id="interrupted-processes-and-ledger-locks"></a>
|
|
86
|
+
- [Interrupted processes and ledger locks](en/troubleshooting.md#guide-ledger-lock-recovery)
|
|
87
|
+
<a id="diagnostics-and-development"></a>
|
|
88
|
+
- [Diagnostics and development](en/advanced.md#guide-diagnostics-and-development)
|