@orkestrel/scaffold 0.0.108 → 0.0.109

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 (157) 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 +1 -1
  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 +43 -18
  26. package/dist/host/agents/platforms/windows.md +3 -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 +31 -20
  38. package/dist/host/agents/skills/orkestrel-dispatch/references/launch.md +3 -4
  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 +10 -8
  49. package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +1 -5
  50. package/dist/host/agents/skills/orkestrel-falsify/references/reconcile.md +1 -1
  51. package/dist/host/agents/skills/orkestrel-falsify/scripts/mutate.ts +701 -0
  52. package/dist/host/agents/skills/orkestrel-harden/SKILL.md +16 -12
  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 +8 -4
  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 +75 -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 +28 -24
  69. package/dist/host/agents/skills/orkestrel-parallel/references/claude.md +15 -13
  70. package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +1 -0
  71. package/dist/host/agents/skills/orkestrel-parallel/references/cursor.md +13 -13
  72. package/dist/host/agents/skills/orkestrel-parallel/scripts/cases.ts +389 -0
  73. package/dist/host/agents/skills/orkestrel-polish/SKILL.md +16 -20
  74. package/dist/host/agents/skills/orkestrel-polish/references/capture-harness.md +16 -26
  75. package/dist/host/agents/skills/orkestrel-publish/SKILL.md +12 -26
  76. package/dist/host/agents/skills/orkestrel-publish/agents/openai.yaml +2 -2
  77. package/dist/host/agents/skills/orkestrel-publish/references/adopt.md +23 -0
  78. package/dist/host/agents/skills/orkestrel-publish/references/release.md +4 -4
  79. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +10 -9
  80. package/dist/host/agents/skills/orkestrel-publish/references/window.md +20 -25
  81. package/dist/host/agents/skills/orkestrel-publish/scripts/compare.ts +348 -59
  82. package/dist/host/agents/skills/orkestrel-publish/scripts/pins.ts +202 -22
  83. package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +1061 -191
  84. package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +812 -140
  85. package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +280 -38
  86. package/dist/host/agents/skills/orkestrel-scout/SKILL.md +3 -3
  87. package/dist/host/agents/skills/orkestrel-scout/scripts/map.ts +428 -70
  88. package/dist/host/agents/templates/brief.md +1 -1
  89. package/dist/host/agents/transports/claude-cli.md +3 -3
  90. package/dist/host/agents/transports/codex.md +2 -7
  91. package/dist/host/agents/transports/cursor.md +2 -3
  92. package/dist/host/claude/AGENTS.md +2 -2
  93. package/dist/host/claude/agents/analyst.md +3 -3
  94. package/dist/host/claude/agents/astra.md +3 -3
  95. package/dist/host/claude/agents/builder.md +1 -1
  96. package/dist/host/claude/agents/checker.md +1 -1
  97. package/dist/host/claude/agents/distiller.md +1 -1
  98. package/dist/host/claude/agents/grok.md +1 -1
  99. package/dist/host/claude/agents/opus.md +2 -2
  100. package/dist/host/claude/agents/orkestrel.md +57 -90
  101. package/dist/host/claude/agents/researcher.md +1 -1
  102. package/dist/host/claude/agents/reviewer.md +4 -0
  103. package/dist/host/claude/agents/scout.md +1 -1
  104. package/dist/host/claude/agents/verifier.md +1 -1
  105. package/dist/host/claude/rules/application.md +14 -21
  106. package/dist/host/claude/rules/architecture.md +34 -44
  107. package/dist/host/claude/rules/browser.md +3 -4
  108. package/dist/host/claude/rules/campaign.md +2 -2
  109. package/dist/host/claude/rules/documentation.md +25 -12
  110. package/dist/host/claude/rules/names.md +9 -4
  111. package/dist/host/claude/rules/patterns.md +6 -7
  112. package/dist/host/claude/rules/portability.md +1 -1
  113. package/dist/host/claude/rules/quality.md +4 -5
  114. package/dist/host/claude/rules/styles.md +2 -2
  115. package/dist/host/claude/rules/tests.md +57 -114
  116. package/dist/host/claude/rules/typescript.md +7 -9
  117. package/dist/host/claude/rules/workspace.md +21 -19
  118. package/dist/host/claude/rules/writing.md +2 -5
  119. package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
  120. package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
  121. package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -1
  122. package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
  123. package/dist/host/codex/agents/analyst.toml +9 -3
  124. package/dist/host/codex/agents/astra.toml +3 -4
  125. package/dist/host/codex/agents/builder.toml +1 -1
  126. package/dist/host/codex/agents/opus.toml +3 -4
  127. package/dist/host/codex/agents/orkestrel.toml +1 -1
  128. package/dist/host/codex/agents/researcher.toml +2 -2
  129. package/dist/host/codex/agents/verifier.toml +1 -1
  130. package/dist/host/configs/helpers.ts +21 -1
  131. package/dist/host/configs/policy.ts +299 -15
  132. package/dist/host/dotfiles/oxlintrc.json +137 -3
  133. package/dist/host/guides/agent.md +111 -134
  134. package/dist/host/guides/capture.md +801 -0
  135. package/dist/host/guides/probe.md +27 -8
  136. package/dist/host/guides/scaffold.md +96 -18
  137. package/dist/host/guides/study.md +534 -440
  138. package/dist/host/guides/test.md +111 -44
  139. package/dist/host/manifest.json +160 -240
  140. package/dist/host/tests/config.test.ts +971 -187
  141. package/dist/host/tests/policy.test.ts +127 -1
  142. package/dist/host/tests/setupPolicy.ts +893 -33
  143. package/dist/src/core/index.cjs +214 -86
  144. package/dist/src/core/index.cjs.map +1 -1
  145. package/dist/src/core/index.d.cts +122 -38
  146. package/dist/src/core/index.d.ts +122 -38
  147. package/dist/src/core/index.js +209 -85
  148. package/dist/src/core/index.js.map +1 -1
  149. package/dist/src/server/index.cjs +20 -27
  150. package/dist/src/server/index.cjs.map +1 -1
  151. package/dist/src/server/index.js +21 -28
  152. package/dist/src/server/index.js.map +1 -1
  153. package/package.json +11 -11
  154. package/dist/agents/skills/orkestrel-dispatch/scripts/helpers.js +0 -283
  155. package/dist/host/agents/skills/orkestrel-dispatch/references/bench.md +0 -25
  156. package/dist/host/agents/skills/orkestrel-dispatch/scripts/helpers.ts +0 -333
  157. 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 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
 
