@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,112 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
3
|
+
import { join, relative, resolve } from "node:path";
|
|
4
|
+
|
|
5
|
+
export type PlanKind = "wagon" | "feature" | "wmbt" | "acceptance" | "train" | "interlocking" | "journey" | "contract";
|
|
6
|
+
export type PlanFinding = { rule_id: string; file: string; evidence: string };
|
|
7
|
+
export type PlanArtifact = { kind: PlanKind; id: string; file: string; data: Record<string, unknown> };
|
|
8
|
+
export type PlanGraph = { artifacts: PlanArtifact[]; findings: PlanFinding[] };
|
|
9
|
+
|
|
10
|
+
const typedKinds: Record<string, PlanKind> = { wagon: "wagon", feature: "feature", wmbt: "wmbt", acc: "acceptance", train: "train", interlocking: "interlocking", journey: "journey", contract: "contract" };
|
|
11
|
+
const id = (value: unknown) => typeof value === "string" ? value : "";
|
|
12
|
+
const finding = (rule_id: string, file: string, evidence: string): PlanFinding => ({ rule_id, file, evidence });
|
|
13
|
+
|
|
14
|
+
async function walk(root: string): Promise<string[]> {
|
|
15
|
+
if (!existsSync(root)) return [];
|
|
16
|
+
const entries = await readdir(root, { withFileTypes: true });
|
|
17
|
+
return (await Promise.all(entries.map(async entry => {
|
|
18
|
+
const path = join(root, entry.name);
|
|
19
|
+
return entry.isDirectory() ? walk(path) : entry.isFile() && /\.(?:yaml|yml|json)$/.test(entry.name) ? [path] : [];
|
|
20
|
+
}))).flat().sort();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function kindOf(data: Record<string, unknown>, path: string): PlanKind | null {
|
|
24
|
+
if (id(data.journey_id)) return "journey";
|
|
25
|
+
if (id(data.interlocking_id)) return "interlocking";
|
|
26
|
+
const urn = id(data.urn); if (urn) { const prefix = urn.split(":", 1)[0]; return typedKinds[prefix] ?? null; }
|
|
27
|
+
if (id(data.train_id)) return "train";
|
|
28
|
+
if (Array.isArray(data.participants) && Array.isArray(data.routes)) return "interlocking";
|
|
29
|
+
if ("wagon" in data) return "wagon";
|
|
30
|
+
if ("$id" in data && id(data.$id).startsWith("contract:")) return "contract";
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function artifactId(kind: PlanKind, data: Record<string, unknown>): string {
|
|
35
|
+
if (kind === "wagon") return id(data.urn) || (id(data.wagon) ? `wagon:${id(data.wagon)}` : "");
|
|
36
|
+
if (kind === "train") return id(data.train_id) || id(data.urn);
|
|
37
|
+
if (kind === "contract") return id(data.$id);
|
|
38
|
+
if (kind === "interlocking") return id(data.interlocking_id);
|
|
39
|
+
if (kind === "journey") return id(data.journey_id);
|
|
40
|
+
return id(data.urn) || id(data.id);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function values(value: unknown): unknown[] { return Array.isArray(value) ? value : value && typeof value === "object" ? Object.values(value as Record<string, unknown>) : []; }
|
|
44
|
+
function typedRefs(value: unknown): string[] {
|
|
45
|
+
if (typeof value === "string") return [...value.matchAll(/\b(?:wagon|feature|wmbt|acc|train|interlocking|journey|contract):[a-z][a-z0-9-]*(?::[A-Za-z0-9._-]+)*/g)].map(match => match[0]);
|
|
46
|
+
if (!value || typeof value !== "object") return [];
|
|
47
|
+
return Object.values(value as Record<string, unknown>).flatMap(typedRefs);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function structuralRefs(artifact: PlanArtifact): string[] {
|
|
51
|
+
const data = artifact.data, out: string[] = [];
|
|
52
|
+
const add = (value: unknown) => { if (typeof value === "string" && /^(?:wagon|feature|wmbt|acc|train|interlocking|journey|contract):/.test(value)) out.push(value); };
|
|
53
|
+
if (artifact.kind === "wagon") for (const feature of values(data.features)) add(feature && typeof feature === "object" ? (feature as Record<string, unknown>).urn : feature);
|
|
54
|
+
if (artifact.kind === "feature") { add(data.wagon); for (const wmbt of values(data.wmbts)) add(wmbt); }
|
|
55
|
+
if (artifact.kind === "train") { const source = data.source_interlocking; if (source && typeof source === "object") add((source as Record<string, unknown>).interlocking_id); for (const participant of values(data.participants)) add(participant); for (const step of values(data.sequence)) if (step && typeof step === "object") { add((step as Record<string, unknown>).from); add((step as Record<string, unknown>).to); } }
|
|
56
|
+
if (artifact.kind === "interlocking") { for (const life of values(data.lifelines)) add(life && typeof life === "object" ? (life as Record<string, unknown>).ref : life); for (const message of values(data.messages)) if (message && typeof message === "object") { const record = message as Record<string, unknown>; add(record.from); add(record.to); for (const wmbt of values(record.wmbt_refs)) add(wmbt); } for (const route of values(data.routes)) if (route && typeof route === "object") add((route as Record<string, unknown>).train_id); }
|
|
57
|
+
if (artifact.kind === "journey") {
|
|
58
|
+
const entrypoint = data.entrypoint; if (entrypoint && typeof entrypoint === "object") add((entrypoint as Record<string, unknown>).interlocking_id);
|
|
59
|
+
for (const continuation of values(data.continuations)) if (continuation && typeof continuation === "object") { const record = continuation as Record<string, unknown>; const from = record.from, to = record.to; if (from && typeof from === "object") add((from as Record<string, unknown>).interlocking_id); if (to && typeof to === "object") add((to as Record<string, unknown>).interlocking_id); }
|
|
60
|
+
for (const terminal of values(data.terminals)) if (terminal && typeof terminal === "object") { const from = (terminal as Record<string, unknown>).from; if (from && typeof from === "object") add((from as Record<string, unknown>).interlocking_id); }
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Load plan artifacts with Bun's native YAML parser. It is read-only and deliberately
|
|
66
|
+
* excludes authoring/session/store behavior from ATDD core. */
|
|
67
|
+
export async function loadPlan(root = process.cwd()): Promise<PlanGraph> {
|
|
68
|
+
const absolute = resolve(root), plan = join(absolute, "plan"), artifacts: PlanArtifact[] = [], findings: PlanFinding[] = [];
|
|
69
|
+
for (const path of await walk(plan)) {
|
|
70
|
+
const file = relative(absolute, path).replaceAll("\\", "/");
|
|
71
|
+
try {
|
|
72
|
+
const text = await readFile(path, "utf8"); const data = path.endsWith(".json") ? JSON.parse(text) : Bun.YAML.parse(text);
|
|
73
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) continue;
|
|
74
|
+
const record = data as Record<string, unknown>, kind = kindOf(record, file); if (!kind) continue;
|
|
75
|
+
const artifact = artifactId(kind, record); if (!artifact) { findings.push(finding("planner.kernel.identity-required", file, `${kind} artifact has no canonical identity`)); continue; }
|
|
76
|
+
artifacts.push({ kind, id: artifact, file, data: record });
|
|
77
|
+
if (kind === "wmbt") for (const acceptance of values(record.acceptances)) {
|
|
78
|
+
if (!acceptance || typeof acceptance !== "object") { findings.push(finding("planner.kernel.acceptance-well-formed", file, "acceptance must be an object")); continue; }
|
|
79
|
+
const identity = (acceptance as { identity?: { urn?: unknown } }).identity; const acceptanceId = identity && typeof identity === "object" ? id((identity as { urn?: unknown }).urn) : "";
|
|
80
|
+
if (!acceptanceId.startsWith("acc:")) findings.push(finding("planner.kernel.acceptance-well-formed", file, "embedded acceptance has no acc: identity.urn"));
|
|
81
|
+
else artifacts.push({ kind: "acceptance", id: acceptanceId, file, data: acceptance as Record<string, unknown> });
|
|
82
|
+
}
|
|
83
|
+
} catch (error) { findings.push(finding("planner.kernel.parse", file, `could not parse artifact: ${String(error)}`)); }
|
|
84
|
+
}
|
|
85
|
+
return { artifacts, findings };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Validate the closed artifact graph: identity uniqueness, typed references, train
|
|
89
|
+
* wagon members, interlocking participants/routes, journey topology references, and WMBT acceptance ownership. */
|
|
90
|
+
export async function validatePlan(root = process.cwd()): Promise<PlanGraph> {
|
|
91
|
+
const graph = await loadPlan(root), byId = new Map<string, PlanArtifact[]>();
|
|
92
|
+
for (const artifact of graph.artifacts) byId.set(artifact.id, [...(byId.get(artifact.id) ?? []), artifact]);
|
|
93
|
+
for (const [artifact, owners] of byId) if (owners.length > 1) graph.findings.push(finding("planner.kernel.identity-unique", owners[0].file, `${artifact} is declared by ${owners.map(owner => owner.file).join(", ")}`));
|
|
94
|
+
const known = new Set(byId.keys());
|
|
95
|
+
for (const artifact of graph.artifacts) {
|
|
96
|
+
const references = structuralRefs(artifact);
|
|
97
|
+
for (const reference of new Set(references)) if (!known.has(reference) && !reference.startsWith("contract:")) graph.findings.push(finding("planner.kernel.reference-resolves", artifact.file, `${artifact.id} references undeclared ${reference}`));
|
|
98
|
+
if (artifact.kind === "train") for (const wagon of values(artifact.data.wagons)) { const reference = `wagon:${id(wagon)}`; if (id(wagon) && !known.has(reference)) graph.findings.push(finding("planner.kernel.train-wagon-resolves", artifact.file, `${artifact.id} lists undeclared ${reference}`)); }
|
|
99
|
+
if (artifact.kind === "interlocking") for (const participant of [...values(artifact.data.participants), ...values(artifact.data.lifelines).map(value => value && typeof value === "object" ? (value as Record<string, unknown>).ref : value)]) { const reference = id(participant); if (reference.startsWith("wagon:") && !known.has(reference)) graph.findings.push(finding("planner.kernel.interlocking-participant-resolves", artifact.file, `${artifact.id} lists undeclared ${reference}`)); }
|
|
100
|
+
}
|
|
101
|
+
return graph;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function traceabilityPlan(graph: PlanGraph): Array<{ from: string; to: string; relation: string }> {
|
|
105
|
+
const links: Array<{ from: string; to: string; relation: string }> = [];
|
|
106
|
+
for (const artifact of graph.artifacts) {
|
|
107
|
+
if (artifact.kind === "wmbt") for (const acceptance of graph.artifacts.filter(other => other.kind === "acceptance" && other.file === artifact.file)) links.push({ from: artifact.id, to: acceptance.id, relation: "defines" });
|
|
108
|
+
for (const reference of new Set(structuralRefs(artifact))) links.push({ from: artifact.id, to: reference, relation: "references" });
|
|
109
|
+
if (artifact.kind === "train") for (const wagon of values(artifact.data.wagons)) if (id(wagon)) links.push({ from: artifact.id, to: `wagon:${id(wagon)}`, relation: "orders" });
|
|
110
|
+
}
|
|
111
|
+
return links;
|
|
112
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import Ajv, { type ErrorObject, type ValidateFunction } from "ajv";
|
|
2
|
+
import addFormats from "ajv-formats";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
import { join, resolve } from "node:path";
|
|
6
|
+
import { loadPlan, type PlanArtifact, type PlanFinding } from "./planner-kernel";
|
|
7
|
+
|
|
8
|
+
type SchemaKind = Extract<PlanArtifact["kind"], "wagon" | "feature" | "wmbt" | "train" | "interlocking" | "journey">;
|
|
9
|
+
|
|
10
|
+
const schemaFiles: Record<SchemaKind, string> = {
|
|
11
|
+
wagon: "wagon.schema.json",
|
|
12
|
+
feature: "feature.schema.json",
|
|
13
|
+
wmbt: "wmbt.schema.json",
|
|
14
|
+
train: "train.schema.json",
|
|
15
|
+
interlocking: "train-interlocking.schema.json",
|
|
16
|
+
journey: "journey.schema.json",
|
|
17
|
+
};
|
|
18
|
+
const supportingSchemaFiles = ["appendix.schema.json", "acceptance.schema.json"];
|
|
19
|
+
const repositorySchemas = [
|
|
20
|
+
{ file: "plan/_themes.yaml", schema: "theme-registry.schema.json", rule: "planner.theme.must-be-canonical" },
|
|
21
|
+
{ file: "contracts/_contracts.yaml", schema: "contract-registry.schema.json", rule: "planner.contract.registry-coherence" },
|
|
22
|
+
] as const;
|
|
23
|
+
const schemaDirectory = join(resolve(import.meta.dir, ".."), "planner-schemas");
|
|
24
|
+
const ruleId = "atdd-bun.planner.schema";
|
|
25
|
+
|
|
26
|
+
function ruleFor(kind: SchemaKind, error: ErrorObject): string {
|
|
27
|
+
if (error.keyword === "pattern" && (
|
|
28
|
+
(kind === "train" && error.instancePath === "/train_id") ||
|
|
29
|
+
(kind === "interlocking" && /^\/routes\/\d+\/train_id$/.test(error.instancePath))
|
|
30
|
+
)) return "planner.train.naming";
|
|
31
|
+
return ruleId;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function formatError(error: ErrorObject): string {
|
|
35
|
+
const at = error.instancePath || "/";
|
|
36
|
+
return at + " " + (error.message ?? error.keyword);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function validators(): Promise<{ artifacts: Map<SchemaKind, ValidateFunction>; repositories: Map<string, ValidateFunction> }> {
|
|
40
|
+
const ajv = new Ajv({ allErrors: true, allowUnionTypes: true, strict: false });
|
|
41
|
+
addFormats(ajv);
|
|
42
|
+
const files = [...supportingSchemaFiles, ...Object.values(schemaFiles), ...repositorySchemas.map(item => item.schema)];
|
|
43
|
+
for (const file of files) ajv.addSchema(JSON.parse(await readFile(join(schemaDirectory, file), "utf8")), file);
|
|
44
|
+
const artifacts = new Map(Object.entries(schemaFiles).map(([kind, file]) => {
|
|
45
|
+
const validator = ajv.getSchema(file);
|
|
46
|
+
if (!validator) throw new Error("could not compile planner schema " + file);
|
|
47
|
+
return [kind as SchemaKind, validator];
|
|
48
|
+
}));
|
|
49
|
+
const repositories = new Map(repositorySchemas.map(item => {
|
|
50
|
+
const validator = ajv.getSchema(item.schema);
|
|
51
|
+
if (!validator) throw new Error("could not compile planner schema " + item.schema);
|
|
52
|
+
return [item.schema, validator];
|
|
53
|
+
}));
|
|
54
|
+
return { artifacts, repositories };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function repositoryRule(file: string, fallback: string, error: ErrorObject): string {
|
|
58
|
+
if (file === "plan/_themes.yaml" && (error.instancePath === "/themes" || error.instancePath === "/themes/0" || error.params.missingProperty === "0")) {
|
|
59
|
+
return "planner.theme.theme-zero-mandatory";
|
|
60
|
+
}
|
|
61
|
+
return fallback;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Validate every recognized plan artifact against the package-shipped canonical
|
|
65
|
+
* JSON Schema. Cross-artifact relationships remain planner validator concerns. */
|
|
66
|
+
export async function validatePlannerSchemas(root = process.cwd()): Promise<PlanFinding[]> {
|
|
67
|
+
const absolute = resolve(root), graph = await loadPlan(absolute);
|
|
68
|
+
const byKind = await validators();
|
|
69
|
+
const findings: PlanFinding[] = [];
|
|
70
|
+
for (const artifact of graph.artifacts) {
|
|
71
|
+
if (!(artifact.kind in schemaFiles)) continue;
|
|
72
|
+
const kind = artifact.kind as SchemaKind, validator = byKind.artifacts.get(kind);
|
|
73
|
+
if (!validator) continue;
|
|
74
|
+
if (!validator(artifact.data)) {
|
|
75
|
+
for (const error of validator.errors ?? []) findings.push({
|
|
76
|
+
rule_id: ruleFor(kind, error),
|
|
77
|
+
file: artifact.file,
|
|
78
|
+
evidence: kind + " violates " + schemaFiles[kind] + ": " + formatError(error),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
for (const item of repositorySchemas) {
|
|
83
|
+
const path = join(absolute, item.file);
|
|
84
|
+
if (!existsSync(path)) continue;
|
|
85
|
+
try {
|
|
86
|
+
const data = Bun.YAML.parse(await readFile(path, "utf8"));
|
|
87
|
+
const repositoryValidator = byKind.repositories.get(item.schema);
|
|
88
|
+
if (!repositoryValidator) throw new Error("could not compile planner schema " + item.schema);
|
|
89
|
+
if (!repositoryValidator(data)) for (const error of repositoryValidator.errors ?? []) findings.push({
|
|
90
|
+
rule_id: repositoryRule(item.file, item.rule, error),
|
|
91
|
+
file: item.file,
|
|
92
|
+
evidence: item.file + " violates " + item.schema + ": " + formatError(error),
|
|
93
|
+
});
|
|
94
|
+
} catch (error) {
|
|
95
|
+
findings.push({ rule_id: item.rule, file: item.file, evidence: `could not parse ${item.file}: ${String(error)}` });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return findings;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { ruleId as PLANNER_SCHEMA_RULE_ID };
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { validatePlan, type PlanArtifact, type PlanFinding } from "./planner-kernel";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
4
|
+
import { join, relative, resolve } from "node:path";
|
|
5
|
+
|
|
6
|
+
const finding = (rule_id: string, file: string, evidence: string): PlanFinding => ({ rule_id, file, evidence });
|
|
7
|
+
const records = (value: unknown): Record<string, unknown>[] => Array.isArray(value) ? value.filter((item): item is Record<string, unknown> => Boolean(item) && typeof item === "object") : [];
|
|
8
|
+
const text = (value: unknown): string => typeof value === "string" ? value : "";
|
|
9
|
+
const duplicate = (values: string[]) => [...new Set(values.filter((value, index) => value && values.indexOf(value) !== index))];
|
|
10
|
+
const contractIdentity = (value: string) => value.startsWith("contract:") ? value.slice("contract:".length) : value;
|
|
11
|
+
|
|
12
|
+
async function yamlFiles(root: string): Promise<string[]> {
|
|
13
|
+
if (!existsSync(root)) return [];
|
|
14
|
+
const entries = await readdir(root, { withFileTypes: true });
|
|
15
|
+
return (await Promise.all(entries.map(async entry => entry.isDirectory() ? yamlFiles(join(root, entry.name)) : entry.isFile() && entry.name.endsWith(".yaml") ? [join(root, entry.name)] : []))).flat().sort();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function trainRegistryFindings(root: string): Promise<PlanFinding[]> {
|
|
19
|
+
const absolute = resolve(root), registryPath = join(absolute, "plan/_trains.yaml"); if (!existsSync(registryPath)) return [];
|
|
20
|
+
const registry = Bun.YAML.parse(await readFile(registryPath, "utf8")) as { trains?: Record<string, Record<string, unknown[]>> };
|
|
21
|
+
const rows = Object.values(registry?.trains ?? {}).flatMap(buckets => Object.values(buckets ?? {}).flat()).filter((row): row is Record<string, unknown> => Boolean(row) && typeof row === "object");
|
|
22
|
+
const registered = new Set<string>(), findings: PlanFinding[] = [];
|
|
23
|
+
for (const row of rows) { const path = text(row.path), train = text(row.train_id); if (!path || !train) continue; registered.add(path); if (!existsSync(join(absolute, path))) findings.push(finding("planner.train.registry-coherence", "plan/_trains.yaml", `registry train ${train} points to missing ${path}`)); }
|
|
24
|
+
const trainRoot = join(absolute, "plan/_trains");
|
|
25
|
+
for (const path of await yamlFiles(trainRoot)) { const rel = relative(absolute, path).replaceAll("\\", "/"), pieces = relative(trainRoot, path).split(/[\\/]/); if (pieces.some(piece => piece.startsWith("_")) || registered.has(rel)) continue; findings.push(finding("planner.train.registry-coherence", rel, `train document is not registered in plan/_trains.yaml`)); }
|
|
26
|
+
return findings;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type ContractRegistry = { identities: Set<string>; rows: Record<string, unknown>[]; file: string };
|
|
30
|
+
|
|
31
|
+
async function contractRegistry(root: string): Promise<ContractRegistry | null> {
|
|
32
|
+
const file = "contracts/_contracts.yaml", path = join(resolve(root), file);
|
|
33
|
+
if (!existsSync(path)) return null;
|
|
34
|
+
try {
|
|
35
|
+
const data = Bun.YAML.parse(await readFile(path, "utf8")) as { contracts?: unknown };
|
|
36
|
+
const source = data?.contracts;
|
|
37
|
+
const rows = Array.isArray(source) ? records(source) : source && typeof source === "object"
|
|
38
|
+
? Object.entries(source as Record<string, unknown>).flatMap(([identity, entry]) => entry && typeof entry === "object" && !Array.isArray(entry) ? [{ ...(entry as Record<string, unknown>), identity: text((entry as Record<string, unknown>).identity) || identity }] : [])
|
|
39
|
+
: [];
|
|
40
|
+
return { identities: new Set(rows.map(row => text(row.identity)).filter(Boolean)), rows, file };
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function themeRegistryFindings(root: string, graph: Awaited<ReturnType<typeof validatePlan>>, registry: ContractRegistry | null): Promise<PlanFinding[]> {
|
|
47
|
+
const absolute = resolve(root), file = "plan/_themes.yaml", path = join(absolute, file);
|
|
48
|
+
const declared: Array<{ theme: string; file: string }> = [];
|
|
49
|
+
for (const artifact of graph.artifacts) {
|
|
50
|
+
if (artifact.kind === "wagon" || artifact.kind === "interlocking") {
|
|
51
|
+
const theme = text(artifact.data.theme); if (theme) declared.push({ theme, file: artifact.file });
|
|
52
|
+
} else if (artifact.kind === "train") {
|
|
53
|
+
for (const theme of Array.isArray(artifact.data.themes) ? artifact.data.themes.map(text) : []) if (theme) declared.push({ theme, file: artifact.file });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
for (const row of registry?.rows ?? []) { const theme = text(row.theme); if (theme) declared.push({ theme, file: registry?.file ?? file }); }
|
|
57
|
+
if (!existsSync(path)) return declared.length ? [finding("planner.theme.must-be-canonical", file, "themes are declared but plan/_themes.yaml is absent; add themes: { '0': commons } and repository-defined entries")] : [];
|
|
58
|
+
try {
|
|
59
|
+
const doc = Bun.YAML.parse(await readFile(path, "utf8")) as { themes?: unknown };
|
|
60
|
+
const themes = doc?.themes && typeof doc.themes === "object" && !Array.isArray(doc.themes) ? doc.themes as Record<string, unknown> : {};
|
|
61
|
+
const values = Object.values(themes).map(text).filter(Boolean);
|
|
62
|
+
const findings: PlanFinding[] = [];
|
|
63
|
+
if (themes["0"] !== "commons") findings.push(finding("planner.theme.theme-zero-mandatory", file, "theme index 0 must be the reserved token commons"));
|
|
64
|
+
for (const name of duplicate(values)) findings.push(finding("planner.theme.must-be-canonical", file, `theme ${name} is declared at more than one index`));
|
|
65
|
+
const known = new Set(values);
|
|
66
|
+
for (const item of declared) if (!known.has(item.theme)) findings.push(finding("planner.theme.must-be-canonical", item.file, `theme ${item.theme} is not declared in plan/_themes.yaml`));
|
|
67
|
+
for (const artifact of graph.artifacts.filter(item => item.kind === "wagon")) {
|
|
68
|
+
const wagonTheme = text(artifact.data.theme);
|
|
69
|
+
for (const produced of records(artifact.data.produce)) {
|
|
70
|
+
const identities = [text(produced.name), text(produced.contract).replace(/^contract:/, ""), text(produced.telemetry).replace(/^telemetry:/, "")].filter(Boolean);
|
|
71
|
+
for (const identity of identities) {
|
|
72
|
+
const namespace = identity.split(":", 1)[0];
|
|
73
|
+
if (!known.has(namespace)) findings.push(finding("planner.artifact-naming.theme-first-identity", artifact.file, `artifact ${identity} begins with undeclared theme ${namespace}`));
|
|
74
|
+
if (wagonTheme && namespace !== wagonTheme) findings.push(finding("planner.theme.urn-namespace-matches", artifact.file, `artifact ${identity} begins with ${namespace}, but wagon ${text(artifact.data.wagon)} declares theme ${wagonTheme}`));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (const consumed of records(artifact.data.consume)) {
|
|
78
|
+
const identity = text(consumed.name); if (!identity) continue;
|
|
79
|
+
const namespace = identity.split(":", 1)[0];
|
|
80
|
+
if (!known.has(namespace)) findings.push(finding("planner.artifact-naming.theme-first-identity", artifact.file, `artifact ${identity} begins with undeclared theme ${namespace}`));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return findings;
|
|
84
|
+
} catch {
|
|
85
|
+
return [finding("planner.theme.must-be-canonical", file, "could not parse plan/_themes.yaml")];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function contractRegistryFindings(root: string, wagons: PlanArtifact[], registry: ContractRegistry | null): PlanFinding[] {
|
|
90
|
+
const findings: PlanFinding[] = [], byName = new Map<string, string[]>();
|
|
91
|
+
for (const wagon of wagons) for (const item of records(wagon.data.consume)) {
|
|
92
|
+
const name = text(item.name); if (name) byName.set(name, [...(byName.get(name) ?? []), text(wagon.data.wagon)]);
|
|
93
|
+
}
|
|
94
|
+
const references: Array<{ contract: string; kind: "produce" | "consume"; name: string; wagon: PlanArtifact; item: Record<string, unknown> }> = [];
|
|
95
|
+
for (const wagon of wagons) for (const kind of ["produce", "consume"] as const) for (const item of records(wagon.data[kind])) {
|
|
96
|
+
const contract = text(item.contract), name = text(item.name);
|
|
97
|
+
if (contract) references.push({ contract, kind, name, wagon, item });
|
|
98
|
+
}
|
|
99
|
+
if (references.length && !registry) {
|
|
100
|
+
for (const reference of references) findings.push(finding("planner.contract.registry-coherence", reference.wagon.file, `${reference.kind} ${reference.name} references ${reference.contract}, but contracts/_contracts.yaml is absent`));
|
|
101
|
+
return findings;
|
|
102
|
+
}
|
|
103
|
+
const registered = registry?.identities ?? new Set<string>();
|
|
104
|
+
const duplicateIdentities = duplicate((registry?.rows ?? []).map(row => text(row.identity)));
|
|
105
|
+
for (const identity of duplicateIdentities) findings.push(finding("planner.contract.registry-coherence", registry?.file ?? "contracts/_contracts.yaml", `contract identity ${identity} is declared more than once`));
|
|
106
|
+
for (const reference of references) if (reference.contract.startsWith("contract:") && !registered.has(contractIdentity(reference.contract))) {
|
|
107
|
+
findings.push(finding("planner.contract.registry-coherence", reference.wagon.file, `${reference.kind} ${reference.name} references unregistered contract ${reference.contract}`));
|
|
108
|
+
}
|
|
109
|
+
for (const row of registry?.rows ?? []) {
|
|
110
|
+
const identity = text(row.identity), theme = text(row.theme), expected = identity.split(":", 1)[0];
|
|
111
|
+
if (identity && theme && theme !== expected) findings.push(finding("planner.contract.registry-coherence", registry.file, `contract ${identity} declares theme ${theme}; its identity namespace is ${expected}`));
|
|
112
|
+
const path = text(row.path); if (path && !existsSync(join(resolve(root), path))) findings.push(finding("planner.contract.registry-coherence", registry.file, `contract ${identity} points to missing ${path}`));
|
|
113
|
+
}
|
|
114
|
+
for (const wagon of wagons) for (const produced of records(wagon.data.produce)) {
|
|
115
|
+
const name = text(produced.name), contract = text(produced.contract), producer = text(wagon.data.wagon);
|
|
116
|
+
const consumers = (byName.get(name) ?? []).filter(consumer => consumer && consumer !== producer);
|
|
117
|
+
if (consumers.length && !contract) findings.push(finding("planner.contract.registry-coherence", wagon.file, `produce ${name} has contract null but is consumed cross-wagon by ${consumers.sort().join(", ")}`));
|
|
118
|
+
if (contract && !consumers.length && text(produced.to || "external") !== "external") findings.push(finding("planner.contract.registry-coherence", wagon.file, `produce ${name} declares ${contract} but has no cross-wagon consumer and is not marked to: external`));
|
|
119
|
+
}
|
|
120
|
+
return findings;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
type JourneyClaim = {
|
|
125
|
+
kind: "continuation" | "terminal";
|
|
126
|
+
interlockingId: string;
|
|
127
|
+
routeId: string;
|
|
128
|
+
artifact: string;
|
|
129
|
+
destination: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
function journeyContinuationFindings(graph: Awaited<ReturnType<typeof validatePlan>>): PlanFinding[] {
|
|
133
|
+
const interlockings = new Map(graph.artifacts.filter(item => item.kind === "interlocking").map(item => [item.id, item]));
|
|
134
|
+
const trains = new Map(graph.artifacts.filter(item => item.kind === "train").map(item => [item.id, item]));
|
|
135
|
+
const findings: PlanFinding[] = [];
|
|
136
|
+
|
|
137
|
+
for (const journey of graph.artifacts.filter(item => item.kind === "journey")) {
|
|
138
|
+
const entrypoint = journey.data.entrypoint && typeof journey.data.entrypoint === "object" ? journey.data.entrypoint as Record<string, unknown> : {};
|
|
139
|
+
const root = text(entrypoint.interlocking_id);
|
|
140
|
+
const claims: JourneyClaim[] = [];
|
|
141
|
+
|
|
142
|
+
for (const continuation of records(journey.data.continuations)) {
|
|
143
|
+
const from = continuation.from && typeof continuation.from === "object" ? continuation.from as Record<string, unknown> : {};
|
|
144
|
+
const to = continuation.to && typeof continuation.to === "object" ? continuation.to as Record<string, unknown> : {};
|
|
145
|
+
claims.push({
|
|
146
|
+
kind: "continuation",
|
|
147
|
+
interlockingId: text(from.interlocking_id),
|
|
148
|
+
routeId: text(from.route_id),
|
|
149
|
+
artifact: text(continuation.artifact),
|
|
150
|
+
destination: text(to.interlocking_id),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
for (const terminal of records(journey.data.terminals)) {
|
|
154
|
+
const from = terminal.from && typeof terminal.from === "object" ? terminal.from as Record<string, unknown> : {};
|
|
155
|
+
claims.push({
|
|
156
|
+
kind: "terminal",
|
|
157
|
+
interlockingId: text(from.interlocking_id),
|
|
158
|
+
routeId: text(from.route_id),
|
|
159
|
+
artifact: "",
|
|
160
|
+
destination: "",
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const claimsByRoute = new Map<string, JourneyClaim[]>();
|
|
165
|
+
for (const claim of claims) {
|
|
166
|
+
const key = `${claim.interlockingId}#${claim.routeId}`;
|
|
167
|
+
claimsByRoute.set(key, [...(claimsByRoute.get(key) ?? []), claim]);
|
|
168
|
+
const source = interlockings.get(claim.interlockingId);
|
|
169
|
+
if (!source) {
|
|
170
|
+
findings.push(finding("planner.journey.continuation-closure", journey.file, `${journey.id} ${claim.kind} source interlocking ${claim.interlockingId || "<missing>"} does not exist`));
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
const route = records(source.data.routes).find(row => text(row.route_id) === claim.routeId);
|
|
174
|
+
if (!route) {
|
|
175
|
+
findings.push(finding("planner.journey.continuation-closure", journey.file, `${journey.id} ${claim.kind} references missing route ${claim.interlockingId}#${claim.routeId || "<missing>"}`));
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (claim.kind === "continuation") {
|
|
179
|
+
const selectedTrain = text(route.train_id), train = trains.get(selectedTrain);
|
|
180
|
+
const artifacts = train ? records(train.data.sequence).map(step => text(step.artifact)).filter(Boolean) : [];
|
|
181
|
+
if (train && claim.artifact && !artifacts.includes(claim.artifact)) findings.push(finding(
|
|
182
|
+
"planner.journey.continuation-closure",
|
|
183
|
+
journey.file,
|
|
184
|
+
`${journey.id} continuation ${claim.interlockingId}#${claim.routeId} waits for ${claim.artifact}, but selected train ${selectedTrain} declares [${artifacts.join(", ")}]`,
|
|
185
|
+
));
|
|
186
|
+
if (claim.destination && !interlockings.has(claim.destination)) findings.push(finding(
|
|
187
|
+
"planner.journey.continuation-closure",
|
|
188
|
+
journey.file,
|
|
189
|
+
`${journey.id} continuation ${claim.interlockingId}#${claim.routeId} targets missing ${claim.destination}`,
|
|
190
|
+
));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const reachable = new Set<string>(), queue = root ? [root] : [];
|
|
195
|
+
while (queue.length) {
|
|
196
|
+
const interlockingId = queue.shift()!;
|
|
197
|
+
if (reachable.has(interlockingId)) continue;
|
|
198
|
+
const interlocking = interlockings.get(interlockingId);
|
|
199
|
+
if (!interlocking) continue;
|
|
200
|
+
reachable.add(interlockingId);
|
|
201
|
+
const routeRows = records(interlocking.data.routes);
|
|
202
|
+
for (const routeId of duplicate(routeRows.map(route => text(route.route_id)))) findings.push(finding(
|
|
203
|
+
"planner.journey.continuation-closure",
|
|
204
|
+
journey.file,
|
|
205
|
+
`${journey.id} cannot key topology through ${interlockingId}: duplicate route_id ${routeId}`,
|
|
206
|
+
));
|
|
207
|
+
for (const route of routeRows) {
|
|
208
|
+
const routeId = text(route.route_id), key = `${interlockingId}#${routeId}`, outgoing = claimsByRoute.get(key) ?? [];
|
|
209
|
+
if (outgoing.length !== 1) findings.push(finding(
|
|
210
|
+
"planner.journey.continuation-closure",
|
|
211
|
+
journey.file,
|
|
212
|
+
`${journey.id} reachable route ${key} must have exactly one continuation or terminal; found ${outgoing.length}`,
|
|
213
|
+
));
|
|
214
|
+
for (const edge of outgoing) if (edge.kind === "continuation" && interlockings.has(edge.destination)) queue.push(edge.destination);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
for (const claim of claims) if (claim.interlockingId && interlockings.has(claim.interlockingId) && !reachable.has(claim.interlockingId)) findings.push(finding(
|
|
219
|
+
"planner.journey.continuation-closure",
|
|
220
|
+
journey.file,
|
|
221
|
+
`${journey.id} declares ${claim.kind} from unreachable ${claim.interlockingId}#${claim.routeId}`,
|
|
222
|
+
));
|
|
223
|
+
|
|
224
|
+
const adjacency = new Map<string, Set<string>>();
|
|
225
|
+
for (const claim of claims) if (claim.kind === "continuation" && reachable.has(claim.interlockingId) && reachable.has(claim.destination)) {
|
|
226
|
+
adjacency.set(claim.interlockingId, new Set([...(adjacency.get(claim.interlockingId) ?? []), claim.destination]));
|
|
227
|
+
}
|
|
228
|
+
const visiting = new Set<string>(), visited = new Set<string>();
|
|
229
|
+
let cycle: string[] | null = null;
|
|
230
|
+
const visit = (node: string, path: string[]): void => {
|
|
231
|
+
if (cycle || visited.has(node)) return;
|
|
232
|
+
if (visiting.has(node)) { const start = path.indexOf(node); cycle = [...path.slice(start), node]; return; }
|
|
233
|
+
visiting.add(node);
|
|
234
|
+
for (const next of adjacency.get(node) ?? []) visit(next, [...path, node]);
|
|
235
|
+
visiting.delete(node);
|
|
236
|
+
visited.add(node);
|
|
237
|
+
};
|
|
238
|
+
if (root) visit(root, []);
|
|
239
|
+
if (cycle) findings.push(finding(
|
|
240
|
+
"planner.journey.continuation-closure",
|
|
241
|
+
journey.file,
|
|
242
|
+
`${journey.id} contains a continuation cycle ${cycle.join(" -> ")}; journey topology is acyclic until explicit loop semantics exist`,
|
|
243
|
+
));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return findings;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Bun realization of the planner validators that depend only on committed plan
|
|
250
|
+
* artifacts. Runtime/session/GitHub validators deliberately stay outside this package. */
|
|
251
|
+
export async function validateStaticPlannerConventions(root = process.cwd()): Promise<PlanFinding[]> {
|
|
252
|
+
// Plan-graph integrity is a package guard with its own implementation contract.
|
|
253
|
+
// This validator emits only the canonical convention ids declared by
|
|
254
|
+
// planner.static.validators.bun.
|
|
255
|
+
const graph = await validatePlan(root), findings: PlanFinding[] = [], wagons = graph.artifacts.filter(artifact => artifact.kind === "wagon");
|
|
256
|
+
const wagonSlugs = new Set(wagons.map(wagon => text(wagon.data.wagon)));
|
|
257
|
+
const wagonBySlug = new Map(wagons.map(wagon => [text(wagon.data.wagon), wagon]));
|
|
258
|
+
const wagonIds = wagons.map(wagon => text(wagon.data.wagon));
|
|
259
|
+
for (const slug of duplicate(wagonIds)) findings.push(finding("planner.wagon.urn", wagonBySlug.get(slug)?.file ?? "plan/", `wagon slug ${slug} is declared more than once`));
|
|
260
|
+
|
|
261
|
+
const contractOwners = new Map<string, string[]>(), telemetryOwners = new Map<string, string[]>();
|
|
262
|
+
for (const wagon of wagons) {
|
|
263
|
+
const slug = text(wagon.data.wagon), expected = `wagon:${slug}`;
|
|
264
|
+
if (!slug || wagon.id !== expected) findings.push(finding("planner.wagon.urn-naming", wagon.file, `wagon identity must be ${expected}`));
|
|
265
|
+
const produced = records(wagon.data.produce), consumed = records(wagon.data.consume);
|
|
266
|
+
for (const name of duplicate(produced.map(item => text(item.name)))) findings.push(finding("planner.wagon.produce-consume-artifacts", wagon.file, `${expected} produces ${name} more than once`));
|
|
267
|
+
for (const feature of duplicate(records(wagon.data.features).map(item => text(item.urn)))) findings.push(finding("planner.wagon.features", wagon.file, `${expected} lists feature ${feature} more than once`));
|
|
268
|
+
for (const item of produced) {
|
|
269
|
+
const contract = text(item.contract), telemetry = item.telemetry; if (contract) contractOwners.set(contract, [...(contractOwners.get(contract) ?? []), slug]);
|
|
270
|
+
for (const value of Array.isArray(telemetry) ? telemetry.map(text) : [text(telemetry)]) if (value) telemetryOwners.set(value, [...(telemetryOwners.get(value) ?? []), slug]);
|
|
271
|
+
const to = text(item.to || "external"); if (to !== "external" && to !== "internal" && (!to.startsWith("wagon:") || !wagonSlugs.has(to.slice(6)))) findings.push(finding("planner.wagon.produce-consume-artifacts", wagon.file, `${expected} produces to invalid destination ${to}`));
|
|
272
|
+
}
|
|
273
|
+
for (const item of consumed) {
|
|
274
|
+
const from = text(item.from); if (!from) continue;
|
|
275
|
+
if (from.startsWith("wagon:")) { const target = from.slice(6); if (!wagonSlugs.has(target)) findings.push(finding("planner.wagon.produce-consume-artifacts", wagon.file, `${expected} consumes from unknown ${from}`)); else if (target === slug) findings.push(finding("planner.wagon.no-consume-cycle", wagon.file, `${expected} consumes from itself`)); }
|
|
276
|
+
else if (!from.startsWith("system:") && !from.startsWith("appendix:") && from !== "internal") findings.push(finding("planner.wagon.produce-consume-artifacts", wagon.file, `${expected} has invalid consume source ${from}`));
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const registry = await contractRegistry(root);
|
|
280
|
+
for (const [contract, owners] of contractOwners) if (owners.length > 1) findings.push(finding("planner.contract.registry-coherence", wagonBySlug.get(owners[0])?.file ?? "plan/", `contract ${contract} is produced by ${owners.join(", ")}`));
|
|
281
|
+
for (const [telemetry, owners] of telemetryOwners) if (owners.length > 1) findings.push(finding("planner.wagon.telemetry-filesystem", wagonBySlug.get(owners[0])?.file ?? "plan/", `telemetry ${telemetry} is produced by ${owners.join(", ")}`));
|
|
282
|
+
findings.push(...contractRegistryFindings(root, wagons, registry));
|
|
283
|
+
findings.push(...await themeRegistryFindings(root, graph, registry));
|
|
284
|
+
findings.push(...await trainRegistryFindings(root));
|
|
285
|
+
findings.push(...journeyContinuationFindings(graph));
|
|
286
|
+
|
|
287
|
+
return findings;
|
|
288
|
+
}
|
package/src/register.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import { enforce, type EnforcementConfig } from "./enforce";
|
|
3
|
+
|
|
4
|
+
export function registerEnforcementTest(config: EnforcementConfig = {}): void {
|
|
5
|
+
test("ATDD Bun enforcement", async () => {
|
|
6
|
+
expect(await enforce(config)).toEqual([]);
|
|
7
|
+
});
|
|
8
|
+
}
|
package/src/release.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
type Release = { enabled?: boolean; version_source?: string; tag_prefix?: string; require_release_intent?: boolean; release_intent_paths?: string[]; publish_sdk?: boolean };
|
|
5
|
+
const git = async (root: string, args: string[]) => { const child = Bun.spawn({ cmd: ["git", ...args], cwd: root, stdout: "pipe", stderr: "pipe" }); return { code: await child.exited, out: (await new Response(child.stdout).text()).trim() }; };
|
|
6
|
+
const semver = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
7
|
+
const cmp = (a: string, b: string) => a.split("-")[0].split(".").map(Number).reduce((r, n, i) => r || Math.sign(n - Number(b.split("-")[0].split(".")[i])), 0);
|
|
8
|
+
async function intentFiles(root: string, folders: string[]) { const files: string[] = []; for (const folder of folders.map(path => path.replace("/**", ""))) { const path = join(root, folder); if (!existsSync(path)) continue; for (const entry of await readdir(path, { withFileTypes: true })) if (entry.isFile()) files.push(join(path, entry.name)); } return files; }
|
|
9
|
+
export async function releaseCheck(root = process.cwd()) { const config = existsSync(join(root, "atdd-bun.yaml")) ? Bun.YAML.parse(await readFile(join(root, "atdd-bun.yaml"), "utf8")) as { release?: Release } : {}; const policy = config.release; if (!policy?.enabled) return { ok: true, message: "release policy disabled" }; const source = policy.version_source ?? "package.json", pkg = JSON.parse(await readFile(join(root, source), "utf8")) as { version?: string }, version = pkg.version ?? ""; if (!semver.test(version)) return { ok: false, message: `invalid SemVer: ${version}` }; const tags = (await git(root, ["tag", "--merged", "HEAD", "--list", `${policy.tag_prefix ?? "v"}*`])).out.split("\n").filter(Boolean).map(tag => tag.replace(policy.tag_prefix ?? "v", "")).filter(tag => semver.test(tag)); const latest = tags.sort(cmp).at(-1); if (latest && cmp(version, latest) <= 0) return { ok: false, message: `version ${version} is not greater than ${latest}` }; const intents = await intentFiles(root, policy.release_intent_paths ?? [".changeset/**", ".release/**"]); const decisions = (await Promise.all(intents.map(file => readFile(file, "utf8")))).flatMap(text => [...text.matchAll(/\b(patch|minor|major|none)\b/g)].map(match => match[1])); if (policy.require_release_intent && decisions.length !== 1) return { ok: false, message: `exactly one release decision required; found ${decisions.length}` }; if (decisions.some(decision => !["patch", "minor", "major", "none"].includes(decision))) return { ok: false, message: "invalid release decision" }; return { ok: true, message: `release ${decisions[0] ?? "none"}: ${version}` }; }
|
package/src/setup.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ciInit, ciStatus } from "./ci";
|
|
2
|
+
import { hooksStatus, installHooks } from "./hooks";
|
|
3
|
+
|
|
4
|
+
/** Install the package's two opt-in local surfaces without touching unrelated
|
|
5
|
+
* workflows or hook paths. Dependency installation itself never calls this. */
|
|
6
|
+
export async function initializeRepository(root = process.cwd(), replace = false) {
|
|
7
|
+
const existingHooks = await hooksStatus(root);
|
|
8
|
+
const hooks = replace || !existingHooks.ok ? await installHooks(root, replace) : existingHooks;
|
|
9
|
+
if (!hooks.ok) return { ok: false, message: `hooks: ${hooks.message}` };
|
|
10
|
+
|
|
11
|
+
const existingCi = await ciStatus(root);
|
|
12
|
+
const ci = replace || !existingCi.ok ? await ciInit(root, replace) : existingCi;
|
|
13
|
+
if (!ci.ok) return { ok: false, message: `CI workflow: ${ci.message}` };
|
|
14
|
+
return { ok: true, message: `hooks: ${hooks.message}\nCI workflow: ${ci.message}` };
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Optional repository-owned release handoff. Configure credentials and publishing policy in this repository.
|
|
2
|
+
name: ATdd-Bun Release
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
jobs:
|
|
7
|
+
atdd-bun-release:
|
|
8
|
+
needs: []
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
with: { fetch-depth: 0 }
|
|
13
|
+
- uses: oven-sh/setup-bun@v2
|
|
14
|
+
- run: bun install --frozen-lockfile
|
|
15
|
+
- run: bun run atdd-bun release check
|
|
16
|
+
# Repository owners may add tag/release/publish steps and credentials here.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated by @afokapu/atdd-bun {{VERSION}}. Do not edit; run `atdd-bun ci init --replace`.
|
|
2
|
+
name: ATdd-Bun
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
merge_group:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
jobs:
|
|
9
|
+
atdd-bun:
|
|
10
|
+
name: atdd-bun
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
with: { fetch-depth: 0 }
|
|
15
|
+
- uses: oven-sh/setup-bun@v2
|
|
16
|
+
- run: bun install --frozen-lockfile
|
|
17
|
+
- run: bun run atdd-bun all
|
|
18
|
+
- run: bun test
|
|
19
|
+
- run: bun run atdd-bun release check
|
|
20
|
+
- uses: actions/upload-artifact@v4
|
|
21
|
+
if: always() && hashFiles('**/atdd-bun*.xml', '**/atdd-bun*.json') != ''
|
|
22
|
+
with:
|
|
23
|
+
name: atdd-bun-report
|
|
24
|
+
path: |
|
|
25
|
+
**/atdd-bun*.xml
|
|
26
|
+
**/atdd-bun*.json
|