@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.
- package/HOOK_AUDIT.md +22 -0
- package/PLANNER_PORT.md +55 -0
- package/README.md +256 -0
- package/bunfig.toml +2 -0
- package/conventions/coder.bun/coder.bun.boundaries-http-client.convention.yaml +43 -0
- package/conventions/coder.bun/coder.bun.commons-application-no-integration.convention.yaml +40 -0
- package/conventions/coder.bun/coder.bun.commons-cross-feature-imports-in.convention.yaml +39 -0
- package/conventions/coder.bun/coder.bun.commons-domain-no-framework-import.convention.yaml +40 -0
- package/conventions/coder.bun/coder.bun.commons-domain-no-outbound.convention.yaml +41 -0
- package/conventions/coder.bun/coder.bun.complexity-cyclomatic.convention.yaml +51 -0
- package/conventions/coder.bun/coder.bun.complexity-length.convention.yaml +43 -0
- package/conventions/coder.bun/coder.bun.complexity-nesting.convention.yaml +49 -0
- package/conventions/coder.bun/coder.bun.composition-consumer.convention.yaml +40 -0
- package/conventions/coder.bun/coder.bun.composition-root.convention.yaml +42 -0
- package/conventions/coder.bun/coder.bun.dead-code-reachability.convention.yaml +49 -0
- package/conventions/coder.bun/coder.bun.design-hierarchy-import.convention.yaml +42 -0
- package/conventions/coder.bun/coder.bun.dto-mapper.convention.yaml +38 -0
- package/conventions/coder.bun/coder.bun.dto-placement.convention.yaml +39 -0
- package/conventions/coder.bun/coder.bun.dto-purity.convention.yaml +40 -0
- package/conventions/coder.bun/coder.bun.duplication-intra-layer.convention.yaml +47 -0
- package/conventions/coder.bun/coder.bun.error-response-bare-string.convention.yaml +47 -0
- package/conventions/coder.bun/coder.bun.error-response-code-format.convention.yaml +46 -0
- package/conventions/coder.bun/coder.bun.green-header-order.convention.yaml +61 -0
- package/conventions/coder.bun/coder.bun.green-header-purpose.convention.yaml +55 -0
- package/conventions/coder.bun/coder.bun.green-header-runtime.convention.yaml +56 -0
- package/conventions/coder.bun/coder.bun.green-header-tested-by.convention.yaml +63 -0
- package/conventions/coder.bun/coder.bun.green-urn-layer.convention.yaml +53 -0
- package/conventions/coder.bun/coder.bun.green-urn-marker.convention.yaml +67 -0
- package/conventions/coder.bun/coder.bun.green-urn-name-matches.convention.yaml +57 -0
- package/conventions/coder.bun/coder.bun.green-urn-pattern.convention.yaml +56 -0
- package/conventions/coder.bun/coder.bun.green-urn-side.convention.yaml +54 -0
- package/conventions/coder.bun/coder.bun.green-urn-wagon-feature.convention.yaml +56 -0
- package/conventions/coder.bun/coder.bun.interlocking-bilateral-binding.convention.yaml +132 -0
- package/conventions/coder.bun/coder.bun.interlocking-delegates-to-trainrunner.convention.yaml +56 -0
- package/conventions/coder.bun/coder.bun.interlocking-does-not-carry-cargo.convention.yaml +53 -0
- package/conventions/coder.bun/coder.bun.interlocking-resolution-model-exists.convention.yaml +61 -0
- package/conventions/coder.bun/coder.bun.interlocking-runner-exists.convention.yaml +64 -0
- package/conventions/coder.bun/coder.bun.journey-runner-boundary.convention.yaml +55 -0
- package/conventions/coder.bun/coder.bun.layer-naming.convention.yaml +41 -0
- package/conventions/coder.bun/coder.bun.logging-console.convention.yaml +47 -0
- package/conventions/coder.bun/coder.bun.logging-structured.convention.yaml +49 -0
- package/conventions/coder.bun/coder.bun.quality-comments.convention.yaml +44 -0
- package/conventions/coder.bun/coder.bun.quality-mi.convention.yaml +47 -0
- package/conventions/coder.bun/coder.bun.runtime-executes-the-declaration.convention.yaml +104 -0
- package/conventions/coder.bun/coder.bun.runtime-server-is-bun-serve.convention.yaml +64 -0
- package/conventions/coder.bun/coder.bun.runtime-single-lockfile.convention.yaml +56 -0
- package/conventions/coder.bun/coder.bun.runtime-typecheck-enforced.convention.yaml +91 -0
- package/conventions/coder.bun/coder.bun.security-hardcoded-secret.convention.yaml +50 -0
- package/conventions/coder.bun/coder.bun.security-missing-auth.convention.yaml +53 -0
- package/conventions/coder.bun/coder.bun.security-sql-injection.convention.yaml +54 -0
- package/conventions/coder.bun/coder.bun.station-master-interlocking-routing.convention.yaml +62 -0
- package/conventions/coder.bun/coder.bun.station-master-journey-routing.convention.yaml +49 -0
- package/conventions/coder.bun/coder.bun.wagon-honours-its-contract.convention.yaml +64 -0
- package/conventions/coder.htmx/coder.htmx.fragment-escapes-interpolation.convention.yaml +72 -0
- package/conventions/coder.htmx/coder.htmx.swap-no-inline-handler.convention.yaml +59 -0
- package/conventions/coder.htmx/coder.htmx.swap-oob-carries-id.convention.yaml +56 -0
- package/conventions/coder.htmx/coder.htmx.verb-destructive-confirms.convention.yaml +56 -0
- package/conventions/coder.htmx/coder.htmx.verb-endpoint-is-routed.convention.yaml +73 -0
- package/conventions/coder.htmx/coder.htmx.verb-endpoint-same-origin.convention.yaml +58 -0
- package/conventions/coder.htmx/coder.htmx.verb-mutation-signals-progress.convention.yaml +59 -0
- package/conventions/planner.docs/planner.docs.adr-registry-derived.convention.yaml +83 -0
- package/conventions/planner.docs/planner.docs.area-index-required.convention.yaml +67 -0
- package/conventions/planner.docs/planner.docs.artifact-path-shape.convention.yaml +82 -0
- package/conventions/planner.docs/planner.docs.asciidoc-only.convention.yaml +71 -0
- package/conventions/planner.docs/planner.docs.doc-id-unique.convention.yaml +65 -0
- package/conventions/planner.docs/planner.docs.graph-target-resolves.convention.yaml +87 -0
- package/conventions/planner.docs/planner.docs.identity-required.convention.yaml +68 -0
- package/conventions/planner.docs/planner.docs.reference-integrity.convention.yaml +74 -0
- package/conventions/planner.docs/planner.docs.undeclared-change.convention.yaml +80 -0
- package/conventions/tester.bun/tester.bun.acceptance-binding-declared.convention.yaml +49 -0
- package/conventions/tester.bun/tester.bun.acceptance-covers-tag-well-formed.convention.yaml +50 -0
- package/conventions/tester.bun/tester.bun.acceptance-resolves-to-declared.convention.yaml +61 -0
- package/conventions/tester.bun/tester.bun.interlocking-production-runner-used.convention.yaml +76 -0
- package/conventions/tester.bun/tester.bun.interlocking-route-coverage.convention.yaml +66 -0
- package/conventions/tester.bun/tester.bun.interlocking-smoke-coverage-for-station-master.convention.yaml +76 -0
- package/conventions/tester.bun/tester.bun.interlocking-trace-binds-declared-route.convention.yaml +74 -0
- package/conventions/tester.bun/tester.bun.interlocking-train-sequence-is-exercised.convention.yaml +77 -0
- package/conventions/tester.bun/tester.bun.red-behavioral-assertion.convention.yaml +51 -0
- package/conventions/tester.bun/tester.bun.red-fails-first.convention.yaml +52 -0
- package/conventions/tester.bun/tester.bun.routing-runtime-family.convention.yaml +41 -0
- package/conventions/tester.bun/tester.bun.security-auth.convention.yaml +46 -0
- package/conventions/tester.bun/tester.bun.security-input.convention.yaml +45 -0
- package/conventions/tester.bun/tester.bun.smoke-no-collaborator-substitution.convention.yaml +45 -0
- package/conventions/tester.bun/tester.bun.smoke-observable-assertion.convention.yaml +54 -0
- package/conventions/tester.bun/tester.bun.telemetry-emit.convention.yaml +46 -0
- package/conventions/tester.bun/tester.bun.test-carries-urn-identity.convention.yaml +51 -0
- package/conventions/tester.bun/tester.bun.test-imports-bun-test.convention.yaml +55 -0
- package/conventions/tester.bun/tester.bun.test-isolation-no-live-state.convention.yaml +50 -0
- package/conventions/tester.bun/tester.bun.test-no-self-skip.convention.yaml +46 -0
- package/conventions/tester.bun/tester.bun.test-phase-declared.convention.yaml +45 -0
- package/conventions/tester.htmx/tester.htmx.fragment-asserts-returned-markup.convention.yaml +52 -0
- package/conventions/tester.htmx/tester.htmx.swap-oob-asserts-destination-id.convention.yaml +48 -0
- package/conventions/tester.htmx/tester.htmx.verb-endpoint-coverage.convention.yaml +54 -0
- package/conventions/traceability/traceability.plan.executable-acceptance-has-test.convention.yaml +2 -0
- package/conventions/traceability/traceability.source.tested-by-present.convention.yaml +2 -0
- package/conventions/traceability/traceability.source.tested-by-resolves.convention.yaml +2 -0
- package/conventions/traceability/traceability.test.binding-resolves.convention.yaml +2 -0
- package/detectors/atdd_traceability_closure/atdd.implementation.yaml +8 -0
- package/detectors/atdd_traceability_closure/detect.mjs +84 -0
- package/detectors/atdd_traceability_closure/fixtures/clean/plan/orders/E001.yaml +4 -0
- package/detectors/atdd_traceability_closure/fixtures/clean/src/order.ts +4 -0
- package/detectors/atdd_traceability_closure/fixtures/clean/test/order.test.ts +4 -0
- package/detectors/atdd_traceability_closure/fixtures/dirty/plan/orders/E001.yaml +6 -0
- package/detectors/atdd_traceability_closure/fixtures/dirty/src/missing-test.ts +2 -0
- package/detectors/atdd_traceability_closure/fixtures/dirty/src/unknown-test.ts +4 -0
- package/detectors/atdd_traceability_closure/fixtures/dirty/test/bad-binding.test.ts +4 -0
- package/detectors/atdd_traceability_closure/fixtures/dirty/test/no-binding.test.ts +3 -0
- package/detectors/bun_clean_architecture_detector/atdd.implementation.yaml +42 -0
- package/detectors/bun_clean_architecture_detector/checks/_map.json +14 -0
- package/detectors/bun_clean_architecture_detector/checks/a_boundaries_http_client.mjs +36 -0
- package/detectors/bun_clean_architecture_detector/checks/a_commons_application_no_integration.mjs +37 -0
- package/detectors/bun_clean_architecture_detector/checks/a_commons_cross_feature.mjs +41 -0
- package/detectors/bun_clean_architecture_detector/checks/a_commons_domain_no_outbound.mjs +40 -0
- package/detectors/bun_clean_architecture_detector/checks/a_composition_consumer.mjs +33 -0
- package/detectors/bun_clean_architecture_detector/checks/a_composition_root.mjs +35 -0
- package/detectors/bun_clean_architecture_detector/checks/a_domain_no_framework.mjs +47 -0
- package/detectors/bun_clean_architecture_detector/checks/a_dto_mapper.mjs +31 -0
- package/detectors/bun_clean_architecture_detector/checks/a_dto_placement.mjs +30 -0
- package/detectors/bun_clean_architecture_detector/checks/a_dto_purity.mjs +59 -0
- package/detectors/bun_clean_architecture_detector/checks/a_hierarchy_import.mjs +48 -0
- package/detectors/bun_clean_architecture_detector/checks/a_layer_naming.mjs +41 -0
- package/detectors/bun_clean_architecture_detector/detect.mjs +46 -0
- package/detectors/bun_clean_architecture_detector/fixtures/clean/contracts/order.ts +5 -0
- package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/application/place.ts +3 -0
- package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/composition.ts +4 -0
- package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/domain/total.ts +2 -0
- package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/integration/order-mapper.ts +3 -0
- package/detectors/bun_clean_architecture_detector/fixtures/clean/features/orders/presentation/api.ts +3 -0
- package/detectors/bun_clean_architecture_detector/fixtures/dirty/commons/application/flow.ts +2 -0
- package/detectors/bun_clean_architecture_detector/fixtures/dirty/commons/domain/billing/rules.ts +1 -0
- package/detectors/bun_clean_architecture_detector/fixtures/dirty/commons/domain/orders/rules.ts +5 -0
- package/detectors/bun_clean_architecture_detector/fixtures/dirty/commons/integration/http.ts +1 -0
- package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/application/pay.ts +2 -0
- package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/domain/rules.ts +2 -0
- package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/helper.ts +1 -0
- package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/integration/client.ts +1 -0
- package/detectors/bun_clean_architecture_detector/fixtures/dirty/features/billing/presentation/api.ts +2 -0
- package/detectors/bun_fullstack_detector/atdd.implementation.yaml +23 -0
- package/detectors/bun_fullstack_detector/checks/_map.json +5 -0
- package/detectors/bun_fullstack_detector/checks/bun_runtime_server_is_bun_serve.mjs +39 -0
- package/detectors/bun_fullstack_detector/checks/bun_runtime_single_lockfile.mjs +40 -0
- package/detectors/bun_fullstack_detector/checks/bun_runtime_typecheck_enforced.mjs +133 -0
- package/detectors/bun_fullstack_detector/detect.mjs +46 -0
- package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_server_is_bun_serve/server.ts +7 -0
- package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_single_lockfile/bun.lock +1 -0
- package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_typecheck_enforced/package.json +5 -0
- package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_typecheck_enforced/server.ts +3 -0
- package/detectors/bun_fullstack_detector/fixtures/clean/bun_runtime_typecheck_enforced/tsconfig.json +1 -0
- package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_server_is_bun_serve/server.ts +5 -0
- package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_single_lockfile/bun.lock +1 -0
- package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_single_lockfile/package-lock.json +1 -0
- package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/package.json +4 -0
- package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/packages/second/index.ts +8 -0
- package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/packages/second/package.json +1 -0
- package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/server.ts +3 -0
- package/detectors/bun_fullstack_detector/fixtures/dirty/bun_runtime_typecheck_enforced/tsconfig.json +1 -0
- package/detectors/bun_green_traceability_detector/atdd.implementation.yaml +35 -0
- package/detectors/bun_green_traceability_detector/checks/_map.json +12 -0
- package/detectors/bun_green_traceability_detector/checks/green_header_order.mjs +24 -0
- package/detectors/bun_green_traceability_detector/checks/green_header_purpose.mjs +18 -0
- package/detectors/bun_green_traceability_detector/checks/green_header_runtime.mjs +25 -0
- package/detectors/bun_green_traceability_detector/checks/green_header_tested_by.mjs +15 -0
- package/detectors/bun_green_traceability_detector/checks/green_urn_layer.mjs +17 -0
- package/detectors/bun_green_traceability_detector/checks/green_urn_marker.mjs +18 -0
- package/detectors/bun_green_traceability_detector/checks/green_urn_name_matches.mjs +26 -0
- package/detectors/bun_green_traceability_detector/checks/green_urn_pattern.mjs +17 -0
- package/detectors/bun_green_traceability_detector/checks/green_urn_side.mjs +20 -0
- package/detectors/bun_green_traceability_detector/checks/green_urn_wagon_feature.mjs +20 -0
- package/detectors/bun_green_traceability_detector/detect.mjs +46 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_order/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_order/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_purpose/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_purpose/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_runtime/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_runtime/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_tested_by/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_header_tested_by/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_layer/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_layer/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_marker/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_marker/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_name_matches/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_name_matches/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_pattern/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_pattern/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_side/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_side/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_wagon_feature/OrderPanel.html +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/clean/green_urn_wagon_feature/OrderRow.ts +7 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_header_order/OrderRow.ts +6 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_header_purpose/OrderRow.ts +5 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_header_runtime/OrderRow.ts +6 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_header_tested_by/OrderPanel.html +5 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_layer/OrderRow.ts +6 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_marker/OrderRow.ts +3 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_name_matches/OrderRow.ts +6 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_pattern/OrderRow.ts +6 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_side/OrderRow.ts +6 -0
- package/detectors/bun_green_traceability_detector/fixtures/dirty/green_urn_wagon_feature/OrderRow.ts +6 -0
- package/detectors/bun_green_traceability_detector/urn_header.mjs +191 -0
- package/detectors/bun_interlocking_binding/atdd.implementation.yaml +31 -0
- package/detectors/bun_interlocking_binding/checks/interlocking_runtime_executes.mjs +168 -0
- package/detectors/bun_interlocking_binding/detect.mjs +608 -0
- package/detectors/bun_interlocking_binding/fixtures/clean/e2e/interlockings/match-resolution/trace.test.ts +10 -0
- package/detectors/bun_interlocking_binding/fixtures/clean/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_binding/fixtures/clean/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/clean/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/clean/server.ts +19 -0
- package/detectors/bun_interlocking_binding/fixtures/clean/src/trains/interlocking.ts +66 -0
- package/detectors/bun_interlocking_binding/fixtures/clean/src/trains/runner.ts +7 -0
- package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/e2e/interlockings/match-resolution/trace.test.ts +10 -0
- package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/plan/_trains/_interlockings/match-resolution.yaml +57 -0
- package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/server.ts +19 -0
- package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/src/trains/interlocking.ts +28 -0
- package/detectors/bun_interlocking_binding/fixtures/clean_flow_style_actions/src/trains/runner.ts +7 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty/e2e/interlockings/match-resolution/trace.test.ts +10 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty/server.ts +19 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty/src/trains/interlocking.ts +28 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty/src/trains/runner.ts +7 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/e2e/interlockings/match-resolution/trace.test.ts +10 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/plan/_trains/_interlockings/match-resolution.yaml +54 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/server.ts +19 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/src/trains/interlocking.ts +28 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_parallel_field/src/trains/runner.ts +7 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/e2e/interlockings/match-resolution/trace.test.ts +10 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/server.ts +19 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/src/trains/interlocking.ts +28 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_station_missing/src/trains/runner.ts +7 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/e2e/interlockings/match-resolution/trace.test.ts +19 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/server.ts +19 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/src/trains/interlocking.ts +28 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_trace_unbound/src/trains/runner.ts +7 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/e2e/interlockings/match-resolution/trace.test.ts +10 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/plan/_trains/train:match:match-resolution-standard.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/plan/_trains/train:match:match-resolution-timeout.yaml +4 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/server.ts +19 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/src/trains/interlocking.ts +30 -0
- package/detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/src/trains/runner.ts +7 -0
- package/detectors/bun_interlocking_coverage/_shared/interlocking.mjs +389 -0
- package/detectors/bun_interlocking_coverage/atdd.implementation.yaml +27 -0
- package/detectors/bun_interlocking_coverage/checks/_map.json +7 -0
- package/detectors/bun_interlocking_coverage/checks/interlocking_production_runner.mjs +82 -0
- package/detectors/bun_interlocking_coverage/checks/interlocking_route_coverage.mjs +58 -0
- package/detectors/bun_interlocking_coverage/checks/interlocking_smoke_coverage.mjs +68 -0
- package/detectors/bun_interlocking_coverage/checks/interlocking_trace_binds.mjs +64 -0
- package/detectors/bun_interlocking_coverage/checks/interlocking_train_sequence.mjs +110 -0
- package/detectors/bun_interlocking_coverage/detect.mjs +46 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_production_runner/e2e/interlockings/match-resolution/routes.test.ts +21 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_production_runner/e2e/interlockings/match-resolution/trace.test.ts +17 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_production_runner/e2e/smoke/resolve-match.smoke.test.ts +13 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_production_runner/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_route_coverage/e2e/interlockings/match-resolution/routes.test.ts +21 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_route_coverage/e2e/interlockings/match-resolution/trace.test.ts +17 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_route_coverage/e2e/smoke/resolve-match.smoke.test.ts +13 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_route_coverage/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage/e2e/interlockings/match-resolution/routes.test.ts +21 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage/e2e/interlockings/match-resolution/trace.test.ts +17 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage/e2e/smoke/resolve-match.smoke.test.ts +13 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage_module/e2e/interlockings/match-resolution/routes.test.ts +21 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage_module/e2e/interlockings/match-resolution/trace.test.ts +17 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage_module/e2e/smoke/resolve-match.smoke.test.ts +19 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_smoke_coverage_module/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_trace_binds/e2e/interlockings/match-resolution/routes.test.ts +21 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_trace_binds/e2e/interlockings/match-resolution/trace.test.ts +17 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_trace_binds/e2e/smoke/resolve-match.smoke.test.ts +13 -0
- package/detectors/bun_interlocking_coverage/fixtures/clean/interlocking_trace_binds/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_production_runner/e2e/interlockings/match-resolution/routes.test.ts +23 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_production_runner/e2e/interlockings/match-resolution/trace.test.ts +17 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_production_runner/e2e/smoke/resolve-match.smoke.test.ts +13 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_production_runner/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_route_coverage/e2e/interlockings/match-resolution/routes.test.ts +12 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_route_coverage/e2e/interlockings/match-resolution/trace.test.ts +17 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_route_coverage/e2e/smoke/resolve-match.smoke.test.ts +13 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_route_coverage/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_smoke_coverage/e2e/interlockings/match-resolution/routes.test.ts +21 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_smoke_coverage/e2e/interlockings/match-resolution/trace.test.ts +17 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_smoke_coverage/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_trace_binds/e2e/interlockings/match-resolution/routes.test.ts +21 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_trace_binds/e2e/interlockings/match-resolution/trace.test.ts +13 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_trace_binds/e2e/smoke/resolve-match.smoke.test.ts +13 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_trace_binds/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_train_sequence/e2e/interlockings/match-resolution/routes.test.ts +16 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_train_sequence/plan/_trains/_interlockings/match-resolution.yaml +51 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_train_sequence/plan/_trains/train:match:match-resolution-standard.yaml +8 -0
- package/detectors/bun_interlocking_coverage/fixtures/dirty/interlocking_train_sequence/plan/_trains/train:match:match-resolution-timeout.yaml +5 -0
- package/detectors/bun_interlocking_infrastructure/_shared/interlocking.mjs +477 -0
- package/detectors/bun_interlocking_infrastructure/atdd.implementation.yaml +32 -0
- package/detectors/bun_interlocking_infrastructure/checks/_map.json +10 -0
- package/detectors/bun_interlocking_infrastructure/checks/interlocking_delegates.mjs +70 -0
- package/detectors/bun_interlocking_infrastructure/checks/interlocking_no_cargo.mjs +62 -0
- package/detectors/bun_interlocking_infrastructure/checks/interlocking_resolution_model.mjs +64 -0
- package/detectors/bun_interlocking_infrastructure/checks/interlocking_runner_exists.mjs +73 -0
- package/detectors/bun_interlocking_infrastructure/checks/interlocking_station_routing.mjs +62 -0
- package/detectors/bun_interlocking_infrastructure/checks/journey_runner_boundary.mjs +153 -0
- package/detectors/bun_interlocking_infrastructure/checks/journey_station_routing.mjs +119 -0
- package/detectors/bun_interlocking_infrastructure/checks/wagon_contract_honoured.mjs +149 -0
- package/detectors/bun_interlocking_infrastructure/detect.mjs +46 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/server.ts +22 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/src/match/wagon.ts +6 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/src/trains/interlocking.ts +41 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_no_cargo/server.ts +22 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_no_cargo/src/match/wagon.ts +6 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_no_cargo/src/trains/interlocking.ts +41 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_no_cargo/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_resolution_model/server.ts +22 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_resolution_model/src/match/wagon.ts +6 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_resolution_model/src/trains/interlocking.ts +41 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_resolution_model/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_runner_exists/server.ts +22 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_runner_exists/src/match/wagon.ts +6 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_runner_exists/src/trains/interlocking.ts +41 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_runner_exists/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_station_routing/server.ts +22 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_station_routing/src/match/wagon.ts +6 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_station_routing/src/trains/interlocking.ts +41 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_station_routing/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_runner_boundary/plan/_journeys/example.yaml +16 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_runner_boundary/src/trains/journey.ts +15 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_station_routing/plan/_journeys/public.yaml +16 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_station_routing/server.ts +13 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/journey_station_routing/src/trains/journey.ts +14 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/wagon_contract_honoured/plan/orders/_orders.yaml +17 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/clean/wagon_contract_honoured/src/orders/wagon.ts +15 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_delegates/server.ts +22 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_delegates/src/match/wagon.ts +6 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_delegates/src/trains/interlocking.ts +49 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_delegates/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_no_cargo/server.ts +22 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_no_cargo/src/match/wagon.ts +11 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_no_cargo/src/trains/interlocking.ts +42 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_no_cargo/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_resolution_model/server.ts +22 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_resolution_model/src/match/wagon.ts +6 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_resolution_model/src/trains/interlocking.ts +21 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_resolution_model/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_runner_exists/server.ts +22 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_runner_exists/src/match/wagon.ts +6 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_runner_exists/src/trains/interlocking.ts +16 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_runner_exists/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_station_routing/server.ts +19 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_station_routing/src/match/wagon.ts +6 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_station_routing/src/trains/interlocking.ts +41 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_station_routing/src/trains/runner.ts +28 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_runner_boundary/plan/_journeys/example.yaml +16 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_runner_boundary/src/trains/journey.ts +14 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_station_routing/plan/_journeys/public.yaml +16 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_station_routing/server.ts +10 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_station_routing/src/trains/journey.ts +14 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/wagon_contract_honoured/plan/orders/_orders.yaml +17 -0
- package/detectors/bun_interlocking_infrastructure/fixtures/dirty/wagon_contract_honoured/src/orders/wagon.ts +13 -0
- package/detectors/bun_security_hygiene_detector/atdd.implementation.yaml +33 -0
- package/detectors/bun_security_hygiene_detector/checks/_map.json +9 -0
- package/detectors/bun_security_hygiene_detector/checks/err_bare_string.mjs +38 -0
- package/detectors/bun_security_hygiene_detector/checks/err_code_format.mjs +36 -0
- package/detectors/bun_security_hygiene_detector/checks/log_console.mjs +33 -0
- package/detectors/bun_security_hygiene_detector/checks/log_structured.mjs +36 -0
- package/detectors/bun_security_hygiene_detector/checks/sec_hardcoded_secret.mjs +43 -0
- package/detectors/bun_security_hygiene_detector/checks/sec_missing_auth.mjs +63 -0
- package/detectors/bun_security_hygiene_detector/checks/sec_sql_injection.mjs +56 -0
- package/detectors/bun_security_hygiene_detector/detect.mjs +46 -0
- package/detectors/bun_security_hygiene_detector/fixtures/clean/server.ts +24 -0
- package/detectors/bun_security_hygiene_detector/fixtures/dirty/db.ts +6 -0
- package/detectors/bun_security_hygiene_detector/fixtures/dirty/errors.ts +6 -0
- package/detectors/bun_security_hygiene_detector/fixtures/dirty/logging.ts +4 -0
- package/detectors/bun_security_hygiene_detector/fixtures/dirty/routes.ts +10 -0
- package/detectors/bun_security_hygiene_detector/fixtures/dirty/secrets.ts +3 -0
- package/detectors/bun_tester_discipline_detector/atdd.implementation.yaml +46 -0
- package/detectors/bun_tester_discipline_detector/checks/_map.json +18 -0
- package/detectors/bun_tester_discipline_detector/checks/t_acceptance_binding.mjs +19 -0
- package/detectors/bun_tester_discipline_detector/checks/t_acceptance_covers_tag.mjs +25 -0
- package/detectors/bun_tester_discipline_detector/checks/t_acceptance_resolves.mjs +106 -0
- package/detectors/bun_tester_discipline_detector/checks/t_isolation_no_live_state.mjs +40 -0
- package/detectors/bun_tester_discipline_detector/checks/t_red_behavioral.mjs +35 -0
- package/detectors/bun_tester_discipline_detector/checks/t_red_fails_first.mjs +30 -0
- package/detectors/bun_tester_discipline_detector/checks/t_routing_runtime.mjs +22 -0
- package/detectors/bun_tester_discipline_detector/checks/t_security_auth.mjs +26 -0
- package/detectors/bun_tester_discipline_detector/checks/t_security_input.mjs +25 -0
- package/detectors/bun_tester_discipline_detector/checks/t_smoke_no_substitution.mjs +25 -0
- package/detectors/bun_tester_discipline_detector/checks/t_smoke_observable.mjs +28 -0
- package/detectors/bun_tester_discipline_detector/checks/t_telemetry_emit.mjs +27 -0
- package/detectors/bun_tester_discipline_detector/checks/t_test_imports_bun_test.mjs +31 -0
- package/detectors/bun_tester_discipline_detector/checks/t_test_no_self_skip.mjs +34 -0
- package/detectors/bun_tester_discipline_detector/checks/t_test_phase_declared.mjs +21 -0
- package/detectors/bun_tester_discipline_detector/checks/t_urn_identity.mjs +18 -0
- package/detectors/bun_tester_discipline_detector/detect.mjs +46 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/audit.sec.test.ts +15 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/checkout.red.test.ts +16 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/emit.telemetry.test.ts +15 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/marked.red.test.ts +14 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/orders.smoke.test.ts +16 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/payload.input.test.ts +13 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E001.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E002.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E020.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E021.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E022.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/clean/plan/orders/E023.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/badcovers.test.ts +7 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/badphase.test.ts +6 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/foreign_harness.test.ts +6 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/happy.auth.test.ts +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/happy.input.test.ts +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/internal.smoke.test.ts +10 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/no_header.test.ts +2 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E004.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E005.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E006.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E007.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E008.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E009.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E010.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E024.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E025.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E026.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E027.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E028.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/plan/orders/E030.yaml +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/polluting.test.ts +11 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/quiet.telemetry.test.ts +9 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/skipped.test.ts +6 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/substituted.smoke.test.ts +13 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/unbound.test.ts +5 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/unmarked.red.test.ts +7 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/unresolvable_binding.test.ts +17 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/vacuous.red.test.ts +7 -0
- package/detectors/bun_tester_discipline_detector/fixtures/dirty/wrongruntime.test.ts +7 -0
- package/detectors/bun_tester_discipline_detector/test_header.mjs +160 -0
- package/detectors/bun_ts_metrics_detector/atdd.implementation.yaml +34 -0
- package/detectors/bun_ts_metrics_detector/checks/_map.json +9 -0
- package/detectors/bun_ts_metrics_detector/checks/ts_complexity_cyclomatic.mjs +36 -0
- package/detectors/bun_ts_metrics_detector/checks/ts_complexity_length.mjs +36 -0
- package/detectors/bun_ts_metrics_detector/checks/ts_complexity_nesting.mjs +36 -0
- package/detectors/bun_ts_metrics_detector/checks/ts_dead_code.mjs +58 -0
- package/detectors/bun_ts_metrics_detector/checks/ts_duplication.mjs +70 -0
- package/detectors/bun_ts_metrics_detector/checks/ts_quality_comments.mjs +30 -0
- package/detectors/bun_ts_metrics_detector/checks/ts_quality_mi.mjs +30 -0
- package/detectors/bun_ts_metrics_detector/detect.mjs +46 -0
- package/detectors/bun_ts_metrics_detector/fixtures/clean/domain/label.ts +6 -0
- package/detectors/bun_ts_metrics_detector/fixtures/clean/domain/total.ts +8 -0
- package/detectors/bun_ts_metrics_detector/fixtures/clean/index.ts +7 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/bare.ts +2 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/big.ts +600 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/consumer.ts +2 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/domain/a.ts +9 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/domain/b.ts +9 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/gnarly.ts +22 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/index.ts +8 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/long.ts +64 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/orphan.ts +1 -0
- package/detectors/bun_ts_metrics_detector/fixtures/dirty/typed.ts +1 -0
- package/detectors/bun_ts_metrics_detector/ts_metrics.mjs +310 -0
- package/detectors/htmx_hypermedia_detector/atdd.implementation.yaml +28 -0
- package/detectors/htmx_hypermedia_detector/checks/_map.json +9 -0
- package/detectors/htmx_hypermedia_detector/checks/htmx_fragment_escapes_interpolation.mjs +66 -0
- package/detectors/htmx_hypermedia_detector/checks/htmx_swap_no_inline_handler.mjs +40 -0
- package/detectors/htmx_hypermedia_detector/checks/htmx_swap_oob_carries_id.mjs +37 -0
- package/detectors/htmx_hypermedia_detector/checks/htmx_verb_destructive_confirms.mjs +36 -0
- package/detectors/htmx_hypermedia_detector/checks/htmx_verb_endpoint_is_routed.mjs +133 -0
- package/detectors/htmx_hypermedia_detector/checks/htmx_verb_endpoint_same_origin.mjs +33 -0
- package/detectors/htmx_hypermedia_detector/checks/htmx_verb_mutation_signals_progress.mjs +43 -0
- package/detectors/htmx_hypermedia_detector/detect.mjs +46 -0
- package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_fragment_escapes_interpolation/render.ts +6 -0
- package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_swap_no_inline_handler/row.html +1 -0
- package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_swap_oob_carries_id/fragment.html +1 -0
- package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_destructive_confirms/delete.html +1 -0
- package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_endpoint_is_routed/server.ts +10 -0
- package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_endpoint_is_routed/src/OrderRow.ts +7 -0
- package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_endpoint_same_origin/panel.html +3 -0
- package/detectors/htmx_hypermedia_detector/fixtures/clean/htmx_verb_mutation_signals_progress/form.html +4 -0
- package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_fragment_escapes_interpolation/render.ts +3 -0
- package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_swap_no_inline_handler/row.html +1 -0
- package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_swap_oob_carries_id/fragment.html +1 -0
- package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_destructive_confirms/delete.html +1 -0
- package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_endpoint_is_routed/server.ts +10 -0
- package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_endpoint_is_routed/src/OrderRow.ts +9 -0
- package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_endpoint_same_origin/panel.html +3 -0
- package/detectors/htmx_hypermedia_detector/fixtures/dirty/htmx_verb_mutation_signals_progress/form.html +3 -0
- package/detectors/htmx_tester_detector/atdd.implementation.yaml +21 -0
- package/detectors/htmx_tester_detector/checks/_map.json +5 -0
- package/detectors/htmx_tester_detector/checks/t_fragment_asserts_returned_markup.mjs +40 -0
- package/detectors/htmx_tester_detector/checks/t_swap_oob_asserts_destination_id.mjs +38 -0
- package/detectors/htmx_tester_detector/checks/t_verb_endpoint_coverage.mjs +59 -0
- package/detectors/htmx_tester_detector/detect.mjs +46 -0
- package/detectors/htmx_tester_detector/fixtures/clean/orders.test.ts +23 -0
- package/detectors/htmx_tester_detector/fixtures/clean/panel.html +7 -0
- package/detectors/htmx_tester_detector/fixtures/dirty/orders.test.ts +20 -0
- package/detectors/htmx_tester_detector/fixtures/dirty/panel.html +7 -0
- package/detectors/htmx_tester_detector/fixtures/dirty/statusonly.test.ts +9 -0
- package/detectors/htmx_tester_detector/test_header.mjs +4 -0
- package/detectors/planner_docs_capability/README.md +34 -0
- package/detectors/planner_docs_capability/atdd.implementation.yaml +57 -0
- package/detectors/planner_docs_capability/detect.mjs +10 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/decisions/index.adoc +7 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/architecture/state-store.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/archive/2025-control-root.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/archive/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/delivery/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/dist/index.md +1 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/purpose/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/clean/docs/purpose/worktrees.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/decisions/index.adoc +7 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/notes.md +3 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/architecture/state-store.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/archive/2025-control-root.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/archive/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/delivery/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/dist/index.md +1 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/purpose/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty/docs/purpose/worktrees.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/decisions/adr-20260906-002-documentation-system.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/decisions/index.adoc +7 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/architecture/state-store.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/archive/2025-control-root.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/archive/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/delivery/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/dist/index.md +1 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/purpose/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_adr_registry/docs/purpose/worktrees.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/decisions/index.adoc +7 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/architecture/state-store.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/archive/2025-control-root.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/archive/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/delivery/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/delivery/worktrees.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/dist/index.md +1 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/purpose/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_duplicate_id/docs/purpose/worktrees.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/decisions/index.adoc +7 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/architecture/state-store.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/archive/2025-control-root.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/archive/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/delivery/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/delivery/release.adoc +3 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/dist/index.md +1 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/purpose/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_identity/docs/purpose/worktrees.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/decisions/index.adoc +7 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/notes.md +3 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/architecture/state-store.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/archive/2025-control-root.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/archive/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/delivery/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/dist/index.md +1 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/purpose/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_markdown/docs/purpose/worktrees.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/decisions/index.adoc +7 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/architecture/state-store.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/archive/2025-control-root.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/archive/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/delivery/release.adoc +10 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/dist/index.md +1 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/purpose/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_missing_index/docs/purpose/worktrees.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/decisions/adr-20260906-001-shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/decisions/index.adoc +7 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/shared-control-root.adoc +8 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/architecture/state-store.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/archive/2025-control-root.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/archive/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/delivery/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/dist/index.md +1 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/purpose/index.adoc +5 -0
- package/detectors/planner_docs_capability/fixtures/dirty_unresolved_edge/docs/purpose/worktrees.adoc +5 -0
- package/detectors/planner_plan_integrity/atdd.implementation.yaml +18 -0
- package/detectors/planner_plan_integrity/detect.mjs +23 -0
- package/detectors/planner_plan_integrity/fixtures/clean/README.md +1 -0
- package/detectors/planner_plan_integrity/fixtures/dirty/plan/broken.yaml +1 -0
- package/detectors/planner_schema_validation/atdd.implementation.yaml +20 -0
- package/detectors/planner_schema_validation/detect.mjs +9 -0
- package/detectors/planner_schema_validation/fixtures/clean/contracts/_contracts.yaml +6 -0
- package/detectors/planner_schema_validation/fixtures/clean/contracts/orders/placed.schema.json +4 -0
- package/detectors/planner_schema_validation/fixtures/clean/plan/_themes.yaml +3 -0
- package/detectors/planner_schema_validation/fixtures/clean/plan/_trains/orders.yaml +11 -0
- package/detectors/planner_schema_validation/fixtures/clean/plan/orders/_orders.yaml +16 -0
- package/detectors/planner_schema_validation/fixtures/dirty/contracts/_contracts.yaml +3 -0
- package/detectors/planner_schema_validation/fixtures/dirty/plan/_themes.yaml +2 -0
- package/detectors/planner_schema_validation/fixtures/dirty/plan/_trains/orders.yaml +11 -0
- package/detectors/planner_static_validators/atdd.implementation.yaml +36 -0
- package/detectors/planner_static_validators/detect.mjs +9 -0
- package/detectors/planner_static_validators/fixtures/clean/contracts/_contracts.yaml +6 -0
- package/detectors/planner_static_validators/fixtures/clean/contracts/orders/placed.schema.json +4 -0
- package/detectors/planner_static_validators/fixtures/clean/plan/_themes.yaml +3 -0
- package/detectors/planner_static_validators/fixtures/clean/plan/orders/E001.yaml +10 -0
- package/detectors/planner_static_validators/fixtures/clean/plan/orders/_orders.yaml +19 -0
- package/detectors/planner_static_validators/fixtures/clean/plan/orders/features/place-order.yaml +4 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/_journeys/broken.yaml +22 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/_themes.yaml +3 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/_trains/_interlockings/journey-a.yaml +4 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/_trains/journey-a.yaml +7 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/_trains/probe/legacy.yaml +3 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/_trains/probe/orphan.yaml +3 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/_trains.yaml +5 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/also_dup/_also_dup.yaml +15 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/dup/E001.yaml +3 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/dup/_dup.yaml +27 -0
- package/detectors/planner_static_validators/fixtures/dirty/plan/dup/features/bad.yaml +2 -0
- package/lib/imports.mjs +83 -0
- package/lib/scan.mjs +246 -0
- package/package.json +35 -0
- package/planner-nodes/ENFORCEMENT_SCOPE.yaml +117 -0
- package/planner-nodes/nodes/planner.acceptance.abstract-fields-required.convention.yaml +44 -0
- package/planner-nodes/nodes/planner.acceptance.authoring-guidelines.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.acceptance.boundary-kind-vocabulary.convention.yaml +38 -0
- package/planner-nodes/nodes/planner.acceptance.execution-kind.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.acceptance.extraction-no-inference.convention.yaml +23 -0
- package/planner-nodes/nodes/planner.acceptance.generator-prompts.convention.yaml +34 -0
- package/planner-nodes/nodes/planner.acceptance.given-when-then-structure.convention.yaml +53 -0
- package/planner-nodes/nodes/planner.acceptance.harness-vocabulary.convention.yaml +99 -0
- package/planner-nodes/nodes/planner.acceptance.harness.convention.yaml +36 -0
- package/planner-nodes/nodes/planner.acceptance.hermetic-fake-contract.convention.yaml +35 -0
- package/planner-nodes/nodes/planner.acceptance.id-pattern.convention.yaml +34 -0
- package/planner-nodes/nodes/planner.acceptance.max-per-wmbt.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.acceptance.plane-keywords.convention.yaml +87 -0
- package/planner-nodes/nodes/planner.acceptance.route-construction.convention.yaml +55 -0
- package/planner-nodes/nodes/planner.acceptance.signal-telemetry-naming.convention.yaml +61 -0
- package/planner-nodes/nodes/planner.acceptance.urn-generation.convention.yaml +39 -0
- package/planner-nodes/nodes/planner.acceptance.well-formed.convention.yaml +57 -0
- package/planner-nodes/nodes/planner.appendix.llm-guidelines.convention.yaml +81 -0
- package/planner-nodes/nodes/planner.appendix.naming-pattern.convention.yaml +45 -0
- package/planner-nodes/nodes/planner.appendix.storage.convention.yaml +44 -0
- package/planner-nodes/nodes/planner.appendix.structure.convention.yaml +17 -0
- package/planner-nodes/nodes/planner.appendix.types.convention.yaml +123 -0
- package/planner-nodes/nodes/planner.artifact-naming.anti-patterns.convention.yaml +31 -0
- package/planner-nodes/nodes/planner.artifact-naming.cardinality-from-aspect.convention.yaml +32 -0
- package/planner-nodes/nodes/planner.artifact-naming.colon-for-hierarchy.convention.yaml +25 -0
- package/planner-nodes/nodes/planner.artifact-naming.contract-file-mapping.convention.yaml +26 -0
- package/planner-nodes/nodes/planner.artifact-naming.depth-guidelines.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.artifact-naming.dot-for-variant.convention.yaml +25 -0
- package/planner-nodes/nodes/planner.artifact-naming.logical-physical-mapping.convention.yaml +36 -0
- package/planner-nodes/nodes/planner.artifact-naming.migration-guide.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.artifact-naming.naming-pattern.convention.yaml +44 -0
- package/planner-nodes/nodes/planner.artifact-naming.path-mirrors-identity.convention.yaml +40 -0
- package/planner-nodes/nodes/planner.artifact-naming.planner-artifacts-use-stable.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.artifact-naming.pluralization.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.artifact-naming.schema-identifier.convention.yaml +31 -0
- package/planner-nodes/nodes/planner.artifact-naming.separator-semantics.convention.yaml +42 -0
- package/planner-nodes/nodes/planner.artifact-naming.theme-first-identity.convention.yaml +39 -0
- package/planner-nodes/nodes/planner.artifact-naming.urn-structure.convention.yaml +26 -0
- package/planner-nodes/nodes/planner.artifact-naming.validation-rules.convention.yaml +33 -0
- package/planner-nodes/nodes/planner.artifact-naming.verb-object-corpus-drift.convention.yaml +49 -0
- package/planner-nodes/nodes/planner.artifact.definition.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.component.artifact-derivation.convention.yaml +139 -0
- package/planner-nodes/nodes/planner.component.business-focus.convention.yaml +65 -0
- package/planner-nodes/nodes/planner.component.count-limit.convention.yaml +64 -0
- package/planner-nodes/nodes/planner.component.derivation.convention.yaml +117 -0
- package/planner-nodes/nodes/planner.component.io-alignment.convention.yaml +65 -0
- package/planner-nodes/nodes/planner.component.layer-assignment.convention.yaml +83 -0
- package/planner-nodes/nodes/planner.component.layer-consistency.convention.yaml +91 -0
- package/planner-nodes/nodes/planner.component.method-limit.convention.yaml +35 -0
- package/planner-nodes/nodes/planner.component.structure.convention.yaml +77 -0
- package/planner-nodes/nodes/planner.component.type-catalog.convention.yaml +436 -0
- package/planner-nodes/nodes/planner.component.urn.convention.yaml +86 -0
- package/planner-nodes/nodes/planner.contract.registry-coherence.convention.yaml +36 -0
- package/planner-nodes/nodes/planner.convention.remedy-must-be-followable.convention.yaml +92 -0
- package/planner-nodes/nodes/planner.coverage.bidirectional-coverage-between-trains.convention.yaml +33 -0
- package/planner-nodes/nodes/planner.coverage.bidirectional-coverage-between-wagons.convention.yaml +33 -0
- package/planner-nodes/nodes/planner.coverage.coverage-graph.convention.yaml +31 -0
- package/planner-nodes/nodes/planner.coverage.every-wmbt-must-be.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.coverage.every-wmbt-must-have.convention.yaml +33 -0
- package/planner-nodes/nodes/planner.coverage.exception-handling.convention.yaml +32 -0
- package/planner-nodes/nodes/planner.criteria.defaults.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.criteria.harness-templates.convention.yaml +159 -0
- package/planner-nodes/nodes/planner.criteria.metric-mapping.convention.yaml +136 -0
- package/planner-nodes/nodes/planner.criteria.plane-keywords.convention.yaml +53 -0
- package/planner-nodes/nodes/planner.criteria.sequence-routing.convention.yaml +26 -0
- package/planner-nodes/nodes/planner.criteria.shape.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.decomposition.canonical-steps.convention.yaml +14 -0
- package/planner-nodes/nodes/planner.decomposition.document-trouble-obligation.convention.yaml +12 -0
- package/planner-nodes/nodes/planner.decomposition.domain-vs-technology.convention.yaml +13 -0
- package/planner-nodes/nodes/planner.decomposition.jtbd-vs-odi-grammar.convention.yaml +18 -0
- package/planner-nodes/nodes/planner.decomposition.keep-pivot-kill.convention.yaml +23 -0
- package/planner-nodes/nodes/planner.decomposition.local-scope.convention.yaml +15 -0
- package/planner-nodes/nodes/planner.decomposition.natural-language-normalization.convention.yaml +12 -0
- package/planner-nodes/nodes/planner.decomposition.train-journey.convention.yaml +13 -0
- package/planner-nodes/nodes/planner.decomposition.wagon-rationale.convention.yaml +12 -0
- package/planner-nodes/nodes/planner.definition.anchor-required.convention.yaml +34 -0
- package/planner-nodes/nodes/planner.feature.artifact-seeded-naming.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.feature.definition.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.feature.estimation.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.feature.feedback-loop-close-the-loop.convention.yaml +33 -0
- package/planner-nodes/nodes/planner.feature.feedback-loop-kind.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.feature.feedback-loop-suppression.convention.yaml +23 -0
- package/planner-nodes/nodes/planner.feature.footprint-scoring.convention.yaml +119 -0
- package/planner-nodes/nodes/planner.feature.grouping-strategy.convention.yaml +37 -0
- package/planner-nodes/nodes/planner.feature.hard-limits.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.feature.name-is-verb-object.convention.yaml +40 -0
- package/planner-nodes/nodes/planner.feature.shape.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.feature.size-max-rule.convention.yaml +41 -0
- package/planner-nodes/nodes/planner.feature.urn-naming.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.feature.validation-rules.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.feature.verb-selection-by-artifact-type.convention.yaml +264 -0
- package/planner-nodes/nodes/planner.feature.wagon-link.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.interface.api-mapping.convention.yaml +70 -0
- package/planner-nodes/nodes/planner.interface.artifact-transformation.convention.yaml +103 -0
- package/planner-nodes/nodes/planner.interface.contract-urn.convention.yaml +119 -0
- package/planner-nodes/nodes/planner.interface.naming-patterns.convention.yaml +73 -0
- package/planner-nodes/nodes/planner.interface.orphan-detection.convention.yaml +46 -0
- package/planner-nodes/nodes/planner.interface.ownership-rules.convention.yaml +54 -0
- package/planner-nodes/nodes/planner.interface.structure-rules.convention.yaml +112 -0
- package/planner-nodes/nodes/planner.interface.tests-subdirectory.convention.yaml +61 -0
- package/planner-nodes/nodes/planner.interlocking.definition.convention.yaml +36 -0
- package/planner-nodes/nodes/planner.interlocking.registry-mirrors-document.convention.yaml +38 -0
- package/planner-nodes/nodes/planner.issue-body.dependency-entries-must-be-classified.convention.yaml +21 -0
- package/planner-nodes/nodes/planner.issue-body.graph-context-required.convention.yaml +21 -0
- package/planner-nodes/nodes/planner.journey.continuation-closure.convention.yaml +51 -0
- package/planner-nodes/nodes/planner.journey.definition.convention.yaml +39 -0
- package/planner-nodes/nodes/planner.plan.confirm-before-author.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.plan.confirm-binds-an-issue.convention.yaml +39 -0
- package/planner-nodes/nodes/planner.plan.confirm-requires-interlocking-sanity.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.plan.granularity-completeness.convention.yaml +38 -0
- package/planner-nodes/nodes/planner.plan.session-lifecycle.convention.yaml +23 -0
- package/planner-nodes/nodes/planner.plan.spec-is-schema-valid.convention.yaml +61 -0
- package/planner-nodes/nodes/planner.relationship.no-orphan-nodes.convention.yaml +32 -0
- package/planner-nodes/nodes/planner.smoke.feedback-loop-close-the-loop.convention.yaml +39 -0
- package/planner-nodes/nodes/planner.smoke.synthetic-fixture-bypass.convention.yaml +44 -0
- package/planner-nodes/nodes/planner.steps.architecture-routing.convention.yaml +109 -0
- package/planner-nodes/nodes/planner.steps.jtbd-taxonomy.convention.yaml +227 -0
- package/planner-nodes/nodes/planner.steps.linguistic-patterns.convention.yaml +81 -0
- package/planner-nodes/nodes/planner.steps.sequence.convention.yaml +17 -0
- package/planner-nodes/nodes/planner.subject.invariants.convention.yaml +34 -0
- package/planner-nodes/nodes/planner.theme.definition.convention.yaml +23 -0
- package/planner-nodes/nodes/planner.theme.must-be-canonical.convention.yaml +38 -0
- package/planner-nodes/nodes/planner.theme.theme-zero-mandatory.convention.yaml +39 -0
- package/planner-nodes/nodes/planner.theme.urn-namespace-matches.convention.yaml +34 -0
- package/planner-nodes/nodes/planner.train.acceptance-commit-failures-covered.convention.yaml +10 -0
- package/planner-nodes/nodes/planner.train.acceptances.convention.yaml +85 -0
- package/planner-nodes/nodes/planner.train.artifact-flow.convention.yaml +31 -0
- package/planner-nodes/nodes/planner.train.categories.convention.yaml +34 -0
- package/planner-nodes/nodes/planner.train.definition.convention.yaml +34 -0
- package/planner-nodes/nodes/planner.train.dependencies.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.train.dispatch-composite-key-exceptional.convention.yaml +17 -0
- package/planner-nodes/nodes/planner.train.dispatch-map-is-registry.convention.yaml +17 -0
- package/planner-nodes/nodes/planner.train.family-matches-terminal-contract.convention.yaml +17 -0
- package/planner-nodes/nodes/planner.train.family.convention.yaml +17 -0
- package/planner-nodes/nodes/planner.train.initial-cargo-inputs-declared.convention.yaml +10 -0
- package/planner-nodes/nodes/planner.train.interlocking-does-not-carry-cargo.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.train.interlocking-entrypoint-shape.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.train.interlocking-fragment-acceptance-binding.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.train.interlocking-guard-coverage.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.train.interlocking-guard-grammar.convention.yaml +31 -0
- package/planner-nodes/nodes/planner.train.interlocking-home.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.train.interlocking-message-payload-typed.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.train.interlocking-payload-contract-body-required.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.train.interlocking-payload-contract-registered.convention.yaml +31 -0
- package/planner-nodes/nodes/planner.train.interlocking-projection-equivalence.convention.yaml +32 -0
- package/planner-nodes/nodes/planner.train.interlocking-route-category-matches-train-id.convention.yaml +32 -0
- package/planner-nodes/nodes/planner.train.interlocking-route-resolution-deterministic.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.train.interlocking-structural-residual-explicit.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.train.interlocking-wmbt-surface-or-residual.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.train.linearity.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.train.naming.convention.yaml +26 -0
- package/planner-nodes/nodes/planner.train.participants.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.train.production-implementation.convention.yaml +24 -0
- package/planner-nodes/nodes/planner.train.registry-coherence.convention.yaml +69 -0
- package/planner-nodes/nodes/planner.train.registry.convention.yaml +39 -0
- package/planner-nodes/nodes/planner.train.route-category-assessment.convention.yaml +43 -0
- package/planner-nodes/nodes/planner.train.route-space-admission.convention.yaml +41 -0
- package/planner-nodes/nodes/planner.train.scope.convention.yaml +38 -0
- package/planner-nodes/nodes/planner.train.sequence.convention.yaml +34 -0
- package/planner-nodes/nodes/planner.train.terminal-contract.convention.yaml +10 -0
- package/planner-nodes/nodes/planner.train.theme-alignment.convention.yaml +25 -0
- package/planner-nodes/nodes/planner.train.theme-orchestrator-urn.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.train.theme-ranges.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.train.validation-rules.convention.yaml +31 -0
- package/planner-nodes/nodes/planner.train.variation-strategies.convention.yaml +26 -0
- package/planner-nodes/nodes/planner.wagon.artifact-contracts.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.wagon.complexity-model.convention.yaml +33 -0
- package/planner-nodes/nodes/planner.wagon.coupling-complexity.convention.yaml +32 -0
- package/planner-nodes/nodes/planner.wagon.definition.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.wagon.features-format.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.wagon.features.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.wagon.logical-vs-filesystem-naming.convention.yaml +34 -0
- package/planner-nodes/nodes/planner.wagon.name-is-verb-object.convention.yaml +39 -0
- package/planner-nodes/nodes/planner.wagon.no-consume-cycle.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.wagon.produce-consume-artifacts.convention.yaml +46 -0
- package/planner-nodes/nodes/planner.wagon.refinement-extraction.convention.yaml +49 -0
- package/planner-nodes/nodes/planner.wagon.semantic-coherence.convention.yaml +30 -0
- package/planner-nodes/nodes/planner.wagon.separability.convention.yaml +33 -0
- package/planner-nodes/nodes/planner.wagon.slug-dirname-conversion.convention.yaml +26 -0
- package/planner-nodes/nodes/planner.wagon.telemetry-filesystem.convention.yaml +52 -0
- package/planner-nodes/nodes/planner.wagon.urn-naming.convention.yaml +28 -0
- package/planner-nodes/nodes/planner.wagon.urn.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.wmbt.context-clarifier.convention.yaml +24 -0
- package/planner-nodes/nodes/planner.wmbt.definition.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.wmbt.dimension-selection.convention.yaml +37 -0
- package/planner-nodes/nodes/planner.wmbt.direction-selection.convention.yaml +41 -0
- package/planner-nodes/nodes/planner.wmbt.filename-pattern.convention.yaml +27 -0
- package/planner-nodes/nodes/planner.wmbt.lens-selection.convention.yaml +44 -0
- package/planner-nodes/nodes/planner.wmbt.must-have-smoke-acceptance.convention.yaml +55 -0
- package/planner-nodes/nodes/planner.wmbt.object-of-control.convention.yaml +26 -0
- package/planner-nodes/nodes/planner.wmbt.shape.convention.yaml +29 -0
- package/planner-nodes/nodes/planner.wmbt.splitting-rules.convention.yaml +37 -0
- package/planner-nodes/nodes/planner.wmbt.statement-template.convention.yaml +23 -0
- package/planner-nodes/nodes/planner.wmbt.step-code-vocabulary.convention.yaml +31 -0
- package/planner-nodes/nodes/planner.wmbt.urn-naming.convention.yaml +31 -0
- package/planner-schemas/acceptance.schema.json +396 -0
- package/planner-schemas/appendix.schema.json +78 -0
- package/planner-schemas/author/convention-node.schema.json +134 -0
- package/planner-schemas/author/gate.schema.json +36 -0
- package/planner-schemas/author/issue.schema.json +72 -0
- package/planner-schemas/author/relationship.schema.json +19 -0
- package/planner-schemas/author/scope.schema.json +28 -0
- package/planner-schemas/binding-lock.schema.json +38 -0
- package/planner-schemas/component.schema.json +114 -0
- package/planner-schemas/contract-registry.schema.json +47 -0
- package/planner-schemas/feature.schema.json +208 -0
- package/planner-schemas/journey.schema.json +225 -0
- package/planner-schemas/registry-index.schema.json +54 -0
- package/planner-schemas/substrate-lock.schema.json +41 -0
- package/planner-schemas/substrate.schema.json +38 -0
- package/planner-schemas/theme-registry.schema.json +28 -0
- package/planner-schemas/train-interlocking-registry.schema.json +49 -0
- package/planner-schemas/train-interlocking.schema.json +459 -0
- package/planner-schemas/train.schema.json +361 -0
- package/planner-schemas/wagon.schema.json +283 -0
- package/planner-schemas/wmbt.schema.json +68 -0
- package/src/ci.ts +9 -0
- package/src/cli.ts +91 -0
- package/src/docs-capability.ts +156 -0
- package/src/enforce.ts +103 -0
- package/src/hooks.ts +48 -0
- package/src/index.ts +13 -0
- package/src/planner-kernel.ts +112 -0
- package/src/planner-schema-validator.ts +101 -0
- package/src/planner-validators.ts +288 -0
- package/src/register.ts +8 -0
- package/src/release.ts +9 -0
- package/src/setup.ts +15 -0
- package/templates/github/atdd-bun-release.yml +16 -0
- package/templates/github/atdd-bun.yml +26 -0
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Detector: coder.bun.interlocking-bilateral-binding (disposition: strict, severity 1)
|
|
3
|
+
//
|
|
4
|
+
// Bun/TS realization of the core python `interlocking_binding.py` detector — the single EXTENSION
|
|
5
|
+
// obligation that makes train interlocking SYSTEMIC. An interlocking system requires CLOSURE across
|
|
6
|
+
// declaration (the interlocking YAML route space, core afokapu/atdd#1248), runtime resolution
|
|
7
|
+
// (InterlockingRunner, #1251), Station Master reachability (the server.ts JOURNEY_MAP), TrainRunner
|
|
8
|
+
// delegation, and the execution trace. This detector emits RAW v1.1 violations under ONE rule_id for
|
|
9
|
+
// any of FIVE binding directions that is broken, plus a schema-drift signal for a parallel reachability
|
|
10
|
+
// field that forks core #1248's `entrypoint`:
|
|
11
|
+
//
|
|
12
|
+
// declaration_to_runtime — every declared route's train artifact exists (runtime can resolve it).
|
|
13
|
+
// runtime_to_declaration — the runtime never resolves a routeId/trainId absent from the loaded YAML.
|
|
14
|
+
// station_to_declaration — every JOURNEY_MAP {interlockingId, path} mapping points to an existing YAML.
|
|
15
|
+
// declaration_to_station — every exposed interlocking is reachable via a declared entrypoint.action.
|
|
16
|
+
// trace_to_declaration — every asserted trace routeId/interlockingId binds back to a declared route.
|
|
17
|
+
// parallel_reachability_field — a forked reachability field is rejected as schema drift.
|
|
18
|
+
//
|
|
19
|
+
// CONTRACT (atdd.workspace.bun v1.1): reads ATDD_SCAN_ROOTS, writes RAW
|
|
20
|
+
// {rule_id,file,line,col,evidence,source_line} violations to ATDD_VIOLATIONS_REPORT, exits 0.
|
|
21
|
+
// Zero third-party deps — node builtins only. The plan/_trains interlocking YAML route space is
|
|
22
|
+
// stack-neutral planner data (snake_case, core #1248); the runtime + JOURNEY_MAP + trace are Bun/TS.
|
|
23
|
+
|
|
24
|
+
import { readFileSync, writeFileSync, statSync, readdirSync } from "node:fs";
|
|
25
|
+
import { scanExecution } from "./checks/interlocking_runtime_executes.mjs";
|
|
26
|
+
import { join, sep, resolve } from "node:path";
|
|
27
|
+
|
|
28
|
+
const RULE = "coder.bun.interlocking-bilateral-binding";
|
|
29
|
+
const DEFAULT_EXCLUDES = ["_generated", "node_modules", "dist", "build", ".next"];
|
|
30
|
+
const PARALLEL_FIELDS = ["entrypoints", "runtime_exposure", "station_actions", "exposed_actions", "reachability"];
|
|
31
|
+
|
|
32
|
+
// ── generic IO / masking ─────────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
function readText(p) {
|
|
35
|
+
try {
|
|
36
|
+
return readFileSync(p, "utf8");
|
|
37
|
+
} catch {
|
|
38
|
+
return "";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function parseJsonEnv(name, fallback) {
|
|
43
|
+
const raw = process.env[name];
|
|
44
|
+
if (!raw) return fallback;
|
|
45
|
+
try {
|
|
46
|
+
const v = JSON.parse(raw);
|
|
47
|
+
return Array.isArray(v) ? v : fallback;
|
|
48
|
+
} catch {
|
|
49
|
+
return fallback;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function lineOfIndex(text, idx) {
|
|
54
|
+
return text.slice(0, idx).split("\n").length;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function lineAt(text, lineno) {
|
|
58
|
+
const lines = text.split(/\r?\n/);
|
|
59
|
+
return lineno >= 1 && lineno <= lines.length ? lines[lineno - 1].trim() : "";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Blank `//` and `/* */` comments to spaces (offsets/newlines preserved); keep string literals.
|
|
63
|
+
function maskComments(text) {
|
|
64
|
+
const out = text.split("");
|
|
65
|
+
const n = text.length;
|
|
66
|
+
let i = 0;
|
|
67
|
+
let state = "code";
|
|
68
|
+
while (i < n) {
|
|
69
|
+
const c = text[i];
|
|
70
|
+
const d = i + 1 < n ? text[i + 1] : "";
|
|
71
|
+
if (state === "code") {
|
|
72
|
+
if (c === "/" && d === "/") { out[i] = out[i + 1] = " "; i += 2; state = "line"; continue; }
|
|
73
|
+
if (c === "/" && d === "*") { out[i] = out[i + 1] = " "; i += 2; state = "block"; continue; }
|
|
74
|
+
if (c === "'") { i++; state = "sq"; continue; }
|
|
75
|
+
if (c === '"') { i++; state = "dq"; continue; }
|
|
76
|
+
if (c === "`") { i++; state = "tpl"; continue; }
|
|
77
|
+
i++;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (state === "line") { if (c === "\n") state = "code"; else out[i] = " "; i++; continue; }
|
|
81
|
+
if (state === "block") { if (c === "*" && d === "/") { out[i] = out[i + 1] = " "; i += 2; state = "code"; continue; } if (c !== "\n") out[i] = " "; i++; continue; }
|
|
82
|
+
if (state === "sq" || state === "dq") { const q = state === "sq" ? "'" : '"'; if (c === "\\") { i += 2; continue; } if (c === q) state = "code"; i++; continue; }
|
|
83
|
+
if (c === "\\") { i += 2; continue; }
|
|
84
|
+
if (c === "`") { state = "code"; i++; continue; }
|
|
85
|
+
i++;
|
|
86
|
+
}
|
|
87
|
+
return out.join("");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ── consumer-tree + scope discovery ──────────────────────────────────────────
|
|
91
|
+
|
|
92
|
+
// The caller's excludes, merged with the defaults. core passes ATDD_SCAN_EXCLUDES
|
|
93
|
+
// (it carries `.atdd/workspaces`, among others) and cli/scan.py and adapter/run.py
|
|
94
|
+
// both merge it in; this family read only its own DEFAULT_EXCLUDES and discarded it.
|
|
95
|
+
// Matching follows lib/scan.mjs: a whole path segment OR a substring, so a
|
|
96
|
+
// multi-segment glob like `.atdd/workspaces` can match at all — segment-only
|
|
97
|
+
// comparison could never match one.
|
|
98
|
+
const SCAN_EXCLUDES = (() => {
|
|
99
|
+
let extra = [];
|
|
100
|
+
try {
|
|
101
|
+
const raw = process.env.ATDD_SCAN_EXCLUDES;
|
|
102
|
+
if (raw) {
|
|
103
|
+
const v = JSON.parse(raw);
|
|
104
|
+
if (Array.isArray(v)) extra = v.filter((x) => typeof x === "string");
|
|
105
|
+
}
|
|
106
|
+
} catch {
|
|
107
|
+
/* malformed env must not silence the scan */
|
|
108
|
+
}
|
|
109
|
+
return [...new Set([...DEFAULT_EXCLUDES, ...extra])];
|
|
110
|
+
})();
|
|
111
|
+
|
|
112
|
+
function isExcluded(path) {
|
|
113
|
+
const segments = path.split(sep);
|
|
114
|
+
return SCAN_EXCLUDES.some((ex) => segments.includes(ex) || path.includes(ex));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function hasChildDir(dir, name) {
|
|
118
|
+
try {
|
|
119
|
+
return statSync(join(dir, name)).isDirectory();
|
|
120
|
+
} catch {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function* walkDirs(root) {
|
|
126
|
+
let st;
|
|
127
|
+
try {
|
|
128
|
+
st = statSync(root);
|
|
129
|
+
} catch {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (!st.isDirectory()) return;
|
|
133
|
+
yield root;
|
|
134
|
+
for (const name of readdirSync(root)) {
|
|
135
|
+
const full = join(root, name);
|
|
136
|
+
if (isExcluded(full)) continue;
|
|
137
|
+
let cst;
|
|
138
|
+
try {
|
|
139
|
+
cst = statSync(full);
|
|
140
|
+
} catch {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (cst.isDirectory()) yield* walkDirs(full);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function findConsumerRoots(scanRoot) {
|
|
148
|
+
const roots = new Set();
|
|
149
|
+
for (const d of walkDirs(scanRoot)) {
|
|
150
|
+
if (hasChildDir(d, "src") || hasChildDir(d, "plan") || hasChildDir(d, "e2e")) roots.add(d);
|
|
151
|
+
}
|
|
152
|
+
return [...roots];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function* walkFiles(dir, pred) {
|
|
156
|
+
let st;
|
|
157
|
+
try {
|
|
158
|
+
st = statSync(dir);
|
|
159
|
+
} catch {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (st.isFile()) {
|
|
163
|
+
if (pred(dir)) yield dir;
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
for (const name of readdirSync(dir)) {
|
|
167
|
+
const full = join(dir, name);
|
|
168
|
+
if (isExcluded(full)) continue;
|
|
169
|
+
let cst;
|
|
170
|
+
try {
|
|
171
|
+
cst = statSync(full);
|
|
172
|
+
} catch {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (cst.isDirectory()) yield* walkFiles(full, pred);
|
|
176
|
+
else if (pred(full)) yield full;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const isYaml = (f) => f.endsWith(".yaml") || f.endsWith(".yml");
|
|
181
|
+
const isTs = (f) => f.endsWith(".ts") || f.endsWith(".tsx");
|
|
182
|
+
|
|
183
|
+
function interlockingFiles(croot) {
|
|
184
|
+
const base = join(croot, "plan", "_trains", "_interlockings");
|
|
185
|
+
const out = [...walkFiles(base, isYaml)];
|
|
186
|
+
const idx = join(croot, "plan", "_trains", "_interlockings.yaml");
|
|
187
|
+
try {
|
|
188
|
+
if (statSync(idx).isFile()) out.push(idx);
|
|
189
|
+
} catch {
|
|
190
|
+
/* absent */
|
|
191
|
+
}
|
|
192
|
+
return [...new Set(out)].sort();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function runtimeFiles(croot) {
|
|
196
|
+
return [...walkFiles(join(croot, "src", "trains"), isTs)].sort();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function e2eFiles(croot) {
|
|
200
|
+
return [...walkFiles(join(croot, "e2e"), isTs)].sort();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// The Station Master is the module that DECLARES a JOURNEY_MAP, not a file with a
|
|
204
|
+
// particular name. This was `join(croot, "server.ts")`, which made the rule and
|
|
205
|
+
// coder.bun.dead-code-reachability mutually unsatisfiable: ts_metrics only treats
|
|
206
|
+
// index/wagon/composition/main/app as structural roots, so a consumer whose Station
|
|
207
|
+
// Master is server.ts had its whole feature tree reported dead, and renaming it to
|
|
208
|
+
// app.ts made the Station Master invisible here. No filename satisfied both. Named
|
|
209
|
+
// files are still checked first, so the common layout costs no extra walking.
|
|
210
|
+
function appFile(croot) {
|
|
211
|
+
for (const name of ["server.ts", "app.ts", "main.ts", "index.ts"]) {
|
|
212
|
+
const p = join(croot, name);
|
|
213
|
+
try {
|
|
214
|
+
if (statSync(p).isFile() && /\bJOURNEY_MAP\b/.test(readText(p))) return p;
|
|
215
|
+
} catch {
|
|
216
|
+
/* absent */
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
for (const f of walkFiles(croot, isTs)) {
|
|
220
|
+
if (/\bJOURNEY_MAP\b/.test(readText(f))) return f;
|
|
221
|
+
}
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function rel(path, root) {
|
|
226
|
+
const r = root.endsWith(sep) ? root : root + sep;
|
|
227
|
+
return path.startsWith(r) ? path.slice(r.length) : path;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// ── interlocking YAML parse (CONSUMES core #1248 fields; snake_case planner data) ─────────────
|
|
231
|
+
|
|
232
|
+
function parseInterlocking(text) {
|
|
233
|
+
const lines = text.split(/\r?\n/);
|
|
234
|
+
const idM = text.match(/^interlocking_id:\s*["']?([^"'#\n]+?)["']?\s*(?:#.*)?$/m);
|
|
235
|
+
if (!idM) return null;
|
|
236
|
+
const interlockingId = idM[1].trim();
|
|
237
|
+
|
|
238
|
+
const routes = [];
|
|
239
|
+
const ri = lines.findIndex((l) => /^routes:\s*(?:#.*)?$/.test(l));
|
|
240
|
+
if (ri >= 0) {
|
|
241
|
+
for (let i = ri + 1; i < lines.length; i++) {
|
|
242
|
+
const l = lines[i];
|
|
243
|
+
if (/^\S/.test(l)) break; // dedent to a new top-level key ends the routes block
|
|
244
|
+
const rm = l.match(/^\s*-\s*route_id:\s*["']?([^"'#\n]+?)["']?\s*(?:#.*)?$/);
|
|
245
|
+
if (rm) {
|
|
246
|
+
routes.push({ routeId: rm[1].trim(), line: i + 1, sourceLine: l, trainId: null, trainPath: null });
|
|
247
|
+
} else if (routes.length) {
|
|
248
|
+
const cur = routes[routes.length - 1];
|
|
249
|
+
const tm = l.match(/^\s*train_id:\s*["']?([^"'#\n]+?)["']?\s*(?:#.*)?$/);
|
|
250
|
+
if (tm) cur.trainId = tm[1].trim();
|
|
251
|
+
const pm = l.match(/^\s*train_path:\s*["']?([^"'#\n]+?)["']?\s*(?:#.*)?$/);
|
|
252
|
+
if (pm) cur.trainPath = pm[1].trim();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (!routes.length) return null;
|
|
257
|
+
|
|
258
|
+
let exposed = false;
|
|
259
|
+
const actions = [];
|
|
260
|
+
const ei = lines.findIndex((l) => /^entrypoint:\s*(?:#.*)?$/.test(l));
|
|
261
|
+
if (ei >= 0) {
|
|
262
|
+
for (let i = ei + 1; i < lines.length; i++) {
|
|
263
|
+
const l = lines[i];
|
|
264
|
+
if (/^\S/.test(l)) break; // dedent ends the entrypoint block
|
|
265
|
+
if (/^\s*exposed:\s*true\b/.test(l)) exposed = true;
|
|
266
|
+
// FLOW STYLE TOO: `actions: [resolve_match, other]`.
|
|
267
|
+
//
|
|
268
|
+
// The interlocking YAML is stack-neutral planner data and flow sequences are
|
|
269
|
+
// ordinary YAML. Python reads it with a real parser and accepts both; this
|
|
270
|
+
// hand-rolled line scanner accepted only block style, so the SAME plan file
|
|
271
|
+
// was judged differently depending on which stack read it — and the verdict
|
|
272
|
+
// was "exposed interlocking is not Station-Master-reachable", a strict
|
|
273
|
+
// blocking finding, against a consumer whose YAML was perfectly valid.
|
|
274
|
+
// Found by running this provider against a Bun consumer written from scratch.
|
|
275
|
+
const flow = l.match(/^\s*actions:\s*\[([^\]]*)\]\s*(?:#.*)?$/);
|
|
276
|
+
if (flow) {
|
|
277
|
+
for (const raw of flow[1].split(",")) {
|
|
278
|
+
const a = raw.trim().replace(/^["']|["']$/g, "");
|
|
279
|
+
if (a) actions.push(a);
|
|
280
|
+
}
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
if (/^\s*actions:\s*(?:#.*)?$/.test(l)) {
|
|
284
|
+
for (let j = i + 1; j < lines.length; j++) {
|
|
285
|
+
const am = lines[j].match(/^\s*-\s*["']?([^"'#\n]+?)["']?\s*(?:#.*)?$/);
|
|
286
|
+
if (am) actions.push(am[1].trim());
|
|
287
|
+
else break;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const parallelFields = PARALLEL_FIELDS.filter((f) => new RegExp("^\\s*" + f + "\\s*:", "m").test(text));
|
|
294
|
+
return { interlockingId, routes, exposed, actions, parallelFields, rawText: text };
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// ── Station Master JOURNEY_MAP parse (server.ts) ─────────────────────────
|
|
298
|
+
|
|
299
|
+
function parseJourneyMap(rawText) {
|
|
300
|
+
const text = maskComments(rawText);
|
|
301
|
+
const m = /\bJOURNEY_MAP\b[^=]*=\s*\{/.exec(text);
|
|
302
|
+
if (!m) return {};
|
|
303
|
+
const open = m.index + m[0].length - 1;
|
|
304
|
+
let depth = 0;
|
|
305
|
+
let close = -1;
|
|
306
|
+
for (let i = open; i < text.length; i++) {
|
|
307
|
+
const c = text[i];
|
|
308
|
+
if (c === "{") depth++;
|
|
309
|
+
else if (c === "}") {
|
|
310
|
+
depth--;
|
|
311
|
+
if (depth === 0) {
|
|
312
|
+
close = i;
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
const bodyStart = open + 1;
|
|
318
|
+
const body = text.slice(bodyStart, close < 0 ? text.length : close);
|
|
319
|
+
const out = {};
|
|
320
|
+
let re = /(?:([A-Za-z_$][\w$]*)|"([^"]+)"|'([^']+)')\s*:\s*\{([^{}]*)\}/g;
|
|
321
|
+
let mm;
|
|
322
|
+
while ((mm = re.exec(body)) !== null) {
|
|
323
|
+
const action = mm[1] || mm[2] || mm[3];
|
|
324
|
+
const inner = mm[4];
|
|
325
|
+
const idm = inner.match(/interlockingId\s*:\s*["']([^"']+)["']/);
|
|
326
|
+
const pm = inner.match(/path\s*:\s*["']([^"']+)["']/);
|
|
327
|
+
if (idm || pm) {
|
|
328
|
+
out[action] = {
|
|
329
|
+
kind: "interlocking",
|
|
330
|
+
interlockingId: idm ? idm[1] : null,
|
|
331
|
+
path: pm ? pm[1] : null,
|
|
332
|
+
line: lineOfIndex(rawText, bodyStart + mm.index),
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
re = /(?:([A-Za-z_$][\w$]*)|"([^"]+)"|'([^']+)')\s*:\s*["']([^"']+)["']\s*[,}]/g;
|
|
337
|
+
while ((mm = re.exec(body)) !== null) {
|
|
338
|
+
const action = mm[1] || mm[2] || mm[3];
|
|
339
|
+
if (!(action in out)) {
|
|
340
|
+
out[action] = { kind: "direct", trainId: mm[4], line: lineOfIndex(rawText, bodyStart + mm.index) };
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return out;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// Resolution-output object properties the runtime sets (core #1251 InterlockingResolution).
|
|
347
|
+
function runtimeResolutionLiterals(rawText) {
|
|
348
|
+
const text = maskComments(rawText);
|
|
349
|
+
const out = [];
|
|
350
|
+
let re = /\brouteId\s*:\s*["']([^"']+)["']/g;
|
|
351
|
+
let m;
|
|
352
|
+
while ((m = re.exec(text)) !== null) out.push({ kind: "route", value: m[1], line: lineOfIndex(rawText, m.index) });
|
|
353
|
+
re = /\b(?:trainId|selectedTrainId)\s*:\s*["']([^"']+)["']/g;
|
|
354
|
+
while ((m = re.exec(text)) !== null) out.push({ kind: "train", value: m[1], line: lineOfIndex(rawText, m.index) });
|
|
355
|
+
return out;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
const TRACE_OBJECT = /\btrace\b/;
|
|
359
|
+
// Matches both a bare `trace.routeId === "X"` / `trace["routeId"] === "X"` comparison AND the
|
|
360
|
+
// vitest/jest `expect(trace.routeId).toBe("X")` / `.toEqual(...)` / `.toStrictEqual(...)` form.
|
|
361
|
+
const TRACE_ASSERT =
|
|
362
|
+
/trace\s*(?:\.\s*(routeId|interlockingId)|\[\s*["'](routeId|interlockingId)["']\s*\])\s*(?:===?\s*|\)\s*\.\s*to(?:Be|Equal|StrictEqual)\s*\(\s*)["']([^"']+)["']/g;
|
|
363
|
+
|
|
364
|
+
// ── violation helper ─────────────────────────────────────────────────────────
|
|
365
|
+
|
|
366
|
+
function mk(file, line, direction, detail, sourceLine) {
|
|
367
|
+
return { rule_id: RULE, file, line, col: 0, evidence: `${direction}: ${detail}`, source_line: sourceLine };
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function trainArtifactExists(croot, route) {
|
|
371
|
+
if (route.trainPath) {
|
|
372
|
+
try {
|
|
373
|
+
return statSync(join(croot, route.trainPath)).isFile();
|
|
374
|
+
} catch {
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (route.trainId) {
|
|
379
|
+
try {
|
|
380
|
+
return statSync(join(croot, "plan", "_trains", `${route.trainId}.yaml`)).isFile();
|
|
381
|
+
} catch {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return false;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// ── per-consumer-tree scan ───────────────────────────────────────────────────
|
|
389
|
+
|
|
390
|
+
function scanConsumerRoot(croot) {
|
|
391
|
+
const records = [];
|
|
392
|
+
for (const f of interlockingFiles(croot)) {
|
|
393
|
+
const rec = parseInterlocking(readText(f));
|
|
394
|
+
if (rec) records.push({ file: f, ...rec });
|
|
395
|
+
}
|
|
396
|
+
const runtime = runtimeFiles(croot).map((f) => ({ file: f, text: readText(f) }));
|
|
397
|
+
const app = appFile(croot);
|
|
398
|
+
const appText = app ? readText(app) : "";
|
|
399
|
+
const journey = app ? parseJourneyMap(appText) : {};
|
|
400
|
+
const e2e = e2eFiles(croot).map((f) => ({ file: f, text: readText(f) }));
|
|
401
|
+
|
|
402
|
+
const enabled =
|
|
403
|
+
records.length > 0 ||
|
|
404
|
+
runtime.some((r) => /InterlockingRunner|InterlockingResolution/.test(r.text));
|
|
405
|
+
if (!enabled) return [];
|
|
406
|
+
|
|
407
|
+
const declaredRoutes = new Set(records.flatMap((r) => r.routes.map((x) => x.routeId)));
|
|
408
|
+
const declaredTrains = new Set(records.flatMap((r) => r.routes.map((x) => x.trainId).filter(Boolean)));
|
|
409
|
+
const declaredIds = new Set(records.map((r) => r.interlockingId));
|
|
410
|
+
const violations = [];
|
|
411
|
+
|
|
412
|
+
// 1. declaration_to_runtime
|
|
413
|
+
for (const rec of records) {
|
|
414
|
+
for (const route of rec.routes) {
|
|
415
|
+
if (trainArtifactExists(croot, route)) continue;
|
|
416
|
+
const target = route.trainPath || (route.trainId ? `plan/_trains/${route.trainId}.yaml` : "<no train_id>");
|
|
417
|
+
violations.push(
|
|
418
|
+
mk(
|
|
419
|
+
rel(rec.file, croot),
|
|
420
|
+
route.line,
|
|
421
|
+
"declaration_to_runtime",
|
|
422
|
+
`declared route "${route.routeId}" of interlocking "${rec.interlockingId}" is not runtime-resolvable: ` +
|
|
423
|
+
`its train artifact "${target}" does not exist, so InterlockingRunner -> TrainRunner cannot resolve it`,
|
|
424
|
+
route.sourceLine.trim(),
|
|
425
|
+
),
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// 2. runtime_to_declaration (no hidden routes)
|
|
431
|
+
for (const { file, text } of runtime) {
|
|
432
|
+
if (!/InterlockingResolution|resolveTrain/.test(text)) continue;
|
|
433
|
+
for (const lit of runtimeResolutionLiterals(text)) {
|
|
434
|
+
const declared = lit.kind === "route" ? declaredRoutes : declaredTrains;
|
|
435
|
+
if (declared.has(lit.value)) continue;
|
|
436
|
+
const label = lit.kind === "route" ? "routeId" : "trainId";
|
|
437
|
+
violations.push(
|
|
438
|
+
mk(
|
|
439
|
+
rel(file, croot),
|
|
440
|
+
lit.line,
|
|
441
|
+
"runtime_to_declaration",
|
|
442
|
+
`InterlockingRunner resolves ${label} "${lit.value}" which is declared in no interlocking YAML ` +
|
|
443
|
+
`(hidden route); every resolved route/train must come from the loaded route space`,
|
|
444
|
+
lineAt(text, lit.line),
|
|
445
|
+
),
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// 3. station_to_declaration (mappings point to existing YAML)
|
|
451
|
+
if (app) {
|
|
452
|
+
for (const [action, mapping] of Object.entries(journey)) {
|
|
453
|
+
if (mapping.kind !== "interlocking") continue;
|
|
454
|
+
if (mapping.path) {
|
|
455
|
+
let exists = false;
|
|
456
|
+
try {
|
|
457
|
+
exists = statSync(join(croot, mapping.path)).isFile();
|
|
458
|
+
} catch {
|
|
459
|
+
exists = false;
|
|
460
|
+
}
|
|
461
|
+
if (!exists) {
|
|
462
|
+
violations.push(
|
|
463
|
+
mk(
|
|
464
|
+
rel(app, croot),
|
|
465
|
+
mapping.line,
|
|
466
|
+
"station_to_declaration",
|
|
467
|
+
`Station Master action "${action}" maps to interlocking path "${mapping.path}" which does not ` +
|
|
468
|
+
`exist; the mapping must point to a real interlocking YAML`,
|
|
469
|
+
lineAt(appText, mapping.line),
|
|
470
|
+
),
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
if (mapping.interlockingId && !declaredIds.has(mapping.interlockingId)) {
|
|
475
|
+
violations.push(
|
|
476
|
+
mk(
|
|
477
|
+
rel(app, croot),
|
|
478
|
+
mapping.line,
|
|
479
|
+
"station_to_declaration",
|
|
480
|
+
`Station Master action "${action}" maps to interlockingId "${mapping.interlockingId}" which is ` +
|
|
481
|
+
`declared by no interlocking YAML in the route space`,
|
|
482
|
+
lineAt(appText, mapping.line),
|
|
483
|
+
),
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// 4. declaration_to_station (exposed interlockings are reachable)
|
|
490
|
+
for (const rec of records) {
|
|
491
|
+
if (!rec.exposed) continue;
|
|
492
|
+
const reachable = rec.actions.some((action) => {
|
|
493
|
+
const mapping = journey[action];
|
|
494
|
+
if (!mapping || mapping.kind !== "interlocking") return false;
|
|
495
|
+
if (mapping.interlockingId === rec.interlockingId) return true;
|
|
496
|
+
if (mapping.path && resolve(join(croot, mapping.path)) === resolve(rec.file)) return true;
|
|
497
|
+
return false;
|
|
498
|
+
});
|
|
499
|
+
if (reachable) continue;
|
|
500
|
+
const m = /^\s*exposed:\s*true\b.*$/m.exec(rec.rawText);
|
|
501
|
+
const line = m ? lineOfIndex(rec.rawText, m.index) : 1;
|
|
502
|
+
const actions = rec.actions.join(", ") || "<none>";
|
|
503
|
+
violations.push(
|
|
504
|
+
mk(
|
|
505
|
+
rel(rec.file, croot),
|
|
506
|
+
line,
|
|
507
|
+
"declaration_to_station",
|
|
508
|
+
`interlocking "${rec.interlockingId}" has entrypoint.exposed:true but is not Station-Master-reachable: ` +
|
|
509
|
+
`none of its entrypoint.actions [${actions}] is wired into JOURNEY_MAP to this interlocking ` +
|
|
510
|
+
`(core afokapu/atdd#1248 entrypoint.exposed/actions)`,
|
|
511
|
+
m ? m[0].trim() : "",
|
|
512
|
+
),
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// schema drift — parallel reachability field
|
|
517
|
+
for (const rec of records) {
|
|
518
|
+
for (const field of rec.parallelFields) {
|
|
519
|
+
const m = new RegExp("^\\s*" + field + "\\s*:.*$", "m").exec(rec.rawText);
|
|
520
|
+
const line = m ? lineOfIndex(rec.rawText, m.index) : 1;
|
|
521
|
+
violations.push(
|
|
522
|
+
mk(
|
|
523
|
+
rel(rec.file, croot),
|
|
524
|
+
line,
|
|
525
|
+
"parallel_reachability_field",
|
|
526
|
+
`interlocking "${rec.interlockingId}" declares a parallel reachability field "${field}"; reachability ` +
|
|
527
|
+
`is owned by core afokapu/atdd#1248's \`entrypoint\` (exposed/actions/reason) — this extension must ` +
|
|
528
|
+
`not fork it (schema drift)`,
|
|
529
|
+
m ? m[0].trim() : "",
|
|
530
|
+
),
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// 5. trace_to_declaration (trace binds back to source YAML)
|
|
536
|
+
for (const { file, text } of e2e) {
|
|
537
|
+
if (!TRACE_OBJECT.test(text)) continue;
|
|
538
|
+
TRACE_ASSERT.lastIndex = 0;
|
|
539
|
+
let m;
|
|
540
|
+
while ((m = TRACE_ASSERT.exec(text)) !== null) {
|
|
541
|
+
const field = m[1] || m[2];
|
|
542
|
+
const value = m[3];
|
|
543
|
+
const declared = field === "interlockingId" ? declaredIds : declaredRoutes;
|
|
544
|
+
if (declared.has(value)) continue;
|
|
545
|
+
const line = lineOfIndex(text, m.index);
|
|
546
|
+
// ANCHORED AT THE DECLARATION, NOT THE TEST — deliberately.
|
|
547
|
+
//
|
|
548
|
+
// This is a CODER rule, and this provider's persona doctrine
|
|
549
|
+
// (conformance/test_persona_scoping.py) is that a coder family never REPORTS
|
|
550
|
+
// on a test file: a consumer adopting atdd.extension.coder.bun without the
|
|
551
|
+
// tester extension would otherwise see a coder rule_id land on a .test.ts,
|
|
552
|
+
// which is the cross-contamination that stops the two extensions being
|
|
553
|
+
// adopted and ratcheted independently.
|
|
554
|
+
//
|
|
555
|
+
// Nothing is lost. The finding is a statement about CLOSURE of the declared
|
|
556
|
+
// route space — "something asserts a route this space does not contain" — so
|
|
557
|
+
// the route space is the honest anchor, and the offending test file and line
|
|
558
|
+
// are named in the evidence. Reading the test is fine; reporting on it is not.
|
|
559
|
+
const anchor = interlockingPathFor(croot, value, field) || rel(file, croot);
|
|
560
|
+
violations.push(
|
|
561
|
+
mk(
|
|
562
|
+
anchor,
|
|
563
|
+
anchor === rel(file, croot) ? line : 1,
|
|
564
|
+
"trace_to_declaration",
|
|
565
|
+
`interlocking trace test "${rel(file, croot)}" (line ${line}) asserts trace.${field} === ` +
|
|
566
|
+
`"${value}", which resolves to no declared ` +
|
|
567
|
+
`${field === "interlockingId" ? "interlocking" : "route"} in the YAML route space; the trace must ` +
|
|
568
|
+
`bind the executed route back to its declaration`,
|
|
569
|
+
lineAt(text, line),
|
|
570
|
+
),
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
return violations;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
// The declaration this closure statement is about: the interlocking route space.
|
|
580
|
+
// Used to anchor trace_to_declaration findings at the YAML rather than at a test file
|
|
581
|
+
// (see the note at the report site). Falls back to null when no route space is found,
|
|
582
|
+
// in which case the caller keeps its original anchor.
|
|
583
|
+
function interlockingPathFor(croot, _value, _field) {
|
|
584
|
+
const files = interlockingFiles(croot);
|
|
585
|
+
return files.length ? rel(files[0], croot) : null;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
function main() {
|
|
589
|
+
const reportPath = process.env.ATDD_VIOLATIONS_REPORT;
|
|
590
|
+
if (!reportPath) {
|
|
591
|
+
process.stderr.write("bun-interlocking-binding: ATDD_VIOLATIONS_REPORT not set\n");
|
|
592
|
+
process.exit(2);
|
|
593
|
+
}
|
|
594
|
+
const roots = parseJsonEnv("ATDD_SCAN_ROOTS", []);
|
|
595
|
+
const violations = [];
|
|
596
|
+
for (const scanRoot of roots) {
|
|
597
|
+
for (const croot of findConsumerRoots(scanRoot)) violations.push(...scanConsumerRoot(croot));
|
|
598
|
+
// coder.bun.runtime-executes-the-declaration — no longer staged. This family is
|
|
599
|
+
// monolithic rather than checks/-collecting, so it is called here rather than
|
|
600
|
+
// discovered.
|
|
601
|
+
violations.push(...scanExecution(scanRoot));
|
|
602
|
+
}
|
|
603
|
+
writeFileSync(reportPath, JSON.stringify({ violations }, null, 2), "utf8");
|
|
604
|
+
process.stderr.write(`bun-interlocking-binding: ${violations.length} violation(s)\n`);
|
|
605
|
+
process.exit(0);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
main();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Trace-binding e2e test — asserts the captured trace binds back to the declared route.
|
|
2
|
+
import { dispatch } from "../../../convex/app";
|
|
3
|
+
|
|
4
|
+
test("resolve_match trace binds the declared route", () => {
|
|
5
|
+
const result: any = dispatch("resolve_match", { allPlayersVoted: true });
|
|
6
|
+
const trace = result.trace;
|
|
7
|
+
expect(trace.interlockingId).toBe("interlocking:match-resolution");
|
|
8
|
+
expect(trace.routeId).toBe("nominal-all-voted");
|
|
9
|
+
expect(trace.selectedTrainId).toBe("train:match:match-resolution-standard");
|
|
10
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Interlocking route space (core afokapu/atdd#1248) — stack-neutral planner data (snake_case).
|
|
2
|
+
# Authoritative for the guarded routes; the runtime + Station Master + trace bind to it.
|
|
3
|
+
schema_version: 1.0.0
|
|
4
|
+
interlocking_id: interlocking:match-resolution
|
|
5
|
+
title: Match resolution route interlocking
|
|
6
|
+
status: checked
|
|
7
|
+
|
|
8
|
+
entrypoint:
|
|
9
|
+
surfaces: [backend]
|
|
10
|
+
exposed: true
|
|
11
|
+
actions:
|
|
12
|
+
- resolve_match
|
|
13
|
+
reason: null
|
|
14
|
+
|
|
15
|
+
route_resolution:
|
|
16
|
+
strategy: fail_on_multiple_match
|
|
17
|
+
|
|
18
|
+
routes:
|
|
19
|
+
- route_id: nominal-all-voted
|
|
20
|
+
priority: 1
|
|
21
|
+
projection:
|
|
22
|
+
expected_sequence_digest: "d285d26427cb21fedb4c5b56edc673743f6d63c85686bdeb37f5e8c5ed4736d8"
|
|
23
|
+
category: nominal
|
|
24
|
+
guard_ref: guard:all-voted
|
|
25
|
+
train_id: train:match:match-resolution-standard
|
|
26
|
+
train_path: plan/_trains/train:match:match-resolution-standard.yaml
|
|
27
|
+
- route_id: alternate-timeout
|
|
28
|
+
priority: 2
|
|
29
|
+
projection:
|
|
30
|
+
expected_sequence_digest: "417c29734ac10c6a6c9a59dc3c568011aa9bdf4bc46e753f351657679d791672"
|
|
31
|
+
category: alternate
|
|
32
|
+
guard_ref: guard:timer-expires
|
|
33
|
+
train_id: train:match:match-resolution-timeout
|
|
34
|
+
train_path: plan/_trains/train:match:match-resolution-timeout.yaml
|
|
35
|
+
|
|
36
|
+
theme: match-resolution
|
|
37
|
+
lifelines:
|
|
38
|
+
- ref: user:actor
|
|
39
|
+
- ref: wagon:match-resolution
|
|
40
|
+
messages:
|
|
41
|
+
- id: msg:match-resolution-request
|
|
42
|
+
kind: boundary
|
|
43
|
+
from: user:actor
|
|
44
|
+
to: wagon:match-resolution
|
|
45
|
+
intent: The actor requests Match Resolution
|
|
46
|
+
payload:
|
|
47
|
+
contract: match-resolution:request-v1
|
|
48
|
+
|
|
49
|
+
source:
|
|
50
|
+
path: official/atdd.workspace.bun/implementations/bun_interlocking_binding/fixtures/clean/plan/_trains/_interlockings/match-resolution.yaml
|
|
51
|
+
content_digest: "0d98b0a851213e2e3a02e660b0f4ede23dfedd3d0595ea1d612b5ad41d40b2af"
|