@orkestrel/scaffold 0.0.107 → 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.
- package/dist/agents/skills/orkestrel-dispatch/scripts/bench.js +326 -91
- package/dist/agents/skills/orkestrel-dispatch/scripts/brief.js +110 -14
- package/dist/agents/skills/orkestrel-dispatch/scripts/chain.js +280 -0
- package/dist/agents/skills/orkestrel-dispatch/scripts/cite.js +188 -26
- package/dist/agents/skills/orkestrel-dispatch/scripts/launch.js +142 -43
- package/dist/agents/skills/orkestrel-dispatch/scripts/login.js +240 -62
- package/dist/agents/skills/orkestrel-dispatch/scripts/patch.js +323 -0
- package/dist/agents/skills/orkestrel-dispatch/scripts/result.js +169 -32
- package/dist/agents/skills/orkestrel-dispatch/scripts/sweep.js +368 -27
- package/dist/agents/skills/orkestrel-falsify/scripts/mutate.js +560 -0
- package/dist/agents/skills/orkestrel-harden/scripts/discovery.js +1052 -205
- package/dist/agents/skills/orkestrel-harden/scripts/measure.js +361 -0
- package/dist/agents/skills/orkestrel-harden/scripts/titles.js +455 -80
- package/dist/agents/skills/orkestrel-parallel/scripts/cases.js +327 -0
- package/dist/agents/skills/orkestrel-publish/scripts/compare.js +298 -51
- package/dist/agents/skills/orkestrel-publish/scripts/pins.js +170 -13
- package/dist/agents/skills/orkestrel-publish/scripts/swap.js +956 -191
- package/dist/agents/skills/orkestrel-publish/scripts/wave.js +707 -112
- package/dist/agents/skills/orkestrel-publish/scripts/window.js +235 -41
- package/dist/agents/skills/orkestrel-scout/scripts/map.js +341 -54
- package/dist/agents/templates/brief.md +1 -1
- package/dist/bin/main.js +51 -46
- package/dist/bin/main.js.map +1 -1
- package/dist/host/AGENTS.md +26 -20
- package/dist/host/agents/orchestration.md +98 -58
- package/dist/host/agents/platforms/posix.md +15 -0
- package/dist/host/agents/platforms/windows.md +37 -0
- package/dist/host/agents/skills/orkestrel-align/SKILL.md +10 -13
- package/dist/host/agents/skills/orkestrel-align/references/fleet.md +4 -10
- package/dist/host/agents/skills/orkestrel-align/references/integration.md +1 -1
- package/dist/host/agents/skills/orkestrel-build/SKILL.md +16 -48
- package/dist/host/agents/skills/orkestrel-build/agents/openai.yaml +1 -1
- package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +19 -16
- package/dist/host/agents/skills/orkestrel-debrief/agents/openai.yaml +1 -1
- package/dist/host/agents/skills/orkestrel-debrief/references/field-testing.md +15 -28
- package/dist/host/agents/skills/orkestrel-debrief/references/instruction-audit.md +5 -6
- package/dist/host/agents/skills/orkestrel-debrief/references/retention.md +12 -14
- package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +36 -24
- package/dist/host/agents/skills/orkestrel-dispatch/references/launch.md +14 -11
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/bench.ts +366 -75
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/brief.ts +126 -16
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/chain.ts +323 -0
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/cite.ts +220 -31
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/launch.ts +176 -33
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/login.ts +294 -59
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/patch.ts +401 -0
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/result.ts +199 -34
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/sweep.ts +428 -27
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +10 -8
- package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +1 -5
- package/dist/host/agents/skills/orkestrel-falsify/references/reconcile.md +1 -1
- package/dist/host/agents/skills/orkestrel-falsify/scripts/mutate.ts +701 -0
- package/dist/host/agents/skills/orkestrel-harden/SKILL.md +16 -12
- package/dist/host/agents/skills/orkestrel-harden/references/bindings.md +23 -81
- package/dist/host/agents/skills/orkestrel-harden/references/centralization.md +4 -5
- package/dist/host/agents/skills/orkestrel-harden/references/contract.md +2 -0
- package/dist/host/agents/skills/orkestrel-harden/references/document.md +33 -0
- package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +6 -3
- package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +8 -4
- package/dist/host/agents/skills/orkestrel-harden/references/research.md +2 -0
- package/dist/host/agents/skills/orkestrel-harden/scripts/discovery.ts +1272 -279
- package/dist/host/agents/skills/orkestrel-harden/scripts/measure.ts +425 -0
- package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +603 -98
- package/dist/host/agents/skills/orkestrel-journey/SKILL.md +75 -98
- package/dist/host/agents/skills/orkestrel-journey/references/captures.md +54 -17
- package/dist/host/agents/skills/orkestrel-journey/references/decide.md +1 -20
- package/dist/host/agents/skills/orkestrel-journey/references/layer.md +21 -31
- package/dist/host/agents/skills/orkestrel-journey/references/styles.md +1 -1
- package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +91 -30
- package/dist/host/agents/skills/orkestrel-parallel/agents/openai.yaml +2 -2
- package/dist/host/agents/skills/orkestrel-parallel/references/claude.md +34 -0
- package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +29 -0
- package/dist/host/agents/skills/orkestrel-parallel/references/cursor.md +29 -0
- package/dist/host/agents/skills/orkestrel-parallel/references/t3.md +31 -0
- package/dist/host/agents/skills/orkestrel-parallel/scripts/cases.ts +389 -0
- package/dist/host/agents/skills/orkestrel-polish/SKILL.md +16 -20
- package/dist/host/agents/skills/orkestrel-polish/references/capture-harness.md +16 -26
- package/dist/host/agents/skills/orkestrel-publish/SKILL.md +12 -26
- package/dist/host/agents/skills/orkestrel-publish/agents/openai.yaml +2 -2
- package/dist/host/agents/skills/orkestrel-publish/references/adopt.md +23 -0
- package/dist/host/agents/skills/orkestrel-publish/references/release.md +4 -4
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +12 -10
- package/dist/host/agents/skills/orkestrel-publish/references/window.md +20 -25
- package/dist/host/agents/skills/orkestrel-publish/scripts/compare.ts +348 -59
- package/dist/host/agents/skills/orkestrel-publish/scripts/pins.ts +202 -22
- package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +1061 -191
- package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +812 -140
- package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +280 -38
- package/dist/host/agents/skills/orkestrel-scout/SKILL.md +3 -3
- package/dist/host/agents/skills/orkestrel-scout/scripts/map.ts +428 -70
- package/dist/host/agents/templates/brief.md +1 -1
- package/dist/host/agents/transports/claude-cli.md +3 -3
- package/dist/host/agents/transports/codex.md +3 -8
- package/dist/host/agents/transports/cursor.md +2 -3
- package/dist/host/claude/AGENTS.md +7 -10
- package/dist/host/claude/agents/analyst.md +3 -3
- package/dist/host/claude/agents/astra.md +3 -3
- package/dist/host/claude/agents/builder.md +1 -1
- package/dist/host/claude/agents/checker.md +1 -1
- package/dist/host/claude/agents/distiller.md +1 -1
- package/dist/host/claude/agents/grok.md +1 -1
- package/dist/host/claude/agents/opus.md +2 -2
- package/dist/host/claude/agents/orkestrel.md +57 -90
- package/dist/host/claude/agents/researcher.md +1 -1
- package/dist/host/claude/agents/reviewer.md +4 -0
- package/dist/host/claude/agents/scout.md +1 -1
- package/dist/host/claude/agents/verifier.md +1 -1
- package/dist/host/claude/rules/application.md +14 -21
- package/dist/host/claude/rules/architecture.md +34 -44
- package/dist/host/claude/rules/browser.md +3 -4
- package/dist/host/claude/rules/campaign.md +55 -0
- package/dist/host/claude/rules/documentation.md +26 -11
- package/dist/host/claude/rules/names.md +9 -4
- package/dist/host/claude/rules/patterns.md +6 -7
- package/dist/host/claude/rules/portability.md +2 -3
- package/dist/host/claude/rules/quality.md +4 -5
- package/dist/host/claude/rules/styles.md +2 -2
- package/dist/host/claude/rules/tests.md +57 -114
- package/dist/host/claude/rules/typescript.md +8 -10
- package/dist/host/claude/rules/workspace.md +21 -19
- package/dist/host/claude/rules/writing.md +3 -3
- package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-parallel/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -1
- package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
- package/dist/host/codex/agents/analyst.toml +9 -3
- package/dist/host/codex/agents/astra.toml +3 -4
- package/dist/host/codex/agents/builder.toml +1 -1
- package/dist/host/codex/agents/opus.toml +3 -4
- package/dist/host/codex/agents/orkestrel.toml +1 -1
- package/dist/host/codex/agents/researcher.toml +2 -2
- package/dist/host/codex/agents/verifier.toml +1 -1
- package/dist/host/codex/config.toml +3 -3
- package/dist/host/configs/helpers.ts +21 -1
- package/dist/host/configs/policy.ts +405 -16
- package/dist/host/cursor/rules/orchestration.mdc +1 -0
- package/dist/host/dotfiles/oxlintrc.json +141 -5
- package/dist/host/guides/agent.md +111 -134
- package/dist/host/guides/capture.md +801 -0
- package/dist/host/guides/probe.md +27 -8
- package/dist/host/guides/scaffold.md +152 -19
- package/dist/host/guides/study.md +534 -440
- package/dist/host/guides/test.md +111 -44
- package/dist/host/manifest.json +199 -242
- package/dist/host/tests/config.test.ts +1558 -219
- package/dist/host/tests/policy.test.ts +127 -1
- package/dist/host/tests/setupPolicy.ts +1389 -39
- package/dist/src/core/index.cjs +239 -87
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +123 -39
- package/dist/src/core/index.d.ts +123 -39
- package/dist/src/core/index.js +234 -86
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +20 -27
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.js +21 -28
- package/dist/src/server/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/agents/skills/orkestrel-dispatch/scripts/helpers.js +0 -283
- package/dist/host/agents/skills/orkestrel-dispatch/references/bench.md +0 -25
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/helpers.ts +0 -333
- package/dist/host/agents/skills/orkestrel-parallel/references/harnesses.md +0 -19
- 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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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 [
|
|
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.
|
|
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.
|
|
52
|
-
10. **Document the final behavior
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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)
|
|
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.
|
|
27
|
-
fixture
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
39
|
-
|
|
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
|
-
|
|
200
|
-
admit: (
|
|
201
|
-
):
|
|
202
|
-
const latest:
|
|
203
|
-
for (const
|
|
204
|
-
if (admit(
|
|
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(
|
|
214
|
-
return
|
|
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
|
-
#
|
|
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.#
|
|
1541
|
-
return this.#
|
|
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
|
-
-
|
|
61
|
-
|
|
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
|
-
-
|
|
67
|
-
|
|
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
|
-
|
|
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
|
|
48
|
-
|
|
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 `
|
|
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
|
|
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
|
|