@orkestrel/scaffold 0.0.112 → 0.0.114

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 (67) hide show
  1. package/dist/agents/skills/orkestrel-harden/scripts/titles.js +3 -3
  2. package/dist/agents/skills/orkestrel-publish/scripts/wave.js +120 -21
  3. package/dist/bin/main.js +71 -23
  4. package/dist/bin/main.js.map +1 -1
  5. package/dist/host/agents/platforms/windows.md +1 -1
  6. package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +3 -3
  7. package/dist/host/agents/skills/orkestrel-publish/SKILL.md +7 -7
  8. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +25 -8
  9. package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +187 -54
  10. package/dist/host/claude/agents/orkestrel.md +53 -53
  11. package/dist/host/claude/rules/architecture.md +4 -3
  12. package/dist/host/claude/rules/tests.md +24 -7
  13. package/dist/host/claude/rules/typescript.md +11 -2
  14. package/dist/host/claude/rules/workspace.md +32 -28
  15. package/dist/host/configs/policy.ts +49 -0
  16. package/dist/host/dotfiles/gitignore +1 -0
  17. package/dist/host/dotfiles/oxlintrc.json +6 -0
  18. package/dist/host/guides/agent.md +13 -13
  19. package/dist/host/guides/brief.md +4 -0
  20. package/dist/host/guides/browser.md +162 -44
  21. package/dist/host/guides/budget.md +1 -1
  22. package/dist/host/guides/capture.md +4 -0
  23. package/dist/host/guides/console.md +13 -0
  24. package/dist/host/guides/contract.md +38 -3
  25. package/dist/host/guides/csv.md +5 -0
  26. package/dist/host/guides/database.md +58 -8
  27. package/dist/host/guides/form.md +17 -0
  28. package/dist/host/guides/guide.md +36 -33
  29. package/dist/host/guides/html.md +72 -44
  30. package/dist/host/guides/indexeddb.md +4 -0
  31. package/dist/host/guides/lsp.md +49 -8
  32. package/dist/host/guides/markdown.md +146 -1
  33. package/dist/host/guides/mcp.md +117 -22
  34. package/dist/host/guides/middleware.md +194 -26
  35. package/dist/host/guides/msg.md +9 -5
  36. package/dist/host/guides/pool.md +8 -1
  37. package/dist/host/guides/probe.md +13 -1
  38. package/dist/host/guides/process.md +102 -90
  39. package/dist/host/guides/program.md +4 -0
  40. package/dist/host/guides/qualifier.md +4 -0
  41. package/dist/host/guides/rater.md +4 -0
  42. package/dist/host/guides/reason.md +6 -4
  43. package/dist/host/guides/relation.md +4 -0
  44. package/dist/host/guides/scaffold.md +32 -14
  45. package/dist/host/guides/server.md +29 -13
  46. package/dist/host/guides/sqlite.md +6 -0
  47. package/dist/host/guides/sse.md +6 -0
  48. package/dist/host/guides/study.md +473 -473
  49. package/dist/host/guides/table.md +3 -0
  50. package/dist/host/guides/template.md +3 -0
  51. package/dist/host/guides/test.md +38 -20
  52. package/dist/host/guides/tool.md +3 -0
  53. package/dist/host/guides/toolbox.md +21 -0
  54. package/dist/host/guides/websocket.md +3 -1
  55. package/dist/host/guides/workflow.md +103 -11
  56. package/dist/host/guides/workspace.md +4 -0
  57. package/dist/host/manifest.json +56 -56
  58. package/dist/host/tests/config.test.ts +72 -16
  59. package/dist/host/tests/policy.test.ts +21 -7
  60. package/dist/host/tests/setupPolicy.ts +147 -12
  61. package/dist/src/core/index.cjs +22 -28
  62. package/dist/src/core/index.cjs.map +1 -1
  63. package/dist/src/core/index.d.cts +8 -8
  64. package/dist/src/core/index.d.ts +8 -8
  65. package/dist/src/core/index.js +22 -28
  66. package/dist/src/core/index.js.map +1 -1
  67. package/package.json +12 -12
@@ -43,59 +43,59 @@ so network-controlled descriptions never enter agent instruction context.
43
43
 
44
44
  <!-- orkestrel:catalog -->
45
45
 
