@afokapu/atdd-bun 0.1.0

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 (876) hide show
  1. package/HOOK_AUDIT.md +22 -0
  2. package/PLANNER_PORT.md +55 -0
  3. package/README.md +256 -0
  4. package/bunfig.toml +2 -0
  5. package/conventions/coder.bun/coder.bun.boundaries-http-client.convention.yaml +43 -0
  6. package/conventions/coder.bun/coder.bun.commons-application-no-integration.convention.yaml +40 -0
  7. package/conventions/coder.bun/coder.bun.commons-cross-feature-imports-in.convention.yaml +39 -0
  8. package/conventions/coder.bun/coder.bun.commons-domain-no-framework-import.convention.yaml +40 -0
  9. package/conventions/coder.bun/coder.bun.commons-domain-no-outbound.convention.yaml +41 -0
  10. package/conventions/coder.bun/coder.bun.complexity-cyclomatic.convention.yaml +51 -0
  11. package/conventions/coder.bun/coder.bun.complexity-length.convention.yaml +43 -0
  12. package/conventions/coder.bun/coder.bun.complexity-nesting.convention.yaml +49 -0
  13. package/conventions/coder.bun/coder.bun.composition-consumer.convention.yaml +40 -0
  14. package/conventions/coder.bun/coder.bun.composition-root.convention.yaml +42 -0
  15. package/conventions/coder.bun/coder.bun.dead-code-reachability.convention.yaml +49 -0
  16. package/conventions/coder.bun/coder.bun.design-hierarchy-import.convention.yaml +42 -0
  17. package/conventions/coder.bun/coder.bun.dto-mapper.convention.yaml +38 -0
  18. package/conventions/coder.bun/coder.bun.dto-placement.convention.yaml +39 -0
  19. package/conventions/coder.bun/coder.bun.dto-purity.convention.yaml +40 -0
  20. package/conventions/coder.bun/coder.bun.duplication-intra-layer.convention.yaml +47 -0
  21. package/conventions/coder.bun/coder.bun.error-response-bare-string.convention.yaml +47 -0
  22. package/conventions/coder.bun/coder.bun.error-response-code-format.convention.yaml +46 -0
  23. package/conventions/coder.bun/coder.bun.green-header-order.convention.yaml +61 -0
  24. package/conventions/coder.bun/coder.bun.green-header-purpose.convention.yaml +55 -0
  25. package/conventions/coder.bun/coder.bun.green-header-runtime.convention.yaml +56 -0
  26. package/conventions/coder.bun/coder.bun.green-header-tested-by.convention.yaml +63 -0
  27. package/conventions/coder.bun/coder.bun.green-urn-layer.convention.yaml +53 -0
  28. package/conventions/coder.bun/coder.bun.green-urn-marker.convention.yaml +67 -0
  29. package/conventions/coder.bun/coder.bun.green-urn-name-matches.convention.yaml +57 -0
  30. package/conventions/coder.bun/coder.bun.green-urn-pattern.convention.yaml +56 -0
  31. package/conventions/coder.bun/coder.bun.green-urn-side.convention.yaml +54 -0
  32. package/conventions/coder.bun/coder.bun.green-urn-wagon-feature.convention.yaml +56 -0
  33. package/conventions/coder.bun/coder.bun.interlocking-bilateral-binding.convention.yaml +132 -0
  34. package/conventions/coder.bun/coder.bun.interlocking-delegates-to-trainrunner.convention.yaml +56 -0
  35. package/conventions/coder.bun/coder.bun.interlocking-does-not-carry-cargo.convention.yaml +53 -0
  36. package/conventions/coder.bun/coder.bun.interlocking-resolution-model-exists.convention.yaml +61 -0
  37. package/conventions/coder.bun/coder.bun.interlocking-runner-exists.convention.yaml +64 -0
  38. package/conventions/coder.bun/coder.bun.journey-runner-boundary.convention.yaml +55 -0
  39. package/conventions/coder.bun/coder.bun.layer-naming.convention.yaml +41 -0
  40. package/conventions/coder.bun/coder.bun.logging-console.convention.yaml +47 -0
  41. package/conventions/coder.bun/coder.bun.logging-structured.convention.yaml +49 -0
  42. package/conventions/coder.bun/coder.bun.quality-comments.convention.yaml +44 -0
  43. package/conventions/coder.bun/coder.bun.quality-mi.convention.yaml +47 -0
  44. package/conventions/coder.bun/coder.bun.runtime-executes-the-declaration.convention.yaml +104 -0
  45. package/conventions/coder.bun/coder.bun.runtime-server-is-bun-serve.convention.yaml +64 -0
  46. package/conventions/coder.bun/coder.bun.runtime-single-lockfile.convention.yaml +56 -0
  47. package/conventions/coder.bun/coder.bun.runtime-typecheck-enforced.convention.yaml +91 -0
  48. package/conventions/coder.bun/coder.bun.security-hardcoded-secret.convention.yaml +50 -0
  49. package/conventions/coder.bun/coder.bun.security-missing-auth.convention.yaml +53 -0
  50. package/conventions/coder.bun/coder.bun.security-sql-injection.convention.yaml +54 -0
  51. package/conventions/coder.bun/coder.bun.station-master-interlocking-routing.convention.yaml +62 -0
  52. package/conventions/coder.bun/coder.bun.station-master-journey-routing.convention.yaml +49 -0
  53. package/conventions/coder.bun/coder.bun.wagon-honours-its-contract.convention.yaml +64 -0
  54. package/conventions/coder.htmx/coder.htmx.fragment-escapes-interpolation.convention.yaml +72 -0
  55. package/conventions/coder.htmx/coder.htmx.swap-no-inline-handler.convention.yaml +59 -0
  56. package/conventions/coder.htmx/coder.htmx.swap-oob-carries-id.convention.yaml +56 -0
  57. package/conventions/coder.htmx/coder.htmx.verb-destructive-confirms.convention.yaml +56 -0
  58. package/conventions/coder.htmx/coder.htmx.verb-endpoint-is-routed.convention.yaml +73 -0
  59. package/conventions/coder.htmx/coder.htmx.verb-endpoint-same-origin.convention.yaml +58 -0
  60. package/conventions/coder.htmx/coder.htmx.verb-mutation-signals-progress.convention.yaml +59 -0
  61. package/conventions/planner.docs/planner.docs.adr-registry-derived.convention.yaml +83 -0
  62. package/conventions/planner.docs/planner.docs.area-index-required.convention.yaml +67 -0
  63. package/conventions/planner.docs/planner.docs.artifact-path-shape.convention.yaml +82 -0
  64. package/conventions/planner.docs/planner.docs.asciidoc-only.convention.yaml +71 -0
  65. package/conventions/planner.docs/planner.docs.doc-id-unique.convention.yaml +65 -0
  66. package/conventions/planner.docs/planner.docs.graph-target-resolves.convention.yaml +87 -0
  67. package/conventions/planner.docs/planner.docs.identity-required.convention.yaml +68 -0
  68. package/conventions/planner.docs/planner.docs.reference-integrity.convention.yaml +74 -0
  69. package/conventions/planner.docs/planner.docs.undeclared-change.convention.yaml +80 -0
  70. package/conventions/tester.bun/tester.bun.acceptance-binding-declared.convention.yaml +49 -0
  71. package/conventions/tester.bun/tester.bun.acceptance-covers-tag-well-formed.convention.yaml +50 -0
  72. package/conventions/tester.bun/tester.bun.acceptance-resolves-to-declared.convention.yaml +61 -0
  73. package/conventions/tester.bun/tester.bun.interlocking-production-runner-used.convention.yaml +76 -0
  74. package/conventions/tester.bun/tester.bun.interlocking-route-coverage.convention.yaml +66 -0
  75. package/conventions/tester.bun/tester.bun.interlocking-smoke-coverage-for-station-master.convention.yaml +76 -0
  76. package/conventions/tester.bun/tester.bun.interlocking-trace-binds-declared-route.convention.yaml +74 -0
  77. package/conventions/tester.bun/tester.bun.interlocking-train-sequence-is-exercised.convention.yaml +77 -0
  78. package/conventions/tester.bun/tester.bun.red-behavioral-assertion.convention.yaml +51 -0
  79. package/conventions/tester.bun/tester.bun.red-fails-first.convention.yaml +52 -0
  80. package/conventions/tester.bun/tester.bun.routing-runtime-family.convention.yaml +41 -0
  81. package/conventions/tester.bun/tester.bun.security-auth.convention.yaml +46 -0
  82. package/conventions/tester.bun/tester.bun.security-input.convention.yaml +45 -0
  83. package/conventions/tester.bun/tester.bun.smoke-no-collaborator-substitution.convention.yaml +45 -0
  84. package/conventions/tester.bun/tester.bun.smoke-observable-assertion.convention.yaml +54 -0
  85. package/conventions/tester.bun/tester.bun.telemetry-emit.convention.yaml +46 -0
  86. package/conventions/tester.bun/tester.bun.test-carries-urn-identity.convention.yaml +51 -0
  87. package/conventions/tester.bun/tester.bun.test-imports-bun-test.convention.yaml +55 -0
  88. package/conventions/tester.bun/tester.bun.test-isolation-no-live-state.convention.yaml +50 -0
  89. package/conventions/tester.bun/tester.bun.test-no-self-skip.convention.yaml +46 -0
  90. package/conventions/tester.bun/tester.bun.test-phase-declared.convention.yaml +45 -0
  91. package/conventions/tester.htmx/tester.htmx.fragment-asserts-returned-markup.convention.yaml +52 -0
  92. package/conventions/tester.htmx/tester.htmx.swap-oob-asserts-destination-id.convention.yaml +48 -0
  93. package/conventions/tester.htmx/tester.htmx.verb-endpoint-coverage.convention.yaml +54 -0
  94. package/conventions/traceability/traceability.plan.executable-acceptance-has-test.convention.yaml +2 -0
  95. package/conventions/traceability/traceability.source.tested-by-present.convention.yaml +2 -0
  96. package/conventions/traceability/traceability.source.tested-by-resolves.convention.yaml +2 -0
  97. package/conventions/traceability/traceability.test.binding-resolves.convention.yaml +2 -0
  98. package/detectors/atdd_traceability_closure/atdd.implementation.yaml +8 -0
  99. package/detectors/atdd_traceability_closure/detect.mjs +84 -0
  100. package/detectors/atdd_traceability_closure/fixtures/clean/plan/orders/E001.yaml +4 -0
  101. package/detectors/atdd_traceability_closure/fixtures/clean/src/order.ts +4 -0
  102. package/detectors/atdd_traceability_closure/fixtures/clean/test/order.test.ts +4 -0
  103. package/detectors/atdd_traceability_closure/fixtures/dirty/plan/orders/E001.yaml +6 -0
  104. package/detectors/atdd_traceability_closure/fixtures/dirty/src/missing-test.ts +2 -0
  105. package/detectors/atdd_traceability_closure/fixtures/dirty/src/unknown-test.ts +4 -0
  106. package/detectors/atdd_traceability_closure/fixtures/dirty/test/bad-binding.test.ts +4 -0
  107. package/detectors/atdd_traceability_closure/fixtures/dirty/test/no-binding.test.ts +3 -0
  108. package/detectors/bun_clean_architecture_detector/atdd.implementation.yaml +42 -0
  109. package/detectors/bun_clean_architecture_detector/checks/_map.json +14 -0
  110. package/detectors/bun_clean_architecture_detector/checks/a_boundaries_http_client.mjs +36 -0
  111. package/detectors/bun_clean_architecture_detector/checks/a_commons_application_no_integration.mjs +37 -0
  112. package/detectors/bun_clean_architecture_detector/checks/a_commons_cross_feature.mjs +41 -0
  113. package/detectors/bun_clean_architecture_detector/checks/a_commons_domain_no_outbound.mjs +40 -0
  114. package/detectors/bun_clean_architecture_detector/checks/a_composition_consumer.mjs +33 -0
  115. package/detectors/bun_clean_architecture_detector/checks/a_composition_root.mjs +35 -0
  116. package/detectors/bun_clean_architecture_detector/checks/a_domain_no_framework.mjs +47 -0
  117. package/detectors/bun_clean_architecture_detector/checks/a_dto_mapper.mjs +31 -0
  118. package/detectors/bun_clean_architecture_detector/checks/a_dto_placement.mjs +30 -0
  119. package/detectors/bun_clean_architecture_detector/checks/a_dto_purity.mjs +59 -0
  120. package/detectors/bun_clean_architecture_detector/checks/a_hierarchy_import.mjs +48 -0
  121. package/detectors/bun_clean_architecture_detector/checks/a_layer_naming.mjs +41 -0
  122. package/detectors/bun_clean_architecture_detector/detect.mjs +46 -0
  123. package/detectors/bun_clean_architecture_detector/fixtures/clean/contracts/order.ts +5 -0
  124. package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/application/place.ts +3 -0
  125. package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/composition.ts +4 -0
  126. package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/domain/total.ts +2 -0
  127. package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/integration/order-mapper.ts +3 -0
  128. package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/presentation/api.ts +3 -0
  129. package/detectors/bun_clean_architecture_detector/fixtures/dirty/commons/application/flow.ts +2 -0
  130. package/detectors/bun_clean_architecture_detector/fixtures/dirty/commons/domain/billing/rules.ts +1 -0
  131. package/detectors/bun_clean_architecture_detector/fixtures/dirty/commons/domain/orders/rules.ts +5 -0
  132. package/detectors/bun_clean_architecture_detector/fixtures/dirty/commons/integration/http.ts +1 -0
  133. package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/application/pay.ts +2 -0
  134. package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/domain/rules.ts +2 -0
  135. package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/helper.ts +1 -0
  136. package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/integration/client.ts +1 -0
  137. package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/presentation/api.ts +2 -0
  138. package/detectors/bun_fullstack_detector/atdd.implementation.yaml +23 -0
  139. package/detectors/bun_fullstack_detector/checks/_map.json +5 -0
  140. package/detectors/bun_fullstack_detector/checks/bun_runtime_server_is_bun_serve.mjs +39 -0
  141. package/detectors/bun_fullstack_detector/checks/bun_runtime_single_lockfile.mjs +40 -0
  142. package/detectors/bun_fullstack_detector/checks/bun_runtime_typecheck_enforced.mjs +133 -0
  143. package/detectors/bun_fullstack_detector/detect.mjs +46 -0
  144. package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_server_is_bun_serve/server.ts +7 -0
  145. package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_single_lockfile/bun.lock +1 -0
  146. package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_typecheck_enforced/package.json +5 -0
  147. package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_typecheck_enforced/server.ts +3 -0
  148. package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_typecheck_enforced/tsconfig.json +1 -0
  149. package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_server_is_bun_serve/server.ts +5 -0
  150. package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_single_lockfile/bun.lock +1 -0
  151. package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_single_lockfile/package-lock.json +1 -0
  152. package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/package.json +4 -0
  153. package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/packages/second/index.ts +8 -0
  154. package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/packages/second/package.json +1 -0
  155. package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/server.ts +3 -0
  156. package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/tsconfig.json +1 -0
  157. package/detectors/bun_green_traceability_detector/atdd.implementation.yaml +35 -0
  158. package/detectors/bun_green_traceability_detector/checks/_map.json +12 -0
  159. package/detectors/bun_green_traceability_detector/checks/green_header_order.mjs +24 -0
  160. package/detectors/bun_green_traceability_detector/checks/green_header_purpose.mjs +18 -0
  161. package/detectors/bun_green_traceability_detector/checks/green_header_runtime.mjs +25 -0
  162. package/detectors/bun_green_traceability_detector/checks/green_header_tested_by.mjs +15 -0
  163. package/detectors/bun_green_traceability_detector/checks/green_urn_layer.mjs +17 -0
  164. package/detectors/bun_green_traceability_detector/checks/green_urn_marker.mjs +18 -0
  165. package/detectors/bun_green_traceability_detector/checks/green_urn_name_matches.mjs +26 -0
  166. package/detectors/bun_green_traceability_detector/checks/green_urn_pattern.mjs +17 -0
  167. package/detectors/bun_green_traceability_detector/checks/green_urn_side.mjs +20 -0
  168. package/detectors/bun_green_traceability_detector/checks/green_urn_wagon_feature.mjs +20 -0
  169. package/detectors/bun_green_traceability_detector/detect.mjs +46 -0
  170. package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_order/OrderPanel.html +7 -0
  171. package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_order/OrderRow.ts +7 -0
  172. package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_purpose/OrderPanel.html +7 -0
  173. package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_purpose/OrderRow.ts +7 -0
  174. package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_runtime/OrderPanel.html +7 -0
  175. package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_runtime/OrderRow.ts +7 -0
  176. package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_tested_by/OrderPanel.html +7 -0
  177. package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_tested_by/OrderRow.ts +7 -0
  178. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_layer/OrderPanel.html +7 -0
  179. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_layer/OrderRow.ts +7 -0
  180. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_marker/OrderPanel.html +7 -0
  181. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_marker/OrderRow.ts +7 -0
  182. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_name_matches/OrderPanel.html +7 -0
  183. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_name_matches/OrderRow.ts +7 -0
  184. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_pattern/OrderPanel.html +7 -0
  185. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_pattern/OrderRow.ts +7 -0
  186. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_side/OrderPanel.html +7 -0
  187. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_side/OrderRow.ts +7 -0
  188. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_wagon_feature/OrderPanel.html +7 -0
  189. package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_wagon_feature/OrderRow.ts +7 -0
  190. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_header_order/OrderRow.ts +6 -0
  191. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_header_purpose/OrderRow.ts +5 -0
  192. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_header_runtime/OrderRow.ts +6 -0
  193. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_header_tested_by/OrderPanel.html +5 -0
  194. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_layer/OrderRow.ts +6 -0
  195. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_marker/OrderRow.ts +3 -0
  196. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_name_matches/OrderRow.ts +6 -0
  197. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_pattern/OrderRow.ts +6 -0
  198. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_side/OrderRow.ts +6 -0
  199. package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_wagon_feature/OrderRow.ts +6 -0
  200. package/detectors/bun_green_traceability_detector/urn_header.mjs +191 -0
  201. package/detectors/bun_interlocking_binding/atdd.implementation.yaml +31 -0
  202. package/detectors/bun_interlocking_binding/checks/interlocking_runtime_executes.mjs +168 -0
  203. package/detectors/bun_interlocking_binding/detect.mjs +608 -0
  204. package/detectors/bun_interlocking_binding/fixtures/clean/e2e/interlockings/match-resolution/trace.test.ts +10 -0
  205. package/detectors/bun_interlocking_binding/fixtures/clean/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  206. package/detectors/bun_interlocking_binding/fixtures/clean/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
  207. package/detectors/bun_interlocking_binding/fixtures/clean/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
  208. package/detectors/bun_interlocking_binding/fixtures/clean/server.ts +19 -0
  209. package/detectors/bun_interlocking_binding/fixtures/clean/src/trains/interlocking.ts +66 -0
  210. package/detectors/bun_interlocking_binding/fixtures/clean/src/trains/runner.ts +7 -0
  211. package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/e2e/interlockings/match-resolution/trace.test.ts +10 -0
  212. package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/plan/_trains/_interlockings/match-resolution.yaml +57 -0
  213. package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
  214. package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
  215. package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/server.ts +19 -0
  216. package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/src/trains/interlocking.ts +28 -0
  217. package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/src/trains/runner.ts +7 -0
  218. package/detectors/bun_interlocking_binding/fixtures/dirty/e2e/interlockings/match-resolution/trace.test.ts +10 -0
  219. package/detectors/bun_interlocking_binding/fixtures/dirty/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  220. package/detectors/bun_interlocking_binding/fixtures/dirty/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
  221. package/detectors/bun_interlocking_binding/fixtures/dirty/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
  222. package/detectors/bun_interlocking_binding/fixtures/dirty/server.ts +19 -0
  223. package/detectors/bun_interlocking_binding/fixtures/dirty/src/trains/interlocking.ts +28 -0
  224. package/detectors/bun_interlocking_binding/fixtures/dirty/src/trains/runner.ts +7 -0
  225. package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/e2e/interlockings/match-resolution/trace.test.ts +10 -0
  226. package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/plan/_trains/_interlockings/match-resolution.yaml +54 -0
  227. package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
  228. package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
  229. package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/server.ts +19 -0
  230. package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/src/trains/interlocking.ts +28 -0
  231. package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/src/trains/runner.ts +7 -0
  232. package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/e2e/interlockings/match-resolution/trace.test.ts +10 -0
  233. package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  234. package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
  235. package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
  236. package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/server.ts +19 -0
  237. package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/src/trains/interlocking.ts +28 -0
  238. package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/src/trains/runner.ts +7 -0
  239. package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/e2e/interlockings/match-resolution/trace.test.ts +19 -0
  240. package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  241. package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
  242. package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
  243. package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/server.ts +19 -0
  244. package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/src/trains/interlocking.ts +28 -0
  245. package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/src/trains/runner.ts +7 -0
  246. package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/e2e/interlockings/match-resolution/trace.test.ts +10 -0
  247. package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  248. package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
  249. package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
  250. package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/server.ts +19 -0
  251. package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/src/trains/interlocking.ts +30 -0
  252. package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/src/trains/runner.ts +7 -0
  253. package/detectors/bun_interlocking_coverage/_shared/interlocking.mjs +389 -0
  254. package/detectors/bun_interlocking_coverage/atdd.implementation.yaml +27 -0
  255. package/detectors/bun_interlocking_coverage/checks/_map.json +7 -0
  256. package/detectors/bun_interlocking_coverage/checks/interlocking_production_runner.mjs +82 -0
  257. package/detectors/bun_interlocking_coverage/checks/interlocking_route_coverage.mjs +58 -0
  258. package/detectors/bun_interlocking_coverage/checks/interlocking_smoke_coverage.mjs +68 -0
  259. package/detectors/bun_interlocking_coverage/checks/interlocking_trace_binds.mjs +64 -0
  260. package/detectors/bun_interlocking_coverage/checks/interlocking_train_sequence.mjs +110 -0
  261. package/detectors/bun_interlocking_coverage/detect.mjs +46 -0
  262. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_production_runner/e2e/interlockings/match-resolution/routes.test.ts +21 -0
  263. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_production_runner/e2e/interlockings/match-resolution/trace.test.ts +17 -0
  264. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_production_runner/e2e/smoke/resolve-match.smoke.test.ts +13 -0
  265. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_production_runner/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  266. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_route_coverage/e2e/interlockings/match-resolution/routes.test.ts +21 -0
  267. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_route_coverage/e2e/interlockings/match-resolution/trace.test.ts +17 -0
  268. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_route_coverage/e2e/smoke/resolve-match.smoke.test.ts +13 -0
  269. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_route_coverage/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  270. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage/e2e/interlockings/match-resolution/routes.test.ts +21 -0
  271. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage/e2e/interlockings/match-resolution/trace.test.ts +17 -0
  272. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage/e2e/smoke/resolve-match.smoke.test.ts +13 -0
  273. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  274. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage_module/e2e/interlockings/match-resolution/routes.test.ts +21 -0
  275. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage_module/e2e/interlockings/match-resolution/trace.test.ts +17 -0
  276. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage_module/e2e/smoke/resolve-match.smoke.test.ts +19 -0
  277. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage_module/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  278. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_trace_binds/e2e/interlockings/match-resolution/routes.test.ts +21 -0
  279. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_trace_binds/e2e/interlockings/match-resolution/trace.test.ts +17 -0
  280. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_trace_binds/e2e/smoke/resolve-match.smoke.test.ts +13 -0
  281. package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_trace_binds/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  282. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_production_runner/e2e/interlockings/match-resolution/routes.test.ts +23 -0
  283. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_production_runner/e2e/interlockings/match-resolution/trace.test.ts +17 -0
  284. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_production_runner/e2e/smoke/resolve-match.smoke.test.ts +13 -0
  285. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_production_runner/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  286. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_route_coverage/e2e/interlockings/match-resolution/routes.test.ts +12 -0
  287. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_route_coverage/e2e/interlockings/match-resolution/trace.test.ts +17 -0
  288. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_route_coverage/e2e/smoke/resolve-match.smoke.test.ts +13 -0
  289. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_route_coverage/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  290. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_smoke_coverage/e2e/interlockings/match-resolution/routes.test.ts +21 -0
  291. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_smoke_coverage/e2e/interlockings/match-resolution/trace.test.ts +17 -0
  292. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_smoke_coverage/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  293. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_trace_binds/e2e/interlockings/match-resolution/routes.test.ts +21 -0
  294. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_trace_binds/e2e/interlockings/match-resolution/trace.test.ts +13 -0
  295. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_trace_binds/e2e/smoke/resolve-match.smoke.test.ts +13 -0
  296. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_trace_binds/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  297. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_train_sequence/e2e/interlockings/match-resolution/routes.test.ts +16 -0
  298. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_train_sequence/plan/_trains/_interlockings/match-resolution.yaml +51 -0
  299. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_train_sequence/plan/_trains/train:match:match-resolution-standard.yaml +8 -0
  300. package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_train_sequence/plan/_trains/train:match:match-resolution-timeout.yaml +5 -0
  301. package/detectors/bun_interlocking_infrastructure/_shared/interlocking.mjs +477 -0
  302. package/detectors/bun_interlocking_infrastructure/atdd.implementation.yaml +32 -0
  303. package/detectors/bun_interlocking_infrastructure/checks/_map.json +10 -0
  304. package/detectors/bun_interlocking_infrastructure/checks/interlocking_delegates.mjs +70 -0
  305. package/detectors/bun_interlocking_infrastructure/checks/interlocking_no_cargo.mjs +62 -0
  306. package/detectors/bun_interlocking_infrastructure/checks/interlocking_resolution_model.mjs +64 -0
  307. package/detectors/bun_interlocking_infrastructure/checks/interlocking_runner_exists.mjs +73 -0
  308. package/detectors/bun_interlocking_infrastructure/checks/interlocking_station_routing.mjs +62 -0
  309. package/detectors/bun_interlocking_infrastructure/checks/journey_runner_boundary.mjs +153 -0
  310. package/detectors/bun_interlocking_infrastructure/checks/journey_station_routing.mjs +119 -0
  311. package/detectors/bun_interlocking_infrastructure/checks/wagon_contract_honoured.mjs +149 -0
  312. package/detectors/bun_interlocking_infrastructure/detect.mjs +46 -0
  313. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/server.ts +22 -0
  314. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/src/match/wagon.ts +6 -0
  315. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/src/trains/interlocking.ts +41 -0
  316. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/src/trains/runner.ts +28 -0
  317. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_no_cargo/server.ts +22 -0
  318. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_no_cargo/src/match/wagon.ts +6 -0
  319. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_no_cargo/src/trains/interlocking.ts +41 -0
  320. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_no_cargo/src/trains/runner.ts +28 -0
  321. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_resolution_model/server.ts +22 -0
  322. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_resolution_model/src/match/wagon.ts +6 -0
  323. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_resolution_model/src/trains/interlocking.ts +41 -0
  324. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_resolution_model/src/trains/runner.ts +28 -0
  325. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_runner_exists/server.ts +22 -0
  326. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_runner_exists/src/match/wagon.ts +6 -0
  327. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_runner_exists/src/trains/interlocking.ts +41 -0
  328. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_runner_exists/src/trains/runner.ts +28 -0
  329. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_station_routing/server.ts +22 -0
  330. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_station_routing/src/match/wagon.ts +6 -0
  331. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_station_routing/src/trains/interlocking.ts +41 -0
  332. package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_station_routing/src/trains/runner.ts +28 -0
  333. package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_runner_boundary/plan/_journeys/example.yaml +16 -0
  334. package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_runner_boundary/src/trains/journey.ts +15 -0
  335. package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_station_routing/plan/_journeys/public.yaml +16 -0
  336. package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_station_routing/server.ts +13 -0
  337. package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_station_routing/src/trains/journey.ts +14 -0
  338. package/detectors/bun_interlocking_infrastructure/fixtures/clean/wagon_contract_honoured/plan/orders/_orders.yaml +17 -0
  339. package/detectors/bun_interlocking_infrastructure/fixtures/clean/wagon_contract_honoured/src/orders/wagon.ts +15 -0
  340. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_delegates/server.ts +22 -0
  341. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_delegates/src/match/wagon.ts +6 -0
  342. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_delegates/src/trains/interlocking.ts +49 -0
  343. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_delegates/src/trains/runner.ts +28 -0
  344. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_no_cargo/server.ts +22 -0
  345. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_no_cargo/src/match/wagon.ts +11 -0
  346. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_no_cargo/src/trains/interlocking.ts +42 -0
  347. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_no_cargo/src/trains/runner.ts +28 -0
  348. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_resolution_model/server.ts +22 -0
  349. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_resolution_model/src/match/wagon.ts +6 -0
  350. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_resolution_model/src/trains/interlocking.ts +21 -0
  351. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_resolution_model/src/trains/runner.ts +28 -0
  352. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_runner_exists/server.ts +22 -0
  353. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_runner_exists/src/match/wagon.ts +6 -0
  354. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_runner_exists/src/trains/interlocking.ts +16 -0
  355. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_runner_exists/src/trains/runner.ts +28 -0
  356. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_station_routing/server.ts +19 -0
  357. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_station_routing/src/match/wagon.ts +6 -0
  358. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_station_routing/src/trains/interlocking.ts +41 -0
  359. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_station_routing/src/trains/runner.ts +28 -0
  360. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_runner_boundary/plan/_journeys/example.yaml +16 -0
  361. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_runner_boundary/src/trains/journey.ts +14 -0
  362. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_station_routing/plan/_journeys/public.yaml +16 -0
  363. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_station_routing/server.ts +10 -0
  364. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_station_routing/src/trains/journey.ts +14 -0
  365. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/wagon_contract_honoured/plan/orders/_orders.yaml +17 -0
  366. package/detectors/bun_interlocking_infrastructure/fixtures/dirty/wagon_contract_honoured/src/orders/wagon.ts +13 -0
  367. package/detectors/bun_security_hygiene_detector/atdd.implementation.yaml +33 -0
  368. package/detectors/bun_security_hygiene_detector/checks/_map.json +9 -0
  369. package/detectors/bun_security_hygiene_detector/checks/err_bare_string.mjs +38 -0
  370. package/detectors/bun_security_hygiene_detector/checks/err_code_format.mjs +36 -0
  371. package/detectors/bun_security_hygiene_detector/checks/log_console.mjs +33 -0
  372. package/detectors/bun_security_hygiene_detector/checks/log_structured.mjs +36 -0
  373. package/detectors/bun_security_hygiene_detector/checks/sec_hardcoded_secret.mjs +43 -0
  374. package/detectors/bun_security_hygiene_detector/checks/sec_missing_auth.mjs +63 -0
  375. package/detectors/bun_security_hygiene_detector/checks/sec_sql_injection.mjs +56 -0
  376. package/detectors/bun_security_hygiene_detector/detect.mjs +46 -0
  377. package/detectors/bun_security_hygiene_detector/fixtures/clean/server.ts +24 -0
  378. package/detectors/bun_security_hygiene_detector/fixtures/dirty/db.ts +6 -0
  379. package/detectors/bun_security_hygiene_detector/fixtures/dirty/errors.ts +6 -0
  380. package/detectors/bun_security_hygiene_detector/fixtures/dirty/logging.ts +4 -0
  381. package/detectors/bun_security_hygiene_detector/fixtures/dirty/routes.ts +10 -0
  382. package/detectors/bun_security_hygiene_detector/fixtures/dirty/secrets.ts +3 -0
  383. package/detectors/bun_tester_discipline_detector/atdd.implementation.yaml +46 -0
  384. package/detectors/bun_tester_discipline_detector/checks/_map.json +18 -0
  385. package/detectors/bun_tester_discipline_detector/checks/t_acceptance_binding.mjs +19 -0
  386. package/detectors/bun_tester_discipline_detector/checks/t_acceptance_covers_tag.mjs +25 -0
  387. package/detectors/bun_tester_discipline_detector/checks/t_acceptance_resolves.mjs +106 -0
  388. package/detectors/bun_tester_discipline_detector/checks/t_isolation_no_live_state.mjs +40 -0
  389. package/detectors/bun_tester_discipline_detector/checks/t_red_behavioral.mjs +35 -0
  390. package/detectors/bun_tester_discipline_detector/checks/t_red_fails_first.mjs +30 -0
  391. package/detectors/bun_tester_discipline_detector/checks/t_routing_runtime.mjs +22 -0
  392. package/detectors/bun_tester_discipline_detector/checks/t_security_auth.mjs +26 -0
  393. package/detectors/bun_tester_discipline_detector/checks/t_security_input.mjs +25 -0
  394. package/detectors/bun_tester_discipline_detector/checks/t_smoke_no_substitution.mjs +25 -0
  395. package/detectors/bun_tester_discipline_detector/checks/t_smoke_observable.mjs +28 -0
  396. package/detectors/bun_tester_discipline_detector/checks/t_telemetry_emit.mjs +27 -0
  397. package/detectors/bun_tester_discipline_detector/checks/t_test_imports_bun_test.mjs +31 -0
  398. package/detectors/bun_tester_discipline_detector/checks/t_test_no_self_skip.mjs +34 -0
  399. package/detectors/bun_tester_discipline_detector/checks/t_test_phase_declared.mjs +21 -0
  400. package/detectors/bun_tester_discipline_detector/checks/t_urn_identity.mjs +18 -0
  401. package/detectors/bun_tester_discipline_detector/detect.mjs +46 -0
  402. package/detectors/bun_tester_discipline_detector/fixtures/clean/audit.sec.test.ts +15 -0
  403. package/detectors/bun_tester_discipline_detector/fixtures/clean/checkout.red.test.ts +16 -0
  404. package/detectors/bun_tester_discipline_detector/fixtures/clean/emit.telemetry.test.ts +15 -0
  405. package/detectors/bun_tester_discipline_detector/fixtures/clean/marked.red.test.ts +14 -0
  406. package/detectors/bun_tester_discipline_detector/fixtures/clean/orders.smoke.test.ts +16 -0
  407. package/detectors/bun_tester_discipline_detector/fixtures/clean/payload.input.test.ts +13 -0
  408. package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E001.yaml +9 -0
  409. package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E002.yaml +9 -0
  410. package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E020.yaml +9 -0
  411. package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E021.yaml +9 -0
  412. package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E022.yaml +9 -0
  413. package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E023.yaml +9 -0
  414. package/detectors/bun_tester_discipline_detector/fixtures/dirty/badcovers.test.ts +7 -0
  415. package/detectors/bun_tester_discipline_detector/fixtures/dirty/badphase.test.ts +6 -0
  416. package/detectors/bun_tester_discipline_detector/fixtures/dirty/foreign_harness.test.ts +6 -0
  417. package/detectors/bun_tester_discipline_detector/fixtures/dirty/happy.auth.test.ts +9 -0
  418. package/detectors/bun_tester_discipline_detector/fixtures/dirty/happy.input.test.ts +9 -0
  419. package/detectors/bun_tester_discipline_detector/fixtures/dirty/internal.smoke.test.ts +10 -0
  420. package/detectors/bun_tester_discipline_detector/fixtures/dirty/no_header.test.ts +2 -0
  421. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E004.yaml +9 -0
  422. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E005.yaml +9 -0
  423. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E006.yaml +9 -0
  424. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E007.yaml +9 -0
  425. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E008.yaml +9 -0
  426. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E009.yaml +9 -0
  427. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E010.yaml +9 -0
  428. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E024.yaml +9 -0
  429. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E025.yaml +9 -0
  430. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E026.yaml +9 -0
  431. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E027.yaml +9 -0
  432. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E028.yaml +9 -0
  433. package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E030.yaml +9 -0
  434. package/detectors/bun_tester_discipline_detector/fixtures/dirty/polluting.test.ts +11 -0
  435. package/detectors/bun_tester_discipline_detector/fixtures/dirty/quiet.telemetry.test.ts +9 -0
  436. package/detectors/bun_tester_discipline_detector/fixtures/dirty/skipped.test.ts +6 -0
  437. package/detectors/bun_tester_discipline_detector/fixtures/dirty/substituted.smoke.test.ts +13 -0
  438. package/detectors/bun_tester_discipline_detector/fixtures/dirty/unbound.test.ts +5 -0
  439. package/detectors/bun_tester_discipline_detector/fixtures/dirty/unmarked.red.test.ts +7 -0
  440. package/detectors/bun_tester_discipline_detector/fixtures/dirty/unresolvable_binding.test.ts +17 -0
  441. package/detectors/bun_tester_discipline_detector/fixtures/dirty/vacuous.red.test.ts +7 -0
  442. package/detectors/bun_tester_discipline_detector/fixtures/dirty/wrongruntime.test.ts +7 -0
  443. package/detectors/bun_tester_discipline_detector/test_header.mjs +160 -0
  444. package/detectors/bun_ts_metrics_detector/atdd.implementation.yaml +34 -0
  445. package/detectors/bun_ts_metrics_detector/checks/_map.json +9 -0
  446. package/detectors/bun_ts_metrics_detector/checks/ts_complexity_cyclomatic.mjs +36 -0
  447. package/detectors/bun_ts_metrics_detector/checks/ts_complexity_length.mjs +36 -0
  448. package/detectors/bun_ts_metrics_detector/checks/ts_complexity_nesting.mjs +36 -0
  449. package/detectors/bun_ts_metrics_detector/checks/ts_dead_code.mjs +58 -0
  450. package/detectors/bun_ts_metrics_detector/checks/ts_duplication.mjs +70 -0
  451. package/detectors/bun_ts_metrics_detector/checks/ts_quality_comments.mjs +30 -0
  452. package/detectors/bun_ts_metrics_detector/checks/ts_quality_mi.mjs +30 -0
  453. package/detectors/bun_ts_metrics_detector/detect.mjs +46 -0
  454. package/detectors/bun_ts_metrics_detector/fixtures/clean/domain/label.ts +6 -0
  455. package/detectors/bun_ts_metrics_detector/fixtures/clean/domain/total.ts +8 -0
  456. package/detectors/bun_ts_metrics_detector/fixtures/clean/index.ts +7 -0
  457. package/detectors/bun_ts_metrics_detector/fixtures/dirty/bare.ts +2 -0
  458. package/detectors/bun_ts_metrics_detector/fixtures/dirty/big.ts +600 -0
  459. package/detectors/bun_ts_metrics_detector/fixtures/dirty/consumer.ts +2 -0
  460. package/detectors/bun_ts_metrics_detector/fixtures/dirty/domain/a.ts +9 -0
  461. package/detectors/bun_ts_metrics_detector/fixtures/dirty/domain/b.ts +9 -0
  462. package/detectors/bun_ts_metrics_detector/fixtures/dirty/gnarly.ts +22 -0
  463. package/detectors/bun_ts_metrics_detector/fixtures/dirty/index.ts +8 -0
  464. package/detectors/bun_ts_metrics_detector/fixtures/dirty/long.ts +64 -0
  465. package/detectors/bun_ts_metrics_detector/fixtures/dirty/orphan.ts +1 -0
  466. package/detectors/bun_ts_metrics_detector/fixtures/dirty/typed.ts +1 -0
  467. package/detectors/bun_ts_metrics_detector/ts_metrics.mjs +310 -0
  468. package/detectors/htmx_hypermedia_detector/atdd.implementation.yaml +28 -0
  469. package/detectors/htmx_hypermedia_detector/checks/_map.json +9 -0
  470. package/detectors/htmx_hypermedia_detector/checks/htmx_fragment_escapes_interpolation.mjs +66 -0
  471. package/detectors/htmx_hypermedia_detector/checks/htmx_swap_no_inline_handler.mjs +40 -0
  472. package/detectors/htmx_hypermedia_detector/checks/htmx_swap_oob_carries_id.mjs +37 -0
  473. package/detectors/htmx_hypermedia_detector/checks/htmx_verb_destructive_confirms.mjs +36 -0
  474. package/detectors/htmx_hypermedia_detector/checks/htmx_verb_endpoint_is_routed.mjs +133 -0
  475. package/detectors/htmx_hypermedia_detector/checks/htmx_verb_endpoint_same_origin.mjs +33 -0
  476. package/detectors/htmx_hypermedia_detector/checks/htmx_verb_mutation_signals_progress.mjs +43 -0
  477. package/detectors/htmx_hypermedia_detector/detect.mjs +46 -0
  478. package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_fragment_escapes_interpolation/render.ts +6 -0
  479. package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_swap_no_inline_handler/row.html +1 -0
  480. package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_swap_oob_carries_id/fragment.html +1 -0
  481. package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_destructive_confirms/delete.html +1 -0
  482. package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_endpoint_is_routed/server.ts +10 -0
  483. package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_endpoint_is_routed/src/OrderRow.ts +7 -0
  484. package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_endpoint_same_origin/panel.html +3 -0
  485. package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_mutation_signals_progress/form.html +4 -0
  486. package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_fragment_escapes_interpolation/render.ts +3 -0
  487. package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_swap_no_inline_handler/row.html +1 -0
  488. package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_swap_oob_carries_id/fragment.html +1 -0
  489. package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_destructive_confirms/delete.html +1 -0
  490. package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_endpoint_is_routed/server.ts +10 -0
  491. package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_endpoint_is_routed/src/OrderRow.ts +9 -0
  492. package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_endpoint_same_origin/panel.html +3 -0
  493. package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_mutation_signals_progress/form.html +3 -0
  494. package/detectors/htmx_tester_detector/atdd.implementation.yaml +21 -0
  495. package/detectors/htmx_tester_detector/checks/_map.json +5 -0
  496. package/detectors/htmx_tester_detector/checks/t_fragment_asserts_returned_markup.mjs +40 -0
  497. package/detectors/htmx_tester_detector/checks/t_swap_oob_asserts_destination_id.mjs +38 -0
  498. package/detectors/htmx_tester_detector/checks/t_verb_endpoint_coverage.mjs +59 -0
  499. package/detectors/htmx_tester_detector/detect.mjs +46 -0
  500. package/detectors/htmx_tester_detector/fixtures/clean/orders.test.ts +23 -0
  501. package/detectors/htmx_tester_detector/fixtures/clean/panel.html +7 -0
  502. package/detectors/htmx_tester_detector/fixtures/dirty/orders.test.ts +20 -0
  503. package/detectors/htmx_tester_detector/fixtures/dirty/panel.html +7 -0
  504. package/detectors/htmx_tester_detector/fixtures/dirty/statusonly.test.ts +9 -0
  505. package/detectors/htmx_tester_detector/test_header.mjs +4 -0
  506. package/detectors/planner_docs_capability/README.md +34 -0
  507. package/detectors/planner_docs_capability/atdd.implementation.yaml +57 -0
  508. package/detectors/planner_docs_capability/detect.mjs +10 -0
  509. package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
  510. package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/decisions/index.adoc +7 -0
  511. package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/index.adoc +5 -0
  512. package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/shared-control-root.adoc +8 -0
  513. package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/state-store.adoc +5 -0
  514. package/detectors/planner_docs_capability/fixtures/clean/docs/archive/2025-control-root.adoc +5 -0
  515. package/detectors/planner_docs_capability/fixtures/clean/docs/archive/index.adoc +5 -0
  516. package/detectors/planner_docs_capability/fixtures/clean/docs/delivery/index.adoc +5 -0
  517. package/detectors/planner_docs_capability/fixtures/clean/docs/dist/index.md +1 -0
  518. package/detectors/planner_docs_capability/fixtures/clean/docs/index.adoc +5 -0
  519. package/detectors/planner_docs_capability/fixtures/clean/docs/purpose/index.adoc +5 -0
  520. package/detectors/planner_docs_capability/fixtures/clean/docs/purpose/worktrees.adoc +5 -0
  521. package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
  522. package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/decisions/index.adoc +7 -0
  523. package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/index.adoc +5 -0
  524. package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/notes.md +3 -0
  525. package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/shared-control-root.adoc +8 -0
  526. package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/state-store.adoc +5 -0
  527. package/detectors/planner_docs_capability/fixtures/dirty/docs/archive/2025-control-root.adoc +5 -0
  528. package/detectors/planner_docs_capability/fixtures/dirty/docs/archive/index.adoc +5 -0
  529. package/detectors/planner_docs_capability/fixtures/dirty/docs/delivery/index.adoc +5 -0
  530. package/detectors/planner_docs_capability/fixtures/dirty/docs/dist/index.md +1 -0
  531. package/detectors/planner_docs_capability/fixtures/dirty/docs/index.adoc +5 -0
  532. package/detectors/planner_docs_capability/fixtures/dirty/docs/purpose/index.adoc +5 -0
  533. package/detectors/planner_docs_capability/fixtures/dirty/docs/purpose/worktrees.adoc +5 -0
  534. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
  535. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/decisions/adr-20260906-002-documentation-system.adoc +8 -0
  536. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/decisions/index.adoc +7 -0
  537. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/index.adoc +5 -0
  538. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/shared-control-root.adoc +8 -0
  539. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/state-store.adoc +5 -0
  540. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/archive/2025-control-root.adoc +5 -0
  541. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/archive/index.adoc +5 -0
  542. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/delivery/index.adoc +5 -0
  543. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/dist/index.md +1 -0
  544. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/index.adoc +5 -0
  545. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/purpose/index.adoc +5 -0
  546. package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/purpose/worktrees.adoc +5 -0
  547. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
  548. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/decisions/index.adoc +7 -0
  549. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/index.adoc +5 -0
  550. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/shared-control-root.adoc +8 -0
  551. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/state-store.adoc +5 -0
  552. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/archive/2025-control-root.adoc +5 -0
  553. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/archive/index.adoc +5 -0
  554. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/delivery/index.adoc +5 -0
  555. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/delivery/worktrees.adoc +5 -0
  556. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/dist/index.md +1 -0
  557. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/index.adoc +5 -0
  558. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/purpose/index.adoc +5 -0
  559. package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/purpose/worktrees.adoc +5 -0
  560. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
  561. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/decisions/index.adoc +7 -0
  562. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/index.adoc +5 -0
  563. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/shared-control-root.adoc +8 -0
  564. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/state-store.adoc +5 -0
  565. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/archive/2025-control-root.adoc +5 -0
  566. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/archive/index.adoc +5 -0
  567. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/delivery/index.adoc +5 -0
  568. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/delivery/release.adoc +3 -0
  569. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/dist/index.md +1 -0
  570. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/index.adoc +5 -0
  571. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/purpose/index.adoc +5 -0
  572. package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/purpose/worktrees.adoc +5 -0
  573. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
  574. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/decisions/index.adoc +7 -0
  575. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/index.adoc +5 -0
  576. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/notes.md +3 -0
  577. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/shared-control-root.adoc +8 -0
  578. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/state-store.adoc +5 -0
  579. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/archive/2025-control-root.adoc +5 -0
  580. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/archive/index.adoc +5 -0
  581. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/delivery/index.adoc +5 -0
  582. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/dist/index.md +1 -0
  583. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/index.adoc +5 -0
  584. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/purpose/index.adoc +5 -0
  585. package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/purpose/worktrees.adoc +5 -0
  586. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
  587. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/decisions/index.adoc +7 -0
  588. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/index.adoc +5 -0
  589. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/shared-control-root.adoc +8 -0
  590. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/state-store.adoc +5 -0
  591. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/archive/2025-control-root.adoc +5 -0
  592. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/archive/index.adoc +5 -0
  593. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/delivery/release.adoc +10 -0
  594. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/dist/index.md +1 -0
  595. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/index.adoc +5 -0
  596. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/purpose/index.adoc +5 -0
  597. package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/purpose/worktrees.adoc +5 -0
  598. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
  599. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/decisions/index.adoc +7 -0
  600. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/index.adoc +5 -0
  601. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/shared-control-root.adoc +8 -0
  602. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/state-store.adoc +5 -0
  603. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/archive/2025-control-root.adoc +5 -0
  604. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/archive/index.adoc +5 -0
  605. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/delivery/index.adoc +5 -0
  606. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/dist/index.md +1 -0
  607. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/index.adoc +5 -0
  608. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/purpose/index.adoc +5 -0
  609. package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/purpose/worktrees.adoc +5 -0
  610. package/detectors/planner_plan_integrity/atdd.implementation.yaml +18 -0
  611. package/detectors/planner_plan_integrity/detect.mjs +23 -0
  612. package/detectors/planner_plan_integrity/fixtures/clean/README.md +1 -0
  613. package/detectors/planner_plan_integrity/fixtures/dirty/plan/broken.yaml +1 -0
  614. package/detectors/planner_schema_validation/atdd.implementation.yaml +20 -0
  615. package/detectors/planner_schema_validation/detect.mjs +9 -0
  616. package/detectors/planner_schema_validation/fixtures/clean/contracts/_contracts.yaml +6 -0
  617. package/detectors/planner_schema_validation/fixtures/clean/contracts/orders/placed.schema.json +4 -0
  618. package/detectors/planner_schema_validation/fixtures/clean/plan/_themes.yaml +3 -0
  619. package/detectors/planner_schema_validation/fixtures/clean/plan/_trains/orders.yaml +11 -0
  620. package/detectors/planner_schema_validation/fixtures/clean/plan/orders/_orders.yaml +16 -0
  621. package/detectors/planner_schema_validation/fixtures/dirty/contracts/_contracts.yaml +3 -0
  622. package/detectors/planner_schema_validation/fixtures/dirty/plan/_themes.yaml +2 -0
  623. package/detectors/planner_schema_validation/fixtures/dirty/plan/_trains/orders.yaml +11 -0
  624. package/detectors/planner_static_validators/atdd.implementation.yaml +36 -0
  625. package/detectors/planner_static_validators/detect.mjs +9 -0
  626. package/detectors/planner_static_validators/fixtures/clean/contracts/_contracts.yaml +6 -0
  627. package/detectors/planner_static_validators/fixtures/clean/contracts/orders/placed.schema.json +4 -0
  628. package/detectors/planner_static_validators/fixtures/clean/plan/_themes.yaml +3 -0
  629. package/detectors/planner_static_validators/fixtures/clean/plan/orders/E001.yaml +10 -0
  630. package/detectors/planner_static_validators/fixtures/clean/plan/orders/_orders.yaml +19 -0
  631. package/detectors/planner_static_validators/fixtures/clean/plan/orders/features/place-order.yaml +4 -0
  632. package/detectors/planner_static_validators/fixtures/dirty/plan/_journeys/broken.yaml +22 -0
  633. package/detectors/planner_static_validators/fixtures/dirty/plan/_themes.yaml +3 -0
  634. package/detectors/planner_static_validators/fixtures/dirty/plan/_trains/_interlockings/journey-a.yaml +4 -0
  635. package/detectors/planner_static_validators/fixtures/dirty/plan/_trains/journey-a.yaml +7 -0
  636. package/detectors/planner_static_validators/fixtures/dirty/plan/_trains/probe/legacy.yaml +3 -0
  637. package/detectors/planner_static_validators/fixtures/dirty/plan/_trains/probe/orphan.yaml +3 -0
  638. package/detectors/planner_static_validators/fixtures/dirty/plan/_trains.yaml +5 -0
  639. package/detectors/planner_static_validators/fixtures/dirty/plan/also_dup/_also_dup.yaml +15 -0
  640. package/detectors/planner_static_validators/fixtures/dirty/plan/dup/E001.yaml +3 -0
  641. package/detectors/planner_static_validators/fixtures/dirty/plan/dup/_dup.yaml +27 -0
  642. package/detectors/planner_static_validators/fixtures/dirty/plan/dup/features/bad.yaml +2 -0
  643. package/lib/imports.mjs +83 -0
  644. package/lib/scan.mjs +246 -0
  645. package/package.json +35 -0
  646. package/planner-nodes/ENFORCEMENT_SCOPE.yaml +117 -0
  647. package/planner-nodes/nodes/planner.acceptance.abstract-fields-required.convention.yaml +44 -0
  648. package/planner-nodes/nodes/planner.acceptance.authoring-guidelines.convention.yaml +29 -0
  649. package/planner-nodes/nodes/planner.acceptance.boundary-kind-vocabulary.convention.yaml +38 -0
  650. package/planner-nodes/nodes/planner.acceptance.execution-kind.convention.yaml +30 -0
  651. package/planner-nodes/nodes/planner.acceptance.extraction-no-inference.convention.yaml +23 -0
  652. package/planner-nodes/nodes/planner.acceptance.generator-prompts.convention.yaml +34 -0
  653. package/planner-nodes/nodes/planner.acceptance.given-when-then-structure.convention.yaml +53 -0
  654. package/planner-nodes/nodes/planner.acceptance.harness-vocabulary.convention.yaml +99 -0
  655. package/planner-nodes/nodes/planner.acceptance.harness.convention.yaml +36 -0
  656. package/planner-nodes/nodes/planner.acceptance.hermetic-fake-contract.convention.yaml +35 -0
  657. package/planner-nodes/nodes/planner.acceptance.id-pattern.convention.yaml +34 -0
  658. package/planner-nodes/nodes/planner.acceptance.max-per-wmbt.convention.yaml +29 -0
  659. package/planner-nodes/nodes/planner.acceptance.plane-keywords.convention.yaml +87 -0
  660. package/planner-nodes/nodes/planner.acceptance.route-construction.convention.yaml +55 -0
  661. package/planner-nodes/nodes/planner.acceptance.signal-telemetry-naming.convention.yaml +61 -0
  662. package/planner-nodes/nodes/planner.acceptance.urn-generation.convention.yaml +39 -0
  663. package/planner-nodes/nodes/planner.acceptance.well-formed.convention.yaml +57 -0
  664. package/planner-nodes/nodes/planner.appendix.llm-guidelines.convention.yaml +81 -0
  665. package/planner-nodes/nodes/planner.appendix.naming-pattern.convention.yaml +45 -0
  666. package/planner-nodes/nodes/planner.appendix.storage.convention.yaml +44 -0
  667. package/planner-nodes/nodes/planner.appendix.structure.convention.yaml +17 -0
  668. package/planner-nodes/nodes/planner.appendix.types.convention.yaml +123 -0
  669. package/planner-nodes/nodes/planner.artifact-naming.anti-patterns.convention.yaml +31 -0
  670. package/planner-nodes/nodes/planner.artifact-naming.cardinality-from-aspect.convention.yaml +32 -0
  671. package/planner-nodes/nodes/planner.artifact-naming.colon-for-hierarchy.convention.yaml +25 -0
  672. package/planner-nodes/nodes/planner.artifact-naming.contract-file-mapping.convention.yaml +26 -0
  673. package/planner-nodes/nodes/planner.artifact-naming.depth-guidelines.convention.yaml +27 -0
  674. package/planner-nodes/nodes/planner.artifact-naming.dot-for-variant.convention.yaml +25 -0
  675. package/planner-nodes/nodes/planner.artifact-naming.logical-physical-mapping.convention.yaml +36 -0
  676. package/planner-nodes/nodes/planner.artifact-naming.migration-guide.convention.yaml +29 -0
  677. package/planner-nodes/nodes/planner.artifact-naming.naming-pattern.convention.yaml +44 -0
  678. package/planner-nodes/nodes/planner.artifact-naming.path-mirrors-identity.convention.yaml +40 -0
  679. package/planner-nodes/nodes/planner.artifact-naming.planner-artifacts-use-stable.convention.yaml +28 -0
  680. package/planner-nodes/nodes/planner.artifact-naming.pluralization.convention.yaml +27 -0
  681. package/planner-nodes/nodes/planner.artifact-naming.schema-identifier.convention.yaml +31 -0
  682. package/planner-nodes/nodes/planner.artifact-naming.separator-semantics.convention.yaml +42 -0
  683. package/planner-nodes/nodes/planner.artifact-naming.theme-first-identity.convention.yaml +39 -0
  684. package/planner-nodes/nodes/planner.artifact-naming.urn-structure.convention.yaml +26 -0
  685. package/planner-nodes/nodes/planner.artifact-naming.validation-rules.convention.yaml +33 -0
  686. package/planner-nodes/nodes/planner.artifact-naming.verb-object-corpus-drift.convention.yaml +49 -0
  687. package/planner-nodes/nodes/planner.artifact.definition.convention.yaml +30 -0
  688. package/planner-nodes/nodes/planner.component.artifact-derivation.convention.yaml +139 -0
  689. package/planner-nodes/nodes/planner.component.business-focus.convention.yaml +65 -0
  690. package/planner-nodes/nodes/planner.component.count-limit.convention.yaml +64 -0
  691. package/planner-nodes/nodes/planner.component.derivation.convention.yaml +117 -0
  692. package/planner-nodes/nodes/planner.component.io-alignment.convention.yaml +65 -0
  693. package/planner-nodes/nodes/planner.component.layer-assignment.convention.yaml +83 -0
  694. package/planner-nodes/nodes/planner.component.layer-consistency.convention.yaml +91 -0
  695. package/planner-nodes/nodes/planner.component.method-limit.convention.yaml +35 -0
  696. package/planner-nodes/nodes/planner.component.structure.convention.yaml +77 -0
  697. package/planner-nodes/nodes/planner.component.type-catalog.convention.yaml +436 -0
  698. package/planner-nodes/nodes/planner.component.urn.convention.yaml +86 -0
  699. package/planner-nodes/nodes/planner.contract.registry-coherence.convention.yaml +36 -0
  700. package/planner-nodes/nodes/planner.convention.remedy-must-be-followable.convention.yaml +92 -0
  701. package/planner-nodes/nodes/planner.coverage.bidirectional-coverage-between-trains.convention.yaml +33 -0
  702. package/planner-nodes/nodes/planner.coverage.bidirectional-coverage-between-wagons.convention.yaml +33 -0
  703. package/planner-nodes/nodes/planner.coverage.coverage-graph.convention.yaml +31 -0
  704. package/planner-nodes/nodes/planner.coverage.every-wmbt-must-be.convention.yaml +29 -0
  705. package/planner-nodes/nodes/planner.coverage.every-wmbt-must-have.convention.yaml +33 -0
  706. package/planner-nodes/nodes/planner.coverage.exception-handling.convention.yaml +32 -0
  707. package/planner-nodes/nodes/planner.criteria.defaults.convention.yaml +30 -0
  708. package/planner-nodes/nodes/planner.criteria.harness-templates.convention.yaml +159 -0
  709. package/planner-nodes/nodes/planner.criteria.metric-mapping.convention.yaml +136 -0
  710. package/planner-nodes/nodes/planner.criteria.plane-keywords.convention.yaml +53 -0
  711. package/planner-nodes/nodes/planner.criteria.sequence-routing.convention.yaml +26 -0
  712. package/planner-nodes/nodes/planner.criteria.shape.convention.yaml +27 -0
  713. package/planner-nodes/nodes/planner.decomposition.canonical-steps.convention.yaml +14 -0
  714. package/planner-nodes/nodes/planner.decomposition.document-trouble-obligation.convention.yaml +12 -0
  715. package/planner-nodes/nodes/planner.decomposition.domain-vs-technology.convention.yaml +13 -0
  716. package/planner-nodes/nodes/planner.decomposition.jtbd-vs-odi-grammar.convention.yaml +18 -0
  717. package/planner-nodes/nodes/planner.decomposition.keep-pivot-kill.convention.yaml +23 -0
  718. package/planner-nodes/nodes/planner.decomposition.local-scope.convention.yaml +15 -0
  719. package/planner-nodes/nodes/planner.decomposition.natural-language-normalization.convention.yaml +12 -0
  720. package/planner-nodes/nodes/planner.decomposition.train-journey.convention.yaml +13 -0
  721. package/planner-nodes/nodes/planner.decomposition.wagon-rationale.convention.yaml +12 -0
  722. package/planner-nodes/nodes/planner.definition.anchor-required.convention.yaml +34 -0
  723. package/planner-nodes/nodes/planner.feature.artifact-seeded-naming.convention.yaml +30 -0
  724. package/planner-nodes/nodes/planner.feature.definition.convention.yaml +27 -0
  725. package/planner-nodes/nodes/planner.feature.estimation.convention.yaml +29 -0
  726. package/planner-nodes/nodes/planner.feature.feedback-loop-close-the-loop.convention.yaml +33 -0
  727. package/planner-nodes/nodes/planner.feature.feedback-loop-kind.convention.yaml +30 -0
  728. package/planner-nodes/nodes/planner.feature.feedback-loop-suppression.convention.yaml +23 -0
  729. package/planner-nodes/nodes/planner.feature.footprint-scoring.convention.yaml +119 -0
  730. package/planner-nodes/nodes/planner.feature.grouping-strategy.convention.yaml +37 -0
  731. package/planner-nodes/nodes/planner.feature.hard-limits.convention.yaml +29 -0
  732. package/planner-nodes/nodes/planner.feature.name-is-verb-object.convention.yaml +40 -0
  733. package/planner-nodes/nodes/planner.feature.shape.convention.yaml +27 -0
  734. package/planner-nodes/nodes/planner.feature.size-max-rule.convention.yaml +41 -0
  735. package/planner-nodes/nodes/planner.feature.urn-naming.convention.yaml +29 -0
  736. package/planner-nodes/nodes/planner.feature.validation-rules.convention.yaml +28 -0
  737. package/planner-nodes/nodes/planner.feature.verb-selection-by-artifact-type.convention.yaml +264 -0
  738. package/planner-nodes/nodes/planner.feature.wagon-link.convention.yaml +27 -0
  739. package/planner-nodes/nodes/planner.interface.api-mapping.convention.yaml +70 -0
  740. package/planner-nodes/nodes/planner.interface.artifact-transformation.convention.yaml +103 -0
  741. package/planner-nodes/nodes/planner.interface.contract-urn.convention.yaml +119 -0
  742. package/planner-nodes/nodes/planner.interface.naming-patterns.convention.yaml +73 -0
  743. package/planner-nodes/nodes/planner.interface.orphan-detection.convention.yaml +46 -0
  744. package/planner-nodes/nodes/planner.interface.ownership-rules.convention.yaml +54 -0
  745. package/planner-nodes/nodes/planner.interface.structure-rules.convention.yaml +112 -0
  746. package/planner-nodes/nodes/planner.interface.tests-subdirectory.convention.yaml +61 -0
  747. package/planner-nodes/nodes/planner.interlocking.definition.convention.yaml +36 -0
  748. package/planner-nodes/nodes/planner.interlocking.registry-mirrors-document.convention.yaml +38 -0
  749. package/planner-nodes/nodes/planner.issue-body.dependency-entries-must-be-classified.convention.yaml +21 -0
  750. package/planner-nodes/nodes/planner.issue-body.graph-context-required.convention.yaml +21 -0
  751. package/planner-nodes/nodes/planner.journey.continuation-closure.convention.yaml +51 -0
  752. package/planner-nodes/nodes/planner.journey.definition.convention.yaml +39 -0
  753. package/planner-nodes/nodes/planner.plan.confirm-before-author.convention.yaml +28 -0
  754. package/planner-nodes/nodes/planner.plan.confirm-binds-an-issue.convention.yaml +39 -0
  755. package/planner-nodes/nodes/planner.plan.confirm-requires-interlocking-sanity.convention.yaml +30 -0
  756. package/planner-nodes/nodes/planner.plan.granularity-completeness.convention.yaml +38 -0
  757. package/planner-nodes/nodes/planner.plan.session-lifecycle.convention.yaml +23 -0
  758. package/planner-nodes/nodes/planner.plan.spec-is-schema-valid.convention.yaml +61 -0
  759. package/planner-nodes/nodes/planner.relationship.no-orphan-nodes.convention.yaml +32 -0
  760. package/planner-nodes/nodes/planner.smoke.feedback-loop-close-the-loop.convention.yaml +39 -0
  761. package/planner-nodes/nodes/planner.smoke.synthetic-fixture-bypass.convention.yaml +44 -0
  762. package/planner-nodes/nodes/planner.steps.architecture-routing.convention.yaml +109 -0
  763. package/planner-nodes/nodes/planner.steps.jtbd-taxonomy.convention.yaml +227 -0
  764. package/planner-nodes/nodes/planner.steps.linguistic-patterns.convention.yaml +81 -0
  765. package/planner-nodes/nodes/planner.steps.sequence.convention.yaml +17 -0
  766. package/planner-nodes/nodes/planner.subject.invariants.convention.yaml +34 -0
  767. package/planner-nodes/nodes/planner.theme.definition.convention.yaml +23 -0
  768. package/planner-nodes/nodes/planner.theme.must-be-canonical.convention.yaml +38 -0
  769. package/planner-nodes/nodes/planner.theme.theme-zero-mandatory.convention.yaml +39 -0
  770. package/planner-nodes/nodes/planner.theme.urn-namespace-matches.convention.yaml +34 -0
  771. package/planner-nodes/nodes/planner.train.acceptance-commit-failures-covered.convention.yaml +10 -0
  772. package/planner-nodes/nodes/planner.train.acceptances.convention.yaml +85 -0
  773. package/planner-nodes/nodes/planner.train.artifact-flow.convention.yaml +31 -0
  774. package/planner-nodes/nodes/planner.train.categories.convention.yaml +34 -0
  775. package/planner-nodes/nodes/planner.train.definition.convention.yaml +34 -0
  776. package/planner-nodes/nodes/planner.train.dependencies.convention.yaml +28 -0
  777. package/planner-nodes/nodes/planner.train.dispatch-composite-key-exceptional.convention.yaml +17 -0
  778. package/planner-nodes/nodes/planner.train.dispatch-map-is-registry.convention.yaml +17 -0
  779. package/planner-nodes/nodes/planner.train.family-matches-terminal-contract.convention.yaml +17 -0
  780. package/planner-nodes/nodes/planner.train.family.convention.yaml +17 -0
  781. package/planner-nodes/nodes/planner.train.initial-cargo-inputs-declared.convention.yaml +10 -0
  782. package/planner-nodes/nodes/planner.train.interlocking-does-not-carry-cargo.convention.yaml +28 -0
  783. package/planner-nodes/nodes/planner.train.interlocking-entrypoint-shape.convention.yaml +30 -0
  784. package/planner-nodes/nodes/planner.train.interlocking-fragment-acceptance-binding.convention.yaml +30 -0
  785. package/planner-nodes/nodes/planner.train.interlocking-guard-coverage.convention.yaml +29 -0
  786. package/planner-nodes/nodes/planner.train.interlocking-guard-grammar.convention.yaml +31 -0
  787. package/planner-nodes/nodes/planner.train.interlocking-home.convention.yaml +29 -0
  788. package/planner-nodes/nodes/planner.train.interlocking-message-payload-typed.convention.yaml +28 -0
  789. package/planner-nodes/nodes/planner.train.interlocking-payload-contract-body-required.convention.yaml +28 -0
  790. package/planner-nodes/nodes/planner.train.interlocking-payload-contract-registered.convention.yaml +31 -0
  791. package/planner-nodes/nodes/planner.train.interlocking-projection-equivalence.convention.yaml +32 -0
  792. package/planner-nodes/nodes/planner.train.interlocking-route-category-matches-train-id.convention.yaml +32 -0
  793. package/planner-nodes/nodes/planner.train.interlocking-route-resolution-deterministic.convention.yaml +30 -0
  794. package/planner-nodes/nodes/planner.train.interlocking-structural-residual-explicit.convention.yaml +30 -0
  795. package/planner-nodes/nodes/planner.train.interlocking-wmbt-surface-or-residual.convention.yaml +30 -0
  796. package/planner-nodes/nodes/planner.train.linearity.convention.yaml +28 -0
  797. package/planner-nodes/nodes/planner.train.naming.convention.yaml +26 -0
  798. package/planner-nodes/nodes/planner.train.participants.convention.yaml +27 -0
  799. package/planner-nodes/nodes/planner.train.production-implementation.convention.yaml +24 -0
  800. package/planner-nodes/nodes/planner.train.registry-coherence.convention.yaml +69 -0
  801. package/planner-nodes/nodes/planner.train.registry.convention.yaml +39 -0
  802. package/planner-nodes/nodes/planner.train.route-category-assessment.convention.yaml +43 -0
  803. package/planner-nodes/nodes/planner.train.route-space-admission.convention.yaml +41 -0
  804. package/planner-nodes/nodes/planner.train.scope.convention.yaml +38 -0
  805. package/planner-nodes/nodes/planner.train.sequence.convention.yaml +34 -0
  806. package/planner-nodes/nodes/planner.train.terminal-contract.convention.yaml +10 -0
  807. package/planner-nodes/nodes/planner.train.theme-alignment.convention.yaml +25 -0
  808. package/planner-nodes/nodes/planner.train.theme-orchestrator-urn.convention.yaml +27 -0
  809. package/planner-nodes/nodes/planner.train.theme-ranges.convention.yaml +28 -0
  810. package/planner-nodes/nodes/planner.train.validation-rules.convention.yaml +31 -0
  811. package/planner-nodes/nodes/planner.train.variation-strategies.convention.yaml +26 -0
  812. package/planner-nodes/nodes/planner.wagon.artifact-contracts.convention.yaml +29 -0
  813. package/planner-nodes/nodes/planner.wagon.complexity-model.convention.yaml +33 -0
  814. package/planner-nodes/nodes/planner.wagon.coupling-complexity.convention.yaml +32 -0
  815. package/planner-nodes/nodes/planner.wagon.definition.convention.yaml +30 -0
  816. package/planner-nodes/nodes/planner.wagon.features-format.convention.yaml +28 -0
  817. package/planner-nodes/nodes/planner.wagon.features.convention.yaml +27 -0
  818. package/planner-nodes/nodes/planner.wagon.logical-vs-filesystem-naming.convention.yaml +34 -0
  819. package/planner-nodes/nodes/planner.wagon.name-is-verb-object.convention.yaml +39 -0
  820. package/planner-nodes/nodes/planner.wagon.no-consume-cycle.convention.yaml +30 -0
  821. package/planner-nodes/nodes/planner.wagon.produce-consume-artifacts.convention.yaml +46 -0
  822. package/planner-nodes/nodes/planner.wagon.refinement-extraction.convention.yaml +49 -0
  823. package/planner-nodes/nodes/planner.wagon.semantic-coherence.convention.yaml +30 -0
  824. package/planner-nodes/nodes/planner.wagon.separability.convention.yaml +33 -0
  825. package/planner-nodes/nodes/planner.wagon.slug-dirname-conversion.convention.yaml +26 -0
  826. package/planner-nodes/nodes/planner.wagon.telemetry-filesystem.convention.yaml +52 -0
  827. package/planner-nodes/nodes/planner.wagon.urn-naming.convention.yaml +28 -0
  828. package/planner-nodes/nodes/planner.wagon.urn.convention.yaml +29 -0
  829. package/planner-nodes/nodes/planner.wmbt.context-clarifier.convention.yaml +24 -0
  830. package/planner-nodes/nodes/planner.wmbt.definition.convention.yaml +29 -0
  831. package/planner-nodes/nodes/planner.wmbt.dimension-selection.convention.yaml +37 -0
  832. package/planner-nodes/nodes/planner.wmbt.direction-selection.convention.yaml +41 -0
  833. package/planner-nodes/nodes/planner.wmbt.filename-pattern.convention.yaml +27 -0
  834. package/planner-nodes/nodes/planner.wmbt.lens-selection.convention.yaml +44 -0
  835. package/planner-nodes/nodes/planner.wmbt.must-have-smoke-acceptance.convention.yaml +55 -0
  836. package/planner-nodes/nodes/planner.wmbt.object-of-control.convention.yaml +26 -0
  837. package/planner-nodes/nodes/planner.wmbt.shape.convention.yaml +29 -0
  838. package/planner-nodes/nodes/planner.wmbt.splitting-rules.convention.yaml +37 -0
  839. package/planner-nodes/nodes/planner.wmbt.statement-template.convention.yaml +23 -0
  840. package/planner-nodes/nodes/planner.wmbt.step-code-vocabulary.convention.yaml +31 -0
  841. package/planner-nodes/nodes/planner.wmbt.urn-naming.convention.yaml +31 -0
  842. package/planner-schemas/acceptance.schema.json +396 -0
  843. package/planner-schemas/appendix.schema.json +78 -0
  844. package/planner-schemas/author/convention-node.schema.json +134 -0
  845. package/planner-schemas/author/gate.schema.json +36 -0
  846. package/planner-schemas/author/issue.schema.json +72 -0
  847. package/planner-schemas/author/relationship.schema.json +19 -0
  848. package/planner-schemas/author/scope.schema.json +28 -0
  849. package/planner-schemas/binding-lock.schema.json +38 -0
  850. package/planner-schemas/component.schema.json +114 -0
  851. package/planner-schemas/contract-registry.schema.json +47 -0
  852. package/planner-schemas/feature.schema.json +208 -0
  853. package/planner-schemas/journey.schema.json +225 -0
  854. package/planner-schemas/registry-index.schema.json +54 -0
  855. package/planner-schemas/substrate-lock.schema.json +41 -0
  856. package/planner-schemas/substrate.schema.json +38 -0
  857. package/planner-schemas/theme-registry.schema.json +28 -0
  858. package/planner-schemas/train-interlocking-registry.schema.json +49 -0
  859. package/planner-schemas/train-interlocking.schema.json +459 -0
  860. package/planner-schemas/train.schema.json +361 -0
  861. package/planner-schemas/wagon.schema.json +283 -0
  862. package/planner-schemas/wmbt.schema.json +68 -0
  863. package/src/ci.ts +9 -0
  864. package/src/cli.ts +91 -0
  865. package/src/docs-capability.ts +156 -0
  866. package/src/enforce.ts +103 -0
  867. package/src/hooks.ts +48 -0
  868. package/src/index.ts +13 -0
  869. package/src/planner-kernel.ts +112 -0
  870. package/src/planner-schema-validator.ts +101 -0
  871. package/src/planner-validators.ts +288 -0
  872. package/src/register.ts +8 -0
  873. package/src/release.ts +9 -0
  874. package/src/setup.ts +15 -0
  875. package/templates/github/atdd-bun-release.yml +16 -0
  876. package/templates/github/atdd-bun.yml +26 -0
