@hobin/developer 0.1.8 → 0.1.9

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.
Files changed (65) hide show
  1. package/README.md +215 -372
  2. package/REFERENCE_ROUTING.md +243 -0
  3. package/extensions/developer.ts +533 -18
  4. package/extensions/machine.ts +45 -0
  5. package/extensions/references/behavior-preserving-structural-change.md +87 -8
  6. package/extensions/skills.ts +330 -52
  7. package/extensions/state.ts +227 -2
  8. package/package.json +9 -3
  9. package/skills/abstraction-review/SKILL.md +37 -23
  10. package/skills/abstraction-review/reference-policy.json +66 -0
  11. package/skills/abstraction-review/references/field-card.md +113 -168
  12. package/skills/abstraction-review/references/repair-table.md +66 -80
  13. package/skills/abstraction-review/references/worked-examples.md +79 -256
  14. package/skills/model/SKILL.md +31 -13
  15. package/skills/model/reference-policy.json +96 -0
  16. package/skills/model/references/contract-and-replacement-models.md +112 -0
  17. package/skills/model/references/logic-query-semantics.md +89 -0
  18. package/skills/model/references/planning-models.md +75 -0
  19. package/skills/model/references/problem-modeling.md +143 -276
  20. package/skills/model/references/proof-obligations.md +71 -0
  21. package/skills/model/references/relational-constraint-models.md +110 -0
  22. package/skills/model/references/solver-result-boundaries.md +83 -0
  23. package/skills/model/references/temporal-behavior-models.md +106 -0
  24. package/skills/naming-judgment/SKILL.md +17 -4
  25. package/skills/naming-judgment/reference-policy.json +29 -0
  26. package/skills/naming-judgment/references/domain-naming.md +29 -10
  27. package/skills/schedule/SKILL.md +16 -6
  28. package/skills/schedule/reference-policy.json +29 -0
  29. package/skills/schedule/references/structural-change-timing.md +81 -18
  30. package/skills/signal/SKILL.md +17 -6
  31. package/skills/signal/reference-policy.json +29 -0
  32. package/skills/signal/references/structural-movement.md +87 -14
  33. package/skills/sketch/SKILL.md +38 -42
  34. package/skills/sketch/reference-policy.json +212 -0
  35. package/skills/sketch/references/accumulator-invariants.md +125 -0
  36. package/skills/sketch/references/closure-and-conventional-interfaces.md +87 -0
  37. package/skills/sketch/references/composition-by-wishes.md +69 -0
  38. package/skills/sketch/references/data-driven-design.md +99 -22
  39. package/skills/sketch/references/data-shape-template-catalog.md +58 -19
  40. package/skills/sketch/references/design-levels-and-boundaries.md +133 -0
  41. package/skills/sketch/references/earned-abstraction.md +75 -0
  42. package/skills/sketch/references/generative-recursion.md +122 -0
  43. package/skills/sketch/references/generic-dispatch-systems.md +75 -0
  44. package/skills/sketch/references/language-semantics.md +82 -0
  45. package/skills/sketch/references/meaning-preserving-conversions.md +69 -0
  46. package/skills/sketch/references/process-shape-and-resources.md +157 -0
  47. package/skills/sketch/references/representation-barriers.md +73 -0
  48. package/skills/sketch/references/responsibility-and-collaboration.md +108 -0
  49. package/skills/sketch/references/runtime-and-compilation.md +84 -0
  50. package/skills/sketch/references/selection-and-creation.md +76 -0
  51. package/skills/sketch/references/state-history-and-order.md +126 -0
  52. package/skills/sketch/references/type-transitions.md +54 -0
  53. package/skills/sketch/references/variation-roles.md +59 -0
  54. package/skills/verify/SKILL.md +17 -6
  55. package/skills/verify/reference-policy.json +30 -0
  56. package/skills/verify/references/verifier-selection-and-pass-but-wrong.md +152 -192
  57. package/SOURCES.md +0 -104
  58. package/skills/abstraction-review/references/recipe-cards.md +0 -322
  59. package/skills/model/references/worked-models-and-specialized-techniques.md +0 -218
  60. package/skills/sketch/references/abstraction-barriers-and-closure.md +0 -160
  61. package/skills/sketch/references/abstraction-composition-and-state.md +0 -184
  62. package/skills/sketch/references/composition-generative-recursion-and-accumulators.md +0 -196
  63. package/skills/sketch/references/generic-operations-and-languages.md +0 -134
  64. package/skills/sketch/references/processes-state-and-time.md +0 -171
  65. package/skills/sketch/references/responsibility-and-variation.md +0 -245
package/README.md CHANGED
@@ -1,12 +1,19 @@
1
- # @hobin/developer
1
+ # Developer for Pi
2
2
 