@@ -34,7 +36,9 @@ Load [centralization.md](references/centralization.md) for every structural lane
34
36
 
35
37
  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.
36
38
 
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).
39
+ Load [document.md](references/document.md) for the documentation lane and for step 10 of every other lane.
40
+
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
 
@@ -44,19 +48,19 @@ Load [equivalence.md](references/equivalence.md) for a structural lane whose rew
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
49
  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
50
  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.
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
54
  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.
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).
53
57
  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
58
  12. **Verify.** Run the repository-prescribed gates in order and inspect the generated outputs relevant to the request.
55
59
  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.
56
60
 
57
61
  ## Accept the result
58
62
 
59
- Do not accept “mostly complete,” “tests pass” without adequacy review, or a builder's self-report. Completion requires:
63
+ Completion requires:
60
64
 
61
65
  - all requested capabilities implemented or explicitly proven out of scope;
62
66
  - red-then-green evidence for every repaired defect;
@@ -64,6 +68,6 @@ Do not accept “mostly complete,” “tests pass” without adequacy review, o
64
68
  - no unresolved centralization, wrapper, dependency-reuse, test-discovery, lifecycle, security, or text-integrity finding;
65
69
  - exact command evidence for every final gate.
66
70
 
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.
71
+ Passing tests without an adequacy review, and a builder's self-report, are not completion evidence. When every row is closed and the gates are green, stop per `AGENTS.md` § Work loop.
68
72
 
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.”
73
+ Report what changed, what evidence proves it, exact test/gate results, 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,5 +1,7 @@
1
1
  # Production hardening
2
2
 
3
+ This reference governs the hardening lane: the risk and seam matrix, real-implementation testing, live-service tests, lifecycle pressure, security paths, the test audit, and generated outputs.
4
+
3
5
  ## Build the risk and seam matrix
4
6
 
5
7
  List every boundary where assumptions can fail:
@@ -82,17 +84,19 @@ For every fetch, write, delete, extraction, path, protocol, or authentication bo
82
84
 
83
85
  ## Audit the tests themselves
84
86
 
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:
87
+ 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
88
 
89
+ - every intended test file is collected by the correct project, and the test counts and environments match the intent;
90
+ - 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
91
  - every flag the census reports is closed or ruled with a reason;
88
92
  - 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;
93
+ - no current-scope requirement is represented only by a todo or a placeholder;
94
+ - assertions can fail for the defect they claim to catch, and fail rather than pass when their population is empty;
91
95
  - tests observe public outcomes rather than private implementation;
92
96
  - helpers do not reimplement production logic;
93
97
  - real cleanup runs even after assertion or setup failure.
94
98
 
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.
99
+ 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
100
 
97
101
  ## Inspect generated outputs
98
102
 
@@ -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: