@orkestrel/scaffold 0.0.108 → 0.0.110

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 (162) hide show
  1. package/dist/agents/skills/orkestrel-dispatch/scripts/bench.js +326 -91
  2. package/dist/agents/skills/orkestrel-dispatch/scripts/brief.js +110 -14
  3. package/dist/agents/skills/orkestrel-dispatch/scripts/chain.js +280 -0
  4. package/dist/agents/skills/orkestrel-dispatch/scripts/cite.js +188 -26
  5. package/dist/agents/skills/orkestrel-dispatch/scripts/launch.js +142 -43
  6. package/dist/agents/skills/orkestrel-dispatch/scripts/login.js +240 -62
  7. package/dist/agents/skills/orkestrel-dispatch/scripts/patch.js +323 -0
  8. package/dist/agents/skills/orkestrel-dispatch/scripts/result.js +169 -32
  9. package/dist/agents/skills/orkestrel-dispatch/scripts/sweep.js +290 -69
  10. package/dist/agents/skills/orkestrel-falsify/scripts/mutate.js +560 -0
  11. package/dist/agents/skills/orkestrel-harden/scripts/discovery.js +1052 -205
  12. package/dist/agents/skills/orkestrel-harden/scripts/measure.js +361 -0
  13. package/dist/agents/skills/orkestrel-harden/scripts/titles.js +455 -80
  14. package/dist/agents/skills/orkestrel-parallel/scripts/cases.js +327 -0
  15. package/dist/agents/skills/orkestrel-publish/scripts/compare.js +298 -51
  16. package/dist/agents/skills/orkestrel-publish/scripts/pins.js +170 -13
  17. package/dist/agents/skills/orkestrel-publish/scripts/swap.js +956 -191
  18. package/dist/agents/skills/orkestrel-publish/scripts/wave.js +707 -112
  19. package/dist/agents/skills/orkestrel-publish/scripts/window.js +235 -41
  20. package/dist/agents/skills/orkestrel-scout/scripts/map.js +341 -54
  21. package/dist/agents/templates/brief.md +6 -2
  22. package/dist/bin/main.js +51 -46
  23. package/dist/bin/main.js.map +1 -1
  24. package/dist/host/AGENTS.md +23 -21
  25. package/dist/host/agents/orchestration.md +85 -54
  26. package/dist/host/agents/platforms/windows.md +8 -3
  27. package/dist/host/agents/skills/orkestrel-align/SKILL.md +10 -13
  28. package/dist/host/agents/skills/orkestrel-align/references/fleet.md +4 -10
  29. package/dist/host/agents/skills/orkestrel-align/references/integration.md +1 -1
  30. package/dist/host/agents/skills/orkestrel-build/SKILL.md +16 -48
  31. package/dist/host/agents/skills/orkestrel-build/agents/openai.yaml +1 -1
  32. package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +19 -16
  33. package/dist/host/agents/skills/orkestrel-debrief/agents/openai.yaml +1 -1
  34. package/dist/host/agents/skills/orkestrel-debrief/references/field-testing.md +15 -28
  35. package/dist/host/agents/skills/orkestrel-debrief/references/instruction-audit.md +5 -6
  36. package/dist/host/agents/skills/orkestrel-debrief/references/retention.md +4 -6
  37. package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +36 -25
  38. package/dist/host/agents/skills/orkestrel-dispatch/references/launch.md +4 -5
  39. package/dist/host/agents/skills/orkestrel-dispatch/scripts/bench.ts +366 -75
  40. package/dist/host/agents/skills/orkestrel-dispatch/scripts/brief.ts +126 -16
  41. package/dist/host/agents/skills/orkestrel-dispatch/scripts/chain.ts +323 -0
  42. package/dist/host/agents/skills/orkestrel-dispatch/scripts/cite.ts +220 -31
  43. package/dist/host/agents/skills/orkestrel-dispatch/scripts/launch.ts +176 -33
  44. package/dist/host/agents/skills/orkestrel-dispatch/scripts/login.ts +294 -59
  45. package/dist/host/agents/skills/orkestrel-dispatch/scripts/patch.ts +401 -0
  46. package/dist/host/agents/skills/orkestrel-dispatch/scripts/result.ts +199 -34
  47. package/dist/host/agents/skills/orkestrel-dispatch/scripts/sweep.ts +330 -69
  48. package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +14 -12
  49. package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +2 -5
  50. package/dist/host/agents/skills/orkestrel-falsify/references/reconcile.md +2 -1
  51. package/dist/host/agents/skills/orkestrel-falsify/scripts/mutate.ts +701 -0
  52. package/dist/host/agents/skills/orkestrel-harden/SKILL.md +31 -24
  53. package/dist/host/agents/skills/orkestrel-harden/references/bindings.md +23 -81
  54. package/dist/host/agents/skills/orkestrel-harden/references/centralization.md +4 -5
  55. package/dist/host/agents/skills/orkestrel-harden/references/contract.md +2 -0
  56. package/dist/host/agents/skills/orkestrel-harden/references/document.md +33 -0
  57. package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +6 -3
  58. package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +34 -18
  59. package/dist/host/agents/skills/orkestrel-harden/references/research.md +2 -0
  60. package/dist/host/agents/skills/orkestrel-harden/scripts/discovery.ts +1272 -279
  61. package/dist/host/agents/skills/orkestrel-harden/scripts/measure.ts +425 -0
  62. package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +603 -98
  63. package/dist/host/agents/skills/orkestrel-journey/SKILL.md +79 -98
  64. package/dist/host/agents/skills/orkestrel-journey/references/captures.md +54 -17
  65. package/dist/host/agents/skills/orkestrel-journey/references/decide.md +1 -20
  66. package/dist/host/agents/skills/orkestrel-journey/references/layer.md +21 -31
  67. package/dist/host/agents/skills/orkestrel-journey/references/styles.md +1 -1
  68. package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +33 -29
  69. package/dist/host/agents/skills/orkestrel-parallel/references/claude.md +15 -13
  70. package/dist/host/agents/skills/orkestrel-parallel/references/cloud.md +28 -0
  71. package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +1 -0
  72. package/dist/host/agents/skills/orkestrel-parallel/references/cursor.md +13 -13
  73. package/dist/host/agents/skills/orkestrel-parallel/references/t3.md +13 -13
  74. package/dist/host/agents/skills/orkestrel-parallel/scripts/cases.ts +389 -0
  75. package/dist/host/agents/skills/orkestrel-polish/SKILL.md +16 -20
  76. package/dist/host/agents/skills/orkestrel-polish/references/capture-harness.md +16 -26
  77. package/dist/host/agents/skills/orkestrel-publish/SKILL.md +12 -26
  78. package/dist/host/agents/skills/orkestrel-publish/agents/openai.yaml +2 -2
  79. package/dist/host/agents/skills/orkestrel-publish/references/adopt.md +23 -0
  80. package/dist/host/agents/skills/orkestrel-publish/references/release.md +4 -4
  81. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +13 -10
  82. package/dist/host/agents/skills/orkestrel-publish/references/window.md +21 -26
  83. package/dist/host/agents/skills/orkestrel-publish/scripts/compare.ts +348 -59
  84. package/dist/host/agents/skills/orkestrel-publish/scripts/pins.ts +202 -22
  85. package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +1061 -191
  86. package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +812 -140
  87. package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +280 -38
  88. package/dist/host/agents/skills/orkestrel-scout/SKILL.md +3 -3
  89. package/dist/host/agents/skills/orkestrel-scout/scripts/map.ts +428 -70
  90. package/dist/host/agents/templates/brief.md +6 -2
  91. package/dist/host/agents/transports/claude-cli.md +3 -3
  92. package/dist/host/agents/transports/codex.md +3 -8
  93. package/dist/host/agents/transports/cursor.md +2 -3
  94. package/dist/host/claude/AGENTS.md +2 -3
  95. package/dist/host/claude/agents/analyst.md +3 -3
  96. package/dist/host/claude/agents/astra.md +4 -4
  97. package/dist/host/claude/agents/builder.md +4 -3
  98. package/dist/host/claude/agents/checker.md +1 -1
  99. package/dist/host/claude/agents/distiller.md +1 -1
  100. package/dist/host/claude/agents/grok.md +1 -1
  101. package/dist/host/claude/agents/opus.md +3 -3
  102. package/dist/host/claude/agents/orkestrel.md +57 -90
  103. package/dist/host/claude/agents/researcher.md +1 -1
  104. package/dist/host/claude/agents/reviewer.md +6 -2
  105. package/dist/host/claude/agents/scout.md +1 -1
  106. package/dist/host/claude/agents/verifier.md +2 -2
  107. package/dist/host/claude/rules/application.md +14 -21
  108. package/dist/host/claude/rules/architecture.md +34 -44
  109. package/dist/host/claude/rules/browser.md +3 -4
  110. package/dist/host/claude/rules/campaign.md +3 -2
  111. package/dist/host/claude/rules/documentation.md +25 -12
  112. package/dist/host/claude/rules/names.md +9 -4
  113. package/dist/host/claude/rules/patterns.md +6 -7
  114. package/dist/host/claude/rules/portability.md +1 -1
  115. package/dist/host/claude/rules/quality.md +7 -6
  116. package/dist/host/claude/rules/styles.md +2 -2
  117. package/dist/host/claude/rules/tests.md +68 -115
  118. package/dist/host/claude/rules/typescript.md +7 -9
  119. package/dist/host/claude/rules/workspace.md +27 -26
  120. package/dist/host/claude/rules/writing.md +2 -5
  121. package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
  122. package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
  123. package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -1
  124. package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
  125. package/dist/host/codex/agents/analyst.toml +9 -3
  126. package/dist/host/codex/agents/astra.toml +10 -7
  127. package/dist/host/codex/agents/builder.toml +4 -4
  128. package/dist/host/codex/agents/opus.toml +6 -6
  129. package/dist/host/codex/agents/orkestrel.toml +1 -1
  130. package/dist/host/codex/agents/researcher.toml +2 -2
  131. package/dist/host/codex/agents/reviewer.toml +2 -2
  132. package/dist/host/codex/agents/verifier.toml +4 -4
  133. package/dist/host/codex/config.toml +1 -1
  134. package/dist/host/configs/helpers.ts +21 -1
  135. package/dist/host/configs/policy.ts +299 -15
  136. package/dist/host/cursor/rules/orchestration.mdc +1 -1
  137. package/dist/host/dotfiles/oxlintrc.json +137 -3
  138. package/dist/host/guides/agent.md +111 -134
  139. package/dist/host/guides/capture.md +801 -0
  140. package/dist/host/guides/probe.md +27 -8
  141. package/dist/host/guides/scaffold.md +97 -19
  142. package/dist/host/guides/study.md +534 -440
  143. package/dist/host/guides/test.md +111 -44
  144. package/dist/host/manifest.json +170 -244
  145. package/dist/host/tests/config.test.ts +977 -187
  146. package/dist/host/tests/policy.test.ts +165 -1
  147. package/dist/host/tests/setupPolicy.ts +1246 -33
  148. package/dist/src/core/index.cjs +222 -90
  149. package/dist/src/core/index.cjs.map +1 -1
  150. package/dist/src/core/index.d.cts +126 -40
  151. package/dist/src/core/index.d.ts +126 -40
  152. package/dist/src/core/index.js +217 -89
  153. package/dist/src/core/index.js.map +1 -1
  154. package/dist/src/server/index.cjs +20 -27
  155. package/dist/src/server/index.cjs.map +1 -1
  156. package/dist/src/server/index.js +21 -28
  157. package/dist/src/server/index.js.map +1 -1
  158. package/package.json +11 -11
  159. package/dist/agents/skills/orkestrel-dispatch/scripts/helpers.js +0 -283
  160. package/dist/host/agents/skills/orkestrel-dispatch/references/bench.md +0 -25
  161. package/dist/host/agents/skills/orkestrel-dispatch/scripts/helpers.ts +0 -333
  162. package/dist/host/guides/supervisor.md +0 -4890
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: orkestrel-harden
3
- description: Research, audit, refactor, implement, centralize, test, document, and locally verify an individual Orkestrel TypeScript package to enterprise-grade production readiness under the repository's current AGENTS.md. Use when asked to fill missing or deferred capabilities, compare upstream or legacy implementations, salvage prior art, centralize source or test declarations, eliminate nested functions or superfluous wrappers, maximize declared @orkestrel dependencies—especially @orkestrel/contract—or add rigorous real-implementation and live-service tests. Select only the phases required by a narrow request; run the full workflow for production readiness or comprehensive hardening.
3
+ description: Research, audit, refactor, implement, centralize, test, document, and locally verify an individual Orkestrel TypeScript package to enterprise-grade production readiness of its own contract on its supported hosts under the repository's current AGENTS.md. Use when asked to fill missing or deferred capabilities, compare upstream or legacy implementations, salvage prior art, centralize source or test declarations, eliminate nested functions or superfluous wrappers, maximize declared @orkestrel dependencies—especially @orkestrel/contract—or add rigorous real-implementation and live-service tests. Select only the phases required by a narrow request; run the full workflow for production readiness or comprehensive hardening. A guide, README, or TSDoc pass on one package runs the document phase alone.
4
4
  ---