@@ -0,0 +1,6 @@
1
+ // match wagon — CLEAN fixture. A wagon transforms artifacts. It reads and returns a data map and
2
+ // does NOT import interlocking code (Cargo boundary, core afokapu/atdd#1251).
3
+ export function runMatch(cargo: Map<string, unknown>): Map<string, unknown> {
4
+ cargo.set("match", { result: { validForRanked: true } });
5
+ return cargo;
6
+ }
@@ -0,0 +1,49 @@
1
+ // DIRTY fixture — coder.bun.interlocking-delegates-to-trainrunner.
2
+ // The InterlockingRunner module imports a wagon directly, calls runTrain(...), and loops over
3
+ // train.sequence as a step executor — competing with TrainRunner instead of delegating.
4
+ // Expected: >=1 violation (interlocking-direct-wagon-execution).
5
+ import { runMatch } from "../match/wagon";
6
+
7
+ export interface InterlockingResolution {
8
+ interlockingId: string;
9
+ routeId: string;
10
+ trainId: string;
11
+ trainPath: string;
12
+ category: string;
13
+ resolutionStrategy: string;
14
+ guardId: string;
15
+ reason: string;
16
+ }
17
+
18
+ export class InterlockingRunner {
19
+ constructor(private readonly path: string) {}
20
+
21
+ resolveTrain(action: string, inputs: Record<string, unknown>): InterlockingResolution {
22
+ return {
23
+ interlockingId: "interlocking:match-resolution",
24
+ routeId: "nominal-all-voted",
25
+ trainId: "train:match:solo-match-complete",
26
+ trainPath: "plan/_trains/train:match:solo-match-complete.yaml",
27
+ category: "nominal",
28
+ resolutionStrategy: "first_priority",
29
+ guardId: "all-voted",
30
+ reason: "all participants voted",
31
+ };
32
+ }
33
+
34
+ execute(action: string, inputs: Record<string, unknown>) {
35
+ const resolution = this.resolveTrain(action, inputs);
36
+ const train = { sequence: ["match"] };
37
+ let acc: Record<string, unknown> = inputs;
38
+ // BUG: interlocking duplicates the TrainRunner step loop and executes wagons itself.
39
+ for (const step of train.sequence) {
40
+ acc = runTrain(step, acc);
41
+ }
42
+ return { selectedTrainId: resolution.trainId, artifacts: acc };
43
+ }
44
+ }
45
+
46
+ function runTrain(step: string, acc: Record<string, unknown>): Record<string, unknown> {
47
+ if (step === "match") return runMatch(new Map()) as unknown as Record<string, unknown>;
48
+ return acc;
49
+ }
@@ -0,0 +1,28 @@
1
+ // TrainRunner — CLEAN fixture. The production linear train executor: the ONLY component that runs
2
+ // wagons and carries Cargo between them. Legitimate execution; not scanned by the interlocking
3
+ // detector (only InterlockingRunner-defining modules are scanned for direct wagon execution).
4
+ import { runMatch } from "../match/wagon";
5
+
6
+ export class Cargo extends Map<string, unknown> {}
7
+
8
+ export class TrainRunner {
9
+ constructor(private readonly trainPath: string) {}
10
+
11
+ execute(trainId: string, inputs: Record<string, unknown>) {
12
+ let cargo: Cargo = new Cargo(Object.entries(inputs));
13
+ const train = loadTrain(this.trainPath);
14
+ for (const step of train.sequence) {
15
+ cargo = runTrain(step, cargo);
16
+ }
17
+ return { selectedTrainId: trainId, artifacts: Object.fromEntries(cargo) };
18
+ }
19
+ }
20
+
21
+ function runTrain(step: string, cargo: Cargo): Cargo {
22
+ if (step === "match") return runMatch(cargo) as Cargo;
23
+ return cargo;
24
+ }
25
+
26
+ function loadTrain(_path: string) {
27
+ return { sequence: ["match"] };
28
+ }
@@ -0,0 +1,22 @@
1
+ // Station Master composition root — CLEAN fixture. Routes both a direct trainId mapping and an
2
+ // interlocking route object, references the InterlockingRunner route-control layer, and ultimately
3
+ // delegates execution to TrainRunner (core afokapu/atdd#1251).
4
+ import { InterlockingRunner } from "./src/trains/interlocking";
5
+ import { TrainRunner } from "./src/trains/runner";
6
+
7
+ export const JOURNEY_MAP: Record<string, string | { interlockingId: string; path: string }> = {
8
+ start_match: "train:match:solo-match-complete",
9
+ resolve_match: {
10
+ interlockingId: "interlocking:match-resolution",
11
+ path: "plan/_trains/_interlockings/match-resolution.yaml",
12
+ },
13
+ };
14
+
15
+ export function dispatch(action: string, inputs: Record<string, unknown>, state?: unknown) {
16
+ const mapping = JOURNEY_MAP[action];
17
+ if (typeof mapping === "string") {
18
+ return new TrainRunner(`plan/_trains/${mapping}.yaml`).execute(mapping, inputs);
19
+ }
20
+ const runner = new InterlockingRunner(mapping.path);
21
+ return runner.execute(action, inputs, state);
22
+ }
@@ -0,0 +1,11 @@
1
+ // DIRTY fixture — coder.bun.interlocking-does-not-carry-cargo (wagon side).
2
+ // A wagon MUST NOT import interlocking code — that couples the artifact plane to route control.
3
+ // Expected: >=1 violation (wagon-imports-interlocking).
4
+ import { InterlockingRunner } from "../src/trains/interlocking";
5
+
6
+ export function runMatch(cargo: Map<string, unknown>): Map<string, unknown> {
7
+ // BUG: wagon reaches into the route-control layer.
8
+ const _runner = InterlockingRunner;
9
+ cargo.set("match", { result: { validForRanked: true } });
10
+ return cargo;
11
+ }
@@ -0,0 +1,42 @@
1
+ // DIRTY fixture — coder.bun.interlocking-does-not-carry-cargo.
2
+ // The InterlockingRunner module references the Cargo data plane and stores an artifact_urn value,
3
+ // bleeding the artifact plane into the route-control layer.
4
+ // Expected: >=1 violation (interlocking-cargo-mutation).
5
+ import { TrainRunner } from "./runner";
6
+ import { Cargo } from "./runner";
7
+
8
+ export interface InterlockingResolution {
9
+ interlockingId: string;
10
+ routeId: string;
11
+ trainId: string;
12
+ trainPath: string;
13
+ category: string;
14
+ resolutionStrategy: string;
15
+ guardId: string;
16
+ reason: string;
17
+ }
18
+
19
+ export class InterlockingRunner {
20
+ constructor(private readonly path: string) {}
21
+
22
+ resolveTrain(action: string, inputs: Record<string, unknown>): InterlockingResolution {
23
+ // BUG: the interlocking reads/mutates Cargo and stores an artifact_urn value mid-resolution.
24
+ const cargo = new Cargo();
25
+ cargo["artifact_urn"] = "urn:artifact:match:result";
26
+ return {
27
+ interlockingId: "interlocking:match-resolution",
28
+ routeId: "nominal-all-voted",
29
+ trainId: "train:match:solo-match-complete",
30
+ trainPath: "plan/_trains/train:match:solo-match-complete.yaml",
31
+ category: "nominal",
32
+ resolutionStrategy: "first_priority",
33
+ guardId: "all-voted",
34
+ reason: "all participants voted",
35
+ };
36
+ }
37
+
38
+ execute(action: string, inputs: Record<string, unknown>) {
39
+ const resolution = this.resolveTrain(action, inputs);
40
+ return new TrainRunner(resolution.trainPath).execute(resolution.trainId, inputs);
41
+ }
42
+ }
@@ -0,0 +1,28 @@
1
+ // TrainRunner — CLEAN fixture. The production linear train executor: the ONLY component that runs
2
+ // wagons and carries Cargo between them. Legitimate execution; not scanned by the interlocking
3
+ // detector (only InterlockingRunner-defining modules are scanned for direct wagon execution).
4
+ import { runMatch } from "../match/wagon";
5
+
6
+ export class Cargo extends Map<string, unknown> {}
7
+
8
+ export class TrainRunner {
9
+ constructor(private readonly trainPath: string) {}
10
+
11
+ execute(trainId: string, inputs: Record<string, unknown>) {
12
+ let cargo: Cargo = new Cargo(Object.entries(inputs));
13
+ const train = loadTrain(this.trainPath);
14
+ for (const step of train.sequence) {
15
+ cargo = runTrain(step, cargo);
16
+ }
17
+ return { selectedTrainId: trainId, artifacts: Object.fromEntries(cargo) };
18
+ }
19
+ }
20
+
21
+ function runTrain(step: string, cargo: Cargo): Cargo {
22
+ if (step === "match") return runMatch(cargo) as Cargo;
23
+ return cargo;
24
+ }
25
+
26
+ function loadTrain(_path: string) {
27
+ return { sequence: ["match"] };
28
+ }
@@ -0,0 +1,22 @@
1
+ // Station Master composition root — CLEAN fixture. Routes both a direct trainId mapping and an
2
+ // interlocking route object, references the InterlockingRunner route-control layer, and ultimately
3
+ // delegates execution to TrainRunner (core afokapu/atdd#1251).
4
+ import { InterlockingRunner } from "./src/trains/interlocking";
5
+ import { TrainRunner } from "./src/trains/runner";
6
+
7
+ export const JOURNEY_MAP: Record<string, string | { interlockingId: string; path: string }> = {
8
+ start_match: "train:match:solo-match-complete",
9
+ resolve_match: {
10
+ interlockingId: "interlocking:match-resolution",
11
+ path: "plan/_trains/_interlockings/match-resolution.yaml",
12
+ },
13
+ };
14
+
15
+ export function dispatch(action: string, inputs: Record<string, unknown>, state?: unknown) {
16
+ const mapping = JOURNEY_MAP[action];
17
+ if (typeof mapping === "string") {
18
+ return new TrainRunner(`plan/_trains/${mapping}.yaml`).execute(mapping, inputs);
19
+ }
20
+ const runner = new InterlockingRunner(mapping.path);
21
+ return runner.execute(action, inputs, state);
22
+ }
@@ -0,0 +1,6 @@
1
+ // match wagon — CLEAN fixture. A wagon transforms artifacts. It reads and returns a data map and
2
+ // does NOT import interlocking code (Cargo boundary, core afokapu/atdd#1251).
3
+ export function runMatch(cargo: Map<string, unknown>): Map<string, unknown> {
4
+ cargo.set("match", { result: { validForRanked: true } });
5
+ return cargo;
6
+ }
@@ -0,0 +1,21 @@
1
+ // DIRTY fixture — coder.bun.interlocking-resolution-model-exists.
2
+ // resolveTrain resolves a BARE trainId string; there is no structured InterlockingResolution model
3
+ // carrying routeId/guardId/category/... Expected: >=1 violation (bare-train-id-resolution).
4
+ import { TrainRunner } from "./runner";
5
+
6
+ export class InterlockingRunner {
7
+ private readonly path: string;
8
+ constructor(interlockingYamlPath: string) {
9
+ this.path = interlockingYamlPath;
10
+ }
11
+
12
+ // BUG: returns a bare trainId string — loses routeId, guardId, category, resolutionStrategy, reason, ...
13
+ resolveTrain(action: string, inputs: Record<string, unknown>): string {
14
+ return "train:match:solo-match-complete";
15
+ }
16
+
17
+ execute(action: string, inputs: Record<string, unknown>) {
18
+ const trainId = this.resolveTrain(action, inputs);
19
+ return new TrainRunner(`plan/_trains/${trainId}.yaml`).execute(trainId, inputs);
20
+ }
21
+ }
@@ -0,0 +1,28 @@
1
+ // TrainRunner — CLEAN fixture. The production linear train executor: the ONLY component that runs
2
+ // wagons and carries Cargo between them. Legitimate execution; not scanned by the interlocking
3
+ // detector (only InterlockingRunner-defining modules are scanned for direct wagon execution).
4
+ import { runMatch } from "../match/wagon";
5
+
6
+ export class Cargo extends Map<string, unknown> {}
7
+
8
+ export class TrainRunner {
9
+ constructor(private readonly trainPath: string) {}
10
+
11
+ execute(trainId: string, inputs: Record<string, unknown>) {
12
+ let cargo: Cargo = new Cargo(Object.entries(inputs));
13
+ const train = loadTrain(this.trainPath);
14
+ for (const step of train.sequence) {
15
+ cargo = runTrain(step, cargo);
16
+ }
17
+ return { selectedTrainId: trainId, artifacts: Object.fromEntries(cargo) };
18
+ }
19
+ }
20
+
21
+ function runTrain(step: string, cargo: Cargo): Cargo {
22
+ if (step === "match") return runMatch(cargo) as Cargo;
23
+ return cargo;
24
+ }
25
+
26
+ function loadTrain(_path: string) {
27
+ return { sequence: ["match"] };
28
+ }
@@ -0,0 +1,22 @@
1
+ // Station Master composition root — CLEAN fixture. Routes both a direct trainId mapping and an
2
+ // interlocking route object, references the InterlockingRunner route-control layer, and ultimately
3
+ // delegates execution to TrainRunner (core afokapu/atdd#1251).
4
+ import { InterlockingRunner } from "./src/trains/interlocking";
5
+ import { TrainRunner } from "./src/trains/runner";
6
+
7
+ export const JOURNEY_MAP: Record<string, string | { interlockingId: string; path: string }> = {
8
+ start_match: "train:match:solo-match-complete",
9
+ resolve_match: {
10
+ interlockingId: "interlocking:match-resolution",
11
+ path: "plan/_trains/_interlockings/match-resolution.yaml",
12
+ },
13
+ };
14
+
15
+ export function dispatch(action: string, inputs: Record<string, unknown>, state?: unknown) {
16
+ const mapping = JOURNEY_MAP[action];
17
+ if (typeof mapping === "string") {
18
+ return new TrainRunner(`plan/_trains/${mapping}.yaml`).execute(mapping, inputs);
19
+ }
20
+ const runner = new InterlockingRunner(mapping.path);
21
+ return runner.execute(action, inputs, state);
22
+ }
@@ -0,0 +1,6 @@
1
+ // match wagon — CLEAN fixture. A wagon transforms artifacts. It reads and returns a data map and
2
+ // does NOT import interlocking code (Cargo boundary, core afokapu/atdd#1251).
3
+ export function runMatch(cargo: Map<string, unknown>): Map<string, unknown> {
4
+ cargo.set("match", { result: { validForRanked: true } });
5
+ return cargo;
6
+ }
@@ -0,0 +1,16 @@
1
+ // DIRTY fixture — coder.bun.interlocking-runner-exists.
2
+ // The InterlockingRunner class exists but ships NO resolveTrain(...) entry point, so a consumer
3
+ // declaring interlocking routes has no route-control entry. Expected: >=1 violation (missing-resolve-train).
4
+ import { TrainRunner } from "./runner";
5
+
6
+ export class InterlockingRunner {
7
+ private readonly path: string;
8
+ constructor(interlockingYamlPath: string) {
9
+ this.path = interlockingYamlPath;
10
+ }
11
+
12
+ // BUG: no resolveTrain(...) — there is no route-control entry point at all.
13
+ execute(action: string, inputs: Record<string, unknown>) {
14
+ return new TrainRunner("plan/_trains/train:match:solo-match-complete.yaml").execute("train:match:solo-match-complete", inputs);
15
+ }
16
+ }
@@ -0,0 +1,28 @@
1
+ // TrainRunner — CLEAN fixture. The production linear train executor: the ONLY component that runs
2
+ // wagons and carries Cargo between them. Legitimate execution; not scanned by the interlocking
3
+ // detector (only InterlockingRunner-defining modules are scanned for direct wagon execution).
4
+ import { runMatch } from "../match/wagon";
5
+
6
+ export class Cargo extends Map<string, unknown> {}
7
+
8
+ export class TrainRunner {
9
+ constructor(private readonly trainPath: string) {}
10
+
11
+ execute(trainId: string, inputs: Record<string, unknown>) {
12
+ let cargo: Cargo = new Cargo(Object.entries(inputs));
13
+ const train = loadTrain(this.trainPath);
14
+ for (const step of train.sequence) {
15
+ cargo = runTrain(step, cargo);
16
+ }
17
+ return { selectedTrainId: trainId, artifacts: Object.fromEntries(cargo) };
18
+ }
19
+ }
20
+
21
+ function runTrain(step: string, cargo: Cargo): Cargo {
22
+ if (step === "match") return runMatch(cargo) as Cargo;
23
+ return cargo;
24
+ }
25
+
26
+ function loadTrain(_path: string) {
27
+ return { sequence: ["match"] };
28
+ }
@@ -0,0 +1,19 @@
1
+ // DIRTY fixture — coder.bun.station-master-interlocking-routing.
2
+ // JOURNEY_MAP declares an interlocking route object but the Station Master never references
3
+ // TrainRunner, so the selected train is never delegated for execution.
4
+ // Expected: >=1 violation (station-master-no-trainrunner-delegation).
5
+ import { InterlockingRunner } from "./src/trains/interlocking";
6
+
7
+ export const JOURNEY_MAP: Record<string, string | { interlockingId: string; path: string }> = {
8
+ resolve_match: {
9
+ interlockingId: "interlocking:match-resolution",
10
+ path: "plan/_trains/_interlockings/match-resolution.yaml",
11
+ },
12
+ };
13
+
14
+ export function dispatch(action: string, inputs: Record<string, unknown>, state?: unknown) {
15
+ const mapping = JOURNEY_MAP[action] as { interlockingId: string; path: string };
16
+ // BUG: builds the runner but never delegates through TrainRunner.
17
+ const runner = new InterlockingRunner(mapping.path);
18
+ return runner;
19
+ }
@@ -0,0 +1,6 @@
1
+ // match wagon — CLEAN fixture. A wagon transforms artifacts. It reads and returns a data map and
2
+ // does NOT import interlocking code (Cargo boundary, core afokapu/atdd#1251).
3
+ export function runMatch(cargo: Map<string, unknown>): Map<string, unknown> {
4
+ cargo.set("match", { result: { validForRanked: true } });
5
+ return cargo;
6
+ }
@@ -0,0 +1,41 @@
1
+ // InterlockingRunner route-control layer — CLEAN fixture (Bun/TS).
2
+ // Resolves exactly one admissible train into a structured InterlockingResolution and delegates
3
+ // linear execution to TrainRunner. It never imports a wagon, calls runTrain, loops over
4
+ // train.sequence, or touches Cargo (core afokapu/atdd#1251).
5
+ import { TrainRunner } from "./runner";
6
+
7
+ export interface InterlockingResolution {
8
+ interlockingId: string;
9
+ routeId: string;
10
+ trainId: string;
11
+ trainPath: string;
12
+ category: string;
13
+ resolutionStrategy: string;
14
+ guardId: string;
15
+ reason: string;
16
+ }
17
+
18
+ export class InterlockingRunner {
19
+ private readonly path: string;
20
+ constructor(interlockingYamlPath: string) {
21
+ this.path = interlockingYamlPath;
22
+ }
23
+
24
+ resolveTrain(action: string, inputs: Record<string, unknown>, state?: unknown): InterlockingResolution {
25
+ return {
26
+ interlockingId: "interlocking:match-resolution",
27
+ routeId: "nominal-all-voted",
28
+ trainId: "train:match:solo-match-complete",
29
+ trainPath: "plan/_trains/train:match:solo-match-complete.yaml",
30
+ category: "nominal",
31
+ resolutionStrategy: "first_priority",
32
+ guardId: "all-voted",
33
+ reason: "all participants voted",
34
+ };
35
+ }
36
+
37
+ execute(action: string, inputs: Record<string, unknown>, state?: unknown) {
38
+ const resolution = this.resolveTrain(action, inputs, state);
39
+ return new TrainRunner(resolution.trainPath).execute(resolution.trainId, inputs);
40
+ }
41
+ }
@@ -0,0 +1,28 @@
1
+ // TrainRunner — CLEAN fixture. The production linear train executor: the ONLY component that runs
2
+ // wagons and carries Cargo between them. Legitimate execution; not scanned by the interlocking
3
+ // detector (only InterlockingRunner-defining modules are scanned for direct wagon execution).
4
+ import { runMatch } from "../match/wagon";
5
+
6
+ export class Cargo extends Map<string, unknown> {}
7
+
8
+ export class TrainRunner {
9
+ constructor(private readonly trainPath: string) {}
10
+
11
+ execute(trainId: string, inputs: Record<string, unknown>) {
12
+ let cargo: Cargo = new Cargo(Object.entries(inputs));
13
+ const train = loadTrain(this.trainPath);
14
+ for (const step of train.sequence) {
15
+ cargo = runTrain(step, cargo);
16
+ }
17
+ return { selectedTrainId: trainId, artifacts: Object.fromEntries(cargo) };
18
+ }
19
+ }
20
+
21
+ function runTrain(step: string, cargo: Cargo): Cargo {
22
+ if (step === "match") return runMatch(cargo) as Cargo;
23
+ return cargo;
24
+ }
25
+
26
+ function loadTrain(_path: string) {
27
+ return { sequence: ["match"] };
28
+ }
@@ -0,0 +1,16 @@
1
+ schema_version: 1.0.0
2
+ journey_id: journey:example
3
+ title: Example journey
4
+ status: checked
5
+ entrypoint:
6
+ interlocking_id: interlocking:first
7
+ exposed: false
8
+ actions: []
9
+ reason: internal-transition-only
10
+ surfaces: [backend]
11
+ continuations: []
12
+ terminals:
13
+ - from:
14
+ interlocking_id: interlocking:first
15
+ route_id: done
16
+ outcome: completed
@@ -0,0 +1,14 @@
1
+ import { TrainRunner } from "./runner";
2
+ import { runOrder } from "../orders/wagon";
3
+
4
+ class Cargo extends Map<string, unknown> {}
5
+
6
+ export class JourneyRunner {
7
+ execute(train: { sequence: string[] }, inputs: Record<string, unknown>) {
8
+ const cargo = new Cargo(Object.entries(inputs));
9
+ for (const step of train.sequence) {
10
+ runOrder(cargo);
11
+ }
12
+ return new TrainRunner("plan/_trains/direct.yaml").execute("train:direct:run", inputs);
13
+ }
14
+ }
@@ -0,0 +1,16 @@
1
+ schema_version: 1.0.0
2
+ journey_id: journey:public
3
+ title: Public journey
4
+ status: checked
5
+ entrypoint:
6
+ interlocking_id: interlocking:first
7
+ exposed: true
8
+ actions: [start_journey]
9
+ reason: null
10
+ surfaces: [backend]
11
+ continuations: []
12
+ terminals:
13
+ - from:
14
+ interlocking_id: interlocking:first
15
+ route_id: done
16
+ outcome: completed
@@ -0,0 +1,10 @@
1
+ export const JOURNEY_MAP = {
2
+ start_journey: {
3
+ journeyId: "journey:other",
4
+ path: "plan/_journeys/other.yaml",
5
+ },
6
+ };
7
+
8
+ export function dispatch(action: string) {
9
+ return JOURNEY_MAP[action as keyof typeof JOURNEY_MAP];
10
+ }
@@ -0,0 +1,14 @@
1
+ import { InterlockingRunner } from "@app/interlocking-runtime";
2
+
3
+ export class JourneyRunner {
4
+ constructor(private readonly journeyYamlPath: string) {}
5
+
6
+ async execute(action: string, inputs: Record<string, unknown>, state?: unknown) {
7
+ const declaration = Bun.YAML.parse(await Bun.file(this.journeyYamlPath).text()) as {
8
+ entrypoint: { interlocking_id: string };
9
+ };
10
+ const id = declaration.entrypoint.interlocking_id.replace("interlocking:", "");
11
+ const path = `plan/_trains/_interlockings/${id}.yaml`;
12
+ return new InterlockingRunner(path).execute(action, inputs, state);
13
+ }
14
+ }
@@ -0,0 +1,17 @@
1
+ wagon: confirm-order
2
+ urn: wagon:orders
3
+ description: Take a customer order from basket to confirmed checkout
4
+ subject: customer:active
5
+ context: in-checkout, basket-priced
6
+ action: confirms the priced basket
7
+ goal: advance the order to a confirmed state
8
+ outcome: order confirmed and its row fragment rendered
9
+ produce:
10
+ - name: orders:confirmed-order
11
+ contract: contract:orders:confirmed-order-v1
12
+ telemetry: telemetry:orders:order-confirmed
13
+ consume:
14
+ - name: orders:priced-basket
15
+ from: wagon:pricing
16
+ wmbt:
17
+ - wmbt:orders:E001
@@ -0,0 +1,13 @@
1
+ // BUG: the plan declares produce "orders:confirmed-order" and consume
2
+ // "orders:priced-basket"; this wagon moves Cargo under ad-hoc keys instead, so the
3
+ // declared contract describes artifacts the code never touches.
4
+ export class Cargo {
5
+ private a: Record<string, unknown> = {};
6
+ put(artifactUrn: string, v: unknown) { this.a[artifactUrn] = v; }
7
+ get(artifactUrn: string) { return this.a[artifactUrn]; }
8
+ }
9
+
10
+ export function runWagon(cargo: Cargo): void {
11
+ const basket = cargo.get("basket");
12
+ cargo.put("done", { confirmed: true, basket });
13
+ }
@@ -0,0 +1,33 @@
1
+ schema_version: 1.1.0
2
+ kind: implementation
3
+ subtype: validator
4
+ implementation_id: bun_security_hygiene_detector
5
+ targets_workspace: atdd.workspace.bun
6
+ contract_version: 1.1.0
7
+ # Security, logging and error-response obligations for the Bun + htmx stack.
8
+ #
9
+ # Only TWO of these seven are ports: `hardcoded-secret` (the secret regexes are
10
+ # language-neutral) and `error-response-code-format` (the payload shape is JSON).
11
+ # The other five are RE-REALIZATIONS — the python-pytest siblings walk a Python AST
12
+ # for FastAPI decorators, `Depends()`, `print()`, `logger.info(extra=)` and
13
+ # `HTTPException(detail=)`, none of which exist in this stack. Same obligations,
14
+ # different detectors, which is why a stack extension is a package rather than a
15
+ # translation of another package.
16
+ emits_rule_ids:
17
+ - coder.bun.error-response-bare-string
18
+ - coder.bun.error-response-code-format
19
+ - coder.bun.logging-console
20
+ - coder.bun.logging-structured
21
+ - coder.bun.security-hardcoded-secret
22
+ - coder.bun.security-missing-auth
23
+ - coder.bun.security-sql-injection
24
+ entrypoint: detect.mjs
25
+ report: detect.mjs
26
+ realizes_convention:
27
+ - coder.bun.error-response-bare-string
28
+ - coder.bun.error-response-code-format
29
+ - coder.bun.logging-console
30
+ - coder.bun.logging-structured
31
+ - coder.bun.security-hardcoded-secret
32
+ - coder.bun.security-missing-auth
33
+ - coder.bun.security-sql-injection
@@ -0,0 +1,9 @@
1
+ {
2
+ "sec_hardcoded_secret": "coder.bun.security-hardcoded-secret",
3
+ "sec_sql_injection": "coder.bun.security-sql-injection",
4
+ "sec_missing_auth": "coder.bun.security-missing-auth",
5
+ "log_console": "coder.bun.logging-console",
6
+ "log_structured": "coder.bun.logging-structured",
7
+ "err_bare_string": "coder.bun.error-response-bare-string",
8
+ "err_code_format": "coder.bun.error-response-code-format"
9
+ }
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bun
2
+ // Member check: coder.bun.error-response-bare-string (security/hygiene family)
3
+ //
4
+ // RE-REALIZED. The python-pytest sibling matches FastAPI's
5
+ // `HTTPException(detail="...")`. Bun has no exception-to-response machinery: an
6
+ // error IS a `Response` with a 4xx/5xx status, so the equivalent fault is
7
+ // `new Response("something went wrong", { status: 400 })` — a bare human string
8
+ // where a structured, coded payload belongs.
9
+ //
10
+ // This matters more in an htmx app than in a JSON API, and that is worth being
11
+ // explicit about: htmx swaps the response body into the DOM, so a bare error
12
+ // string is not merely unstructured — it is rendered to the user verbatim,
13
+ // including whatever internal detail it happens to carry.
14
+ import { walk, readRoots, readExcludes, readText, emit, locate, SOURCE_EXT } from "../../../lib/scan.mjs";
15
+
16
+ const RULE = "coder.bun.error-response-bare-string";
17
+
18
+ // `new Response(<string literal>, { ... status: 4xx|5xx ... })` — the status may
19
+ // precede or follow other options, so the options object is matched loosely.
20
+ const BARE_ERROR_RESPONSE_RE =
21
+ /new\s+Response\s*\(\s*(['"`])((?:[^'"`\\]|\\.)*)\1\s*,\s*\{[^}]*\bstatus\s*:\s*([45]\d{2})/g;
22
+
23
+ const violations = [];
24
+ const excludes = readExcludes();
25
+ for (const root of readRoots()) {
26
+ for (const file of walk(root, excludes, SOURCE_EXT)) {
27
+ const text = readText(file);
28
+ if (!text) continue;
29
+ for (const m of text.matchAll(BARE_ERROR_RESPONSE_RE)) {
30
+ violations.push({
31
+ rule_id: RULE, file, ...locate(text, m.index),
32
+ evidence: `HTTP ${m[3]} returns the bare string "${m[2].slice(0, 40)}"; return a structured payload carrying an error_code`,
33
+ });
34
+ }
35
+ }
36
+ }
37
+ process.stderr.write(`bun-security[error-bare-string]: ${violations.length} violation(s)\n`);
38
+ emit(violations);