3
- Adaptive product-development judgment for [Pi](https://pi.dev).
3
+ Developer helps [Pi](https://pi.dev) stop guessing, choose the right design or
4
+ review method, make one justified change, and show the evidence behind it.
4
5
 
5
- Developer combines a small, branch-aware coordination extension with ten
6
- independent skills. It routes one concrete question or green-to-green movement
7
- at a time, records the resulting evidence, and preserves unresolved questions.
8
- Its default topology gives feature work a useful backbone without turning every
9
- task into a fixed lifecycle.
6
+ Use it when a task may hide product rules, consequential cases, ownership,
7
+ compatibility, structural timing, or pass-but-wrong verification. Developer:
8
+
9
+ - turns consequential uncertainty into explicit questions;
10
+ - routes Pi to one of ten focused judgment skills;
11
+ - loads deeper references only when an observable trigger calls for them;
12
+ - keeps implementation, unresolved questions, and verification evidence visible
13
+ on the current session branch.
14
+
15
+ Developer is adaptive rather than phase-driven. It does not force every task
16
+ through a fixed plan, design, implementation, and review sequence.
10
17
 
11
18
  ## Install
12
19
 
@@ -22,308 +29,225 @@ Try it for one run without installing:
22
29
  pi -e npm:@hobin/developer
23
30
  ```
24
31
 
25
- ## Quick start
26
-
27
- Start Pi, turn Developer on, and describe the product task normally:
32
+ Start Pi and enable Developer:
28
33
 
29
34
  ```text
30
35
  /develop on
31
- The selected payment method disappears after navigating back to checkout. Find the cause and fix it.
32
36
  ```
33
37
 
34
- Developer decides whether the next concrete question would benefit from a focused
35
- skill or is already justified as implementation action. You do not need to call
36
- its internal protocol tools yourself. While Developer is on, Pi's built-in shell
37
- and artifact tools follow the active route.
38
+ Run `pi list` if you want to confirm that the package is installed.
38
39
 
39
- ## Commands
40
+ ## Try it
40
41
 
41
- | Command | Effect |
42
- | --- | --- |
43
- | `/develop` | Open the non-overlay Developer settings surface |
44
- | `/develop on` | Enable adaptive routing and route-bound access to Pi built-in `bash`, `edit`, and `write` |
45
- | `/develop status` | Inspect current branch state in a read-only panel |
46
- | `/develop questions` | Choose an unresolved question, answer it or request investigation, and submit it to Pi |
47
- | `/develop off` | Disable the protocol and clear current protocol state |
42
+ Describe the product task normally. You do not need to name a skill or call an
43
+ internal protocol tool.
44
+
45
+ ```text
46
+ /develop on
47
+ The selected payment method disappears after navigating back to checkout.
48
+ Find the cause and fix it.
49
+ ```
48
50
 
49
- Explicit command arguments participate in Pi's completion UI. In interactive
50
- use, turning Developer off while a route or unresolved question exists requires
51
- confirmation. The historical session entries remain; only current protocol
52
- state is cleared.
51
+ Depending on what the repository already establishes, Developer may ask for a
52
+ missing product decision, inspect the relevant behavior, route a focused model
53
+ or sketch, permit one implementation movement, and require evidence before the
54
+ changed work is treated as complete.
53
55
 
54
- Start a non-interactive or preconfigured session with Developer enabled:
56
+ Other useful first requests:
55
57
 
56
- ```sh
57
- pi --develop
58
+ ```text
59
+ Add scheduled invoice delivery.
60
+ Clarify any missing product rules before editing.
58
61
  ```
59
62
 
60
- ## Activation and tool policy
61
-
62
- Developer has one boolean setting: on or off. When on, adaptive routing and the
63
- route-bound tool policy always apply. Pi built-in `bash` is available during
64
- skill and implementation routes; built-in `edit` and `write` require an active
65
- `implementation` route and no `before-implementation` gate. When off, Developer
66
- clears current protocol state and restores only tools that it withheld.
67
-
68
- The tool policy and question gates are workflow-integrity controls, not a security
69
- sandbox. A skill route receives the shell execution lane needed for repository
70
- inspection and verifier execution, while structured `edit`/`write` mutation
71
- remains implementation-only. Shell commands are not parsed as a security language; skill
72
- contracts prohibit artifact mutation, and adversarial evaluation checks the
73
- workspace boundary. Developer recognizes Pi built-ins from their provenance,
74
- preserves unrelated active tools, and does not force-enable tools the user
75
- disabled.
76
-
77
- Before Pi tears down a session runtime, Developer releases its route-bound tool
78
- delta so a reload, session replacement, or later extension instance does not
79
- inherit orphaned restrictions. After that release, the package records a
80
- reload-safe lifecycle marker. If an in-process reload finds older Developer
81
- history without a later release marker, Developer stays off and requires a full
82
- Pi process restart. Neither `/reload` nor `/develop off` → `on` can safely infer
83
- which built-ins the user originally enabled.
84
-
85
- ## How a request runs
86
-
87
- Developer adds two model-facing protocol tools:
88
-
89
- 1. `developer_route_question` opens one route for one concrete question.
90
- 2. The route target is `implementation` or one currently available Developer skill.
91
- 3. A skill route returns the exact Pi-discovered `SKILL.md` instructions and canonical
92
- path; an implementation route declares one movement, its stable landing, and its narrow
93
- verification. A behavior-preserving structural route also loads the focused
94
- execution profile based on flocking-style movement and small tidyings.
95
- 4. `developer_record_judgment` closes the route with a status, result, evidence,
96
- artifacts, and any newly opened questions. Developer then routes again from
97
- the stable landing before another movement.
98
- 5. Consecutive implementation routes remain valid. To prevent routing by momentum, a
99
- implementation route that follows an implementation judgment must cite the previous landing
100
- evidence and record the plausible skill routes reconsidered plus why they add
101
- no useful judgment at that point.
102
-
103
- The conditional default topology is:
63
+ ```text
64
+ This parser change is green, but the conditionals are spreading.
65
+ Decide whether structural work belongs now.
66
+ ```
104
67
 
105
68
  ```text
106
- clarify when needed model consequential cases
107
- sketch the first feature implementation surface OR signal existing-code movement
108
- → one implementation green-to-green movement → re-route from evidence
109
- → verify before completion
69
+ The tests pass after this cache rewrite.
70
+ Check what they do not prove before calling it done.
110
71
  ```
111
72
 
112
- This is not a mandatory phase sequence. A stage may be not applicable and new
113
- evidence may route backward or sideways. One guard is deliberate: a resolved
114
- model cannot flow straight into mutation. New feature work receives an initial
115
- `sketch`; existing-code structural work receives a `signal` first.
116
-
117
- Product code is still read, edited, executed, and tested with Pi's normal tools.
118
- Developer's tools only route and record judgment; they do not implement product
119
- changes themselves.
120
-
121
- There is never a required order such as `specify → model → sketch → verify`.
122
- Each new route is chosen from the current question and evidence.
123
-
124
- ## What the TUI shows
125
-
126
- Developer uses different Pi surfaces for different information:
127
-
128
- - The footer contains only activation, protocol state, and current route target.
129
- - A compact widget appears only while a route or unresolved question exists.
130
- - `/develop` uses Pi's `SettingsList` semantics: the `Developer` row shows
131
- and toggles the current On/Off value, `Status` opens branch details,
132
- `History · N` opens complete route/judgment records when present, and
133
- `Open questions · N` appears only when unresolved questions exist.
134
- - `/develop status` opens a non-overlay, branch-grounded, read-only status panel
135
- with recent route/judgment history and the alternatives recorded for
136
- consecutive implementation work.
137
- - `/develop questions` uses stable internal question IDs. A sole question opens
138
- directly; multiple questions use one selector. Every open question, regardless
139
- of owner or gate, first shows a complete non-overlay decision brief: context is
140
- rendered as Markdown, then blocked work, gate, resolution criteria, and every
141
- structured field/option appear before Continue or Leave open controls.
142
- Cancelling the first field or editor returns to that brief; leaving the brief
143
- returns to the parent without changing protocol state.
144
- - A newly opened, answerable user question that gates implementation work is pushed
145
- to the same explanation-first brief before the judgment tool returns. The user
146
- may continue only after reviewing the explanation or leave it open. Structured
147
- responses then collect each option/detail and provide review/edit before submission.
148
- The answer still requires a focused judgment and explicit `question_updates`.
149
- - Developer custom surfaces leave mouse ownership with the terminal: wheel/trackpad
150
- scrolls normal-buffer content, drag selects text, and Cmd+C copies it. Wheel input
151
- never changes the selected control; arrow keys do. Potentially long surfaces render
152
- complete content rather than hiding it behind an application-owned viewport.
153
- - Protocol tool rows show compact status by default and higher-contrast evidence
154
- details when expanded with the user's configured Pi keybinding. They render
155
- without Pi's default full tool-row background.
156
-
157
- RPC, JSON, and print modes keep the same protocol semantics without depending on
158
- terminal components.
159
-
160
- ## Protocol states
73
+ ## Why Developer
161
74
 
162
- | State | Meaning |
75
+ Ordinary coding requests often contain decisions that look like implementation
76
+ details but are actually product, model, boundary, or evidence questions.
77
+
78
+ | Before | With Developer |
163
79
  | --- | --- |
164
- | `idle` | No active route and no unresolved Developer question |
165
- | `needs-judgment` | One route is active and must be closed with a judgment |
166
- | `needs-evidence` | At least one agent- or environment-owned evidence question remains open |
167
- | `needs-answer` | At least one user-owned answer or decision remains open |
168
- | `needs-routing` | An implementation stable landing must be re-observed and routed again |
169
- | `needs-verification` | Changed artifacts still need a resolved verify judgment |
170
- | `blocked` | A question is unavailable or explicitly gates implementation work |
171
-
172
- These are routing states, not product-completion claims. In particular:
173
-
174
- - `idle` does not mean the user's task is finished.
175
- - A resolved `specify` judgment is not user acceptance.
176
- - A resolved `verify` judgment is not timeless proof after later changes.
177
-
178
- Pending questions receive stable internal IDs, but users do not type them. Each
179
- question records:
180
-
181
- - `resolutionOwner`: `agent`, `user`, or `environment`;
182
- - `gate`: `none`, `before-implementation`, or `before-completion`;
183
- - `resolutionCriteria`: the observable evidence or answer that closes it;
184
- - `context`: Markdown explanation rendered before answer controls for every open
185
- question; required for user-owned `before-implementation` and `before-completion`
186
- questions, optional for other and legacy questions;
187
- - optional user-owned `responseSpec`: a bounded `choice-form` with required
188
- single-choice fields and optional per-option detail prompts.
189
-
190
- A producer should use `response_spec` when a user must answer finite decisions
191
- such as A, B1–B4, C, and so on. Each decision becomes one field; the TUI does not
192
- infer controls by parsing Markdown. Options such as A3 or G3 that need additional
193
- input declare `detail_prompt`. Missing or malformed replay data falls back to the
194
- freeform editor without dropping the pending question.
195
-
196
- Selecting `/develop questions` always opens the explanation brief before any
197
- structured control or owner-specific editor. User questions then ask for the
198
- required decision, agent questions ask Pi to investigate, and environment
199
- questions request access or an external observation. Submitting
200
- focuses the question in branch state; an explicit ID, focus, or exact question
201
- match associates the next route. Selection alone never closes it.
202
-
203
- Every judgment rechecks all pending questions. `question_updates` can resolve an
204
- unfocused question when implementation, tests, inspection, user input, or an
205
- environment observation naturally supplies its criteria. A focused question
206
- must receive an explicit update: resolve or dismiss it with concrete basis,
207
- retain it as open or blocked, or close the broad parent while opening narrower
208
- children. Resolved and not-applicable updates remove the question with recorded
209
- basis; open or blocked updates preserve its identity. A `before-implementation` question blocks both implementation
210
- routes and Pi built-in artifact tools while Developer is on. A
211
- `before-completion` question allows investigation and implementation but keeps
212
- the protocol non-idle and prevents verification debt from being cleared as a
213
- completion claim.
214
-
215
- A resolved or not-applicable judgment may preserve a distinct follow-up question:
216
- finishing the routed judgment does not imply that no later work was discovered.
217
- It may not reopen its own normalized question under a resolved status; that route
218
- must remain needs-evidence/blocked or explicitly refine a focused parent instead.
219
-
220
- When a judgment replaces a broad unresolved question with more specific evidence
221
- questions, only the actionable children remain. Equivalent question wording is
222
- deduplicated while preserving the existing identity.
80
+ | Vague requests decide product behavior | Unknowns become owned questions |
81
+ | Green tests stand in for claims | Evidence is matched to each claim |
82
+ | Refactoring follows taste or momentum | Structure follows observed pressure |
83
+ | All methods enter context | Only triggered methods load |
84
+ | Branches lose rationale | Evidence replays with its branch |
85
+
86
+ Developer coordinates judgment; Pi still reads, edits, runs, and tests the
87
+ product with its normal tools.
88
+
89
+ ## How it works
90
+
91
+ Developer follows a small adaptive loop:
92
+
93
+ ```text
94
+ Discover Load Derive Act Check Learn
95
+ ```
96
+
97
+ 1. **Discover** the current unresolved question from the request, repository,
98
+ and latest evidence.
99
+ 2. **Load** one focused skill, plus only the deeper references whose triggers
100
+ actually apply.
101
+ 3. **Derive** an inspectable artifact such as a case table, boundary map, wished
102
+ interface, review card, timing matrix, or evidence matrix.
103
+ 4. **Act** through one justified implementation movement when mutation is the
104
+ right next step.
105
+ 5. **Check** the changed claim with an appropriate observer and verifier.
106
+ 6. **Learn** from the stable landing, preserve remaining questions, and route
107
+ again rather than continuing by momentum.
108
+
109
+ This is not a mandatory phase sequence. A simple task can move directly to
110
+ implementation. New evidence can route backward or sideways. Consecutive
111
+ implementation movements are allowed when the previous landing is re-observed
112
+ and the plausible judgment routes add no useful information.
113
+
114
+ ## Common workflows
115
+
116
+ | Need | Developer helps Pi… |
117
+ | --- | --- |
118
+ | Clarify a feature | Separate meaning, constraints, examples, and blockers |
119
+ | Model behavior | Enumerate cases, contracts, transitions, and guarantees |
120
+ | Shape code | Expose data, interfaces, collaboration, state, and checks |
121
+ | Inspect a design | Identify structural movement and model-code mismatch |
122
+ | Review an abstraction | Keep, revise, split, reject, or defer the candidate |
123
+ | Time a refactor | Separate behavior work and judge the cost of delay |
124
+ | Name code | Preserve domain meaning and expose effects or multiple senses |
125
+ | Verify completion | Match evidence to claims and find pass-but-wrong risks |
126
+ | Challenge a claim | Run finite adversarial checks with an explicit stop |
127
+ | Clarify a decision | Choose the smallest useful visual surface |
223
128
 
224
129
  ## Skills
225
130
 
226
- Pi may match these skills automatically, Developer may route a question to one,
227
- or the user may invoke one directly with `/skill:<name>`.
131
+ Developer may route these skills automatically. You can also invoke any one
132
+ directly with `/skill:<name>`.
228
133
 
229
134
  | Skill | Helps decide |
230
135
  | --- | --- |
231
- | `specify` | Product meaning, scope, invariants, risks, and blocking unknowns |
232
- | `model` | Condition spaces, contracts, replacement, transitions, guarantees, and verification targets |
233
- | `sketch` | Inspectable code/pseudocode skeletons, case and interface tables, boundary/flow maps, state, responsibility, and variation |
234
- | `signal` | Evidence-backed structural movement and model-code mismatch |
235
- | `naming-judgment` | Domain sense, honest effects, and change-preserving names |
236
- | `abstraction-review` | Whether a candidate should be kept, revised, split, rejected, or deferred |
237
- | `schedule` | Behavior/structure timing: now, after, or never |
238
- | `verify` | Verifier selection, evidence relevance, and pass-but-wrong risk |
239
- | `visualize` | The smallest visual surface that lowers judgment cost |
240
- | `adversarial-eval` | Finite, escalating attempts to falsify a skill or implementation claim |
241
-
242
- Each leaf chooses a surface that matches its inspection problem instead of
243
- returning undifferentiated prose: contract and scope tables for `specify`, case
244
- or transition models for `model`, code/interface/check surfaces for `sketch`,
245
- artifact comparisons for `signal`, rename maps for `naming-judgment`, review
246
- cards and boundaries for `abstraction-review`, timing matrices for `schedule`,
247
- evidence matrices for `verify`, escalation matrices for `adversarial-eval`, and
248
- a completed visual artifact for `visualize` when a visual is warranted. Simple
249
- judgments may remain compact when prose is genuinely clearer.
250
-
251
- Skill judgment results preserve those surfaces as Markdown. Expanded protocol
252
- rows render tables and code blocks through Pi's Markdown component rather than
253
- flattening them into dim text.
254
-
255
- Pi's loaded resource metadata is authoritative. If package configuration filters
256
- or disables a skill, Developer cannot route to it even if its file exists in the
257
- npm package.
258
-
259
- Several skills link to detailed capability documents under their own
260
- `references/` directory. Pi loads the `SKILL.md` instructions on demand; the
261
- instructions say when each reference is worth reading and resolve it relative to
262
- the skill directory. A reference may synthesize several sources because the
263
- leaf's question, not a book title, owns the capability. Each source-derived
264
- reference includes a source trace, and [SOURCES.md](./SOURCES.md) maps the full
265
- book coverage across leaves and the implementation path. Small, settled judgments do not
266
- need the extra context.
267
-
268
- Primary references retain the capability's core insight and one complete case.
269
- When a question has materially different derivation rules, the skill routes a
270
- more focused supporting reference—for example, data-shape templates separately
271
- from generative recursion, or representation barriers separately from state and
272
- time. This follows Pi's documented progressive-disclosure structure: supporting
273
- files stay relative to their skill and load only when the unresolved question
274
- needs them. `SOURCES.md` also records the reference-quality contract used to
275
- prevent source summaries from replacing executable judgment recipes.
276
-
277
- Developer treats Pi's loaded `systemPromptOptions.skills` metadata as the skill
278
- SSOT. It does not rescan the package and cannot route a skill Pi filtered,
279
- disabled, or replaced through resource configuration.
280
-
281
- ## State, branches, and compaction
282
-
283
- Activation changes are stored as Pi custom session entries. Routes and judgments
284
- are stored in tool-result details. Developer replays the current branch through
285
- an XState v5 machine on startup and tree navigation, so a fork inherits only the
286
- events on its branch. Parallel machine regions keep activation, route, question gates,
287
- framing debt, and verification debt explicit; transition guards reject an implementation
288
- route while a `before-implementation` question remains.
136
+ | `specify` | Product meaning, scope, invariants, and blockers |
137
+ | `model` | Cases, contracts, transitions, guarantees, and checks |
138
+ | `sketch` | Data, interfaces, collaboration, flow, state, and code shape |
139
+ | `signal` | Structural movement and model-code mismatch |
140
+ | `naming-judgment` | Stable domain meaning, effects, and multiple senses |
141
+ | `abstraction-review` | Whether to keep, revise, split, reject, or defer |
142
+ | `schedule` | Whether structural work belongs now, after, or never |
143
+ | `verify` | What evidence proves and what pass-but-wrong risk remains |
144
+ | `visualize` | Which visual surface materially lowers judgment cost |
145
+ | `adversarial-eval` | Which finite checks could falsify a claim |
146
+
147
+ Each skill produces an artifact suited to its question instead of defaulting to
148
+ undifferentiated prose. Simple judgments remain compact when prose is genuinely
149
+ clearer.
289
150
 
290
- ```text
291
- developerMachine (parallel)
292
- ├── activation: disabled | enabled
293
- ├── route: idle | judgment | implementation
294
- ├── questions: clear | open
295
- ├── implementationGate: clear | blocked
296
- ├── completionGate: clear | blocked
297
- ├── checkpoint: ready | required
298
- ├── framing: clear | required
299
- └── verification: current | required
151
+ ## Commands
152
+
153
+ | Command | Effect |
154
+ | --- | --- |
155
+ | `/develop` | Open Developer settings |
156
+ | `/develop on` | Enable adaptive routing and route-bound tool access |
157
+ | `/develop status` | Inspect current branch state and recent route history |
158
+ | `/develop questions` | Review or investigate an unresolved question |
159
+ | `/develop off` | Disable Developer and clear current protocol state |
160
+
161
+ Start a preconfigured session with Developer enabled:
162
+
163
+ ```sh
164
+ pi --develop
300
165
  ```
301
166
 
302
- Judgment routes carry the `execute` tag, implementation routes carry `execute` and
303
- `mutate`, and question/debt regions expose blocking tags. Every implementation judgment
304
- moves the checkpoint to `required`; the next accepted route returns it to
305
- `ready`. Tool availability, runtime call guards, status, and implementation-transition
306
- eligibility are derived from the same machine snapshot.
307
-
308
- The current event contract is `developer/v5`. Earlier protocol entries are not
309
- replayed; this breaking contract uses `target`, `implementation`, and
310
- `before-implementation` consistently across tools, events, and machine state.
311
- A process started on the current package may open a branch containing those
312
- entries, but hot-reloading directly from a pre-handoff runtime is rejected with
313
- a restart instruction so its in-memory tool ownership cannot be mistaken for
314
- user configuration.
315
-
316
- Developer deliberately leaves compaction ownership to Pi. It does not trigger,
317
- cancel, or replace threshold/overflow compaction, so it cannot override the
318
- user's Pi settings or race another extension. Configure earlier compaction with
319
- Pi's `compaction.reserveTokens` and `compaction.keepRecentTokens` settings when
320
- a large-context model reaches its limit too abruptly.
321
-
322
- Each new agent turn receives current protocol state, and route results place
323
- identity and recovery metadata before potentially long skill instructions. That
324
- makes the active route recoverable after Pi compacts normally. Tool output is
325
- checked against Pi's standard size limits before state changes are committed.
326
- At most twenty pending questions may remain in current state.
167
+ Turning Developer off while work or questions remain asks for confirmation in
168
+ interactive mode. Historical session entries remain; only current protocol state
169
+ is cleared.
170
+
171
+ ## Questions and visible state
172
+
173
+ Developer keeps consequential unknowns explicit instead of silently turning them
174
+ into assumptions. A question records who can resolve it, what evidence or answer
175
+ would close it, and whether it blocks implementation or completion.
176
+
177
+ `/develop questions` shows the explanation before answer controls. User-owned
178
+ questions accept an answer, agent-owned questions can be sent back to Pi for
179
+ investigation, and environment-owned questions identify access or observations
180
+ that must come from outside the session.
181
+
182
+ The footer shows activation and the current route. A compact widget appears only
183
+ while a route or unresolved question exists. `/develop status` and
184
+ `/develop questions` expose the details without requiring users to remember
185
+ internal IDs.
186
+
187
+ Visible routing states include:
188
+
189
+ | State | Meaning |
190
+ | --- | --- |
191
+ | `idle` | No active route or unresolved Developer question |
192
+ | `needs-judgment` | Current route still needs a recorded result |
193
+ | `needs-evidence` | Agent or environment evidence is still required |
194
+ | `needs-answer` | A user decision is still required |
195
+ | `needs-routing` | An implementation landing must be routed again |
196
+ | `needs-verification` | Changed artifacts still need verification |
197
+ | `blocked` | A required answer, observation, or access is unavailable |
198
+
199
+ These are routing states, not timeless product-completion claims. In particular,
200
+ `idle` does not mean that the user's task is complete, and later changes can
201
+ invalidate an earlier verification judgment.
202
+
203
+ ## Tool boundaries
204
+
205
+ While Developer is on:
206
+
207
+ - Pi's built-in `bash` is available for repository inspection and verification
208
+ during skill and implementation routes;
209
+ - built-in `edit` and `write` require an active implementation route with no
210
+ unresolved before-implementation gate;
211
+ - unrelated tools and user-disabled tools keep their existing configuration;
212
+ - product changes still happen through Pi's normal tools, not through
213
+ Developer's coordination tools.
214
+
215
+ These controls protect workflow integrity. They are **not a security sandbox**:
216
+ shell commands are not parsed as a security language, and Pi packages run with
217
+ the access of the Pi process. Review the package before installation and use an
218
+ external sandbox when you need an operating-system security boundary.
219
+
220
+ ## References and auditability
221
+
222
+ A skill's always-needed method lives in `SKILL.md`. Conditional derivations live
223
+ in `references/*.md`, while `reference-policy.json` maps an observable trigger
224
+ to one question, required reference set, expected artifact, stop condition, and
225
+ handoff boundary.
226
+
227
+ During a Developer route, selected references are loaded through a dedicated
228
+ trace rather than an ordinary file read. A resolved judgment connects each
229
+ relied-upon reference to the observed trigger, applied rule, and resulting
230
+ artifact.
231
+ Reference and policy hashes make that application replayable on the current
232
+ branch; they do not by themselves prove source fidelity.
233
+
234
+ See [Reference routing](./REFERENCE_ROUTING.md) for the runtime contract and
235
+ policy schema.
236
+
237
+ ## Branches, compaction, and reloads
238
+
239
+ Routes, judgments, questions, and activation changes are stored in Pi session
240
+ entries and replayed from the current branch. A fork therefore inherits only its
241
+ own branch history.
242
+
243
+ Developer leaves compaction to Pi. Current route and recovery metadata are
244
+ placed where the normal Pi compactor can preserve them. Configure Pi's
245
+ compaction settings if you want an earlier threshold.
246
+
247
+ Developer restores only the built-in tool changes it owns when a session runtime
248
+ shuts down. If a hot reload encounters older Developer history without a safe
249
+ release marker, restart the Pi process rather than guessing the user's original
250
+ tool configuration.
327
251
 
328
252
  ## Update, configure, and remove
329
253
 
@@ -341,27 +265,8 @@ Use a project-local install when a repository should declare the package in
341
265
  pi install -l npm:@hobin/developer
342
266
  ```
343
267
 
344
- Pi packages execute with Pi's system access. Review the extension and skills
345
- before installation. See the [Pi package
346
- documentation](https://pi.dev/docs/latest/packages) for package scope, filtering,
347
- pinning, and security behavior.
348
-
349
- ## Package contents
350
-
351
- ```text
352
- extensions/
353
- ├── developer.ts # command, protocol tools, events, and Pi integration
354
- ├── machine.ts # XState v5 parallel regions, guards, transitions, and tags
355
- ├── references/ # implementation profiles loaded through tool results
356
- ├── state.ts # developer/v5 event normalization and branch replay
357
- ├── skills.ts # loaded-skill filtering and instruction rendering
358
- ├── tool-policy.ts # machine-derived execution and mutation access policy
359
- └── tui.ts # selectors, widget, status panel, and prompt preparation
360
- skills/ # ten independently loadable Pi skills
361
- SOURCES.md # source-to-capability maintenance trace
362
- evals/ # model-dependent scenarios and workspace assertions
363
- tests/ # deterministic state, policy, extension, and TUI tests
364
- ```
268
+ See the [Pi package documentation](https://pi.dev/docs/latest/packages) for
269
+ package scope, filtering, pinning, and security behavior.
365
270
 
366
271
  ## Development
367
272
 
@@ -379,76 +284,14 @@ Load the workspace package into Pi without installing it:
379
284
  pi -e ./packages/developer
380
285
  ```
381
286
 
382
- Launch the isolated surface fixture in a new Ghostty window for visual QA:
383
-
384
- ```sh
385
- ./packages/developer/scripts/ghostty-tui-qa.sh
386
- ```
387
-
388
- Choose each independent scenario from the QA menu:
389
-
390
- 1. **Activation + confirm/cancel** — toggle Off/On on the same Settings surface;
391
- cancel destructive Off and verify the row stays On, then confirm it and verify
392
- the route/questions clear before toggling On again.
393
- 2. **Settings / Status / History / Questions** — open a History judgment,
394
- drag-select detail text and paste it elsewhere, then verify one-level Escape
395
- from detail → History → Settings → scenario menu with parent focus restored.
396
- 3. **Custom answer + Korean IME** — choose **Write another answer…**, then check
397
- composition, validation, review/edit, and preset/custom provenance.
398
- 4. **Resize / scroll / mouse cleanup** — repeatedly resize long Status and
399
- History detail surfaces between wide and narrow layouts; check native mouse
400
- wheel scrolling, border alignment, drag selection, Cmd+C, and paste elsewhere.
401
- 5. **Unicode + compact overlay footprint** — inspect `◆`, `→`, `↑↓`, `·`, `…`,
402
- and Korean glyph alignment, untouched background, and content-bounded overlays.
403
-
404
- Across Developer surfaces, Ghostty owns the mouse: the wheel scrolls terminal
405
- scrollback, ordinary drag selects text, and `Cmd+C` copies it. Wheel movement
406
- never changes the selected list target; use `↑`/`↓` for selection. Potentially
407
- long lists render every row as non-overlay surfaces, while complete two-choice
408
- interruptions remain compact overlays.
409
-
410
- Each scenario creates a fresh in-memory model. Activation events use the same
411
- `applyDeveloperEvent` reducer and `DeveloperSettingsBinding` contract as the
412
- production surface; no state is shared between scenario runs. The fixture does
413
- not append entries, submit answers, register tools, mutate active tools, restore
414
- sessions, start network work, or send model messages. Prepared answers are shown
415
- only as a character count.
416
-
417
- `check` validates package structure and deterministic behavior, including
418
- reload migration detection and shutdown restoration of Developer-owned tool
419
- deltas. `eval` launches the real Pi RPC surface without a model and covers
420
- package resources, commands, activation state, and route-bound tool gating.
421
- These are release-gating checks.
422
-
423
- Model-dependent runs are probabilistic evaluations rather than binary tests:
424
-
425
- ```sh
426
- PI_CODING_AGENT_DIR=~/.pi/agent \
427
- DEVELOPER_EVAL_FIXTURE=agent-before-implementation-evidence-gate \
428
- DEVELOPER_EVAL_TRIALS=5 \
429
- pnpm --filter @hobin/developer eval:live
430
- ```
287
+ `check` validates package structure and deterministic behavior. `eval` exercises
288
+ the real Pi RPC surface without a model. Model-dependent evaluations are
289
+ probabilistic and must not be interpreted as proof from a single successful
290
+ sample.
431
291
 
432
- Use `eval:live:json` for the JSON transport. Each report separates the hard
433
- admissibility envelope from routing quality: structurally valid runs must use an
434
- admissible route, preserve mutation/question/completion invariants, satisfy
435
- hidden artifact checks, include required semantic terms, and end in a declared
436
- outcome. Among accepted runs, `preferredFirstTargets` measures better versus
437
- merely admissible routing. Reports include acceptance and preference rates,
438
- 95% Wilson intervals, inadmissible results, rejected protocol attempts, budget
439
- exhaustion, and environment failures. Any accepted inadmissible result makes the
440
- evaluation command fail; ordinary admissible preference variation remains a
441
- rate. A single model sample is not release evidence.
442
-
443
- Live fixtures classify terminal outcomes as `settled-unchanged`, `pending`,
444
- `changed-paused`, or `changed-verified`. An eval-only observer compares
445
- product-file snapshots around bash/edit/write calls and rejects artifact changes
446
- outside an implementation route. Dedicated fixtures sample a deliberately paused implementation
447
- landing and an agent-owned before-implementation question resolved through a non-implementation
448
- bash evidence route; their structural guarantees also have deterministic machine,
449
- extension, trace, filesystem, and outcome tests. RPC and JSON runners share
450
- route, tool-call, tool-error, wall-clock, and no-progress budgets and preserve a
451
- trace for diagnosis.
292
+ The published npm package contains the runtime extension, skills, user-facing
293
+ documentation, and license. Source audits, evaluation fixtures, scripts, and
294
+ tests remain repository-only maintenance evidence.
452
295
 
453
296
  ## License
454
297