@orkestrel/scaffold 0.0.45 → 0.0.47

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 (37) hide show
  1. package/dist/bin/main.js +179 -44
  2. package/dist/bin/main.js.map +1 -1
  3. package/dist/host/AGENTS.md +1 -0
  4. package/dist/host/agents/orchestration.md +3 -1
  5. package/dist/host/claude/agents/codex.md +4 -4
  6. package/dist/host/claude/agents/orkestrel.md +6 -5
  7. package/dist/host/claude/rules/documentation.md +2 -1
  8. package/dist/host/claude/rules/quality.md +3 -0
  9. package/dist/host/claude/rules/tests.md +19 -0
  10. package/dist/host/claude/rules/workspace.md +28 -21
  11. package/dist/host/claude/settings.json +781 -2
  12. package/dist/host/codex/config.toml +4 -0
  13. package/dist/host/configs/policy.ts +167 -10
  14. package/dist/host/cursor/mcp.json +4 -0
  15. package/dist/host/dotfiles/mcp.json +4 -0
  16. package/dist/host/dotfiles/oxlintrc.json +9 -0
  17. package/dist/host/guides/scaffold.md +143 -44
  18. package/dist/host/scripts/codex.sh +0 -0
  19. package/dist/host/scripts/cursor.sh +0 -0
  20. package/dist/host/scripts/deps.sh +0 -0
  21. package/dist/host/scripts/ollama.sh +0 -0
  22. package/dist/host/tests/config.test.ts +126 -11
  23. package/dist/host/tests/policy.test.ts +7 -0
  24. package/dist/host/tests/setupPolicy.ts +222 -8
  25. package/dist/src/core/index.cjs +420 -23
  26. package/dist/src/core/index.cjs.map +1 -1
  27. package/dist/src/core/index.d.cts +102 -9
  28. package/dist/src/core/index.d.ts +102 -9
  29. package/dist/src/core/index.js +416 -24
  30. package/dist/src/core/index.js.map +1 -1
  31. package/dist/src/server/index.cjs +41 -49
  32. package/dist/src/server/index.cjs.map +1 -1
  33. package/dist/src/server/index.d.cts +9 -8
  34. package/dist/src/server/index.d.ts +9 -8
  35. package/dist/src/server/index.js +42 -50
  36. package/dist/src/server/index.js.map +1 -1
  37. package/package.json +8 -5
@@ -42,7 +42,7 @@ so network-controlled descriptions never enter agent instruction context.
42
42
  | `@orkestrel/browser` | `0.0.11` | L3 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/html` `^0.0.4`, `@orkestrel/websocket` `^0.0.9` |
43
43
  | `@orkestrel/budget` | `0.0.7` | L1 | `@orkestrel/contract` `^0.0.12` |
44
44
  | `@orkestrel/console` | `0.0.9` | L2 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7` |
45
- | `@orkestrel/contract` | `0.0.12` | L0 | |
45
+ | `@orkestrel/contract` | `0.0.13` | L0 | |
46
46
  | `@orkestrel/csv` | `0.0.4` | L1 | `@orkestrel/contract` `^0.0.12` |
47
47
  | `@orkestrel/database` | `0.0.11` | L2 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/indexeddb` `^0.0.8`, `@orkestrel/sqlite` `^0.0.8` |
48
48
  | `@orkestrel/emitter` | `0.0.7` | L1 | `@orkestrel/contract` `^0.0.12` |
@@ -52,13 +52,14 @@ so network-controlled descriptions never enter agent instruction context.
52
52
  | `@orkestrel/indexeddb` | `0.0.8` | L1 | `@orkestrel/contract` `^0.0.12` |
53
53
  | `@orkestrel/interpret` | `0.0.10` | L3 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/reason` `^0.0.7`, `@orkestrel/template` `^0.0.4` |
54
54
  | `@orkestrel/markdown` | `0.0.9` | L2 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/html` `^0.0.4` |
55
- | `@orkestrel/mcp` | `0.0.19` | L3 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/process` `^0.0.3`, `@orkestrel/sse` `^0.0.5`, `@orkestrel/tool` `^0.0.11`, `@orkestrel/websocket` `^0.0.9` |
55
+ | `@orkestrel/mcp` | `0.0.20` | L3 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/process` `^0.0.4`, `@orkestrel/sse` `^0.0.5`, `@orkestrel/tool` `^0.0.11`, `@orkestrel/websocket` `^0.0.9` |
56
56
  | `@orkestrel/middleware` | `0.0.16` | L2 | `@orkestrel/abort` `^0.0.7`, `@orkestrel/budget` `^0.0.7`, `@orkestrel/contract` `^0.0.12`, `@orkestrel/timeout` `^0.0.7` |
57
57
  | `@orkestrel/msg` | `0.0.7` | L0 | |
58
58
  | `@orkestrel/ndjson` | `0.0.7` | L1 | `@orkestrel/contract` `^0.0.12` |
59
59
  | `@orkestrel/ollama` | `0.0.10` | L6 | `@orkestrel/agent` `^0.0.16`, `@orkestrel/budget` `^0.0.7`, `@orkestrel/contract` `^0.0.12`, `@orkestrel/ndjson` `^0.0.7`, `@orkestrel/timeout` `^0.0.7`, `@orkestrel/tool` `^0.0.11` |
60
60
  | `@orkestrel/pool` | `0.0.8` | L2 | `@orkestrel/emitter` `^0.0.7` |
61
- | `@orkestrel/process` | `0.0.3` | L2 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7` |
61
+ | `@orkestrel/probe` | `0.0.2` | L4 | `@orkestrel/contract` `^0.0.13`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/mcp` `^0.0.20`, `@orkestrel/queue` `^0.0.9`, `@orkestrel/timeout` `^0.0.7`, `@orkestrel/tool` `^0.0.11` |
62
+ | `@orkestrel/process` | `0.0.4` | L2 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7` |
62
63
  | `@orkestrel/program` | `0.0.9` | L4 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/qualifier` `^0.0.10`, `@orkestrel/rater` `^0.0.11`, `@orkestrel/reason` `^0.0.7` |
63
64
  | `@orkestrel/qualifier` | `0.0.10` | L3 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/reason` `^0.0.7` |
64
65
  | `@orkestrel/queue` | `0.0.9` | L3 | `@orkestrel/abort` `^0.0.7`, `@orkestrel/contract` `^0.0.12`, `@orkestrel/database` `^0.0.10`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/timeout` `^0.0.7` |
@@ -66,7 +67,7 @@ so network-controlled descriptions never enter agent instruction context.
66
67
  | `@orkestrel/reason` | `0.0.7` | L2 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7` |
67
68
  | `@orkestrel/relation` | `0.0.9` | L3 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/database` `^0.0.10`, `@orkestrel/emitter` `^0.0.7` |
68
69
  | `@orkestrel/router` | `0.0.10` | L2 | `@orkestrel/abort` `^0.0.7`, `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7` |
69
- | `@orkestrel/scaffold` | `0.0.44` | L3 | `@orkestrel/console` `^0.0.8`, `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/markdown` `^0.0.9`, `@orkestrel/process` `^0.0.3`, `@orkestrel/template` `^0.0.4` |
70
+ | `@orkestrel/scaffold` | `0.0.46` | L3 | `@orkestrel/console` `^0.0.9`, `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/markdown` `^0.0.9`, `@orkestrel/process` `^0.0.4`, `@orkestrel/template` `^0.0.4` |
70
71
  | `@orkestrel/sea` | `0.0.9` | L3 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/process` `^0.0.3` |
71
72
  | `@orkestrel/server` | `0.0.14` | L3 | `@orkestrel/abort` `^0.0.7`, `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/router` `^0.0.10`, `@orkestrel/timeout` `^0.0.7` |
