ytdb-slate 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +222 -105
- package/docs/blast-radius.md +460 -0
- package/docs/context-budget.md +207 -261
- package/docs/delivery-packages.md +177 -0
- package/docs/design-principles.md +93 -90
- package/docs/model-routing.md +401 -773
- package/docs/pr-publishing.md +134 -44
- package/docs/review-rules.md +500 -226
- package/docs/track-workflow.md +667 -326
- package/docs/user-notes.md +206 -0
- package/docs/writing-guidance.md +193 -157
- package/extension/artifact-names.ts +3 -6
- package/extension/base-model.ts +15 -5
- package/extension/config.ts +79 -0
- package/extension/episodes.ts +368 -333
- package/extension/failover.ts +191 -312
- package/extension/handoff.ts +115 -79
- package/extension/index.ts +82 -174
- package/extension/logical-model-adapters.ts +302 -0
- package/extension/logical-model-definitions.ts +121 -0
- package/extension/logical-model-recovery.ts +296 -0
- package/extension/logical-model-render.ts +131 -0
- package/extension/logical-model-resolver.ts +256 -0
- package/extension/logical-model-runtime.ts +251 -0
- package/extension/mode.ts +288 -389
- package/extension/model-default.ts +6 -8
- package/extension/notify.ts +2 -2
- package/extension/observations.ts +104 -15
- package/extension/paths.ts +4 -1
- package/extension/prompt-docs.ts +2 -2
- package/extension/render.ts +12 -26
- package/extension/request-throttle.ts +362 -0
- package/extension/slate-files.ts +1 -1
- package/extension/state.ts +209 -300
- package/extension/threads.ts +896 -1402
- package/extension/tools.ts +65 -152
- package/extension/worker-extensions.ts +137 -36
- package/extension/worker-reminder.ts +61 -0
- package/extension/worker.ts +453 -45
- package/extension/writing-check.mjs +46 -24
- package/extension/writing-reminder.ts +122 -54
- package/extension/writing.ts +215 -62
- package/package.json +6 -6
- package/docs/model-failover.md +0 -242
- package/docs/thread-cache-cost.md +0 -223
- package/extension/model-profiles.ts +0 -967
- package/extension/model-router.ts +0 -1168
- package/extension/route.ts +0 -1294
- package/extension/thread-choice.ts +0 -1207
package/README.md
CHANGED
|
@@ -1,147 +1,246 @@
|
|
|
1
|
-
# ytdb-slate
|
|
1
|
+
# ytdb-slate: Agent orchestration for the pi coding agent
|
|
2
2
|
|
|
3
3
|
[](https://github.com/JetBrains/ytdb-slate/actions/workflows/ci.yml)
|
|
4
4
|
|
|
5
|
-
Slate is a thread-weaving orchestration extension for the [pi coding agent](https://pi.dev).
|
|
5
|
+
**Slate is a thread-weaving orchestration extension for the [pi coding agent](https://pi.dev).** It helps you guide long coding tasks while focused worker sessions research, implement, and review bounded parts of the work.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
You stay in the main session and decide what to build. Slate manages context, delegates actions, preserves useful results, and applies a risk-based development workflow.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- [Start using Slate](#start-using-slate)
|
|
10
|
+
- [Understand how Slate works](#how-slate-works)
|
|
11
|
+
- [See the roadmap](#where-slate-is-going)
|
|
12
|
+
- [Configure Slate](#configuration)
|
|
13
|
+
- [Read the safety boundaries](#safety-and-trust)
|
|
14
|
+
- [Open the complete reference](#shipped-docs)
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
## Start using Slate
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
You need an installed and authenticated [pi coding agent](https://pi.dev/docs/latest/quickstart). From your project directory, install a pinned Slate version into the project:
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
| Decomposition | none | none | direct tree | REPL functions | task-based | subagent delegation | implicit |
|
|
19
|
-
| Synchronization | single thread | single thread | gated steps | REPL return | reduce & return | message passing | episodes |
|
|
20
|
-
| Intermediate feedback | per step | per step | on task failure | on execution end | after compress | message passing | per episode |
|
|
21
|
-
| Context isolation | none | none | per subtask | per subcall | subagent | subagent | per thread |
|
|
22
|
-
| Context compaction | none | none | task-based | REPL slicing | subagent compress | compaction | episode compress |
|
|
23
|
-
| Parallel execution | none | none | none | in REPL | Altera only | native | native |
|
|
24
|
-
| Expressivity | high | high | low | high | medium | medium | high |
|
|
25
|
-
| Adaptability | yes | if plan updated | no | limited — no mid-run course correction | yes | limited by message passing | yes |
|
|
20
|
+
```bash
|
|
21
|
+
pi install -l npm:ytdb-slate@<version>
|
|
22
|
+
```
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
The `-l` option records the package in `.pi/settings.json`. Pi may ask you to trust the project before it loads project settings and extensions.
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
Pinned package specifications such as `@<version>` are deliberately skipped by `pi update --extensions` and `pi update --all`. Moving the pin is a conscious project change. Review Slate's shipped workflow documents before you update it.
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
- **Compaction at a chosen boundary.** Compression happens at a predictable point — action completion — instead of mid-stream when context overflows. The compression itself is still LLM-performed and lossy, but the boundary is chosen, not forced.
|
|
33
|
-
- **Episodes compose.** One thread's episode can seed another thread's context, so conclusions travel across the system by reference. Subagents pass back a single response string; episodes are durable, structured, reusable records.
|
|
28
|
+
Start a new interactive pi session, then turn on orchestrator mode:
|
|
34
29
|
|
|
35
|
-
|
|
30
|
+
```text
|
|
31
|
+
/slate on
|
|
32
|
+
```
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
Try a request that gives Slate a clear outcome and leaves planning open:
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
```text
|
|
37
|
+
Add input validation to the account settings endpoint. First research the relevant code and tests. Show me the proposed tracks and risks before implementation.
|
|
38
|
+
```
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
2. **User design review** — the user approves the design direction before any machine review.
|
|
43
|
-
3. **Adversarial review** — a fresh-context reviewer attacks the design pre-implementation; findings are triaged with the user.
|
|
44
|
-
4. **Track split approval** — the user approves how the change splits into independently reviewable tracks.
|
|
45
|
-
5. **Per-track loop** — implement → agent code review → fixes → mandatory user review → marker commit (an empty commit marking the track's boundary in history).
|
|
46
|
-
6. **Delivery** — with draft-PR publishing enabled, the squash-merge is performed by the user; the agent never merges. With it disabled (the default), the change lands as a squashed commit that carries the workflow log's key content in its message.
|
|
40
|
+
Slate will ask for required decisions before it edits code. It will delegate implementation work to worker threads after the workflow gates allow that work.
|
|
47
41
|
|
|
48
|
-
|
|
42
|
+
To leave orchestrator mode, run `/slate off`. Running `/slate` with no argument toggles the mode. See [Everyday commands](#everyday-commands) for handoff, resume, and routing commands.
|
|
49
43
|
|
|
50
|
-
|
|
44
|
+
## How Slate works
|
|
51
45
|
|
|
52
|
-
|
|
46
|
+
Slate uses four terms throughout this README:
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
- **Main session:** the interactive pi session where you set goals, answer questions, and review results. In orchestrator mode, this session acts as the **orchestrator**.
|
|
49
|
+
- **Bounded action:** one focused unit of work with a clear limit and expected result.
|
|
50
|
+
- **Worker thread:** a new isolated pi session that performs one bounded action. A follow-up action uses another new worker thread.
|
|
51
|
+
- **Episode:** a durable, structured summary of one worker action. It retains intent, actions, findings, artifacts, open issues, and handoff notes.
|
|
55
52
|
|
|
56
|
-
|
|
53
|
+
The orchestrator dispatches bounded actions and adapts after each episode. A large language model compresses successful work and failed partial work into the episode. A failure without a worker response uses a fixed episode and no compression call.
|
|
57
54
|
|
|
58
|
-
|
|
55
|
+
Later actions can receive earlier episode identifiers through `context`. Slate loads those episodes into the new worker prompt. The main session can therefore compose prior results without re-reading every raw worker transcript.
|
|
59
56
|
|
|
60
|
-
|
|
57
|
+
### What Slate adds
|
|
61
58
|
|
|
62
|
-
|
|
59
|
+
- **Context isolation.** Each worker receives the context for one action instead of the full history of the main session.
|
|
60
|
+
- **Compaction at an action boundary.** Compression happens when the action ends. Compression remains model-performed and lossy, but the boundary is deliberate rather than forced by a full context window.
|
|
61
|
+
- **Adaptive planning.** Control returns to the orchestrator after each episode. New evidence can change the next action.
|
|
62
|
+
- **Composable results.** Episodes are durable records that later worker threads can use by reference.
|
|
63
|
+
- **Parallel work.** Independent bounded actions can run in parallel while each action keeps its own worker context.
|
|
64
|
+
- **Risk-based review.** User-approved risk proofs select workflow gates and agent reviewers instead of applying every review to every change.
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
Slate follows the thread-weaving architecture introduced by the Random Labs technical report for its `@randomlabs/slate` agent. ytdb-slate is an independent implementation of that architecture for pi.
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
The full rationale is in [`docs/design-principles.md`](docs/design-principles.md). If this summary and that document disagree, the document wins.
|
|
67
69
|
|
|
68
|
-
|
|
70
|
+
## Where Slate is going
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
> **Planned work:** The two priorities below describe future changes. They are not current Slate features.
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
Spend more time deciding what to build, and less time checking code or managing agents. We are working toward that goal with two priorities:
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
1. **Guide changes through design, not code.** Review the design without having to read the code yourself. We plan to add design documents at several levels, from system goals to component details, and keep them updated as work progresses. Agents will still review code quality and check that changes follow your approved design.
|
|
77
|
+
Follow [#361](https://github.com/JetBrains/ytdb-slate/issues/361), [#402](https://github.com/JetBrains/ytdb-slate/issues/402), [#403](https://github.com/JetBrains/ytdb-slate/issues/403), and [#404](https://github.com/JetBrains/ytdb-slate/issues/404).
|
|
75
78
|
|
|
76
|
-
|
|
79
|
+
2. **Keep working while agents run.** Asynchronous threads will let the main session continue without waiting for each result. A redesigned terminal interface will make it easier to follow and control their work. Clear, accurate usage and cost reports will show where your resources go.
|
|
80
|
+
Follow [#269](https://github.com/JetBrains/ytdb-slate/issues/269), [#296](https://github.com/JetBrains/ytdb-slate/issues/296), [#212](https://github.com/JetBrains/ytdb-slate/issues/212), and [#38](https://github.com/JetBrains/ytdb-slate/issues/38).
|
|
77
81
|
|
|
78
|
-
|
|
82
|
+
## Current workflow and behavior
|
|
79
83
|
|
|
80
|
-
|
|
84
|
+
### Feature development workflow
|
|
81
85
|
|
|
82
|
-
|
|
86
|
+
In orchestrator mode, Slate injects a mandatory track-based development workflow. Project configuration can extend it through `doctrineExtraPath`. Configuration cannot replace it.
|
|
83
87
|
|
|
84
|
-
|
|
88
|
+
Eleven focus areas name specific risks. They cover
|
|
89
|
+
concurrency defects, data loss, security weaknesses, performance degradation,
|
|
90
|
+
test-quality defects, unreadable user-facing prose, licensing exposure,
|
|
91
|
+
non-local logic defects, consumer contract breaks, governing-rule defects, and
|
|
92
|
+
unreported failures.
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
During planning, the orchestrator writes an independent risk record for the change and for every track. Each record has one line for every focus area. A `NAMED` line carries a four-part proof. User approval makes that area proved. User rejection makes it `SKIPPED`. Only proved areas add gates or routine implementation reviewers. A track with at least one proved area gets one general Reviewer I plus every required area specialist. A track with no proved area gets no routine implementation reviewer.
|
|
95
|
+
|
|
96
|
+
The workflow follows these steps:
|
|
97
|
+
|
|
98
|
+
1. **Plan and confirm.** The orchestrator proposes all eleven focus lines. The user alone approves or rejects each `NAMED` proof.
|
|
99
|
+
2. **Design.** A proved `DESIGN-TRIGGERING` area requires a high-level design. The user validates it before focus reconfirmation and one adversarial design review per proved `DESIGN-TRIGGERING` area. Final design approval follows.
|
|
100
|
+
3. **Implement tracks.** Each track is one coherent, independently mergeable unit with its own focus set. About 400 added plus removed lines is a planning guideline. The orchestrator estimates before splitting work. The implementer estimates during work and stops at a coherent boundary near the guideline. A small overrun may finish the nearest coherent unit and must include its reason. Lockfiles, migration files, and generated output do not count.
|
|
101
|
+
4. **Review and deliver.** When a track has a proved area, one Reviewer I and every required area specialist inspect it in separate review actions. A zero-area track reports routine implementation review as `NOT REQUIRED`. Tracks with a proved `DESIGN-TRIGGERING` area require blocking user acceptance. Other tracks do not. Where a marker applies, it follows required machine gates, the packet, and resolution of blocking user notes. Per-track mode uses the user-merged commit instead. Final change acceptance is always blocking.
|
|
102
|
+
|
|
103
|
+
Draft pull request publishing activates only when `workflow.draftPRs` is `true`. The orchestrator then asks once whether every track gets its own pull request. A yes answer requires user merges in sequence and a fresh branch from updated `main` for each next track. A no answer keeps one umbrella draft pull request.
|
|
104
|
+
|
|
105
|
+
This summary provides orientation only. The [shipped workflow documents](#shipped-docs) are normative.
|
|
106
|
+
|
|
107
|
+
### Logical-model routing and recovery
|
|
108
|
+
|
|
109
|
+
Every `thread` call names a provider-free logical `model` and a short `reason`. The active policy fixes effort, exact physical routes, capability and cost ratings, guidance, cautions, and bounded recovery order. Slate resolves one immutable policy when the parent session starts. Dispatch, compression, main-session recovery, doctrine, and `/slate effective` share it.
|
|
89
110
|
|
|
90
|
-
|
|
111
|
+
The shipped ordinary pool has six definitions. A trusted project can replace membership, add complete definitions, replace selected fields, and exclude members. The independent compressor list defaults to Sonnet at `medium`. Untrusted projects use home preferences over the shipped policy and consume no project router data. Critical errors block logical work. Legacy physical-router keys produce named warnings and receive no automatic migration.
|
|
112
|
+
|
|
113
|
+
Pi retries the active physical route first. Slate advances only after Pi reports known retry exhaustion. Recovery tries another permitted provider for the same logical model before it moves through the ordinary or compressor order. Unknown outcomes and cancellation stop recovery. One operation owns recovery. An overlapping operation receives a visible busy refusal. Slate does not queue or replay it.
|
|
114
|
+
|
|
115
|
+
Pi 0.85.1 model and effort switches are session-only unless persistence is requested. Slate retains its saved-default compatibility guard for explicit persistence and older behavior. Slate retains bounded completed worker output when compression fails or is cancelled. A failed episode write can prevent an episode. A failed final state save can leave episode bytes without a proved durable reference. Both failures remain visible.
|
|
116
|
+
|
|
117
|
+
A remembered later compressor starts later actions at that entry and does not move backward until preference reset. This is an accepted limitation. `extension/index.ts` is the supported package entry. Logical-runtime exports and retry-evidence exports are internal and unstable. Retry-evidence exports classify provider retry outcomes. [`docs/model-routing.md`](docs/model-routing.md) defines the complete contract.
|
|
118
|
+
|
|
119
|
+
### Writing guidance
|
|
120
|
+
|
|
121
|
+
Writing guidance and checker findings are active in orchestrator mode when the project is trusted or a home configuration file exists. Slate adds one doctrine rule for writing and another for design discipline. It also adds a status value such as `writing 2 fail, 3 style / 10 turns` in interactive sessions. The value reports model-visible findings in the latest ten measured prose turns. Each worker with permitted Slate settings gets a shorter reminder about reader understanding, semicolons, and contractions.
|
|
122
|
+
|
|
123
|
+
The guidance has prompt cost. Each orchestrator system prompt contains both doctrine rules. You pay for this text on every turn. Each worker with permitted Slate settings also gets the preamble addition.
|
|
124
|
+
|
|
125
|
+
The shipped command checks plain files, JSON Lines records, and unified diffs. See [`docs/writing-guidance.md`](docs/writing-guidance.md) for its rules, limits, output, and command examples.
|
|
126
|
+
|
|
127
|
+
Slate sends hidden reminders after completed turns. The default cadence is four completed turns. A model-visible finding can trigger an immediate reminder when that option is enabled. The reminder carries the writing and conversation title, three retained style rules, ten writing requirements, and seven design requirements. A findings section appears only when the latest measured turn carries a model-visible finding. The requirements exclude research logs, worker task text, and this project's agent instruction file.
|
|
128
|
+
|
|
129
|
+
## Everyday commands
|
|
130
|
+
|
|
131
|
+
| Command | Current behavior |
|
|
132
|
+
| --- | --- |
|
|
133
|
+
| `/slate on` | Turn on orchestrator mode. Slate removes tactical tools from the main session and expects delegation through worker threads. |
|
|
134
|
+
| `/slate off` | Turn off orchestrator mode and restore the earlier tool set. |
|
|
135
|
+
| `/slate` | Toggle orchestrator mode. |
|
|
136
|
+
| `/slate effective` | Show the effective logical-model policy and remembered route selections. |
|
|
137
|
+
| `/slate handoff [focus]` | Prepare a new-session handoff, with an optional focus. |
|
|
138
|
+
| `/slate resume` | Clear a context-budget pause and accept user prompts again. |
|
|
139
|
+
|
|
140
|
+
## Community
|
|
141
|
+
|
|
142
|
+
Join the [Slate Zulip community](https://youtrackdb.zulipchat.com/#narrow/channel/634235-slate) to share what you are building, ask for help, or discuss the project.
|
|
91
143
|
|
|
92
144
|
## Configuration
|
|
93
145
|
|
|
94
|
-
|
|
146
|
+
### Configuration files and merging
|
|
147
|
+
|
|
148
|
+
Slate reads two optional configuration files at session start:
|
|
149
|
+
|
|
150
|
+
- Home: `<getAgentDir()>/slate.json`, normally `~/.pi/agent/slate.json`. Pi's `PI_CODING_AGENT_DIR` environment variable can select another agent directory.
|
|
151
|
+
- Project: `<cwd>/.pi/slate.json`, read **only when the project is trusted**.
|
|
152
|
+
|
|
153
|
+
Project values override home values. Objects merge recursively. Arrays, scalar values, and explicit `null` replace the home value. Arrays never append. Slate applies its existing setting validators after the merge.
|
|
154
|
+
|
|
155
|
+
A missing file is valid. An unreadable file, invalid JSON, or a root that is not an object produces a warning naming that file. Any such error in a permitted file blocks model routing, even when the other file is valid.
|
|
156
|
+
|
|
157
|
+
Home preferences also apply in untrusted projects. Without a home file, existing project behavior and defaults stay unchanged. Configuration edits require a new session.
|
|
158
|
+
|
|
159
|
+
Paths in `orchestratorPromptDocs`, `workerPromptDocs`, `doctrineExtraPath`, and `reviewPerspectivesPath` belong to the file that supplies the value. Relative home paths start at the agent directory. Relative project paths start at the project root, not `.pi`. Absolute paths stay absolute. See [Safety and trust](#safety-and-trust) for the security boundary.
|
|
160
|
+
|
|
161
|
+
Pi can refresh a prompt cache by sending background requests. Slate disables those requests in every worker because they bypass its request limits. This does not disable prompt caching for ordinary worker requests. The main session and saved pi settings stay unchanged.
|
|
162
|
+
|
|
163
|
+
### Common starting point
|
|
164
|
+
|
|
165
|
+
Create `.pi/slate.json` when you want new interactive sessions to start in orchestrator mode:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"orchestratorModeDefault": true
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The project must be trusted before Slate reads this file. Start a new session after any configuration change.
|
|
174
|
+
|
|
175
|
+
### Complete option reference
|
|
95
176
|
|
|
96
177
|
| Key | Type | Default | Semantics |
|
|
97
178
|
| --- | --- | --- | --- |
|
|
98
179
|
| `orchestratorModeDefault` | boolean | `false` | Start fresh interactive sessions with orchestrator mode ON. |
|
|
99
|
-
| `episodeModel` | string | newest available Anthropic Sonnet, else the orchestrator's own base model | Model (`provider/id`) used to compress a finished action into an episode. Never the model an action was routed to: an episode is read by every later consumer of the thread, so one cheap route must not degrade the record. An unusable value is reported and the default is used. |
|
|
100
180
|
| `workerTools` | string[] | `["read", "bash", "edit", "write", "grep", "find", "ls"]` | Tools available to worker threads (an empty list also falls back to the default). |
|
|
101
|
-
| `workerExtensions` | string[] | `[]` | Regex patterns (matched **unanchored**) selecting which of the host session's already-loaded extensions also load into every worker thread; each matched extension's tools are added **on top of** `workerTools`. Empty (default) means workers load no extensions. The orchestrator keeps its restricted tool set but its doctrine is told what was whitelisted. Invalid patterns are dropped with a warning at session start. |
|
|
102
|
-
| `
|
|
181
|
+
| `workerExtensions` | string[] | `[]` | Regex patterns (matched **unanchored**) selecting which of the host session's already-loaded extensions also load into every worker thread; each matched extension's tools are added **on top of** `workerTools`. Empty (default) means workers load no project or discovered extensions. Slate still supplies one internal reminder component. The orchestrator keeps its restricted tool set but its doctrine is told what was whitelisted. Invalid patterns are dropped with a warning at session start. |
|
|
182
|
+
| `cacheKeyEnabled` | boolean | `true` | Add one OpenAI Responses prompt cache key to all workers in the current main Slate session. Another main session receives another key. `false` disables key injection. It does not disable request throttling. Provider requests with `cacheRetention: "none"`, including worker summaries, keep that opt-out and receive no forced key. |
|
|
183
|
+
| `cacheKeyShards` | number | ignored | This removed partitioning key has no effect. Slate reports it once at session start. Remove it from `slate.json`. |
|
|
184
|
+
| `requestThrottle.enabled` | boolean | `true` | Pace OpenAI Responses worker requests. `false` disables pacing. It does not disable cache-key injection. The scope includes worker turns, failover requests, history compaction, and branch summaries. It excludes orchestrator requests, episode compression, other provider interfaces, other sessions and processes, and direct tool requests. |
|
|
185
|
+
| `requestThrottle.maxRequestsPerMinute` | number | `12` | Maximum logical SDK requests admitted for one actual `provider/id` in the preceding 60 seconds. The value must be a whole number from 1 through 1000. Provider network retries inside one SDK request do not consume another admission. Different models have independent counters. This threshold is request pacing, not a cache-hit or provider-rate-limit guarantee. |
|
|
186
|
+
| `requestThrottle.baseWaitMs` | number | `1000` | Base delay before a blocked request rechecks capacity. The value must be a whole number from 1 through 60000. A positive minimum prevents a repeated zero-delay loop. |
|
|
187
|
+
| `requestThrottle.jitterMs` | number | `1000` | Uniform random extra delay from zero through this inclusive bound before a blocked request rechecks. The value must be a whole number from 0 through 60000. Admission is approximately fair. It is not first-in-first-out and does not promise a bounded wait. |
|
|
188
|
+
| `maxConcurrent` | number | `4` | Maximum number of worker actions running concurrently (must be ≥ 1 — unenforced: a value of 0 or less silently hangs all dispatches). Excess actions wait for a global concurrency slot. Every action has its own thread. Default rationale: shipped `docs/design-principles.md` §5 (repo-local note). |
|
|
103
189
|
| `contextBudget` | number \| object | `256000` (Anthropic models: `400000`) | Absolute orchestrator context budget (tokens) at which Slate auto-pauses and prepares a fresh-session handoff — semantics, defaults, per-model overrides, and rationale in [`docs/context-budget.md`](docs/context-budget.md). |
|
|
104
|
-
| `orchestratorPromptDocs` | string[] | `[]` |
|
|
105
|
-
| `workerPromptDocs` | string[] | `[]` |
|
|
106
|
-
| `workflow.draftPRs` | boolean | `false` | Enable
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `writing.
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
|
|
118
|
-
|
|
190
|
+
| `orchestratorPromptDocs` | string[] | `[]` | Markdown files whose paths follow the source rules above and whose **contents** are appended to the orchestrator system prompt. |
|
|
191
|
+
| `workerPromptDocs` | string[] | `[]` | Markdown files whose **contents** are appended to every worker-thread system prompt. |
|
|
192
|
+
| `workflow.draftPRs` | boolean | `false` | Enable draft-PR publishing. Before implementation, ask once whether each track gets its own pull request or all tracks share one umbrella pull request. |
|
|
193
|
+
| `workflow.followUpIssues` | boolean | `false` | When true, the orchestrator asks which deferred items become tracked issues. Deferred items are always reported whatever the value. |
|
|
194
|
+
| `workflow.routingRecommendations` | boolean | `false` | Before final acceptance, add an evidence-bounded model-routing field for logical models dispatched during the current change. The enabled field always appears. It reports when no change is recommended and never edits routing files. |
|
|
195
|
+
| `writing.check` | boolean | ignored | This ignored writing key remains accepted for compatibility. Remove it from `slate.json`. Guidance is automatic during orchestrator mode when the project is trusted or a home file exists. See [`docs/writing-guidance.md`](docs/writing-guidance.md). |
|
|
196
|
+
| `writing.remind` | boolean | ignored | This ignored writing key remains accepted for compatibility. Remove it from `slate.json`. Reminder gates require orchestrator mode, permitted Slate settings, no pause, and a ready trigger. Delivery is limited to one reminder per response round. See [`docs/writing-guidance.md`](docs/writing-guidance.md). |
|
|
197
|
+
| `writing.remindPercent` | number | ignored | This retired key remains accepted and ignored. Slate emits a notice. Replace it with `writing.remindTurns`, which counts completed turns instead of a token-budget share. |
|
|
198
|
+
| `writing.remindTurns` | number | `4` | Set the reminder cadence in completed turns. The value must be a whole number from 1 through 20. An invalid value warns and falls back to `4`. See [`docs/writing-guidance.md`](docs/writing-guidance.md). |
|
|
199
|
+
| `writing.remindOnFinding` | boolean | `true` | Send a reminder on the turn after a measured turn with a model-visible finding. An invalid value warns and falls back to `true`. `writing.findings: false` disables this trigger. |
|
|
200
|
+
| `writing.sentenceWordLimit` | number \| boolean | `25` | Set the sentence-length house-style limit in words. The value must be a whole number from 10 through 200, inclusive, or `false` to turn the rule off. See [`docs/writing-guidance.md`](docs/writing-guidance.md). |
|
|
201
|
+
| `writing.statusWindowTurns` | number | `10` | Set the whole-number status window from 3 through 100 measured turns. An invalid value warns and falls back to `10`. The status line reports model-visible fail and style counts in this window. |
|
|
202
|
+
| `writing.findings` | boolean | `true` | Include the latest model-visible writing findings in the hidden reminder. An invalid value warns and falls back to `true`. Measurement and the status line continue when this value is `false`. |
|
|
203
|
+
| `doctrineExtraPath` | string | — | Markdown whose **content** is appended to the orchestrator doctrine (project-specific workflow additions). |
|
|
204
|
+
| `reviewPerspectivesPath` | string | — | Review charters, each declaring its own finding-ID prefix. The doctrine references this **path**; the orchestrator reads the file alongside the shipped review rules. |
|
|
205
|
+
| `router.models` | object | shipped six-model pool | Ordinary membership and definitions. `include` replaces the starting membership, including with an empty list. `add` accepts complete new definitions. `replace` changes selected fields. `exclude` applies last. Within each model definition, lists and provider maps replace shipped fields. The home and project configuration files merge first. |
|
|
206
|
+
| `router.compressor.models` | array of `{ model, effort }` | `[{"model":"claude-sonnet-5","effort":"medium"}]` | Independent ordered compressor list. An explicit empty list blocks work. |
|
|
207
|
+
|
|
208
|
+
### Extended example
|
|
209
|
+
|
|
210
|
+
The `docs/agents/...` values below are placeholders. Point them at Markdown files that exist in your project.
|
|
119
211
|
|
|
120
212
|
```json
|
|
121
213
|
{
|
|
122
214
|
"orchestratorModeDefault": true,
|
|
123
|
-
"
|
|
215
|
+
"cacheKeyEnabled": true,
|
|
216
|
+
"requestThrottle": { "enabled": true, "maxRequestsPerMinute": 12, "baseWaitMs": 1000, "jitterMs": 1000 },
|
|
124
217
|
"maxConcurrent": 4,
|
|
125
218
|
"orchestratorPromptDocs": ["docs/agents/orchestrator-guidelines.md"],
|
|
126
219
|
"workerPromptDocs": ["docs/agents/thread-guidelines.md"],
|
|
127
|
-
"workflow": { "draftPRs": true },
|
|
128
|
-
"writing": {
|
|
129
|
-
"check": true,
|
|
130
|
-
"remind": false,
|
|
131
|
-
"remindPercent": 10
|
|
132
|
-
},
|
|
220
|
+
"workflow": { "draftPRs": true, "followUpIssues": false, "routingRecommendations": false },
|
|
221
|
+
"writing": { "remindTurns": 4, "remindOnFinding": true, "sentenceWordLimit": 25, "statusWindowTurns": 10, "findings": true },
|
|
133
222
|
"doctrineExtraPath": "docs/agents/workflow-additions.md",
|
|
134
223
|
"reviewPerspectivesPath": "docs/agents/review-perspectives.md",
|
|
135
|
-
"
|
|
136
|
-
|
|
224
|
+
"router": {
|
|
225
|
+
"models": { "include": ["luna-6", "claude-opus-5.5"] },
|
|
226
|
+
"compressor": { "models": [{ "model": "claude-sonnet-5", "effort": "medium" }] }
|
|
227
|
+
}
|
|
137
228
|
}
|
|
138
229
|
```
|
|
139
230
|
|
|
140
|
-
|
|
231
|
+
Remove `writing.check` and `writing.remind` when copying an older configuration. Current Slate reports these ignored writing keys.
|
|
232
|
+
|
|
233
|
+
### Document path warning
|
|
234
|
+
|
|
235
|
+
> **Silent skip:** document-path errors produce no warning. Slate skips missing, unreadable, or empty files selected by `orchestratorPromptDocs`, `workerPromptDocs`, and `doctrineExtraPath`. For `reviewPerspectivesPath`, Slate omits the pointer only when the file is missing. Slate does not read that file at injection time, so an unreadable or empty file is still cited. Verify your paths after copying the example.
|
|
236
|
+
|
|
237
|
+
## Safety and trust
|
|
141
238
|
|
|
142
|
-
|
|
239
|
+
### Worker extensions (`workerExtensions`)
|
|
143
240
|
|
|
144
|
-
|
|
241
|
+
By default worker threads load no project or discovered extensions. Slate supplies one internal reminder component to every worker session. After tool results reach its handler, the component tells the worker to issue independent tool calls in one turn. It sends the reminder once for each such turn. The reminder persists in the worker transcript and stays hidden from the user in the normal terminal interface. The component is not gated on project trust.
|
|
242
|
+
|
|
243
|
+
This key is a list of regex patterns that select extensions the **host session has already loaded** and load them into every worker too. Each pattern is matched **unanchored** (unlike `contextBudget.overrides`, which is anchored) against a load unit's recorded source spec (e.g. `npm:pi-web-search@1.3.1`), its load-unit path, or the entry path of any tool that unit contributes, so a bare package name matches:
|
|
145
244
|
|
|
146
245
|
```json
|
|
147
246
|
{
|
|
@@ -149,41 +248,59 @@ Older Slate releases warn about these reminder keys and ignore them. Use a Slate
|
|
|
149
248
|
}
|
|
150
249
|
```
|
|
151
250
|
|
|
152
|
-
Every worker then gets the fetch and web-search tools **on top of** `workerTools` (and on top of the per-dispatch `tools` argument of the `thread` tool — those two govern the built-in tools only). The orchestrator itself does **not** gain these tools — orchestrator mode keeps its restricted set — but its doctrine gains a rule naming each whitelisted extension and its tools, so it knows what it can delegate.
|
|
251
|
+
Every worker then gets the fetch and web-search tools **on top of** `workerTools` (and on top of the per-dispatch `tools` argument of the `thread` tool — those two govern the built-in tools only). The orchestrator itself does **not** gain these tools — orchestrator mode keeps its restricted set — but its doctrine gains a rule naming each whitelisted extension and its tools, so it knows what it can delegate.
|
|
252
|
+
|
|
253
|
+
For project and discovered extensions, pi's discovery, project-trust gating, and dedup remain the only ingress. A worker cannot load a whitelisted extension that the host is not running. An extension that registers no tools cannot be whitelisted. A host started with extensions disabled offers nothing to whitelist. Slate's internal reminder component is the separate always-loaded input described above.
|
|
153
254
|
|
|
154
255
|
**What to know before whitelisting** — it reaches past Slate's isolation, so it is an operator decision:
|
|
155
256
|
|
|
156
257
|
- **Delegation is unbounded.** Slate guarantees only that no worker obtains Slate's own `thread`/`threads`/`episode` tools. A whitelisted extension that ships its own sub-agent or delegation tool under any other name gives workers delegation Slate can neither detect, bound, nor account for.
|
|
157
|
-
- **Credential and filesystem reach.** Inside a worker the extension has the same filesystem and credential access it has in the host
|
|
158
|
-
- **
|
|
159
|
-
- **Abort.** A third-party extension may ignore the abort signal, so its network activity can outlive an abort or a context-budget pause.
|
|
258
|
+
- **Credential and filesystem reach.** Inside a worker the extension has the same filesystem and credential access it has in the host. Slate's read-only settings snapshot blocks pi-settings writes and nothing else.
|
|
259
|
+
- **Worker lifecycle.** Slate completes each selected extension's `session_start` before the worker action begins. A startup failure blocks the action. Slate emits one `session_shutdown` before it disposes the worker, including after startup or action failure and during host shutdown.
|
|
260
|
+
- **Abort.** A third-party extension may ignore the abort signal, so its network activity can outlive an abort or a context-budget pause. During a pause, Slate still allows orchestrator state-save workers while it refuses new user prompts.
|
|
160
261
|
- **Cost.** Provider-native tool billing can escape Slate's worker cost accounting.
|
|
161
|
-
- **Pathological patterns.** The patterns are regexes from your own trusted config — the same file that already steers models, prompts, and tool lists — matched with no time bound while the extension set is resolved once per session. A pattern with catastrophic backtracking can stall that resolution
|
|
262
|
+
- **Pathological patterns.** The patterns are regexes from your own trusted config — the same file that already steers models, prompts, and tool lists — matched with no time bound while the extension set is resolved once per session. A pattern with catastrophic backtracking can stall that resolution. Avoid such patterns. They are not a privilege boundary.
|
|
162
263
|
|
|
163
264
|
The load-time recursion guard behind this — and the risks it does and does not cover — is in [`docs/design-principles.md`](docs/design-principles.md).
|
|
164
265
|
|
|
165
|
-
|
|
266
|
+
### Worker provider registrations
|
|
267
|
+
|
|
268
|
+
Every worker inherits host extension provider registrations that are absent after the worker session is constructed. This behavior is independent of `workerExtensions`. It supports provider-only extensions that register no tools. The worker's own registration wins by provider id, even when one side uses a native provider and the other uses the config form. A built-in provider is not an extension registration, so a host extension override of a built-in is inherited.
|
|
166
269
|
|
|
167
|
-
Slate
|
|
270
|
+
Inheritance happens after worker session construction and before route authentication or the first model request. Slate copies current registrations and reuses their provider functions. Nested config values and native provider objects can remain shared by reference. A worker uses its own pi credential resolution, but inherited provider authentication callbacks and configured keys can read or update the same credential files and third-party state that the host uses. Slate does not copy host event handlers such as `before_provider_headers`, `before_provider_request`, or `after_provider_response`. Provider extensions that depend on those handlers will not behave the same in a worker.
|
|
271
|
+
|
|
272
|
+
A worker extension can register the same provider id during construction. Its registration takes precedence. Slate does not synchronize later host changes or intercept later worker registrations. Pi can merge a later partial worker registration with inherited config. That merge can retain inherited credentials while changing the endpoint. This accepted startup-only boundary requires extension authors to replace provider configuration carefully. Compatibility with specific third-party provider extensions has not been verified.
|
|
273
|
+
|
|
274
|
+
### Project trust boundary
|
|
275
|
+
|
|
276
|
+
Slate excludes untrusted project Slate configuration and content selected through that configuration. Home preferences remain active, including documents and host extensions selected by those preferences. A home document path can point into a working tree, so select those paths carefully.
|
|
277
|
+
|
|
278
|
+
Home preferences do not change pi's project-trust decision. Pi's independent instruction loading stays unchanged. In particular, this feature does not filter pi's `AGENTS.md` context files. Slate still requires project trust before it restores pending handoff state. Worker pi settings remain nonpersistent.
|
|
168
279
|
|
|
169
280
|
## Shipped docs
|
|
170
281
|
|
|
171
|
-
|
|
282
|
+
This section is the complete reference document roster.
|
|
283
|
+
|
|
284
|
+
In orchestrator mode, Slate appends a short **doctrine**, which is a block of numbered rules, to the orchestrator system prompt each turn. The doctrine does not embed the workflow documents. It cites them by absolute path inside the installed package, and the orchestrator reads them when needed.
|
|
285
|
+
|
|
286
|
+
The embedded paths make the block size depend on your install location. [`docs/context-budget.md`](docs/context-budget.md) gives measured sizes with and without optional rules. It also gives the arithmetic for your own installation.
|
|
172
287
|
|
|
173
|
-
- `docs/
|
|
174
|
-
- `docs/
|
|
175
|
-
- `docs/
|
|
176
|
-
- `docs/design-principles.md`
|
|
177
|
-
- `docs/model-
|
|
178
|
-
- `docs/
|
|
179
|
-
- `docs/
|
|
180
|
-
- `docs/
|
|
288
|
+
- [`docs/blast-radius.md`](docs/blast-radius.md) defines the eleven focus areas, proof requirements, track constraints, and review coverage.
|
|
289
|
+
- [`docs/context-budget.md`](docs/context-budget.md) defines `contextBudget` defaults, per-model overrides, the window clamp, and pricing rationale. It is reference documentation and is not cited by the doctrine.
|
|
290
|
+
- [`docs/delivery-packages.md`](docs/delivery-packages.md) — the compact track and change package format, read only before package preparation
|
|
291
|
+
- [`docs/design-principles.md`](docs/design-principles.md) gives Slate's design rationale.
|
|
292
|
+
- [`docs/model-routing.md`](docs/model-routing.md) defines the logical-model policy, exact defaults, configuration, common recovery, history, and accepted limitations. The doctrine cites its absolute path for trusted sessions.
|
|
293
|
+
- [`docs/pr-publishing.md`](docs/pr-publishing.md) defines per-track and umbrella draft pull request publishing. The doctrine cites it only when `workflow.draftPRs` is `true`.
|
|
294
|
+
- [`docs/review-rules.md`](docs/review-rules.md) defines reviewer composition, the combined test-quality role, evidence standards, findings, and fix gates.
|
|
295
|
+
- [`docs/track-workflow.md`](docs/track-workflow.md) defines the focus-area lifecycle for research, design, implementation, review, and delivery.
|
|
296
|
+
- [`docs/user-notes.md`](docs/user-notes.md) defines how Slate records, classifies, and resolves user notes during development.
|
|
297
|
+
- [`docs/writing-guidance.md`](docs/writing-guidance.md) defines the writing convention, ignored writing keys, status line, and checker command.
|
|
181
298
|
|
|
182
|
-
Project-specific additions
|
|
299
|
+
Project-specific additions extend the shipped doctrine. They do not replace it:
|
|
183
300
|
|
|
184
|
-
- **Content injection
|
|
185
|
-
- **Pointer
|
|
301
|
+
- **Content injection:** `doctrineExtraPath` appends content to the doctrine and is read again at each prompt assembly. `orchestratorPromptDocs` and `workerPromptDocs` append content to their respective system prompts.
|
|
302
|
+
- **Pointer:** `reviewPerspectivesPath` is cited by path from the doctrine's review rule and read when needed, like the shipped documents.
|
|
186
303
|
|
|
187
304
|
## License
|
|
188
305
|
|
|
189
|
-
Apache-2.0
|
|
306
|
+
Apache-2.0. See [LICENSE](LICENSE).
|