@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,22 @@
|
|
|
1
|
+
// A deliberately gnarly function to exercise every metric branch.
|
|
2
|
+
export function decide(a: number, b: string, c: boolean, d: any[]): string {
|
|
3
|
+
if (a > 1 && b !== "x") {
|
|
4
|
+
for (const item of d) {
|
|
5
|
+
while (item.next) {
|
|
6
|
+
if (item.kind === "a" || item.kind === "b") {
|
|
7
|
+
try { item.run(); } catch (e) { return "err"; }
|
|
8
|
+
} else if (c) {
|
|
9
|
+
switch (item.kind) {
|
|
10
|
+
case "z": return "z";
|
|
11
|
+
case "y": return "y";
|
|
12
|
+
default: break;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const t = a > 5 ? "big" : "small";
|
|
19
|
+
return t ?? "none";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const short = (x) => x;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { decide } from "./gnarly";
|
|
2
|
+
import { longOne } from "./long";
|
|
3
|
+
import { dense0 } from "./big";
|
|
4
|
+
import { bare } from "./bare";
|
|
5
|
+
import { consume } from "./consumer";
|
|
6
|
+
import { processA } from "./domain/a";
|
|
7
|
+
import { processB } from "./domain/b";
|
|
8
|
+
export const run = () => [decide, longOne, dense0, bare, consume, processA, processB];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export function longOne(x: number): number {
|
|
2
|
+
let acc = x;
|
|
3
|
+
acc = acc + 0;
|
|
4
|
+
acc = acc + 1;
|
|
5
|
+
acc = acc + 2;
|
|
6
|
+
acc = acc + 3;
|
|
7
|
+
acc = acc + 4;
|
|
8
|
+
acc = acc + 5;
|
|
9
|
+
acc = acc + 6;
|
|
10
|
+
acc = acc + 7;
|
|
11
|
+
acc = acc + 8;
|
|
12
|
+
acc = acc + 9;
|
|
13
|
+
acc = acc + 10;
|
|
14
|
+
acc = acc + 11;
|
|
15
|
+
acc = acc + 12;
|
|
16
|
+
acc = acc + 13;
|
|
17
|
+
acc = acc + 14;
|
|
18
|
+
acc = acc + 15;
|
|
19
|
+
acc = acc + 16;
|
|
20
|
+
acc = acc + 17;
|
|
21
|
+
acc = acc + 18;
|
|
22
|
+
acc = acc + 19;
|
|
23
|
+
acc = acc + 20;
|
|
24
|
+
acc = acc + 21;
|
|
25
|
+
acc = acc + 22;
|
|
26
|
+
acc = acc + 23;
|
|
27
|
+
acc = acc + 24;
|
|
28
|
+
acc = acc + 25;
|
|
29
|
+
acc = acc + 26;
|
|
30
|
+
acc = acc + 27;
|
|
31
|
+
acc = acc + 28;
|
|
32
|
+
acc = acc + 29;
|
|
33
|
+
acc = acc + 30;
|
|
34
|
+
acc = acc + 31;
|
|
35
|
+
acc = acc + 32;
|
|
36
|
+
acc = acc + 33;
|
|
37
|
+
acc = acc + 34;
|
|
38
|
+
acc = acc + 35;
|
|
39
|
+
acc = acc + 36;
|
|
40
|
+
acc = acc + 37;
|
|
41
|
+
acc = acc + 38;
|
|
42
|
+
acc = acc + 39;
|
|
43
|
+
acc = acc + 40;
|
|
44
|
+
acc = acc + 41;
|
|
45
|
+
acc = acc + 42;
|
|
46
|
+
acc = acc + 43;
|
|
47
|
+
acc = acc + 44;
|
|
48
|
+
acc = acc + 45;
|
|
49
|
+
acc = acc + 46;
|
|
50
|
+
acc = acc + 47;
|
|
51
|
+
acc = acc + 48;
|
|
52
|
+
acc = acc + 49;
|
|
53
|
+
acc = acc + 50;
|
|
54
|
+
acc = acc + 51;
|
|
55
|
+
acc = acc + 52;
|
|
56
|
+
acc = acc + 53;
|
|
57
|
+
acc = acc + 54;
|
|
58
|
+
acc = acc + 55;
|
|
59
|
+
acc = acc + 56;
|
|
60
|
+
acc = acc + 57;
|
|
61
|
+
acc = acc + 58;
|
|
62
|
+
acc = acc + 59;
|
|
63
|
+
return acc;
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const orphan = () => 2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Shape = { a: number };
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
// ts_metrics.mjs — native Bun port of the four PYTHON TypeScript detectors that
|
|
2
|
+
// ship under atdd.workspace.python-pytest. Lives at the implementation ROOT
|
|
3
|
+
// (imported by checks via `../ts_metrics.mjs`); the family runner only spawns
|
|
4
|
+
// `checks/*.mjs`, so this module is never run as a member.
|
|
5
|
+
//
|
|
6
|
+
// WHY A PORT IS SOUND. Every one of those detectors states in its own manifest
|
|
7
|
+
// that it "inspects TypeScript SOURCE via regex normalization, it does not execute
|
|
8
|
+
// TS". None of them needs a Python library — no radon, no tree-sitter, no AST.
|
|
9
|
+
// They are deterministic string algorithms that happen to be written in Python, so
|
|
10
|
+
// a faithful port changes the host language and nothing else. The thresholds, the
|
|
11
|
+
// regexes, the formulas and the skip rules below are transcribed from those
|
|
12
|
+
// modules so a repo gets the same numbers from either provider.
|
|
13
|
+
//
|
|
14
|
+
// PARITY NOTES — the three places Python and JavaScript regex differ, handled:
|
|
15
|
+
// * `re.MULTILINE` -> the `m` flag; `re.DOTALL` -> `[\s\S]` (JS has no `s` in
|
|
16
|
+
// older engines and `[\s\S]` is unambiguous).
|
|
17
|
+
// * `re.findall` returns GROUPS when the pattern has capturing groups. Every
|
|
18
|
+
// ported pattern uses non-capturing `(?:...)`, so `matchAll` length is the
|
|
19
|
+
// same count Python produced.
|
|
20
|
+
// * `math.log`/`log2`/`sin`/`sqrt` -> `Math.*`, identical IEEE-754 doubles.
|
|
21
|
+
//
|
|
22
|
+
// The one deliberate UPGRADE is in the import graph — see `moduleImports` below.
|
|
23
|
+
import { extname, dirname, resolve as resolvePath, basename, sep } from "node:path";
|
|
24
|
+
|
|
25
|
+
// ── thresholds (transcribed from the Python detectors) ────────────────────────
|
|
26
|
+
export const MAX_CYCLOMATIC = 10; // complexity_typescript.py
|
|
27
|
+
export const MAX_NESTING = 4;
|
|
28
|
+
export const MAX_FUNCTION_LINES = 50;
|
|
29
|
+
export const MIN_MI = 20; // quality_metrics_typescript.py
|
|
30
|
+
export const MIN_COMMENT_RATIO = 0.10;
|
|
31
|
+
export const DUP_MIN_LINES = 7; // duplication_typescript.py
|
|
32
|
+
export const TS_EXT = new Set([".ts", ".tsx"]);
|
|
33
|
+
|
|
34
|
+
// ── function extraction (complexity_typescript.py) ────────────────────────────
|
|
35
|
+
const FUNC_PATTERNS = [
|
|
36
|
+
/^(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:<[^>]*>)?\s*\(/gm,
|
|
37
|
+
/^(?:export\s+)?(?:const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?::\s*[^=]+?)?\s*=\s*(?:async\s+)?(?:function\s*)?(?:<[^>]*>)?\s*\(/gm,
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
function findOpeningBrace(content, start) {
|
|
41
|
+
let parenDepth = 0;
|
|
42
|
+
for (let i = start; i < content.length; i++) {
|
|
43
|
+
const ch = content[i];
|
|
44
|
+
if (ch === "(") parenDepth++;
|
|
45
|
+
else if (ch === ")") parenDepth--;
|
|
46
|
+
else if (ch === "{" && parenDepth === 0) return i;
|
|
47
|
+
else if (ch === "\n" && parenDepth === 0) {
|
|
48
|
+
const segment = content.slice(start, i);
|
|
49
|
+
if (segment.includes("=>") && !segment.includes("{")) return -1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return -1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// String/comment aware brace matcher, so a `}` inside a string or comment never
|
|
56
|
+
// closes a body early.
|
|
57
|
+
function matchBraces(content, openPos) {
|
|
58
|
+
let depth = 0, i = openPos, inString = null;
|
|
59
|
+
let inLineComment = false, inBlockComment = false;
|
|
60
|
+
while (i < content.length) {
|
|
61
|
+
const ch = content[i];
|
|
62
|
+
if (inLineComment) { if (ch === "\n") inLineComment = false; i++; continue; }
|
|
63
|
+
if (inBlockComment) {
|
|
64
|
+
if (ch === "*" && content[i + 1] === "/") { inBlockComment = false; i += 2; continue; }
|
|
65
|
+
i++; continue;
|
|
66
|
+
}
|
|
67
|
+
if (inString) {
|
|
68
|
+
if (ch === "\\") { i += 2; continue; }
|
|
69
|
+
if (ch === inString) inString = null;
|
|
70
|
+
i++; continue;
|
|
71
|
+
}
|
|
72
|
+
if (ch === "/" && content[i + 1] === "/") { inLineComment = true; i += 2; continue; }
|
|
73
|
+
if (ch === "/" && content[i + 1] === "*") { inBlockComment = true; i += 2; continue; }
|
|
74
|
+
if (ch === "'" || ch === '"' || ch === "`") { inString = ch; i++; continue; }
|
|
75
|
+
if (ch === "{") depth++;
|
|
76
|
+
else if (ch === "}") { depth--; if (depth === 0) return i; }
|
|
77
|
+
i++;
|
|
78
|
+
}
|
|
79
|
+
return -1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function extractFunctions(content) {
|
|
83
|
+
const out = [];
|
|
84
|
+
for (const pattern of FUNC_PATTERNS) {
|
|
85
|
+
for (const m of content.matchAll(pattern)) {
|
|
86
|
+
const name = m[1];
|
|
87
|
+
const line = content.slice(0, m.index).split("\n").length;
|
|
88
|
+
const end = m.index + m[0].length;
|
|
89
|
+
// The Python port passes `match.end() - 1` — the index OF the params' "(" —
|
|
90
|
+
// so the parameter parenthesis balances and the body brace is actually
|
|
91
|
+
// found. Passing `match.end()` (as the original core did) drives paren_depth
|
|
92
|
+
// to -1 before the body and truncates every function to its signature,
|
|
93
|
+
// which silently makes all three metrics inert. Preserved deliberately.
|
|
94
|
+
const bodyStart = findOpeningBrace(content, end - 1);
|
|
95
|
+
if (bodyStart === -1) {
|
|
96
|
+
let stmtEnd = content.indexOf("\n", end);
|
|
97
|
+
if (stmtEnd === -1) stmtEnd = content.length;
|
|
98
|
+
out.push({ name, line, body: content.slice(m.index, stmtEnd) });
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
const bodyEnd = matchBraces(content, bodyStart);
|
|
102
|
+
if (bodyEnd === -1) continue;
|
|
103
|
+
out.push({ name, line, body: content.slice(m.index, bodyEnd + 1) });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const countMatches = (text, re) => (text.match(re) || []).length;
|
|
110
|
+
|
|
111
|
+
export function cyclomatic(body) {
|
|
112
|
+
let c = 1;
|
|
113
|
+
for (const kw of [/\bif\b/g, /\belse\s+if\b/g, /\bfor\b/g, /\bwhile\b/g,
|
|
114
|
+
/\bdo\b/g, /\bcatch\b/g, /\bcase\b/g]) c += countMatches(body, kw);
|
|
115
|
+
c += countMatches(body, /&&/g);
|
|
116
|
+
c += countMatches(body, /\|\|/g);
|
|
117
|
+
c += countMatches(body, /\?\?/g);
|
|
118
|
+
c += countMatches(body, /[^\s?]\s*\?(?![\s.?:])\s*[^:]/g);
|
|
119
|
+
return c;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function nestingDepth(body) {
|
|
123
|
+
const CONTROL = /\b(if|else|for|while|do|switch|try|catch|finally)\b/;
|
|
124
|
+
let maxDepth = 0, braceDepth = 0, baseDepth = null;
|
|
125
|
+
for (const line of body.split("\n")) {
|
|
126
|
+
const s = line.trim();
|
|
127
|
+
if (!s || s.startsWith("//") || s.startsWith("/*")) continue;
|
|
128
|
+
const opens = (s.match(/\{/g) || []).length;
|
|
129
|
+
const closes = (s.match(/\}/g) || []).length;
|
|
130
|
+
if (baseDepth === null && opens > 0) baseDepth = braceDepth;
|
|
131
|
+
const hasControl = CONTROL.test(s);
|
|
132
|
+
braceDepth += opens - closes;
|
|
133
|
+
if (hasControl && opens > 0) maxDepth = Math.max(maxDepth, braceDepth - (baseDepth || 0));
|
|
134
|
+
}
|
|
135
|
+
return maxDepth;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function countCodeLines(body) {
|
|
139
|
+
let count = 0, inBlock = false;
|
|
140
|
+
for (const line of body.split("\n")) {
|
|
141
|
+
const s = line.trim();
|
|
142
|
+
if (inBlock) { if (s.includes("*/")) inBlock = false; continue; }
|
|
143
|
+
if (s.startsWith("/*")) { if (!s.includes("*/")) inBlock = true; continue; }
|
|
144
|
+
if (!s || s.startsWith("//")) continue;
|
|
145
|
+
count++;
|
|
146
|
+
}
|
|
147
|
+
return count;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ── maintainability index (quality_metrics_typescript.py) ─────────────────────
|
|
151
|
+
const OPERATORS = /(?:===|!==|==|!=|>=|<=|=>|&&|\|\||>>>=|>>>|>>=|<<=|\?\?|\?\.|[+\-*/%&|^~!<>=]=?|\.\.\.|[{}()[\];,.:?])/g;
|
|
152
|
+
const OPERANDS = /(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`(?:[^`\\]|\\.)*`|\b\d[\d_.eExXbBoO]*\b|\b[a-zA-Z_$][a-zA-Z0-9_$]*\b)/g;
|
|
153
|
+
const CC_KEYWORDS = /\b(?:if|else\s+if|for|while|do|catch|case|&&|\|\|)\b/g;
|
|
154
|
+
|
|
155
|
+
export function stripComments(src) {
|
|
156
|
+
return src.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function halsteadVolume(src) {
|
|
160
|
+
const operators = src.match(OPERATORS) || [];
|
|
161
|
+
const operands = src.match(OPERANDS) || [];
|
|
162
|
+
const n = new Set(operators).size + new Set(operands).size;
|
|
163
|
+
const N = operators.length + operands.length;
|
|
164
|
+
if (n <= 1) return 1.0;
|
|
165
|
+
return N * Math.log2(n);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function commentRatio(src) {
|
|
169
|
+
let total = 0, comments = 0, inBlock = false;
|
|
170
|
+
for (const line of src.split("\n")) {
|
|
171
|
+
const s = line.trim();
|
|
172
|
+
if (!s) continue;
|
|
173
|
+
total++;
|
|
174
|
+
if (inBlock) { comments++; if (s.includes("*/")) inBlock = false; continue; }
|
|
175
|
+
if (s.startsWith("/*")) { comments++; if (!s.includes("*/")) inBlock = true; continue; }
|
|
176
|
+
if (s.startsWith("//") || s.startsWith("*")) { comments++; continue; }
|
|
177
|
+
}
|
|
178
|
+
return total > 0 ? comments / total : 0.0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function maintainabilityIndex(source) {
|
|
182
|
+
const code = stripComments(source);
|
|
183
|
+
const loc = code.split("\n").filter((l) => l.trim()).length;
|
|
184
|
+
if (loc === 0) return 100.0;
|
|
185
|
+
let V = halsteadVolume(code);
|
|
186
|
+
if (V <= 0) V = 1.0;
|
|
187
|
+
const cc = (source.match(CC_KEYWORDS) || []).length;
|
|
188
|
+
const funcCount = Math.max(1, (source.match(/\bfunction\b/g) || []).length +
|
|
189
|
+
(source.match(/=>\s*[{(]/g) || []).length);
|
|
190
|
+
const avgCc = Math.max(1, cc) / funcCount;
|
|
191
|
+
const cm = commentRatio(source);
|
|
192
|
+
const mi = 171 - 5.2 * Math.log(V) - 0.23 * avgCc - 16.2 * Math.log(loc)
|
|
193
|
+
+ 50.0 * Math.sin(Math.sqrt(2.4 * cm));
|
|
194
|
+
return Math.max(0.0, Math.min(100.0, mi));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// ── duplication (duplication_typescript.py) ───────────────────────────────────
|
|
198
|
+
export function determineLayer(filePath) {
|
|
199
|
+
const p = filePath.toLowerCase();
|
|
200
|
+
if (p.includes("/domain/")) return "domain";
|
|
201
|
+
if (p.includes("/application/")) return "application";
|
|
202
|
+
if (p.includes("/presentation/")) return "presentation";
|
|
203
|
+
if (p.includes("/integration/") || p.includes("/infrastructure/")) return "integration";
|
|
204
|
+
if (p.includes("/entities/") || p.includes("/models/") || p.includes("/value_objects/")) return "domain";
|
|
205
|
+
if (p.includes("/use_cases/") || p.includes("/usecases/") || p.includes("/hooks/")) return "application";
|
|
206
|
+
if (p.includes("/components/") || p.includes("/pages/") || p.includes("/views/")) return "presentation";
|
|
207
|
+
if (p.includes("/adapters/") || p.includes("/clients/") || p.includes("/api/")) return "integration";
|
|
208
|
+
return "unknown";
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const NORMALIZE = [
|
|
212
|
+
[/\/\/.*$/gm, ""],
|
|
213
|
+
[/\/\*[\s\S]*?\*\//g, ""],
|
|
214
|
+
[/'[^']*'/g, '"S"'],
|
|
215
|
+
[/"[^"]*"/g, '"S"'],
|
|
216
|
+
[/`[^`]*`/g, '"S"'],
|
|
217
|
+
[/\b\d+\.?\d*\b/g, "0"],
|
|
218
|
+
[/\b(?!(?:import|export|from|const|let|var|function|class|interface|type|if|else|for|while|do|switch|case|break|continue|return|throw|try|catch|finally|new|delete|typeof|instanceof|void|in|of|as|is|async|await|extends|implements|static|get|set|public|private|protected|readonly|abstract|override|enum|namespace|module|declare|default|yield|super|this|true|false|null|undefined|never|any|string|number|boolean|object|unknown|void|Promise|Array|Map|Set|Record)\b)[a-zA-Z_$][a-zA-Z0-9_$]*/g, "ID"],
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
export function normalizeLine(line) {
|
|
222
|
+
let r = line.trim();
|
|
223
|
+
if (!r) return "";
|
|
224
|
+
for (const [re, sub] of NORMALIZE) r = r.replace(re, sub);
|
|
225
|
+
return r.replace(/\s+/g, " ").trim();
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const TRIVIAL = new Set(["", "{", "}", "};", ");", "],", ")", "]", "});"]);
|
|
229
|
+
export const isTrivial = (n) => TRIVIAL.has(n);
|
|
230
|
+
|
|
231
|
+
// A 16-hex-char digest of each `minLines` window of non-trivial normalized lines —
|
|
232
|
+
// the same fingerprint shape the Python detector hashes with sha256[:16].
|
|
233
|
+
export function fragments(source, minLines, hasher) {
|
|
234
|
+
const nonTrivial = [];
|
|
235
|
+
source.split("\n").forEach((line, i) => {
|
|
236
|
+
const n = normalizeLine(line);
|
|
237
|
+
if (!isTrivial(n)) nonTrivial.push([i + 1, n]);
|
|
238
|
+
});
|
|
239
|
+
if (nonTrivial.length < minLines) return [];
|
|
240
|
+
const out = [];
|
|
241
|
+
for (let i = 0; i <= nonTrivial.length - minLines; i++) {
|
|
242
|
+
const window = nonTrivial.slice(i, i + minLines);
|
|
243
|
+
const block = window.map(([, l]) => l).join("\n");
|
|
244
|
+
out.push({ hash: hasher(block), start: window[0][0], end: window[window.length - 1][0] });
|
|
245
|
+
}
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ── import graph (dead_code_typescript.py) — THE ONE UPGRADE ─────────────────
|
|
250
|
+
//
|
|
251
|
+
// The Python detector reads imports with five regexes — the best a Python process
|
|
252
|
+
// can do without a TypeScript parser — and cannot distinguish
|
|
253
|
+
// `import type { T } from "./t"` from a value import, so a module whose only
|
|
254
|
+
// referrer is a TYPE import is counted as reachable. A type-only import is erased
|
|
255
|
+
// at compile time and creates no runtime edge, so that module is dead and the regex
|
|
256
|
+
// reports it alive.
|
|
257
|
+
//
|
|
258
|
+
// Bun ships a real TypeScript parser in-process, which omits type-only imports.
|
|
259
|
+
// Same obligation, measured correctly — and available only because the runtime is
|
|
260
|
+
// Bun. The resolver itself now lives in ../../lib/imports.mjs, shared with the
|
|
261
|
+
// clean-architecture family.
|
|
262
|
+
export { moduleImports } from "../../lib/imports.mjs";
|
|
263
|
+
|
|
264
|
+
export const ROOT_FILENAMES = new Set(["index.ts", "index.tsx", "wagon.ts", "composition.ts"]);
|
|
265
|
+
// `server.ts` is the canonical Bun entrypoint (Bun.serve) and the Station Master in
|
|
266
|
+
// 17 of the interlocking family's own fixtures. Omitting it reported a whole feature
|
|
267
|
+
// tree as dead code for consumers built the way that family prescribes.
|
|
268
|
+
export const ENTRY_FILENAMES = new Set(["main.ts", "main.tsx", "app.ts", "app.tsx", "server.ts"]);
|
|
269
|
+
export const STRUCTURAL = new Set(["index.ts", "index.tsx"]);
|
|
270
|
+
|
|
271
|
+
export function resolveImport(specifier, sourceFile, allFiles, root) {
|
|
272
|
+
const candidates = new Set();
|
|
273
|
+
let base = null;
|
|
274
|
+
if (specifier.startsWith(".")) base = resolvePath(dirname(sourceFile), specifier);
|
|
275
|
+
else if (specifier.startsWith("@/")) base = resolvePath(root, specifier.slice(2));
|
|
276
|
+
if (base === null) return candidates; // external npm specifier: outside the graph
|
|
277
|
+
for (const ext of [".ts", ".tsx"]) {
|
|
278
|
+
const withExt = base.replace(/\.[^./]*$/, "") === base ? base + ext : base.replace(/\.[^./]*$/, ext);
|
|
279
|
+
if (allFiles.has(withExt)) candidates.add(withExt);
|
|
280
|
+
if (allFiles.has(base + ext)) candidates.add(base + ext);
|
|
281
|
+
if (allFiles.has(`${base}${sep}index${ext}`)) candidates.add(`${base}${sep}index${ext}`);
|
|
282
|
+
}
|
|
283
|
+
if (allFiles.has(base)) candidates.add(base);
|
|
284
|
+
return candidates;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export const isTestFile = (f) => /\.(test|spec)\.tsx?$/.test(f) ||
|
|
288
|
+
f.split(sep).some((p) => p === "__tests__" || p === "tests" || p === "test");
|
|
289
|
+
|
|
290
|
+
export const isRootFile = (f) => ROOT_FILENAMES.has(basename(f)) || ENTRY_FILENAMES.has(basename(f));
|
|
291
|
+
|
|
292
|
+
export function reachableFrom(roots, graph) {
|
|
293
|
+
const visited = new Set();
|
|
294
|
+
const queue = [...roots];
|
|
295
|
+
while (queue.length) {
|
|
296
|
+
const cur = queue.shift();
|
|
297
|
+
if (visited.has(cur)) continue;
|
|
298
|
+
visited.add(cur);
|
|
299
|
+
for (const n of graph.get(cur) || []) if (!visited.has(n)) queue.push(n);
|
|
300
|
+
}
|
|
301
|
+
return visited;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export function reverseGraph(graph) {
|
|
305
|
+
const rev = new Map([...graph.keys()].map((k) => [k, new Set()]));
|
|
306
|
+
for (const [src, targets] of graph) {
|
|
307
|
+
for (const t of targets) if (rev.has(t)) rev.get(t).add(src);
|
|
308
|
+
}
|
|
309
|
+
return rev;
|
|
310
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
schema_version: 1.1.0
|
|
2
|
+
kind: implementation
|
|
3
|
+
subtype: validator
|
|
4
|
+
implementation_id: htmx_hypermedia_detector
|
|
5
|
+
targets_workspace: atdd.workspace.bun
|
|
6
|
+
contract_version: 1.1.0
|
|
7
|
+
emits_rule_ids:
|
|
8
|
+
- coder.htmx.verb-destructive-confirms
|
|
9
|
+
- coder.htmx.verb-endpoint-same-origin
|
|
10
|
+
- coder.htmx.fragment-escapes-interpolation
|
|
11
|
+
- coder.htmx.verb-mutation-signals-progress
|
|
12
|
+
- coder.htmx.swap-no-inline-handler
|
|
13
|
+
- coder.htmx.swap-oob-carries-id
|
|
14
|
+
- coder.htmx.verb-endpoint-is-routed
|
|
15
|
+
entrypoint: detect.mjs
|
|
16
|
+
report: detect.mjs
|
|
17
|
+
realizes_convention:
|
|
18
|
+
# A family detector OWNS every rule it emits: all six are authored in
|
|
19
|
+
# atdd.extension.coder.htmx and no other implementation claims them, so ownership
|
|
20
|
+
# and co-emission coincide here. Declared as a LIST (the family form) rather than a
|
|
21
|
+
# scalar — a scalar would bind one rule and leave the other five unenforced while
|
|
22
|
+
# still appearing to work.
|
|
23
|
+
- coder.htmx.verb-destructive-confirms
|
|
24
|
+
- coder.htmx.verb-endpoint-same-origin
|
|
25
|
+
- coder.htmx.fragment-escapes-interpolation
|
|
26
|
+
- coder.htmx.verb-mutation-signals-progress
|
|
27
|
+
- coder.htmx.swap-no-inline-handler
|
|
28
|
+
- coder.htmx.swap-oob-carries-id
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"htmx_verb_destructive_confirms": "coder.htmx.verb-destructive-confirms",
|
|
3
|
+
"htmx_verb_endpoint_same_origin": "coder.htmx.verb-endpoint-same-origin",
|
|
4
|
+
"htmx_fragment_escapes_interpolation": "coder.htmx.fragment-escapes-interpolation",
|
|
5
|
+
"htmx_verb_mutation_signals_progress": "coder.htmx.verb-mutation-signals-progress",
|
|
6
|
+
"htmx_swap_no_inline_handler": "coder.htmx.swap-no-inline-handler",
|
|
7
|
+
"htmx_swap_oob_carries_id": "coder.htmx.swap-oob-carries-id",
|
|
8
|
+
"htmx_verb_endpoint_is_routed": "coder.htmx.verb-endpoint-is-routed"
|
|
9
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Detector: coder.htmx.fragment-escapes-interpolation (disposition: strict)
|
|
3
|
+
//
|
|
4
|
+
// In a full-stack Bun + htmx app the server RENDERS HTML FRAGMENTS as template
|
|
5
|
+
// literals and htmx injects them into the live DOM. That makes every bare
|
|
6
|
+
// `${value}` interpolated into an HTML template a stored-XSS vector: there is no
|
|
7
|
+
// framework auto-escaping in the path (that is what React/JSX gave up when the
|
|
8
|
+
// stack moved to hypermedia), and the fragment is inserted via innerHTML by
|
|
9
|
+
// design. So the escaping obligation, which a JSX stack could leave implicit,
|
|
10
|
+
// becomes explicit and enforceable here.
|
|
11
|
+
//
|
|
12
|
+
// PRECISION: only a BARE identifier or property chain is flagged — `${user.name}`,
|
|
13
|
+
// `${row.title}`. An interpolation that is a CALL (`${escapeHtml(x)}`,
|
|
14
|
+
// `${rows.map(row).join("")}`) is fragment COMPOSITION or an escape helper and is
|
|
15
|
+
// deliberately out of scope; flagging it would drown the rule in false positives
|
|
16
|
+
// on legitimate nesting. The rule therefore catches exactly the shape that is
|
|
17
|
+
// always wrong: raw data dropped straight into markup.
|
|
18
|
+
import { walk, readRoots, readExcludes, readText, emit, locate, templateLiterals, SOURCE_EXT } from "../../../lib/scan.mjs";
|
|
19
|
+
|
|
20
|
+
const RULE_ID = "coder.htmx.fragment-escapes-interpolation";
|
|
21
|
+
// The literal emits markup — an opening tag, not merely a stray `<`.
|
|
22
|
+
const EMITS_HTML_RE = /<[a-zA-Z][\w-]*[\s/>]/;
|
|
23
|
+
// A bare variable or property chain: no call, no operator, no literal.
|
|
24
|
+
const BARE_CHAIN_RE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/;
|
|
25
|
+
|
|
26
|
+
// Collect the `${...}` spans of one template literal, brace-depth aware so a
|
|
27
|
+
// nested object literal inside the interpolation does not end it early.
|
|
28
|
+
function interpolations(tpl) {
|
|
29
|
+
const spans = [];
|
|
30
|
+
for (let i = 0; i < tpl.length - 1; i++) {
|
|
31
|
+
if (tpl[i] !== "$" || tpl[i + 1] !== "{") continue;
|
|
32
|
+
let depth = 1;
|
|
33
|
+
let j = i + 2;
|
|
34
|
+
while (j < tpl.length && depth > 0) {
|
|
35
|
+
if (tpl[j] === "{") depth++;
|
|
36
|
+
else if (tpl[j] === "}") depth--;
|
|
37
|
+
j++;
|
|
38
|
+
}
|
|
39
|
+
spans.push({ offset: i, expr: tpl.slice(i + 2, j - 1).trim() });
|
|
40
|
+
i = j - 1;
|
|
41
|
+
}
|
|
42
|
+
return spans;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const violations = [];
|
|
46
|
+
const excludes = readExcludes();
|
|
47
|
+
for (const root of readRoots()) {
|
|
48
|
+
for (const file of walk(root, excludes, SOURCE_EXT)) {
|
|
49
|
+
const text = readText(file);
|
|
50
|
+
if (!text) continue;
|
|
51
|
+
for (const tpl of templateLiterals(text)) {
|
|
52
|
+
if (!EMITS_HTML_RE.test(tpl.text)) continue;
|
|
53
|
+
for (const span of interpolations(tpl.text)) {
|
|
54
|
+
if (!BARE_CHAIN_RE.test(span.expr)) continue;
|
|
55
|
+
violations.push({
|
|
56
|
+
rule_id: RULE_ID,
|
|
57
|
+
file,
|
|
58
|
+
...locate(text, tpl.start + span.offset),
|
|
59
|
+
evidence: `\${${span.expr}} is interpolated raw into an HTML fragment; escape it before htmx swaps it into the DOM`,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
process.stderr.write(`bun-detector[fragment-interpolation-escaped]: ${violations.length} violation(s)\n`);
|
|
66
|
+
emit(violations);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Detector: coder.htmx.swap-no-inline-handler (disposition: suppress-and-clean)
|
|
3
|
+
//
|
|
4
|
+
// In htmx-driven markup, behaviour is declared with hypermedia attributes
|
|
5
|
+
// (hx-trigger / hx-on) — not with inline `onclick="..."` JavaScript. An inline
|
|
6
|
+
// handler is invisible to htmx's event model, is wiped the moment the element is
|
|
7
|
+
// swapped, and cannot be reasoned about by the swap lifecycle; mixing the two is
|
|
8
|
+
// how htmx pages acquire ghost handlers that fire on stale nodes.
|
|
9
|
+
//
|
|
10
|
+
// SELF-SCOPING: only files that actually contain an `hx-` attribute are judged. A
|
|
11
|
+
// plain non-htmx page in the same repo is not this rule's business.
|
|
12
|
+
// Case-sensitive and lowercase-only by design, so React's `onClick={...}` (a JSX
|
|
13
|
+
// prop, not an inline HTML handler) is never flagged.
|
|
14
|
+
import { walk, readRoots, readExcludes, readText, emit, locate, SOURCE_EXT, TEMPLATE_EXT } from "../../../lib/scan.mjs";
|
|
15
|
+
|
|
16
|
+
const RULE_ID = "coder.htmx.swap-no-inline-handler";
|
|
17
|
+
const IS_HTMX_FILE_RE = /\bhx-(get|post|put|patch|delete|trigger|target|swap|on)\b/;
|
|
18
|
+
const INLINE_HANDLER_RE =
|
|
19
|
+
/\son(click|submit|change|input|load|error|focus|blur|keyup|keydown|mouseover|mouseout)\s*=\s*['"]/g;
|
|
20
|
+
|
|
21
|
+
const EXTS = new Set([...SOURCE_EXT, ...TEMPLATE_EXT]);
|
|
22
|
+
|
|
23
|
+
const violations = [];
|
|
24
|
+
const excludes = readExcludes();
|
|
25
|
+
for (const root of readRoots()) {
|
|
26
|
+
for (const file of walk(root, excludes, EXTS)) {
|
|
27
|
+
const text = readText(file);
|
|
28
|
+
if (!text || !IS_HTMX_FILE_RE.test(text)) continue;
|
|
29
|
+
for (const m of text.matchAll(INLINE_HANDLER_RE)) {
|
|
30
|
+
violations.push({
|
|
31
|
+
rule_id: RULE_ID,
|
|
32
|
+
file,
|
|
33
|
+
...locate(text, m.index + 1),
|
|
34
|
+
evidence: `inline on${m[1]} handler in htmx markup; declare behaviour with hx-trigger/hx-on so it survives a swap`,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
process.stderr.write(`bun-detector[no-inline-event-handler]: ${violations.length} violation(s)\n`);
|
|
40
|
+
emit(violations);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Detector: coder.htmx.swap-oob-carries-id (disposition: strict)
|
|
3
|
+
//
|
|
4
|
+
// An out-of-band swap is matched to its destination BY ID: htmx takes the
|
|
5
|
+
// `hx-swap-oob` element out of the response and replaces the existing element
|
|
6
|
+
// with the same `id`. An oob element carrying no `id` has no destination, so htmx
|
|
7
|
+
// silently discards it — the update simply never happens, with no error anywhere.
|
|
8
|
+
// This is the single most common htmx bug that presents as "the server is
|
|
9
|
+
// returning it but the page doesn't change".
|
|
10
|
+
import { walk, readRoots, readExcludes, readText, emit, locate, enclosingTag, SOURCE_EXT, TEMPLATE_EXT } from "../../../lib/scan.mjs";
|
|
11
|
+
|
|
12
|
+
const RULE_ID = "coder.htmx.swap-oob-carries-id";
|
|
13
|
+
const OOB_RE = /\bhx-swap-oob\s*=/gi;
|
|
14
|
+
// `id="x"` in markup, or `id={expr}` in JSX — both are a real destination id.
|
|
15
|
+
const HAS_ID_RE = /\bid\s*=\s*(['"][^'"]*['"]|\{)/i;
|
|
16
|
+
const EXTS = new Set([...SOURCE_EXT, ...TEMPLATE_EXT]);
|
|
17
|
+
|
|
18
|
+
const violations = [];
|
|
19
|
+
const excludes = readExcludes();
|
|
20
|
+
for (const root of readRoots()) {
|
|
21
|
+
for (const file of walk(root, excludes, EXTS)) {
|
|
22
|
+
const text = readText(file);
|
|
23
|
+
if (!text) continue;
|
|
24
|
+
for (const m of text.matchAll(OOB_RE)) {
|
|
25
|
+
const tag = enclosingTag(text, m.index);
|
|
26
|
+
if (tag && HAS_ID_RE.test(tag.text)) continue;
|
|
27
|
+
violations.push({
|
|
28
|
+
rule_id: RULE_ID,
|
|
29
|
+
file,
|
|
30
|
+
...locate(text, m.index),
|
|
31
|
+
evidence: "hx-swap-oob element declares no id, so htmx has no element to swap it into and drops it silently",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
process.stderr.write(`bun-detector[oob-swap-carries-id]: ${violations.length} violation(s)\n`);
|
|
37
|
+
emit(violations);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Detector: coder.htmx.verb-destructive-confirms (disposition: strict)
|
|
3
|
+
//
|
|
4
|
+
// An element issuing `hx-delete` must carry `hx-confirm` (or `hx-prompt`). In
|
|
5
|
+
// htmx a delete is one attribute on a clickable element — there is no form
|
|
6
|
+
// submit, no route transition, no framework-level guard between the user's click
|
|
7
|
+
// and the destructive request. `hx-confirm` IS the guard, and it is declarative
|
|
8
|
+
// precisely so it cannot be forgotten in a handler. A delete control without one
|
|
9
|
+
// destroys data on a single mis-click.
|
|
10
|
+
import { walk, readRoots, readExcludes, readText, emit, locate, enclosingTag, SOURCE_EXT, TEMPLATE_EXT } from "../../../lib/scan.mjs";
|
|
11
|
+
|
|
12
|
+
const RULE_ID = "coder.htmx.verb-destructive-confirms";
|
|
13
|
+
const DELETE_RE = /\bhx-delete\s*=/gi;
|
|
14
|
+
const CONFIRMS_RE = /\bhx-(confirm|prompt)\s*=/i;
|
|
15
|
+
const EXTS = new Set([...SOURCE_EXT, ...TEMPLATE_EXT]);
|
|
16
|
+
|
|
17
|
+
const violations = [];
|
|
18
|
+
const excludes = readExcludes();
|
|
19
|
+
for (const root of readRoots()) {
|
|
20
|
+
for (const file of walk(root, excludes, EXTS)) {
|
|
21
|
+
const text = readText(file);
|
|
22
|
+
if (!text) continue;
|
|
23
|
+
for (const m of text.matchAll(DELETE_RE)) {
|
|
24
|
+
const tag = enclosingTag(text, m.index);
|
|
25
|
+
if (tag && CONFIRMS_RE.test(tag.text)) continue;
|
|
26
|
+
violations.push({
|
|
27
|
+
rule_id: RULE_ID,
|
|
28
|
+
file,
|
|
29
|
+
...locate(text, m.index),
|
|
30
|
+
evidence: "hx-delete without hx-confirm/hx-prompt: one mis-click destroys data with no guard",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
process.stderr.write(`bun-detector[destructive-verb-confirms]: ${violations.length} violation(s)\n`);
|
|
36
|
+
emit(violations);
|