46
- | Package | Version | Layer | Runtime dependencies | Peer dependencies |
47
- | ----------------------- | --------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
48
- | `@orkestrel/abort` | `0.0.13` | L1 | `@orkestrel/contract` `^0.0.19` | |
49
- | `@orkestrel/agent` | `0.0.32` | L5 | `@orkestrel/tool` `^0.0.19`, `@orkestrel/abort` `^0.0.13`, `@orkestrel/queue` `^0.0.17`, `@orkestrel/budget` `^0.0.14`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/timeout` `^0.0.13`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/database` `^0.0.18`, `@orkestrel/workflow` `^0.0.23`, `@orkestrel/workspace` `^0.0.12` | |
50
- | `@orkestrel/brief` | `0.0.11` | L4 | `@orkestrel/reason` `^0.0.13`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/interpret` `^0.0.16` | |
51
- | `@orkestrel/browser` | `0.0.29` | L5 | `@orkestrel/mcp` `^0.0.39`, `@orkestrel/html` `^0.0.12`, `@orkestrel/pool` `^0.0.17`, `@orkestrel/tool` `^0.0.19`, `@orkestrel/codec` `^0.0.6`, `@orkestrel/router` `^0.0.17`, `@orkestrel/server` `^0.0.23`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/markdown` `^0.0.17`, `@orkestrel/websocket` `^0.0.15` | |
52
- | `@orkestrel/budget` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.19` | |
53
- | `@orkestrel/capture` | `0.0.1` | L3 | `@orkestrel/process` `^0.0.15`, `@orkestrel/timeout` `^0.0.13`, `@orkestrel/contract` `^0.0.19` | `vite` `^8.3.5`, `vitest` `^4.1.12 \|\| ^5.0.5`, `playwright` `^1.61.0`, `@vitest/browser-playwright` `^4.1.12 \|\| ^5.0.5` |
54
- | `@orkestrel/codec` | `0.0.6` | L1 | `@orkestrel/contract` `^0.0.19` | |
55
- | `@orkestrel/console` | `0.0.16` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
56
- | `@orkestrel/contract` | `0.0.19` | L0 | | |
57
- | `@orkestrel/csv` | `0.0.10` | L1 | `@orkestrel/contract` `^0.0.19` | |
58
- | `@orkestrel/database` | `0.0.18` | L2 | `@orkestrel/sqlite` `^0.0.14`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/indexeddb` `^0.0.14` | |
59
- | `@orkestrel/emitter` | `0.0.12` | L1 | `@orkestrel/contract` `^0.0.19` | |
60
- | `@orkestrel/form` | `0.0.13` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
61
- | `@orkestrel/guide` | `0.0.25` | L3 | `@orkestrel/contract` `^0.0.19`, `@orkestrel/markdown` `^0.0.17` | |
62
- | `@orkestrel/html` | `0.0.12` | L1 | `@orkestrel/contract` `^0.0.19` | |
63
- | `@orkestrel/indexeddb` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.19` | |
64
- | `@orkestrel/interpret` | `0.0.16` | L3 | `@orkestrel/reason` `^0.0.13`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/template` `^0.0.10` | |
65
- | `@orkestrel/lsp` | `0.0.11` | L3 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/process` `^0.0.15`, `@orkestrel/contract` `^0.0.19` | |
66
- | `@orkestrel/markdown` | `0.0.17` | L2 | `@orkestrel/html` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
67
- | `@orkestrel/mcp` | `0.0.39` | L4 | `@orkestrel/sse` `^0.0.10`, `@orkestrel/tool` `^0.0.19`, `@orkestrel/codec` `^0.0.6`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/process` `^0.0.15`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/websocket` `^0.0.15` | `@orkestrel/router` `^0.0.17`, `@orkestrel/server` `^0.0.23` |
68
- | `@orkestrel/middleware` | `0.0.25` | L4 | `@orkestrel/abort` `^0.0.13`, `@orkestrel/budget` `^0.0.14`, `@orkestrel/timeout` `^0.0.13`, `@orkestrel/contract` `^0.0.19` | `@orkestrel/server` `^0.0.23`, `@orkestrel/database` `^0.0.18` |
69
- | `@orkestrel/msg` | `0.0.13` | L1 | `@orkestrel/contract` `^0.0.19` | |
70
- | `@orkestrel/ndjson` | `0.0.12` | L1 | `@orkestrel/contract` `^0.0.19` | |
71
- | `@orkestrel/ollama` | `0.0.26` | L6 | `@orkestrel/tool` `^0.0.19`, `@orkestrel/agent` `^0.0.32`, `@orkestrel/budget` `^0.0.14`, `@orkestrel/ndjson` `^0.0.12`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/process` `^0.0.15`, `@orkestrel/contract` `^0.0.19` | |
72
- | `@orkestrel/pool` | `0.0.17` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
73
- | `@orkestrel/probe` | `0.0.25` | L5 | `@orkestrel/lsp` `^0.0.11`, `@orkestrel/mcp` `^0.0.39`, `@orkestrel/pool` `^0.0.17`, `@orkestrel/tool` `^0.0.19`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/timeout` `^0.0.13`, `@orkestrel/contract` `^0.0.19` | `vitest` `^4.1.12 \|\| ^5.0.5`, `typescript` `^6.0.3 \|\| ^7.0.2` |
74
- | `@orkestrel/process` | `0.0.15` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
75
- | `@orkestrel/program` | `0.0.16` | L4 | `@orkestrel/rater` `^0.0.17`, `@orkestrel/reason` `^0.0.13`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/qualifier` `^0.0.17` | |
76
- | `@orkestrel/qualifier` | `0.0.17` | L3 | `@orkestrel/reason` `^0.0.13`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
77
- | `@orkestrel/queue` | `0.0.17` | L3 | `@orkestrel/abort` `^0.0.13`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/timeout` `^0.0.13`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/database` `^0.0.18` | |
78
- | `@orkestrel/rater` | `0.0.17` | L3 | `@orkestrel/reason` `^0.0.13`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
79
- | `@orkestrel/reason` | `0.0.13` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
80
- | `@orkestrel/relation` | `0.0.16` | L3 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/database` `^0.0.18` | |
81
- | `@orkestrel/router` | `0.0.17` | L2 | `@orkestrel/abort` `^0.0.13`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
82
- | `@orkestrel/scaffold` | `0.0.108` | L3 | `@orkestrel/console` `^0.0.16`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/process` `^0.0.15`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/markdown` `^0.0.17`, `@orkestrel/template` `^0.0.10` | |
83
- | `@orkestrel/sea` | `0.0.19` | L3 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/process` `^0.0.15`, `@orkestrel/contract` `^0.0.19` | |
84
- | `@orkestrel/server` | `0.0.23` | L3 | `@orkestrel/abort` `^0.0.13`, `@orkestrel/codec` `^0.0.6`, `@orkestrel/router` `^0.0.17`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/timeout` `^0.0.13`, `@orkestrel/contract` `^0.0.19` | |
85
- | `@orkestrel/sqlite` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.19` | |
86
- | `@orkestrel/sse` | `0.0.10` | L1 | `@orkestrel/contract` `^0.0.19` | |
87
- | `@orkestrel/study` | `0.0.6` | L7 | `@orkestrel/tool` `^0.0.19`, `@orkestrel/abort` `^0.0.13`, `@orkestrel/agent` `^0.0.32`, `@orkestrel/budget` `^0.0.14`, `@orkestrel/ollama` `^0.0.26`, `@orkestrel/timeout` `^0.0.13`, `@orkestrel/contract` `^0.0.19` | |
88
- | `@orkestrel/table` | `0.0.12` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
89
- | `@orkestrel/template` | `0.0.10` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
90
- | `@orkestrel/terminal` | `0.0.20` | L3 | `@orkestrel/sse` `^0.0.10`, `@orkestrel/form` `^0.0.12`, `@orkestrel/console` `^0.0.16`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/database` `^0.0.18` | |
91
- | `@orkestrel/test` | `0.0.30` | L1 | `@orkestrel/contract` `^0.0.19` | `vitest` `^4.1.12 \|\| ^5.0.5`, `playwright` `^1.64.1` |
92
- | `@orkestrel/timeout` | `0.0.13` | L1 | `@orkestrel/contract` `^0.0.19` | |
93
- | `@orkestrel/tool` | `0.0.19` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
94
- | `@orkestrel/toolbox` | `0.0.21` | L6 | `@orkestrel/form` `^0.0.13`, `@orkestrel/tool` `^0.0.19`, `@orkestrel/agent` `^0.0.32`, `@orkestrel/server` `^0.0.23`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/database` `^0.0.18`, `@orkestrel/relation` `^0.0.16`, `@orkestrel/terminal` `^0.0.20`, `@orkestrel/workflow` `^0.0.23`, `@orkestrel/workspace` `^0.0.12` | |
95
- | `@orkestrel/websocket` | `0.0.15` | L2 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19` | |
96
- | `@orkestrel/worker` | `0.0.17` | L4 | `@orkestrel/pool` `^0.0.17`, `@orkestrel/queue` `^0.0.17`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/database` `^0.0.18` | |
97
- | `@orkestrel/workflow` | `0.0.23` | L4 | `@orkestrel/abort` `^0.0.13`, `@orkestrel/queue` `^0.0.17`, `@orkestrel/budget` `^0.0.14`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/timeout` `^0.0.13`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/database` `^0.0.18` | |
98
- | `@orkestrel/workspace` | `0.0.12` | L3 | `@orkestrel/emitter` `^0.0.12`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/database` `^0.0.18` | |
46
+ | Package | Version | Layer | Runtime dependencies | Peer dependencies |
47
+ | ----------------------- | --------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
48
+ | `@orkestrel/abort` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.20` | |
49
+ | `@orkestrel/agent` | `0.0.33` | L5 | `@orkestrel/tool` `^0.0.20`, `@orkestrel/abort` `^0.0.14`, `@orkestrel/queue` `^0.0.18`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19`, `@orkestrel/workflow` `^0.0.24`, `@orkestrel/workspace` `^0.0.13` | |
50
+ | `@orkestrel/brief` | `0.0.13` | L4 | `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/interpret` `^0.0.18` | |
51
+ | `@orkestrel/browser` | `0.0.30` | L5 | `@orkestrel/mcp` `^0.0.40`, `@orkestrel/html` `^0.0.13`, `@orkestrel/pool` `^0.0.18`, `@orkestrel/tool` `^0.0.20`, `@orkestrel/codec` `^0.0.7`, `@orkestrel/router` `^0.0.18`, `@orkestrel/server` `^0.0.24`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/markdown` `^0.0.18`, `@orkestrel/websocket` `^0.0.16` | |
52
+ | `@orkestrel/budget` | `0.0.15` | L1 | `@orkestrel/contract` `^0.0.20` | |
53
+ | `@orkestrel/capture` | `0.0.2` | L3 | `@orkestrel/process` `^0.0.16`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | `vite` `^8.3.5`, `vitest` `^4.1.12 \|\| ^5.0.5`, `playwright` `^1.61.0`, `@vitest/browser-playwright` `^4.1.12 \|\| ^5.0.5` |
54
+ | `@orkestrel/codec` | `0.0.7` | L1 | `@orkestrel/contract` `^0.0.20` | |
55
+ | `@orkestrel/console` | `0.0.17` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
56
+ | `@orkestrel/contract` | `0.0.20` | L0 | | |
57
+ | `@orkestrel/csv` | `0.0.11` | L1 | `@orkestrel/contract` `^0.0.20` | |
58
+ | `@orkestrel/database` | `0.0.19` | L2 | `@orkestrel/sqlite` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/indexeddb` `^0.0.15` | |
59
+ | `@orkestrel/emitter` | `0.0.13` | L1 | `@orkestrel/contract` `^0.0.20` | |
60
+ | `@orkestrel/form` | `0.0.14` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
61
+ | `@orkestrel/guide` | `0.0.26` | L3 | `@orkestrel/contract` `^0.0.20`, `@orkestrel/markdown` `^0.0.18` | |
62
+ | `@orkestrel/html` | `0.0.13` | L1 | `@orkestrel/contract` `^0.0.20` | |
63
+ | `@orkestrel/indexeddb` | `0.0.15` | L1 | `@orkestrel/contract` `^0.0.20` | |
64
+ | `@orkestrel/interpret` | `0.0.18` | L3 | `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/template` `^0.0.11` | |
65
+ | `@orkestrel/lsp` | `0.0.12` | L3 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20` | |
66
+ | `@orkestrel/markdown` | `0.0.18` | L2 | `@orkestrel/html` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
67
+ | `@orkestrel/mcp` | `0.0.40` | L4 | `@orkestrel/sse` `^0.0.11`, `@orkestrel/tool` `^0.0.20`, `@orkestrel/codec` `^0.0.7`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/websocket` `^0.0.16` | `@orkestrel/router` `^0.0.18`, `@orkestrel/server` `^0.0.24` |
68
+ | `@orkestrel/middleware` | `0.0.26` | L4 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | `@orkestrel/server` `^0.0.24`, `@orkestrel/database` `^0.0.19` |
69
+ | `@orkestrel/msg` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.20` | |
70
+ | `@orkestrel/ndjson` | `0.0.13` | L1 | `@orkestrel/contract` `^0.0.20` | |
71
+ | `@orkestrel/ollama` | `0.0.27` | L6 | `@orkestrel/tool` `^0.0.20`, `@orkestrel/agent` `^0.0.33`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/ndjson` `^0.0.13`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20` | |
72
+ | `@orkestrel/pool` | `0.0.18` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
73
+ | `@orkestrel/probe` | `0.0.26` | L5 | `@orkestrel/lsp` `^0.0.12`, `@orkestrel/mcp` `^0.0.40`, `@orkestrel/pool` `^0.0.18`, `@orkestrel/tool` `^0.0.20`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | `vitest` `^4.1.12 \|\| ^5.0.5`, `typescript` `^6.0.3 \|\| ^7.0.2` |
74
+ | `@orkestrel/process` | `0.0.16` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
75
+ | `@orkestrel/program` | `0.0.18` | L4 | `@orkestrel/rater` `^0.0.19`, `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/qualifier` `^0.0.19` | |
76
+ | `@orkestrel/qualifier` | `0.0.19` | L3 | `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
77
+ | `@orkestrel/queue` | `0.0.18` | L3 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
78
+ | `@orkestrel/rater` | `0.0.19` | L3 | `@orkestrel/reason` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
79
+ | `@orkestrel/reason` | `0.0.15` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
80
+ | `@orkestrel/relation` | `0.0.17` | L3 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
81
+ | `@orkestrel/router` | `0.0.18` | L2 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
82
+ | `@orkestrel/scaffold` | `0.0.113` | L3 | `@orkestrel/console` `^0.0.16`, `@orkestrel/emitter` `^0.0.12`, `@orkestrel/process` `^0.0.15`, `@orkestrel/contract` `^0.0.19`, `@orkestrel/markdown` `^0.0.17`, `@orkestrel/template` `^0.0.10` | |
83
+ | `@orkestrel/sea` | `0.0.20` | L3 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/process` `^0.0.16`, `@orkestrel/contract` `^0.0.20` | |
84
+ | `@orkestrel/server` | `0.0.24` | L3 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/codec` `^0.0.7`, `@orkestrel/router` `^0.0.18`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | |
85
+ | `@orkestrel/sqlite` | `0.0.15` | L1 | `@orkestrel/contract` `^0.0.20` | |
86
+ | `@orkestrel/sse` | `0.0.11` | L1 | `@orkestrel/contract` `^0.0.20` | |
87
+ | `@orkestrel/study` | `0.0.7` | L7 | `@orkestrel/tool` `^0.0.20`, `@orkestrel/abort` `^0.0.14`, `@orkestrel/agent` `^0.0.33`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/ollama` `^0.0.27`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20` | |
88
+ | `@orkestrel/table` | `0.0.13` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
89
+ | `@orkestrel/template` | `0.0.11` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
90
+ | `@orkestrel/terminal` | `0.0.21` | L3 | `@orkestrel/sse` `^0.0.11`, `@orkestrel/form` `^0.0.14`, `@orkestrel/console` `^0.0.17`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
91
+ | `@orkestrel/test` | `0.0.31` | L1 | `@orkestrel/contract` `^0.0.20` | `vitest` `^4.1.12 \|\| ^5.0.5`, `playwright` `^1.64.1` |
92
+ | `@orkestrel/timeout` | `0.0.14` | L1 | `@orkestrel/contract` `^0.0.20` | |
93
+ | `@orkestrel/tool` | `0.0.20` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
94
+ | `@orkestrel/toolbox` | `0.0.22` | L6 | `@orkestrel/form` `^0.0.14`, `@orkestrel/tool` `^0.0.20`, `@orkestrel/agent` `^0.0.33`, `@orkestrel/server` `^0.0.24`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19`, `@orkestrel/relation` `^0.0.17`, `@orkestrel/terminal` `^0.0.21`, `@orkestrel/workflow` `^0.0.24`, `@orkestrel/workspace` `^0.0.13` | |
95
+ | `@orkestrel/websocket` | `0.0.16` | L2 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20` | |
96
+ | `@orkestrel/worker` | `0.0.18` | L4 | `@orkestrel/pool` `^0.0.18`, `@orkestrel/queue` `^0.0.18`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
97
+ | `@orkestrel/workflow` | `0.0.24` | L4 | `@orkestrel/abort` `^0.0.14`, `@orkestrel/queue` `^0.0.18`, `@orkestrel/budget` `^0.0.15`, `@orkestrel/emitter` `^0.0.13`, `@orkestrel/timeout` `^0.0.14`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
98
+ | `@orkestrel/workspace` | `0.0.13` | L3 | `@orkestrel/emitter` `^0.0.13`, `@orkestrel/contract` `^0.0.20`, `@orkestrel/database` `^0.0.19` | |
99
99
 
100
100
  <!-- /orkestrel:catalog -->
101
101
 
@@ -48,8 +48,8 @@ Use only the centralized files an environment needs.
48
48
  - A function module contains imports and exactly one exported function named for its file. Everything else extracts by kind exactly as it does from a class module.
49
49
  - Extract local declarations by kind. “Only used here” and “not exported” are not exemptions.
50
50
  - Every declaration in a centralized file is exported. Fold away a trivial single-use declaration or export/test it; never leave it hidden.
51
- - The only permitted non-exported module-scope declarations are in a runtime entrypoint that must be self-contained and cannot import siblings, such as raw source loaded in a worker. Explain that necessity in a comment.
52
- - Treat `src/bin/main.ts`, `app/browser/main.ts`, `app/vue/main.ts`, and `app/server/main.ts` as fixed runtime entries. Declare no module-scope constant or function in them; import what they need and run. Apply the preceding self-contained exception only to an entrypoint that cannot import siblings.
51
+ - When a runtime entrypoint must be self-contained and cannot import siblings, such as raw source loaded in a worker, import only installed packages and `node:` modules there and explain that necessity in a comment. Keep its declarations in the kind its file names, as every other file does: inline what a sibling would supply as a callback argument, and keep per-run state in the call's own entities, such as an `AbortController` instance whose signal scopes a listener.
52
+ - Treat `src/bin/main.ts`, `app/browser/main.ts`, `app/vue/main.ts`, and `app/server/main.ts` as fixed runtime entries. Declare no module-scope constant or function in them; import what they need and run.
53
53
  - Perform a cleanup pass after implementation: no stray implementation-file declarations, non-exported/wrong-kind centralized declarations, prohibited nested declarations, duplicate implementations, compatibility aliases, superfluous wrappers, stale imports/barrel rows, or untested extracted functions.
54
54
 
55
55
  ## Kind purity
@@ -256,10 +256,11 @@ Choose the access shape:
256
256
 
257
257
  - **Point access:** `get`, `set`, `delete`.
258
258
  - **Bulk restore:** `save`, `load`, `remove`, `clear`.
259
+ - **Atomic update:** one verb that reads, decides, and writes a key's entry in one call, such as `consume(key, now, limits)`, for a counter or budget store whose read-modify-write must not interleave across an `await`.
259
260
 
260
261
  Every shape obeys:
261
262
 
262
- - The stored value carries its own id; do not pass a separate id to `set`/`save`.
263
+ - The stored value carries its own id; do not pass a separate id to `set`/`save`. An atomic update takes the key of the entry it changes, because the caller passes no stored value.
263
264
  - Every primitive is async and returns a `Promise`.
264
265
  - Deleting/removing a missing key is a no-op.
265
266
  - Concrete stores live in `stores/`; the interface stays in module-root `types.ts`; `create*Store` factories stay in `factories.ts`.
@@ -20,7 +20,8 @@ These rules govern what a test asserts and where it lives, the cross-cutting and
20
20
  not add `tests/configs/`.
21
21
  - Resolve a mirrored module through `.ts`, `.tsx`, `.mts`, `.cts`, `.vue`, `.scss`, or `.css`.
22
22
  - Resolve a Sass or CSS partial through the module's leading underscore.
23
- - Mirror root setup modules and proofs in both directions. A root `tests/setup<Name>.test.ts`
23
+ - Mirror the root setup modules § Shared test infrastructure places, and their proofs, in both
24
+ directions; that section's list is the whole set of names. A root `tests/setup<Name>.test.ts`
24
25
  resolves to `tests/setup<Name>.ts`. A root `tests/setup<Name>.ts` that declares an export has
25
26
  `tests/setup<Name>.test.ts` or is imported by `tests/setup.test.ts`, which can prove several
26
27
  setup modules when their helpers serve several projects. The setup modules scaffold owns are
@@ -165,12 +166,14 @@ A test that spawns a process, packs, installs, or drives a real build is a proof
165
166
 
166
167
  - Give it its own Vitest project with its own setup and timeout.
167
168
  - Keep it out of the default run where the workspace has a gate that can hold it.
168
- `.claude/rules/workspace.md` fixes which gate each isolated project runs from, and that placement
169
+ `.claude/rules/workspace.md` fixes where each isolated project runs, and that placement
169
170
  differs between a publishing and a `private: true` workspace.
170
- - The fixed expensive-proof projects are `distribution`, `service`, and `studies`.
171
- - Put in `studies` only the proofs the `@orkestrel/study` engine drives. A slow end-to-end proof of
171
+ - Use `distribution` and `service` as the fixed expensive-proof projects.
172
+ - Put a study's proofs under `tests/studies/` in the `studies` project, which
173
+ `.claude/rules/workspace.md` § Test project matrix places.
174
+ - Put in `studies` only the proofs the `@orkestrel/study` engine drives. Place a slow end-to-end proof of
172
175
  the package's own features that no study engine drives, such as its built executable run against
173
- a fixture workspace, is an integration test under § Cross-cutting proofs. Place it by the scope it
176
+ a fixture workspace, as an integration test under § Cross-cutting proofs. Place it by the scope it
174
177
  composes:
175
178
  - Put a proof that crosses environments in `tests/integration.test.ts`, which the `integration`
176
179
  project runs from `test`.
@@ -201,7 +204,10 @@ Test helpers are shared infrastructure, not local test-file clutter.
201
204
  - Export every reusable helper, fixture type, factory, constant, and guard from setup files.
202
205
  - A setup file owns everything an assertion needs and nothing an assertion is: `describe`, `it`, `test`, and `expect` never appear in a `setup*.ts`; lint refuses their import from `vitest` there.
203
206
  - Data tables and case matrices belong in a setup file at any size; test registration does not.
204
- - Test files import shared infrastructure rather than declaring local fixture factories.
207
+ - Test files import shared infrastructure rather than declaring local fixture factories. The
208
+ `policy/no-test-helper` lint rule refuses a module-scope function, class, or function-valued
209
+ binding in a mirrored test file (`tests/src/**`, `tests/app/**`) or a root setup proof; move each
210
+ into the setup module its environment names.
205
211
  - Never reimplement a framework helper in tests or fixtures; import the real parser, signer, flattener, or other helper.
206
212
  - Prefer small customizable factories/stubs that seed inert data for a real scenario over repeated inline setup.
207
213
  - Helper names follow module-helper naming: `createFixtureServer`, `buildElement`, `appendItems`, `renderRows`, `waitForReady`, `extractDetail`.
@@ -209,13 +215,24 @@ Test helpers are shared infrastructure, not local test-file clutter.
209
215
  - A module reads no live host object at import; it reads one inside the function that needs it.
210
216
  - A fixture that stands in for another package's platform behavior copies that package's own proof of the behavior rather than re-deriving it.
211
217
 
212
- Place helpers by environment:
218
+ Declare test infrastructure only in the root modules the following list places, each in the
219
+ environment it names, and in scaffold's vendored `tests/setupPolicy.ts`. Never create another
220
+ `tests/setup<Name>.ts`, a nested setup module, or a helper, type, suite, or builder module anywhere
221
+ else under `tests/`. Put a cross-cutting proof's helpers in the module of the environment the proof
222
+ runs in: `tests/setupServer.ts` for the Node `conformance`, `tree`, and `integration` proofs. A file
223
+ under a `fixtures/` directory is data or an entry a test runs or loads on its own, never a helper a
224
+ test file imports. The policy sweep's `mirror` rule refuses every other TypeScript module under
225
+ `tests/` that is not a test, a bench, or a declaration file; it reads paths, not imports, so review
226
+ refuses a helper placed under `fixtures/`.
213
227
 
214
228
  - `tests/setup.ts`: host-independent; no `node:*`, DOM, `window`, or Vue. Lint refuses a `node:` or Vue import there.
215
229
  - `tests/setupServer.ts`: Node-only helpers and `node:fs` loaders anchored to `WORKSPACE_ROOT`.
216
230
  - `tests/setupBrowser.ts`: DOM/Vue/browser helpers and setup CSS. Lint refuses a `node:` import here and in `tests/setupStyles.ts`.
217
231
  - `tests/setupStyles.ts`: the CSSOM and sheet helpers `.claude/rules/styles.md` places there; a
218
232
  sheet-face project loads it after `tests/setupBrowser.ts` when the target has the file.
233
+ - `tests/setupService.ts`: the `service` project's readiness setup, per § Live-service tests.
234
+ - `tests/setupGlobal.ts`: the `globalSetup` module `.claude/rules/workspace.md` § Test project
235
+ matrix assigns to `src:browser`, `setup:browser`, and `integration`.
219
236
  - `tests/setupStudy.ts`: the harness module the study tests import and, in a study-engine package,
220
237
  its source tests too. Name it in no project's `setupFiles`; tests import it, as the policy proof
221
238
  imports `tests/setupPolicy.ts`.
@@ -87,7 +87,9 @@ The non-negotiables and design laws in `AGENTS.md` apply without exception and a
87
87
  reached, such as a child directory, a dependency, an amendment, or a child process. Count as one
88
88
  step a complete iteration that removes or visits an entry of the worklist, its nested loops
89
89
  included. Treat a worklist that no step can add more than one entry to as a cursor, and return
90
- what it reaches from a bounded recursion;
90
+ what it reaches from a bounded recursion. When only an input limit bounds the walk's depth, as
91
+ a linked chain's length does, walk it through an iterator created for the call instead, under
92
+ the **Per-call state** rule, with the cursor in that iterator's `#` field;
91
93
  - a traversal's membership set or map, which the traversal reads to avoid revisiting a node or to
92
94
  discover the nodes reachable from nodes it has recorded, whether or not it iterates that
93
95
  collection, and to which the cursor condition never applies;
@@ -220,12 +222,19 @@ type Result<T, E = Error> = Success<T> | Failure<E>
220
222
  declares, checked against its declared type, under the guard law in
221
223
  `.claude/rules/patterns.md` § Validation and contracts; never require the class's `name`, which
222
224
  a subclass replaces;
225
+ - check a member whose type the package declares against every value that type admits, a class
226
+ instance and a callable object carrying the declared members included. Check a member whose type
227
+ `@orkestrel/contract` defines, such as a JSON value, a fault, or an array of either, through that
228
+ package's guard for the type, which fixes its data shape: a plain record, own array indices, and
229
+ the enumerable members that JSON reads. The one exception is a number, where the guard accepts
230
+ any number the type admits;
223
231
  - where `@orkestrel/contract` is declared, read through its `INTRINSICS` constant inside its
224
232
  `holds` function.
225
233
  - Prove the guard in `tests/distribution.test.ts` against two copies of the packed package, each
226
234
  copy's guard reading the other copy's error: the `require` entry against the `import` entry where
227
235
  the package ships both, and the installed package against a copy of its files at a second path.
228
- Prove beside it that the guard accepts an instance of a subclass and refuses a look-alike error
236
+ Assert that the loaded copies' error constructors are pairwise distinct, so that the proof cannot
237
+ pass on one module instance. Prove beside it that the guard accepts an instance of a subclass and refuses a look-alike error
229
238
  with the same `code` and no brand, a transparent `Proxy` object over a branded error, and a plain
230
239
  object that only carries the brand.
231
240
 
@@ -85,6 +85,10 @@ private copy of that environment into the face, so the vendored `.oxlintrc.json`
85
85
  `devDependencies` there: the root config bundles the file into every config load, builds
86
86
  included, and the bundle resolves no workspace alias. Load workspace source inside a command
87
87
  body through `context.project.vitest.import`, never through a static import.
88
+ - Keep `fsModuleCache: false` in the root configuration's `test` block. Vitest 5.0.5 reads a cached
89
+ module's code as bytes, and with the cache on, every stack read inside source a command loads
90
+ through `context.project.vitest.import` throws (measured 2026-10-29 in `@orkestrel/test`'s
91
+ `chooseFiles` command). Remove the setting only after a Vitest release reads that code as text.
88
92
  - Keep `configs/helpers.ts` free of any dependency a core-only workspace does not declare. It is
89
93
  vendored byte-identical to every workspace, so an import there must resolve in all of them.
90
94
  `configs/browsers.ts` exists for that reason: it imports `playwright` and
@@ -180,7 +184,7 @@ one environment, so each is its own project:
180
184
  | `distribution` | `tests/distribution.test.ts` | The packed package installs and resolves through its public exports | `prepublishOnly`; absent when private |
181
185
  | `integration` | `tests/integration.test.ts` | The package's features work together end to end across environments | `test` |
182
186
  | `service` | `tests/service/**/*.test.ts` | The live external services this package drives, driven for real | `prepublishOnly`; `test` when private |
183
- | `studies` | `tests/studies/**/*.test.ts` | The study proofs the `@orkestrel/study` engine drives: installed packages run through bounded subprocesses and protocol fixtures; an end-to-end proof no study engine drives is an integration test | `prepublishOnly`; `test` when private |
187
+ | `studies` | `tests/studies/**/*.test.ts` | Run the study proofs the `@orkestrel/study` engine drives. | Run `npm run test:studies` on demand. |
184
188
 
185
189
  - Define the Node `setup` project when `global` selects its seeded proof or a root file matches
186
190
  `tests/setup*.test.ts`, exact-case, other than `tests/setupBrowser.test.ts` and
@@ -205,18 +209,18 @@ one environment, so each is its own project:
205
209
  from its application project, and run `test:journey` and one `test:journey:<framework>` per
206
210
  app-side browser extension after the application projects in `test`.
207
211
 
208
- `conformance`, `tree`, `integration`, `distribution`, `studies`, and `service` are separate
209
- subjects, not names for one.
212
+ Keep `conformance`, `tree`, `integration`, `distribution`, `studies`, and `service` as separate
213
+ subjects.
210
214
  Keep `conformance` in `test`: measure this package against an installed official artifact, and start
211
215
  any server the proof drives itself. Keep `tree` in `test`: read the real tree in Node and drive no
212
216
  build, install, or service. Keep `integration` in `test` whatever its cost: compose the workspace's public
213
217
  surfaces without packing, installing, or driving an external service. In a publishing workspace,
214
- run `distribution`, `studies`, and `service` from `prepublishOnly`: pack and install the package in
215
- `distribution`, run the authored study proofs in `studies` after `npm test` and before the release
216
- proof, and drive the real service with `tests/setupService.ts`, longer timeouts, and no file
218
+ run `distribution` and `service` from `prepublishOnly`: pack and install the package in
219
+ `distribution`, and drive the real service with `tests/setupService.ts`, longer timeouts, and no file
217
220
  parallelism in `service`. In a `private: true` workspace, never declare `prepublishOnly`; omit
218
- `distribution`, reach `studies` and then `service` from `test`, and retain each isolated project's
219
- configuration.
221
+ `distribution`, reach `service` from `test`, and retain each isolated project's configuration.
222
+ In both kinds of workspace, run `studies` on demand through `npm run test:studies` alone.
223
+ Keep `test:studies` out of every gate and chain.
220
224
 
221
225
  One project sits on neither axis. `probe` includes `tmp/probes/**/*.test.ts` so an agent can run a
222
226
  throwaway instrument against real sources, aliases and setup. Declare no proof there. Keep the
@@ -288,26 +292,26 @@ Build/check config alignment:
288
292
 
289
293
  ## Script intent
290
294
 
291
- | Script | Contract |
292
- | ---------------------------- | -------------------------------------------------------------------------- |
293
- | `dev` | Browser development entry |
294
- | `build` | Build configured library/application targets |
295
- | `serve` / `serve:build` | Run built server / build then run |
296
- | `showcase` | Showcase dev server of the base mode |
297
- | `showcase:<framework>` | Showcase dev server of that framework's mode |
298
- | `build:showcase` | Build `showcase/browser.html` |
299
- | `build:showcase:<framework>` | Build `showcase/<framework>.html` |
300
- | `lint` | `oxlint --config .oxlintrc.json --fix .`; separate from typecheck |
301
- | `lint:check` | Non-mutating whole-tree lint gate |
302
- | `check` | Comprehensive root typecheck plus configured isolation scopes |
303
- | `check:<scope>` | On-demand environment-isolation pass |
304
- | `format` | Format all files |
305
- | `format:check` | Non-mutating whole-tree format gate |
306
- | `test` | Environment projects plus non-isolated cross-cutting proofs |
307
- | `clean` | Remove `dist/` |
308
- | `copy <from> <to>` | Copy while creating parent directories |
309
- | `prepublishOnly` | Publishing workspaces only: the gate chain, then isolated proofs |
310
- | `prepack` | Publishing workspaces only: rebuild `dist/` so a pack ships current output |
295
+ | Script | Contract |
296
+ | ---------------------------- | ---------------------------------------------------------------------------- |
297
+ | `dev` | Browser development entry |
298
+ | `build` | Build configured library/application targets |
299
+ | `serve` / `serve:build` | Run built server / build then run |
300
+ | `showcase` | Showcase dev server of the base mode |
301
+ | `showcase:<framework>` | Showcase dev server of that framework's mode |
302
+ | `build:showcase` | Build `showcase/browser.html` |
303
+ | `build:showcase:<framework>` | Build `showcase/<framework>.html` |
304
+ | `lint` | `oxlint --config .oxlintrc.json --fix .`; separate from typecheck |
305
+ | `lint:check` | Non-mutating whole-tree lint gate |
306
+ | `check` | Comprehensive root typecheck plus configured isolation scopes |
307
+ | `check:<scope>` | On-demand environment-isolation pass |
308
+ | `format` | Format all files |
309
+ | `format:check` | Non-mutating whole-tree format gate |
310
+ | `test` | Environment projects plus non-isolated cross-cutting proofs |
311
+ | `clean` | Remove `dist/` |
312
+ | `copy <from> <to>` | Copy while creating parent directories |
313
+ | `prepublishOnly` | Publishing workspaces only: the gate chain, then the isolated release proofs |
314
+ | `prepack` | Publishing workspaces only: rebuild `dist/` so a pack ships current output |
311
315
 
312
316
  - In a publishing workspace, `prepublishOnly` runs `build:showcase` and every
313
317
  `build:showcase:<framework>` script after `npm run build`.
@@ -321,6 +321,16 @@ export const POLICY_NESTED_GLOBS: readonly string[] = Object.freeze(
321
321
  ),
322
322
  )
323
323
 
324
+ /**
325
+ * Matches the lint population the test-helper rule runs over, as the Oxlint configuration declares
326
+ * it: the mirrored test files and the root setup proofs.
327
+ */
328
+ export const POLICY_TEST_GLOBS: readonly string[] = Object.freeze([
329
+ 'tests/src/**/*.test.ts',
330
+ 'tests/app/**/*.test.ts',
331
+ 'tests/setup*.test.ts',
332
+ ])
333
+
324
334
  /**
325
335
  * Matches the lint population the skill-script rules run over, as the Oxlint configuration declares
326
336
  * it.
@@ -1225,6 +1235,22 @@ export function reportData(context: PolicyContext, node: PolicyExpression): void
1225
1235
  }
1226
1236
  }
1227
1237
 
1238
+ /** Reports a module-scope function, class, or function-valued binding a test file declares. */
1239
+ export function reportTestHelper(context: PolicyContext, node: PolicyExpression): void {
1240
+ if (!isPolicyTop(node)) return
1241
+ if (node.type !== 'VariableDeclaration') {
1242
+ context.report({ node, messageId: 'helper' })
1243
+ return
1244
+ }
1245
+ for (const declarator of node.declarations ?? []) {
1246
+ const init = declarator.init
1247
+ if (init === undefined || init === null) continue
1248
+ if (isPolicyFunction(init) || init.type === 'ClassExpression') {
1249
+ context.report({ node: declarator, messageId: 'helper' })
1250
+ }
1251
+ }
1252
+ }
1253
+
1228
1254
  /** Reports module function syntax outside a function-kind file. */
1229
1255
  export function reportFunction(context: PolicyContext, node: PolicyExpression): void {
1230
1256
  if (isPolicyAmbient(context.filename)) return
@@ -1827,6 +1853,28 @@ export const MUTABLE_RULE: PolicyRuleInterface = {
1827
1853
  },
1828
1854
  }
1829
1855
 
1856
+ /** Bans a module-scope function, class, or fixture factory in a mirrored test file or setup proof. */
1857
+ export const HELPER_RULE: PolicyRuleInterface = {
1858
+ meta: {
1859
+ type: 'problem',
1860
+ docs: {
1861
+ description:
1862
+ 'Disallow a module-scope function, class, or function-valued binding in a test file; shared test infrastructure lives in the root setup modules.',
1863
+ },
1864
+ messages: {
1865
+ helper:
1866
+ 'Move this declaration into the root setup module its environment names (tests/setup.ts, tests/setupServer.ts, or tests/setupBrowser.ts), export it, and import it; a test file imports shared infrastructure and declares none of its own.',
1867
+ },
1868
+ },
1869
+ create(context) {
1870
+ return {
1871
+ FunctionDeclaration: (node) => reportTestHelper(context, node),
1872
+ ClassDeclaration: (node) => reportTestHelper(context, node),
1873
+ VariableDeclaration: (node) => reportTestHelper(context, node),
1874
+ }
1875
+ },
1876
+ }
1877
+
1830
1878
  /** Bans a comment carrying a term the substitution table bans unconditionally. */
1831
1879
  export const TERM_RULE: PolicyRuleInterface = {
1832
1880
  meta: {
@@ -1870,5 +1918,6 @@ export default {
1870
1918
  'no-banned-term': TERM_RULE,
1871
1919
  'no-malformed-script': SCRIPT_RULE,
1872
1920
  'no-mutable-property': MUTABLE_RULE,
1921
+ 'no-test-helper': HELPER_RULE,
1873
1922
  },
1874
1923
  }
@@ -34,6 +34,7 @@ dist-ssr
34
34
 
35
35
  # Test screenshots (generated by vitest browser mode)
36
36
  tests/**/__screenshots__/
37
+ .vitest/
37
38
 
38
39
  # Playwright
39
40
  test-results/
@@ -906,6 +906,12 @@
906
906
  }
907
907
  ]
908
908
  }
909
+ },
910
+ {
911
+ "files": ["tests/src/**/*.test.ts", "tests/app/**/*.test.ts", "tests/setup*.test.ts"],
912
+ "rules": {
913
+ "policy/no-test-helper": "error"
914
+ }
909
915
  }
910
916
  ]
911
917
  }