5
5
 
6
6
  # Harden an Orkestrel package
@@ -11,10 +11,11 @@ description: Research, audit, refactor, implement, centralize, test, document, a
11
11
 
12
12
  ## Scripts
13
13
 
14
- | Script | Does |
15
- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16
- | `scripts/discovery.ts` | `[--config vite.config.ts] [--projects a,b] [--json]`, run from the checkout root: let Vitest select each gate. Follow root npm script chains and forwarded arguments. Collect an unfiltered universe per config, mode, root, and directory, including the base config. For a root or directory without an explicit config, let Vitest resolve its config. Pass gate arguments verbatim and in order, including separator tokens; remove only reporter, output-file, coverage, color, cache, silent, UI, watch, run-mode, inspector, and standalone options, reading their spellings and arity from installed Vitest help. A listing that outlasts its time limit exits 2 naming its gate. Reuse identical listings and the universe for a gate with no arguments. Use `--filesOnly` for file selection; collect in full for name, tag, line, shard, allow-only, and strict-tag options. Add `--includeTaskLocation` to full listings and compare file, project, name, line, and column without folding browser names. Merge identities across units and retain repeated entries within a listing. Ignore bench, list, mergeReports, listTags, and clearCache invocations as gates. Accept a non-Vitest command that runs a test file directly. Flag partly ungated rows and undiscovered test files. Classify empty rows from Vitest listings; flag an empty project when a chain containing `>` names it, otherwise report a workbench. With `--projects`, let Vitest select the reporting scope and omit the undiscovered-file census. Retry a census when test files change in the workspace, gate roots/directories, or their `tmp/probes` workbenches; refuse changes during the retry. Read files, tests, gates, units, and marker counts in the result. Expect exit 0 with no findings, 3 with findings, 2 for missing Vitest, unsupported related commands, CLI/help/argument/listing/output failures, repeated test-file changes, or filesystem/JSON errors, and 64 on usage. Read the named gate and arguments when Vitest refuses a gate listing. |
17
- | `scripts/titles.ts` | `--base REV [--root DIR] [--json] [--out FILE]`, run from the checkout root: list every literal `describe`, `it`, and `test` title of the `tests/**/*.test.ts` files at `REV` that the working tree's `tests/**/*.test.ts` files no longer carry as often, comparing exact title text. Balance each-table arguments over code tokens, skipping strings, templates, comments, and regex. Report a missing title that a working-tree `tests/**/*.ts` file holds as a string literal as moved, with that file. Expect exit 0 when no title is missing, 3 when one is, 2 on git, filesystem, lexical, or unbalanced each-argument refusal, and 64 on usage. |
14
+ Run each from the checkout root. Each script's opening comment owns its behavior.
15
+
16
+ - `scripts/discovery.ts [--config vite.config.ts] [--projects a,b] [--json]` censuses which project collects each test file and which root script chain (a gate) reaches each project. It needs `npm ci` first. It flags a project whose tests no gate lists (ungated), a chained project that collects nothing (empty), and a test or spec file under `tests/` that no project collects and no `node` command runs (undiscovered). It reports without a flag the marker counts per file (`.todo`, `.skipIf`, `.runIf`, `.fails`, a `retry` or timeout option, a numeric timeout argument; `vitest/no-focused-tests` and `vitest/no-disabled-tests` refuse `.only` and `.skip`) and each workbench, an empty project no chain names. The reader rules every marker and reads the chain behind every workbench. Full collection passes `--staticParse=false` to evaluate runtime titles, setup modules, and shard selection. `--projects` lists only the named projects (an exact name never lists another; a name holding `*` or opening with `!` is a Vitest pattern and may reach beyond the names), exits 64 for a name no project matches without listing any other project, and skips the undiscovered scan. Exit 0 no flag, 3 a flag, 2 tool, listing, or option-table failure, 64 usage.
17
+ - `scripts/titles.ts --base REV [--root DIR] [--json] [--out FILE.json|FILE.txt]` compares the `describe`, `it`, `test`, and `suite` titles of `tests/**/*.test.ts` against `REV`. It flags a title registered fewer times than at `REV` as missing, or as moved when another string literal in `tests/**/*.ts` spells it; the reader rules each moved row by reading its holder. It reports each registration whose title is no literal (dynamic), which the comparison cannot follow, and flags a file that registers fewer of them than at `REV` (lost dynamic). It cannot see a removed `.each` table row or a title registered through an alias such as a `test.extend` result. `--root` defaults to the working directory and may sit below the repository top; `REV` may not open with `-`. Exit 0 no missing or moved title and no lost-dynamic file, 3 any of them, 2 git, filesystem, or lexical refusal, 64 usage.
18
+ - `scripts/measure.ts --rule ID [--options JSON] PATH...` counts one lint rule's hits over the named paths before the rule is enabled. It writes a variant config under `tmp/probes/lint/` that enables only that rule as an error beside the workspace's `plugins` and `jsPlugins` (so a `policy/` rule loads), runs the installed oxlint from the checkout root, and prints the total and the hits per file. A hit is a diagnostic whose code names the rule; another diagnostic, a parse error included, or a linter status other than a clean 0 or 1 refuses the count. `--options` is the rule's JSON options, an array spread after `error` or one value. The variant carries no `ignorePatterns` and no override, so it reads exactly the named paths. It needs `npm ci` first. Exit 0 no hit, 3 a hit, 2 the config or the linter cannot run or reports another diagnostic, 64 usage.
18
19
 