72
73
  | `@orkestrel/sqlite` | `0.0.8` | L1 | `@orkestrel/contract` `^0.0.12` |
@@ -75,7 +76,7 @@ so network-controlled descriptions never enter agent instruction context.
75
76
  | `@orkestrel/table` | `0.0.2` | L2 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7` |
76
77
  | `@orkestrel/template` | `0.0.4` | L2 | `@orkestrel/contract` `^0.0.12`, `@orkestrel/emitter` `^0.0.7` |
77
78
  | `@orkestrel/terminal` | `0.0.11` | L3 | `@orkestrel/console` `^0.0.8`, `@orkestrel/contract` `^0.0.12`, `@orkestrel/database` `^0.0.11`, `@orkestrel/emitter` `^0.0.7`, `@orkestrel/form` `^0.0.2`, `@orkestrel/sse` `^0.0.5` |
78
- | `@orkestrel/test` | `0.0.7` | L0 | |
79
+ | `@orkestrel/test` | `0.0.8` | L0 | |
79
80
  | `@orkestrel/timeout` | `0.0.7` | L1 | `@orkestrel/contract` `^0.0.12` |
80
81
  | `@orkestrel/tool` | `0.0.11` | L1 | `@orkestrel/contract` `^0.0.12` |
81
82
  | `@orkestrel/toolbox` | `0.0.7` | L6 | `@orkestrel/agent` `^0.0.16`, `@orkestrel/contract` `^0.0.12`, `@orkestrel/database` `^0.0.10`, `@orkestrel/form` `^0.0.2`, `@orkestrel/relation` `^0.0.9`, `@orkestrel/server` `^0.0.13`, `@orkestrel/terminal` `^0.0.10`, `@orkestrel/tool` `^0.0.11`, `@orkestrel/workflow` `^0.0.13`, `@orkestrel/workspace` `^0.0.5` |
@@ -69,8 +69,9 @@ Never use in-repository `@src/*` aliases in public guide examples; reserve them
69
69
  - Set `name` to the skill's own directory name.
70
70
  - Write `description` as a single-line scalar or a folded `>-` block, and no other shape. Include in it a sentence beginning `Use ` that names when to invoke the skill.
71
71
  - Do not put model routing or package version catalogs in a skill.
72
- - Validate every referenced resource; do not leave template TODOs or auxiliary README/changelog files.
72
+ - Validate every referenced resource, leave no template TODOs, and limit each skill directory to `SKILL.md`, `agents/openai.yaml`, and the `references/*.md` files its `SKILL.md` names; add no other file or directory.
73
73
  - Write `agents/openai.yaml` as one root `interface:` mapping over exactly `display_name`, `short_description`, and `default_prompt`, in that order, each on its own two-space-indented line.
74
+ - Research the external schema only when a consumer needs a key outside `display_name`, `short_description`, and `default_prompt`, and add no key before then.
74
75
  - Give every one of those keys a non-empty single-quoted scalar, and write an apostrophe inside it as `''`.
75
76
  - Name the skill's own `$<directory>` token in `default_prompt`.
76
77
  - Keep provider bridges minimal: they load one canonical workflow and add no competing instructions.
@@ -59,6 +59,9 @@ A review that reads a diff finds what the diff shows. A review that tries to bre
59
59
  ### Instruments
60
60
 
61
61
  - An instrument is not evidence until it has failed. Pair every probe, comparison, or matrix with a negative control that must report failure, run under the same conditions. An identity check whose control reports "same" has measured nothing.
62
+ - When a question about a TypeScript edit can supply a workspace project, a case of workspace files with a test, and a negative control naming its files, its test, the stage it must fail at, and why, call the `prove` tool the `probe` MCP server registers before relying on the answer. When the question supplies no project, no case, or no control, follow `.claude/rules/tests.md` § Probes and report the fallback instrument's own control and coverage.
63
+ - Quote the closing line of the `prove` answer verbatim in every report, brief, and audit verdict that rests on the claim: the `receipt probe:<digest>:…` line when the case ran clean and the control broke exactly where the claim declared it would, and the `no receipt` line otherwise. A `no receipt` line leaves the claim unproved — report it with the stage that refused.
64
+ - Read a receipt as evidence about its claim, never as a gate result. The gate chain still runs, and `verifier` still owns its result.
62
65
  - Draw the negative control from outside the population the instrument covers. Name the instrument's membership rule first, then pick a control that rule excludes. A control sampled from constructs the instrument already handles proves only that it discriminates among those constructs, and says nothing about the class it silently cannot reach.
63
66
  - State an instrument's coverage beside its result. A conclusion inherits the instrument's scope, not the question's. An unstated coverage claim is read as complete, and it never is. A search proves something about the paths it walked, so name them.
64
67
  - Match the instrument to the question. A text search reports on text, so a claim about declarations, call sites, or structure needs the compiler or a parser instead. A pattern written for one spelling of a construct reports on that spelling alone. A path check answers relative to the directory it runs from, so resolve the inputs against their own base before reading a miss as a finding.
@@ -93,6 +93,14 @@ its own:
93
93
 
94
94
  A probe is a throwaway instrument that settles one question. It is not a test and never ships.
95
95
 
96
+ Route the question before writing a probe. When you can state the edit you believe is correct and the
97
+ edit that must break with the stage it breaks at, the question is a claim for the `prove` tool the
98
+ `probe` MCP server registers, and `.claude/rules/quality.md` § Instruments owns that rule. When the
99
+ question carries no stated belief to falsify yet, when the subject lies outside the TypeScript a
100
+ workspace project judges, or when the proof needs what that tool's stages do not model — a process
101
+ tree, a listening socket, an installed package, a built entry driven as a child, or a live external
102
+ service — write a probe.
103
+
96
104
  The kinds split by which tool has to see the probe:
97
105
 
98
106
  - A **type probe** is read by `tsc`, whose scoped project includes only its own environment, so it
@@ -101,11 +109,22 @@ The kinds split by which tool has to see the probe:
101
109
  - A **runtime probe** is collected by a Vitest project, so it lives in `tmp/probe/` and runs through
102
110
  the `probe` project. `tmp/` is ignored by git, so no probe enters a commit by accident, and every
103
111
  test script names its project, so no gate runs the `probe` project.
112
+ - A **bench** is read by Vitest's benchmark mode, so it lives inside a test file as a block behind
113
+ the `if (import.meta.env.MODE === 'benchmark')` guard. Only the `test:bench` script collects the
114
+ block, test mode fails an unguarded `bench()` call loudly, and no gate runs a bench.
104
115
 
105
116
  Run a probe before relying on an unverified belief about behaviour: what a function returns, what a
106
117
  configuration resolves to, whether a path is reached at all. Prefer a probe to an argument whenever
107
118
  the probe is cheap.
108
119
 
120
+ When the question is whether the difference between methods is a magnitude or negligible, write a
121
+ guarded bench block beside the probe test and run the `test:bench` script. Declare the threshold
122
+ before the run, read the ratio between the methods against each side's reported uncertainty, and
123
+ record nothing below a magnitude. A settled magnitude that underwrites an implementation choice
124
+ promotes with its test into the mirrored suite and keeps its guarded block there while that choice
125
+ stands. A deterministic relationship promotes as an ordinary assertion, so delete the block. Never
126
+ commit baseline output.
127
+
109
128
  These rules bind every probe:
110
129
 
111
130
  - **Prove the instrument can fail before trusting that it passed.** Pair it with a control drawn
@@ -150,9 +150,15 @@ parallelism in `service`. In a `private: true` workspace, never declare `prepubl
150
150
  configuration.
151
151
 
152
152
  One project sits on neither axis. `probe` includes `tmp/probe/**/*.test.ts` so an agent can run a
153
- throwaway instrument against real sources, aliases and setup. Declare no proof there. Every test
154
- script names its project, so no gate runs it; its directory is ignored by git; and
155
- `.claude/rules/tests.md` governs what may live there.
153
+ throwaway instrument against real sources, aliases and setup. Declare no proof there. Keep the
154
+ project composed in the root configuration rather than declared as a path string. The `probe` MCP
155
+ server arms through it — its arming specifications live under the `tmp/probe/` directory and infer
156
+ this project — so a workspace that removes the project, or declares it as a path string, fails the
157
+ server's arming, and an unarmed server refuses every `prove` call. The `test:bench` script runs the
158
+ same project in benchmark mode, which collects every test file under the `tmp/probe/` directory and
159
+ the `tests/` tree while refusing every ordinary test case. Every test script names its project and
160
+ the `test:bench` script joins no chain, so no gate runs either mode; the project's directory is
161
+ ignored by git; and `.claude/rules/tests.md` governs what may live there.
156
162
 
157
163
  - Define a cross-cutting project only for a proof the package actually has.
158
164
  - A live-service project is the `service` project in the preceding table, `scripts/service.sh`
@@ -208,24 +214,25 @@ Build/check config alignment:
208
214
 
209
215
  ## Script intent
210
216
 
211
- | Script | Contract |
212
- | ----------------------- | ----------------------------------------------------------------- |
213
- | `dev` | Browser development entry |
214
- | `build` | Build configured library/application targets |
215
- | `serve` / `serve:build` | Run built server / build then run |
216
- | `showcase` | Showcase dev server |
217
- | `build:showcase` | Build `dist/showcase` |
218
- | `show` | Build and copy showcase to `demo/showcase.html` |
219
- | `lint` | `oxlint --config .oxlintrc.json --fix .`; separate from typecheck |
220
- | `lint:check` | Non-mutating whole-tree lint gate |
221
- | `check` | Comprehensive root typecheck plus configured isolation scopes |
222
- | `check:<scope>` | On-demand environment-isolation pass |
223
- | `format` | Format all files |
224
- | `format:check` | Non-mutating whole-tree format gate |
225
- | `test` | Environment projects plus non-isolated cross-cutting proofs |
226
- | `clean` | Remove `dist/` |
227
- | `copy <from> <to>` | Copy while creating parent directories |
228
- | `prepublishOnly` | Publishing workspaces only: the gate chain, then isolated proofs |
217
+ | Script | Contract |
218
+ | ----------------------- | -------------------------------------------------------------------------- |
219
+ | `dev` | Browser development entry |
220
+ | `build` | Build configured library/application targets |
221
+ | `serve` / `serve:build` | Run built server / build then run |
222
+ | `showcase` | Showcase dev server |
223
+ | `build:showcase` | Build `dist/showcase` |
224
+ | `show` | Build and copy showcase to `demo/showcase.html` |
225
+ | `lint` | `oxlint --config .oxlintrc.json --fix .`; separate from typecheck |
226
+ | `lint:check` | Non-mutating whole-tree lint gate |
227
+ | `check` | Comprehensive root typecheck plus configured isolation scopes |
228
+ | `check:<scope>` | On-demand environment-isolation pass |
229
+ | `format` | Format all files |
230
+ | `format:check` | Non-mutating whole-tree format gate |
231
+ | `test` | Environment projects plus non-isolated cross-cutting proofs |
232
+ | `clean` | Remove `dist/` |
233
+ | `copy <from> <to>` | Copy while creating parent directories |
234
+ | `prepublishOnly` | Publishing workspaces only: the gate chain, then isolated proofs |
235
+ | `prepack` | Publishing workspaces only: rebuild `dist/` so a pack ships current output |
229
236
 
230
237
  Run `show` only **after** formatting. The committed `demo/showcase.html` is generated/minified; formatting after generation would expand its inlined bundle.
231
238