19
20
  ## Select the work lane
20
21
 
@@ -23,6 +24,7 @@ Choose the smallest lane that fully satisfies the request:
23
24
  - **Structural:** centralization, nested-function removal, wrapper cleanup, or test-infrastructure consolidation.
24
25
  - **Capability:** research and implement named missing behavior or upstream parity.
25
26
  - **Hardening:** perform the complete production-readiness workflow.
27
+ - **Documentation:** a guide, README, or TSDoc pass on one package; it runs step 10 alone.
26
28
 
27
29
  A narrow structural request does not authorize unrelated API redesign. A hardening request does authorize fixing every verified in-scope defect and completing every in-scope deferred capability.
28
30
 
@@ -32,38 +34,43 @@ Load [contract.md](references/contract.md) whenever the package declares `@orkes
32
34
 
33
35
  Load [centralization.md](references/centralization.md) for every structural lane and as a mandatory cleanup pass after capability or hardening work.
34
36
 
35
- Load [hardening.md](references/hardening.md) for the hardening lane and for any request involving concurrency, lifecycle pressure, security boundaries, real services/models, test discovery, or package inspection.
37
+ Load [hardening.md](references/hardening.md) for the hardening lane, for any request involving concurrency, lifecycle pressure, security boundaries, real services/models, test discovery, or package inspection, and before any repair round at a seam.
38
+
39
+ Load [document.md](references/document.md) for the documentation lane and for step 10 of every other lane.
36
40
 
37
- Load [bindings.md](references/bindings.md) for a census or a sweep under `.claude/rules/typescript.md` § Bindings, together with [equivalence.md](references/equivalence.md).
41
+ Load [bindings.md](references/bindings.md) for a census or a sweep under `.claude/rules/typescript.md` § Bindings, together with [equivalence.md](references/equivalence.md). Before a census item becomes a lint rule, count the rule's hits with `scripts/measure.ts`.
38
42
 
39
43
  Load [equivalence.md](references/equivalence.md) for a structural lane whose rewrite claims unchanged behavior, and cite it in the claims of the review that judges one.
40
44
 
41
45
  ## Execute the workflow
42
46
 
43
- 1. **Bound the campaign.** Record requested outcomes, in-scope environments/domains, explicit exclusions, supported hosts, dirty files, and evidence needed for acceptance.
47
+ 1. **Bound the campaign.** Record requested outcomes, in-scope environments and domains, explicit exclusions, supported hosts, dirty files, and the evidence acceptance needs. Draw the package's bounds: the contract its types and guide promise, the hosts it supports, and each host, runtime, or harness behavior it depends on but does not own, with what the contract promises when that behavior fails. Set the campaign's stops from the package's complexity and the goal's importance (the repair effort a seam receives before a design question, the pressure a proof applies, the cost a round may spend), state each stop with its reason in `.orkestrel/<package>/plan.md`, and re-examine every stop at each phase boundary. As soon as a candidate commit exists, run the package's release chain in a fresh clone on each reachable supported host, before any review round, as a baseline observation that `.agents/orchestration.md` § Campaign's Verify phase replaces, and rerun only the checks a later change invalidates.
44
48
  2. **Map before editing.** Trace public types, implementations, callers, tests, guides, exports, runtime boundaries, installed Orkestrel dependencies, and applicable legacy/upstream references.
45
- 3. **Establish the intended contract.** Build a capability/defect matrix. Separate verified fact from inference. Mark each row implement, repair, retain, or exclude with a reason. The matrix is fixed at this step and is the campaign's definition of done: every later step serves a row, and work that serves no row belongs to the next campaign. The row set is fixed; the planned work that closes it is not. Re-baseline that work at each phase boundary per `.agents/orchestration.md`, which owns the step and its boundary with rescoping.
46
- 4. **Design types first.** Update guide/spec intent and `*/types.ts` before implementation, under the root design laws. A contract that needs a compatibility shim is the wrong contract.
47
- 5. **Implement completely.** Finish every in-scope branch and reuse the exact installed Orkestrel primitives whose semantics match. The root completion law decides what may not be left behind.
49
+ 3. **Establish the intended contract.** Build a capability/defect matrix inside the bounds step 1 drew, per [hardening.md](references/hardening.md) § Build the risk and seam matrix. Separate verified fact from inference. Mark each row implement, repair, retain, or exclude with a reason. Record the matrix in the tracked `.orkestrel/<package>/plan.md` as claims, a release bar, and a deferral list before the first writer: the claims are the campaign's definition of done; the bar names the observable consequences that make a finding outside the claims blocking; the deferral list (`.claude/rules/campaign.md` § Content) holds every other finding. The row set is fixed at this step: a finding a later step raises enters a row's repair or the deferral list, never the row set, and a row the user adds is a rescoping the ledger records. Re-baseline the planned work at each phase boundary per `.agents/orchestration.md`, which owns the step and its boundary with rescoping.
50
+ 4. **Design types first.** Update `*/types.ts` and record the design decision before implementation, under the root design laws; write guide prose at the root's final pass. A contract that needs a compatibility shim is the wrong contract.
51
+ 5. **Implement completely.** Finish every in-scope branch and reuse the exact installed Orkestrel primitives whose semantics match.
48
52
  6. **Prove each defect before repairing it** per the defect rule in `AGENTS.md` § Work loop. A repair with no red-then-green record is unproven.
49
53
  7. **Consolidate.** Run the complete centralization and wrapper sweep. Update all call sites to the real symbol rather than leaving aliases or 1:1 delegates.
50
- 8. **Challenge seams.** Add deterministic tests for invariants, boundaries, failures, lifecycle, cleanup, cancellation, concurrency, malformed or unexpected input, and resource pressure as applicable, under the test rules' real-implementation law.
51
- 9. **Use live services deliberately.** Put real external services/models in their dedicated project, require readiness, and make each request minimally sufficient, stable across the service's nondeterminism, and behaviorally meaningful. When the claim is that a foreign client can use this package, drive one representative real client end to end.
52
- 10. **Document the final behavior.** Update the governing guide, examples, method tables, limitations, and parity coverage. Document architectural limits honestly.
53
- 11. **Audit completion.** Run `node .agents/skills/orkestrel-harden/scripts/discovery.ts` and rule on every flag and marker it reports, then inspect source/test helper duplication, exports, environment isolation, unexpected text corruption, and the entire diff.
54
- 12. **Verify.** Run the repository-prescribed gates in order and inspect the generated outputs relevant to the request.
55
- 13. **Review by the size gate, never by the author.** Run the review `.agents/orchestration.md` § Size gate names for the change, resolve every required finding, then rerun the affected scoped verification.
54
+ 8. **Challenge seams within the bounds.** Add deterministic tests for invariants, boundaries, failures, lifecycle, cleanup, cancellation, concurrency, malformed or unexpected input, and resource pressure as applicable, under the test rules' real-implementation law and [hardening.md](references/hardening.md) § Challenge lifecycle and pressure. A seam is the package's contract meeting a boundary; prove a boundary the package does not own only as far as the contract promises about it, and treat a finding past that promise per [hardening.md](references/hardening.md) § Hold the package's bounds. Set each pressure proof per that section, which points at `.claude/rules/tests.md` § Expensive proofs for the repeat count and acceptance under suite load.
55
+ 9. **Use live services deliberately.** Put real external services/models in their dedicated project, require readiness, and make each request minimally sufficient, stable across the service's nondeterminism, and behaviorally meaningful. For a foreign-client claim, apply the seam row in [hardening.md](references/hardening.md) § Use real implementations.
56
+ 10. **Document the final behavior** per [document.md](references/document.md).
57
+ 11. **Audit completion.** Run `node .agents/skills/orkestrel-harden/scripts/discovery.ts` and rule on every flag and marker it reports, run [hardening.md](references/hardening.md) § Audit security and destructive paths, then inspect source/test helper duplication, exports, environment isolation, unexpected text corruption, and the entire diff.
58
+ 12. **Verify scoped.** Run the gates of the touched projects per `.agents/orchestration.md` § Size gate, in the order the package's own chain fixes, and inspect the generated outputs relevant to the request.
59
+ 13. **Review by the size gate, never by the author.** Run the review `.agents/orchestration.md` § Size gate names on the matrix's claims. Rule every finding before any repair: a finding against a claim is repaired within that claim's row; a finding outside the claims blocks only above the release bar, and the review brief names the plan's bar; an above-bar finding outside every claim opens a rescoping the ledger records and the user rules on; every other finding enters the deferral list (`.claude/rules/campaign.md` § Content). Class each repair's remedy per § Size gate (a correction, a design question, or a deferral), and send a finding about a boundary the package does not own to step 14 before any writer starts. Rerun the affected scoped verification after each repair.
60
+ 14. **Hold the bounds.** Before another repair round at one seam, apply the stop step 1 set for it, re-examined against the signals [hardening.md](references/hardening.md) § Hold the package's bounds names. When the stop fires, or when the seam's findings concern a boundary the package does not own, open one design question on the package's dependence on that behavior, record the decision in the commit that makes it and cite that commit in `plan.md`, and route the findings that remain outside the contract to the deferral list. A stop keeps every claim closed and the bar unbroken; a stop that would reopen a claim is a rescoping the user rules on.
61
+ 15. **Verify tree-wide.** After the review closes, run the tree-wide gates once per `.agents/orchestration.md` § Campaign, with the release chain in a fresh clone of the candidate on each reachable supported host, and name the independent receipt per § Acceptance.
56
62
 
57
63
  ## Accept the result
58
64
 
59
- Do not accept “mostly complete,” “tests pass” without adequacy review, or a builder's self-report. Completion requires:
65
+ Completion requires:
60
66
 
61
- - all requested capabilities implemented or explicitly proven out of scope;
62
- - red-then-green evidence for every repaired defect;
67
+ - every matrix row closed: implemented, repaired with red-then-green evidence, retained, or excluded with its reason, and no row added since step 3 without a recorded rescoping;
68
+ - no finding above the release bar, and every other finding in the deferral list (`.claude/rules/campaign.md` § Content);
69
+ - every stop step 1 set honored as stated, and each design decision step 14 made recorded in the commit that makes it and cited in `plan.md`;
63
70
  - public contract, implementation, tests, guides, and generated outputs aligned;
64
- - no unresolved centralization, wrapper, dependency-reuse, test-discovery, lifecycle, security, or text-integrity finding;
65
- - exact command evidence for every final gate.
71
+ - the centralization, wrapper, dependency-reuse, test-discovery, lifecycle, security, and text-integrity sweeps run, each hit repaired within a row or deferred per the deferral list;
72
+ - the release chain green in a fresh clone of the accepted commit on each reachable supported host, with exact command evidence for every final gate and the independent receipt `.agents/orchestration.md` § Acceptance names.
66
73
 
67
- Completion is those conditions met, not the absence of anything further to find. When every row is closed and the gates are green, stopping is the correct action and the next campaign is the deliverable; a further pass over the same surface is a new instruction from the user, not a finding.
74
+ Passing tests without an adequacy review, and a builder's self-report, are not completion evidence. When every row is closed, no finding stands above the bar, and the gates are green, stop per `AGENTS.md` § Work loop; a finding below the bar reopens nothing.
68
75
 
69
- Report what changed, what evidence proves it, exact test/gate results, and any genuine residual risk. Do not call an in-scope omission “future work.”
76
+ Report what changed, what evidence proves it, exact test/gate results, the deferral list, and any genuine residual risk.
@@ -15,28 +15,30 @@ Find candidates with the item's signatures, and rule each candidate by the item'
15
15
  - **Tool.** Run each signature with ripgrep's default engine, `rg -n`, and add `-U` where the item
16
16
  says a pattern spans lines.
17
17
  - **Ruling.** Treat a signature hit as a candidate, and rule it by reading its source. A text search
18
- reports on text (`.claude/rules/quality.md` § Instruments); an AST pass over the TypeScript parser
19
- is the exact instrument for `variables.assignments`.
18
+ reports on text (`.claude/rules/quality.md` § Instruments).
20
19
  - **Report.** Record each ruled candidate as `path:line`, the item's key, and the ruling.
21
20
 
22
21
  ## Run the controls
23
22
 
24
23
  Run an item's controls before trusting its clean result:
25
24
 
26
- 1. Write each fixture of the item to a scratch file under `tmp/probes/census/`, named as the
27
- fixture's label gives.
28
- 2. Run the item's signatures over the scratch files, and record the hit lines of each file.
29
- 3. Require every hit fixture to yield a candidate the reading keeps, and every clear fixture to yield
30
- no candidate or only candidates the reading drops.
31
- 4. Delete `tmp/probes/census/`.
25
+ 1. Run the `test:skills` script: `tests/agents/skills/orkestrel-harden/bindings.test.ts` reads this
26
+ document, compiles each signature as a JavaScript pattern, and matches each hit fixture against
27
+ its item's signatures, a `-U` signature over the whole fixture and the others line by line.
28
+ Repair a signature the test refuses before any later step.
29
+ 2. Read each hit fixture by the item's reading, and require it to keep a candidate. Write each clear
30
+ fixture of the item to a scratch file under `tmp/probes/census/`, named as the fixture's label
31
+ gives, and run the item's signatures over it. Require every clear fixture to yield no candidate or
32
+ only candidates the reading drops.
33
+ 3. Delete `tmp/probes/census/`.
32
34
 
33
35
  When a hit fixture yields no kept candidate, or a clear fixture yields a kept one, repair the
34
36
  signatures or the reading before you run the item over the checkout.
35
37
 
36
38
  ## Keys outside the census
37
39
 
38
- - Run no item for these keys: `variables.declarations`, `derivation.expression`,
39
- `iteration.counter`, `try.helper`, `try.log`, `running.definition`, `lists.derived`, `logs.loop`,
40
+ - Run no item for the **Variables** bullet; the lint rules it names decide it.
41
+ - Run no item for these keys: `derivation.expression`, `iteration.counter`, `try.helper`, `try.log`, `running.definition`, `lists.derived`, `logs.loop`,
40
42
  `logs.scan`, `exemptions.reach`, `percall.entity`, `percall.lifetime`, `percall.relative`,
41
43
  `entity.home`, `entity.pointers`, `slots.route`, `slots.exclusions`, `resets.home`, `bound.read`,
42
44
  `bound.several`, `bound.selection`, `bound.latch`, `registry.clear`, `registry.scope`,
@@ -45,66 +47,6 @@ signatures or the reading before you run the item over the checkout.
45
47
  logs a `reduce` call returns. Read `bound.unit` through `bound.field`. Read `running.position`
46
48
  through `running.cell`, `bound.field`, and `registry.reads`.
47
49
 
48
- ## `variables.assignments` (**Variables**)
49
-
50
- - **Precheck.** Run `\b(?:let|var)\s+[A-Za-z_$\[{]` first, and rule each hit in code, outside
51
- comments and strings, under `variables.declarations`. Hold a parameter-only reading of this item
52
- until every such declaration is ruled: after the precheck, a bare-identifier assignment can only
53
- target a parameter, a `catch` binding, a declaration the precheck found, or a name TypeScript
54
- refuses.
55
- - **Signatures.**
56
- - Assignment statements: `(?:^|[;{}]\s*)\s*[A-Za-z_$][\w$]*\s*(?:[-+*/%&|^]|\*\*|<<|>>>?|\?\?|\|\||&&)?=[^=>]`.
57
- - Guarded assignments: `(?:\)|\belse|=>)\s*[A-Za-z_$][\w$]*\s*(?:[-+*/%&|^]|\*\*|<<|>>>?|\?\?|\|\||&&)?=[^=>]`.
58
- - Updates: `(?:^|[^.#\w$])[A-Za-z_$][\w$]*\s*(?:\+\+|--)` and `(?:\+\+|--)\s*[A-Za-z_$][\w$]*\b`.
59
- - Destructuring targets: `^\s*\[[^\]]*\]\s*=[^=]` and `^\s*\(\s*\{[^}]*\}\s*=[^=]`.
60
- - Declaration-free loop heads: `for\s*(?:await\s*)?\(\s*[A-Za-z_$][\w$]*\s+(?:of|in)\b`.
61
- - **Reading.** Keep a hit whose target resolves to a parameter of the enclosing function or to a
62
- `catch` binding (**Variables**). Drop a parameter default on its own line, a public class field,
63
- an enum member, a member update such as `++this.#count`, and a target the precheck found.
64
-
65
- Hit fixture, `variables.assignments.hit.ts`:
66
-
67
- ```ts
68
- function normalizeName(name: string): string {
69
- name = name.trim()
70
- return name
71
- }
72
-
73
- function labelRow(label: string): string {
74
- if (label === '') label = 'untitled'
75
- return label
76
- }
77
-
78
- function mergeOverride(base: ProjectConfig, override?: ProjectConfig): ProjectConfig {
79
- if (override !== undefined && 'command' in override && 'mode' in override) {
80
- if (typeof override.mode !== 'string') {
81
- throw new Error('The project invocation carries no string mode')
82
- }
83
- override = { mode: override.mode }
84
- }
85
- return override === undefined ? { ...base } : mergeConfig(base, override)
86
- }
87
- ```
88
-
89
- Clear fixture, `variables.assignments.clear.ts`:
90
-
91
- ```ts
92
- class Transport {
93
- #count = 0
94
-
95
- async readWithRetries(
96
- url: string,
97
- timeout: number,
98
- spent: number[],
99
- accept?: string,
100
- binary = false,
101
- ): Promise<TextReadResult | BytesReadResult> {
102
- const id = ++this.#count
103
- return binary ? readBytes(url, timeout, spent, id) : readText(url, timeout, spent, id, accept)
104
- }
105
- }
106
- ```
107
-
108
50
  ## `running.carriers` (**Running values**)
109
51
 
110
52
  - **Signatures.**
@@ -196,12 +138,12 @@ Hit fixture, `running.cell.hit.ts`:
196
138
 
197
139
  ```ts
198
140
  function readLatest(
199
- readings: readonly Reading[],
200
- admit: (reading: Reading) => boolean,
201
- ): Reading | undefined {
202
- const latest: Reading[] = []
203
- for (const reading of readings) {
204
- if (admit(reading)) latest.splice(0, latest.length, reading)
141
+ samples: readonly Sample[],
142
+ admit: (sample: Sample) => boolean,
143
+ ): Sample | undefined {
144
+ const latest: Sample[] = []
145
+ for (const sample of samples) {
146
+ if (admit(sample)) latest.splice(0, latest.length, sample)
205
147
  }
206
148
  return latest[0]
207
149
  }
@@ -210,8 +152,8 @@ function readLatest(
210
152
  Clear fixture, `running.cell.clear.ts`:
211
153
 
212
154
  ```ts
213
- function readLast(readings: readonly Reading[]): Reading | undefined {
214
- return readings.at(-1)
155
+ function readLast(samples: readonly Sample[]): Sample | undefined {
156
+ return samples.at(-1)
215
157
  }
216
158
  ```
217
159
 
@@ -1523,7 +1465,7 @@ Clear fixture, `registry.form.clear.ts`:
1523
1465
  class ProcessSession {
1524
1466
  readonly #goals = new Set<ProcessGoal>()
1525
1467
  readonly #tickets = new Map<number, ParentTicket>()
1526
- #closing: Promise<void> | undefined
1468
+ #shutdown: Promise<void> | undefined
1527
1469
 
1528
1470
  async execute(goal: Goal, context: GoalContext): Promise<Product> {
1529
1471
  if (this.#goals.size !== 0) throw new Error('The process cannot execute in its current state')
@@ -1537,8 +1479,8 @@ class ProcessSession {
1537
1479
  }
1538
1480
 
1539
1481
  close(): Promise<void> {
1540
- this.#closing ??= this.#close()
1541
- return this.#closing
1482
+ this.#shutdown ??= this.#close()
1483
+ return this.#shutdown
1542
1484
  }
1543
1485
 
1544
1486
  async #close(): Promise<void> {
@@ -57,14 +57,13 @@ isolated tests for declaration-only types, constants, barrels, or error definiti
57
57
 
58
58
  Before acceptance, prove:
59
59
 
60
- - no stray declarations remain in implementation files;
61
- - no non-exported or wrong-kind declaration remains in centralized files;
62
- - no prohibited nested function declaration or assignment remains;
60
+ - `npm run lint:check` passes, which refuses a stray, unexported, or wrong-kind declaration in
61
+ `src/` and `app/`, and a prohibited nested function;
63
62
  - no duplicate or rename-only wrapper remains;
64
63
  - every move updated imports, barrels, guides, and tests;
65
64
  - test helpers are consolidated without over-generalizing one-off setup;
66
- - files are valid UTF-8 with no replacement characters, mojibake, unintended control
67
- characters, or accidental trailing debris.
65
+ - the policy sweep passes `.claude/rules/workspace.md` § Text integrity, and a reading of the diff
66
+ finds no mojibake or accidental trailing debris.
68
67
 
69
68
  Review the complete diff after formatting. Formatting cannot substitute for the structural
70
69
  sweep.
@@ -1,5 +1,7 @@
1
1
  # Adopt `@orkestrel/contract`
2
2
 
3
+ This reference governs adopting `@orkestrel/contract` in one package: the exact-package inspection, the overlap matrix, the wrapper-free refactor, and the strictness proofs.
4
+
3
5
  ## Inspect the exact installed package
4
6
 
5
7
  Never work from a remembered contract version or copied API list. Read:
@@ -0,0 +1,33 @@
1
+ # Document one package
2
+
3
+ This reference governs the guide pass for one package, `AGENTS.md` § Work loop step 6, which fixes when it starts. `.claude/rules/documentation.md` holds the law for guides, parity, and examples, and `.claude/rules/typescript.md` § Comments and API documentation holds the TSDoc shape. This file holds the steps and restates none of them.
4
+
5
+ ## Take the worklist
6
+
7
+ 1. Read the governing guide, the README, and the barrel of each environment the package publishes.
8
+ 2. Run `npm run test:guides`, read-only. Its drift report is the worklist for the Summary cells, titled examples, and tagline.
9
+ 3. List each export the change added, removed, or altered, and each guide section that names one.
10
+
11
+ ## Write each surface
12
+
13
+ 1. **Guide.** Update every guide the package owns: the `## Surface` and `## Methods` rows, patterns, limitations, and the `guides/README.md` indexes when a guide is added or removed.
14
+ 2. **README.** Set the pitch equal to the guide's tagline; keep the install and link lines in step with the shipped exports.
15
+ 3. **TSDoc.** Give each export the change touched the block `.claude/rules/typescript.md` § Comments and API documentation fixes, with fictional descriptive data in its `@example`.
16
+ 4. **Fences.** Import through the published specifier and run each example; read what it returns before writing the comment beside it.
17
+
18
+ ## Choose the rewrite direction
19
+
20
+ Choose per drift row by the side you wrote in this pass.
21
+
22
+ - Run `npm run test:guides -- --to guide` when the TSDoc block carries the wording to keep.
23
+ - Run `npm run test:guides -- --to source` when the guide carries it.
24
+
25
+ Run one direction at a time, then rerun the read-only command until the worklist is empty.
26
+
27
+ ## Read the prose last
28
+
29
+ Re-read every changed sentence against what shipped, per `.claude/rules/documentation.md` § Parity. For each behavior claim, name the example or assertion that breaks when the claim goes false; add the assertion where none exists.
30
+
31
+ ## Close
32
+
33
+ Run `npm run test:guides`, then the repository's format check, and report both exit codes with the guides, README, and files touched.
@@ -30,7 +30,7 @@ reads:
30
30
  - `Array.from(source, mapper)` falls back to index access when `Symbol.iterator` is missing, so it
31
31
  returns where `for…of` threw a `TypeError`.
32
32
  - `source.values()` and the array methods read by index, so they accept a missing iterator and
33
- bypass a replaced or closing one; `flatMap`, `filter`, `reduce`, `forEach`, `some`, and `every`
33
+ skip a replaced or closing one; `flatMap`, `filter`, `reduce`, `forEach`, `some`, and `every`
34
34
  skip a hole that `for…of` reads.
35
35
  - A spread copies every element first, so it reads past a hole or ahead of a throwing entry where
36
36
  the baseline threw at the earlier element.
@@ -44,5 +44,8 @@ yields more entries than `length` is truncated.
44
44
 
45
45
  Before a claim that a rewrite lost no test, run
46
46
  `node .agents/skills/orkestrel-harden/scripts/titles.ts --base REV`, where `REV` is the baseline
47
- revision. Restore each missing title, or rule its removal with the behavior it proved, and confirm
48
- each moved title by reading the registration that uses it.
47
+ revision. Restore each missing title, or rule its removal with the behavior it proved. A moved row
48
+ exits 3 like a missing one, because a literal that only spells the title (an assertion value, a data
49
+ table) holds it too: read each moved title's holder, treat one that is no registration as missing,
50
+ and add no exemption. The comparison cannot follow a dynamic row or see a removed `.each` table row;
51
+ rule those by reading.
@@ -1,35 +1,39 @@
1
1
  # Production hardening
2
2
 
3
+ This reference governs the hardening lane: the package's bounds, the risk and seam matrix, real-implementation testing, live-service tests, lifecycle pressure, holding the bounds, security paths, the test audit, and generated outputs.
4
+
3
5
  ## Build the risk and seam matrix
4
6
 
5
- List every boundary where assumptions can fail:
7
+ Draw the matrix inside the package's bounds: the contract its types and guide promise and the hosts it supports. A boundary the package crosses but does not own (the host filesystem's locking and handle semantics, a runtime's scheduling, a harness's sandbox, a scanner's hold on a file) enters the matrix only as the contract's promise about it: what the package does when that boundary fails, never how the boundary behaves.
8
+
9
+ List every boundary where the contract's assumptions can fail:
6
10
 
7
11
  - public inputs and option combinations;
8
12
  - empty, missing, minimum, maximum, overflow, `NaN`, infinity, and signed-zero values;
9
13
  - invalid state transitions and repeated lifecycle operations;
10
14
  - partial work, abort, timeout, retry, pause/resume, stop/destroy, and cleanup;
11
15
  - concurrency, reentrancy, ordering, idempotency, fairness, and backpressure;
12
- - filesystem, process, socket, protocol, browser, model, and network boundaries;
16
+ - filesystem, process, socket, protocol, browser, model, and network boundaries, each marked owned or not owned;
13
17
  - malformed or unexpected strings, paths, headers, frames, JSON, prototypes, getters, and proxies;
14
18
  - resource ownership, leaks, teardown, and pressure;
15
- - environment isolation and unsupported-host behavior;
19
+ - environment isolation, and the contract's refusal or degradation on an unsupported host;
16
20
  - serialization, restore, public exports, and consumer ergonomics.
17
21
 
18
- For each applicable seam, state the invariant, failure mode, observable result, and proving test. Omit irrelevant generic cases rather than creating meaningless tests.
22
+ For each applicable seam, state the invariant, the failure mode, the observable result, the proving test, and whether the package owns the boundary. Omit irrelevant generic cases rather than creating meaningless tests.
19
23
 
20
24
  ## Use real implementations
21
25
 
22
26
  Test through public behavior with:
23
27
 
24
- | Seam | The real thing it must be driven with |
25
- | --------------------------------------- | ------------------------------------------------------------------------ |
26
- | Package behavior | Real package classes and composed managers |
27
- | Filesystem | Temporary directories and files |
28
- | Network protocol | Actual local sockets and protocol-faithful fixture servers |
29
- | Browser | An actual Chromium-family browser when the browser is the system |
30
- | Declared dependency | The actual installed dependency |
31
- | External service or model | The real service in its dedicated project when its behavior is the claim |
32
- | Third-party client or protocol consumer | One representative real foreign client, driven end to end |
28
+ | Seam | The real thing it must be driven with |
29
+ | --------------------------------------- | ---------------------------------------------------------------------------------------------- |
30
+ | Package behavior | Real package classes and composed managers |
31
+ | Filesystem | Temporary directories and files |
32
+ | Network protocol | Actual local sockets and protocol-faithful fixture servers |
33
+ | Browser | An actual Chromium-family browser when the browser is the system |
34
+ | Declared dependency | The actual installed dependency |
35
+ | External service or model | The real service in its dedicated project when its behavior is the claim |
36
+ | Third-party client or protocol consumer | Representative real foreign clients of each client class the contract names, driven end to end |
33
37
 
34
38
  A third-party seam is the one case where the package's own tests cannot close the claim:
35
39
  protocol tests prove the protocol, and only a real client of that class proves the
@@ -67,7 +71,17 @@ Exercise:
67
71
  - cancellation propagation and bounded shutdown;
68
72
  - no busy polling, open handles, leaked processes, sessions, pages, files, or listeners.
69
73
 
70
- Use bounded pressure tests that expose coordination defects without making the suite gratuitously slow.
74
+ Set each pressure proof's load and concurrency from the coordination defect it must expose, state them with the reason beside the proof, and re-examine them against the stop signals `.agents/orchestration.md` § Size gate names. `.claude/rules/tests.md` § Expensive proofs owns the repeat count and acceptance under suite load.
75
+
76
+ ## Hold the package's bounds
77
+
78
+ A seam's finding concerns the package when it falsifies a promise the contract makes; it concerns the host when it describes how a boundary the package does not own behaves.
79
+
80
+ - When a finding falsifies a promise, repair it within its row and close the repair with the mutation probe `.agents/orchestration.md` § Size gate names.
81
+ - When a finding describes a host behavior the contract never promised to survive, open one design question on the package's dependence on that behavior: remove the dependence, narrow the promise, or refuse on that host. Never add a mechanism around the behavior.
82
+ - When a finding is outside the bounds and below the release bar, record it in the deferral list (`.claude/rules/campaign.md` § Content), and reopen it only when its trigger fires.
83
+ - Before another round at one seam, weigh a further repair against a design question and re-examine the stop set for that seam against the signals `.agents/orchestration.md` § Size gate names; the hardening lane adds one: findings move from the contract to the host.
84
+ - A seam that reprices on every edit (a count, a timing) is not a seam; drop the claim per the `orkestrel-falsify` skill § End the depth search.
71
85
 
72
86
  ## Audit security and destructive paths
73
87
 
@@ -82,17 +96,19 @@ For every fetch, write, delete, extraction, path, protocol, or authentication bo
82
96
 
83
97
  ## Audit the tests themselves
84
98
 
85
- Run `node .agents/skills/orkestrel-harden/scripts/discovery.ts` for the discovery census: which project collects each file, which gate reaches each project, and where a file carries `.skip`, `.todo`, a conditional skip, a retry, or a timeout. Then verify:
99
+ Run the discovery census, `scripts/discovery.ts` as `SKILL.md` § Scripts states (step 11 of the hardening lane): which project collects each file, which gate reaches each project, and where a file carries `.todo`, a conditional skip (`.skipIf`, `.runIf`), `.fails`, a retry, or a timeout. `vitest/no-focused-tests` and `vitest/no-disabled-tests` refuse `.only` and `.skip`. Then verify:
86
100
 
101
+ - every intended test file is collected by the correct project, and the test counts and environments match the intent;
102
+ - every project that collects tests has a gate: the census flags one no chain reaches as ungated, and a chained project that collects nothing as empty. A declared project that collects nothing and that no chain names is a workbench, reported without a flag; read the chain behind every workbench and rule it by its purpose, not by the exit code;
87
103
  - every flag the census reports is closed or ruled with a reason;
88
104
  - every marker it reports is justified;
89
- - no current-scope requirement is represented only by a todo;
90
- - assertions can fail for the defect they claim to catch;
105
+ - no current-scope requirement is represented only by a todo or a placeholder;
106
+ - assertions can fail for the defect they claim to catch, and fail rather than pass when their population is empty;
91
107
  - tests observe public outcomes rather than private implementation;
92
108
  - helpers do not reimplement production logic;
93
109
  - real cleanup runs even after assertion or setup failure.
94
110
 
95
- Collection evaluates every collected project's `setupFiles`, so the census runs each setup module's load-time work, and `--projects` narrows the report, never that listing. When a setup module contacts a live service at load, such as a `service` project's readiness gate in `tests/setupService.ts`, run the census only while an instance the run may contact is up and the service's address points at it; with the address on a closed port, that project's listing fails and the census exits 2 naming its gate.
111
+ Collection evaluates the `setupFiles` of every project the census lists, so each listed project's setup module runs its load-time work; `--projects a,b` lists only the named projects, so a project outside the names never loads. When a setup module contacts a live service at load, such as a `service` project's readiness gate in `tests/setupService.ts`, run the census only while an instance the run may contact is up and the service's address points at it, or name the other projects with `--projects`; with the address on a closed port, a listed project's listing fails and the census exits 2 naming its gate.
96
112
 
97
113
  ## Inspect generated outputs
98
114
 
@@ -1,5 +1,7 @@
1
1
  # Research and capability audit
2
2
 
3
+ This reference governs research for one package: the source order, focused reading, the capability matrix, and the conversion of evidence into design.
4
+
3
5
  ## Establish sources
4
6
 
5
7
  Use this source order: