@afokapu/atdd-bun 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +30 -0
  2. package/conventions/atdd-bun.planner/atdd-bun.planner.acceptance-identity.convention.yaml +27 -0
  3. package/conventions/atdd-bun.planner/atdd-bun.planner.identity-required.convention.yaml +28 -0
  4. package/conventions/atdd-bun.planner/atdd-bun.planner.identity-unique.convention.yaml +27 -0
  5. package/conventions/atdd-bun.planner/atdd-bun.planner.interlocking-participant-resolves.convention.yaml +28 -0
  6. package/conventions/atdd-bun.planner/atdd-bun.planner.parse.convention.yaml +27 -0
  7. package/conventions/atdd-bun.planner/atdd-bun.planner.reference-resolves.convention.yaml +28 -0
  8. package/conventions/atdd-bun.planner/atdd-bun.planner.schema.convention.yaml +30 -0
  9. package/conventions/atdd-bun.planner/atdd-bun.planner.train-wagon-resolves.convention.yaml +26 -0
  10. package/conventions/atdd-bun.topology/atdd-bun.topology.e2e-location.convention.yaml +38 -0
  11. package/conventions/atdd-bun.topology/atdd-bun.topology.feature-source-coverage.convention.yaml +30 -0
  12. package/conventions/atdd-bun.topology/atdd-bun.topology.feature-test-coverage.convention.yaml +29 -0
  13. package/conventions/atdd-bun.topology/atdd-bun.topology.plan-location.convention.yaml +31 -0
  14. package/conventions/atdd-bun.topology/atdd-bun.topology.source-location.convention.yaml +33 -0
  15. package/conventions/atdd-bun.topology/atdd-bun.topology.test-location.convention.yaml +34 -0
  16. package/detectors/atdd_topology/atdd.implementation.yaml +16 -0
  17. package/detectors/atdd_topology/detect.mjs +182 -0
  18. package/detectors/atdd_topology/fixtures/clean/atdd-bun.yaml +2 -0
  19. package/detectors/atdd_topology/fixtures/clean/e2e/interlockings/checkout/nominal.routes.test.ts +4 -0
  20. package/detectors/atdd_topology/fixtures/clean/e2e/journeys/checkout.journey.test.ts +5 -0
  21. package/detectors/atdd_topology/fixtures/clean/implementation/orders/features/place-order/domain/order.ts +4 -0
  22. package/detectors/atdd_topology/fixtures/clean/plan/_journeys/checkout.yaml +4 -0
  23. package/detectors/atdd_topology/fixtures/clean/plan/_trains/_interlockings/checkout.yaml +4 -0
  24. package/detectors/atdd_topology/fixtures/clean/plan/_trains/checkout.yaml +1 -0
  25. package/detectors/atdd_topology/fixtures/clean/plan/orders/E001.yaml +8 -0
  26. package/detectors/atdd_topology/fixtures/clean/plan/orders/_orders.yaml +5 -0
  27. package/detectors/atdd_topology/fixtures/clean/plan/orders/place-order.yaml +3 -0
  28. package/detectors/atdd_topology/fixtures/clean/tests/wagons/orders/features/place-order/unit/order.test.ts +4 -0
  29. package/detectors/atdd_topology/fixtures/dirty/plan/_journeys/checkout.yaml +3 -0
  30. package/detectors/atdd_topology/fixtures/dirty/plan/orders/E001.yaml +4 -0
  31. package/detectors/atdd_topology/fixtures/dirty/plan/orders/_orders.yaml +4 -0
  32. package/detectors/atdd_topology/fixtures/dirty/plan/orders/features/place-order.yaml +3 -0
  33. package/detectors/atdd_topology/fixtures/dirty/src/wagons/orders/features/place-order/domain/forged.ts +2 -0
  34. package/detectors/atdd_topology/fixtures/dirty/src/wagons/orders/features/place-order/domain/order.ts +2 -0
  35. package/detectors/atdd_topology/fixtures/dirty/tests/wagons/orders/features/place-order/unit/order.test.ts +4 -0
  36. package/detectors/atdd_traceability_closure/detect.mjs +5 -2
  37. package/detectors/bun_interlocking_binding/checks/interlocking_runtime_executes.mjs +3 -2
  38. package/detectors/bun_interlocking_binding/detect.mjs +6 -5
  39. package/detectors/bun_interlocking_coverage/_shared/interlocking.mjs +4 -3
  40. package/detectors/bun_interlocking_coverage/checks/interlocking_train_sequence.mjs +2 -2
  41. package/detectors/bun_interlocking_infrastructure/_shared/interlocking.mjs +2 -1
  42. package/detectors/bun_interlocking_infrastructure/checks/journey_runner_boundary.mjs +3 -2
  43. package/detectors/bun_interlocking_infrastructure/checks/journey_station_routing.mjs +2 -1
  44. package/detectors/bun_interlocking_infrastructure/checks/wagon_contract_honoured.mjs +3 -2
  45. package/detectors/bun_tester_discipline_detector/checks/t_acceptance_resolves.mjs +7 -6
  46. package/detectors/planner_docs_capability/atdd.implementation.yaml +7 -0
  47. package/detectors/planner_plan_integrity/atdd.implementation.yaml +1 -0
  48. package/detectors/planner_plan_integrity/detect.mjs +4 -1
  49. package/detectors/planner_plan_integrity/fixtures/dirty/plan/_trains/_interlockings/checkout.yaml +6 -0
  50. package/detectors/planner_plan_integrity/fixtures/dirty/plan/_trains/_interlockings/unnamed.yaml +2 -0
  51. package/detectors/planner_plan_integrity/fixtures/dirty/plan/_trains/dup-a.yaml +7 -0
  52. package/detectors/planner_plan_integrity/fixtures/dirty/plan/_trains/dup-b.yaml +6 -0
  53. package/detectors/planner_plan_integrity/fixtures/dirty/plan/orders/E001.yaml +5 -0
  54. package/detectors/planner_schema_validation/fixtures/dirty/plan/_trains/missing-description.yaml +5 -0
  55. package/integrity.json +65 -24
  56. package/package.json +1 -1
  57. package/planner-nodes/ENFORCEMENT_SCOPE.yaml +11 -1
  58. package/relationships.yaml +224 -0
  59. package/src/docs-capability.ts +3 -0
  60. package/src/enforce.ts +30 -5
  61. package/src/hooks.ts +2 -1
  62. package/src/index.ts +2 -0
  63. package/src/planner-kernel.ts +4 -2
  64. package/src/planner-schema-validator.ts +12 -10
  65. package/src/planner-validators.ts +16 -15
  66. package/src/topology.ts +40 -0
package/README.md CHANGED
@@ -97,6 +97,7 @@ name.
97
97
  | Profile | Use it when you need to check |
98
98
  |---|---|
99
99
  | `traceability` | plan acceptance, Bun test, and implementation closure |
100
+ | `topology` | feature decomposition and canonical plan, source, test, and E2E locations |
100
101
  | `planner` | plan parsing/graph integrity plus the explicitly scoped planner rules |
101
102
  | `docs` | the optional documentation capability and its declared artifacts, including the generated journey view |
102
103
  | `coder`, `tester`, `security`, `architecture`, `metrics`, `runtime` | Bun source and test conventions for that concern |
@@ -123,6 +124,35 @@ carry Station Master actions; the Bun interlocking family checks those actions r
123
124
  Hooks, direct CLI use, and CI invoke this same profile and therefore share the
124
125
  same schema source.
125
126
 
127
+ ### Repository topology
128
+
129
+ The topology gate makes a feature a required plan artifact instead of an
130
+ optional label on a WMBT. Its default layout is:
131
+
132
+ ```text
133
+ plan/<wagon>/{_<wagon>,<feature>,<WMBT>}.yaml
134
+ src/wagons/<wagon>/features/<feature>/{domain,application,infrastructure,presentation}/
135
+ tests/wagons/<wagon>/features/<feature>/{unit,contract,integration}/
136
+ e2e/interlockings/<interlocking>/<route>.routes.test.ts
137
+ e2e/journeys/<journey>.journey.test.ts
138
+ ```
139
+
140
+ Each feature must be declared by exactly one wagon and each WMBT by exactly one
141
+ feature. Source and test headers must name the feature in their path; tests bind
142
+ with `Acceptance:`, while exposed journey E2E tests bind with `Train:`. The
143
+ component-URN `integration` layer maps to the `infrastructure/` directory.
144
+
145
+ Change the four roots for an existing repository in `atdd-bun.yaml`; the same
146
+ validation then follows the configured locations:
147
+
148
+ ```yaml
149
+ topology:
150
+ plan_root: plan
151
+ source_root: src/wagons
152
+ test_root: tests/wagons
153
+ e2e_root: e2e
154
+ ```
155
+
126
156
  ### Design system
127
157
 
128
158
  The `design` profile (also part of `coder`) is the Bun realization of the core
@@ -0,0 +1,27 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.planner.acceptance-identity
3
+ kind: rule
4
+ status: active
5
+ name: Embedded acceptances carry an acceptance identity
6
+ statement: Every acceptance embedded in a WMBT is an object whose `identity.urn` starts with `acc:`. Package rule,
7
+ strict.
8
+ terms:
9
+ - term_id: package_rule
10
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
11
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
12
+ relationship edges.'
13
+ content:
14
+ summary: Embedded acceptances carry an acceptance identity.
15
+ normative_text: Tests bind acceptances by that identity; one without it can never be proven.
16
+ fix_hint: 'Give the acceptance `identity: { urn: acc:<wagon>:<id> }`.'
17
+ exceptions:
18
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
19
+ metadata:
20
+ aliases:
21
+ - ATDD-BUN-PLANNER-ACCEPTANCE-IDENTITY
22
+ severity: 3
23
+ disposition: strict
24
+ introduced_in: 0.1.0
25
+ implementation:
26
+ type: validator
27
+ ref: planner_plan_integrity
@@ -0,0 +1,28 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.planner.identity-required
3
+ kind: rule
4
+ status: active
5
+ name: Plan artifacts carry their identity
6
+ statement: Every plan artifact whose kind the planner recognizes carries its canonical identity (`train_id`, `interlocking_id`,
7
+ `journey_id`, or `urn`). Package rule, strict.
8
+ terms:
9
+ - term_id: package_rule
10
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
11
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
12
+ relationship edges.'
13
+ content:
14
+ summary: Plan artifacts carry their identity.
15
+ normative_text: An artifact without an identity cannot be referenced, bound, or traced; every rule that resolves
16
+ references silently skips it.
17
+ fix_hint: 'Add the identity field for the artifact kind, for example `interlocking_id: interlocking:checkout`.'
18
+ exceptions:
19
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
20
+ metadata:
21
+ aliases:
22
+ - ATDD-BUN-PLANNER-IDENTITY-REQUIRED
23
+ severity: 3
24
+ disposition: strict
25
+ introduced_in: 0.1.0
26
+ implementation:
27
+ type: validator
28
+ ref: planner_plan_integrity
@@ -0,0 +1,27 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.planner.identity-unique
3
+ kind: rule
4
+ status: active
5
+ name: Plan identities are unique
6
+ statement: No two plan artifacts declare the same identity (`train_id`, `interlocking_id`, `journey_id`, `urn`,
7
+ …). Package rule, strict.
8
+ terms:
9
+ - term_id: package_rule
10
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
11
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
12
+ relationship edges.'
13
+ content:
14
+ summary: Plan identities are unique.
15
+ normative_text: A reference to a duplicated identity resolves to whichever file was read first.
16
+ fix_hint: Rename one of the artifacts, or merge them.
17
+ exceptions:
18
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
19
+ metadata:
20
+ aliases:
21
+ - ATDD-BUN-PLANNER-IDENTITY-UNIQUE
22
+ severity: 3
23
+ disposition: strict
24
+ introduced_in: 0.1.0
25
+ implementation:
26
+ type: validator
27
+ ref: planner_plan_integrity
@@ -0,0 +1,28 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.planner.interlocking-participant-resolves
3
+ kind: rule
4
+ status: active
5
+ name: Interlocking participants resolve
6
+ statement: Every participant and lifeline an interlocking lists is either an external actor (`user:…`, `system:…`)
7
+ or a typed reference to an artifact the plan declares. Package rule, strict.
8
+ terms:
9
+ - term_id: package_rule
10
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
11
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
12
+ relationship edges.'
13
+ content:
14
+ summary: Interlocking participants resolve.
15
+ normative_text: A routing decision between participants the plan does not declare cannot be traced to anything
16
+ that implements it.
17
+ fix_hint: Declare the participant, or correct the lifeline.
18
+ exceptions:
19
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
20
+ metadata:
21
+ aliases:
22
+ - ATDD-BUN-PLANNER-INTERLOCKING-PARTICIPANT-RESOLVES
23
+ severity: 3
24
+ disposition: strict
25
+ introduced_in: 0.1.0
26
+ implementation:
27
+ type: validator
28
+ ref: planner_plan_integrity
@@ -0,0 +1,27 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.planner.parse
3
+ kind: rule
4
+ status: active
5
+ name: Plan artifacts parse
6
+ statement: Every `.yaml`, `.yml` or `.json` file under `plan/` parses. Package rule, strict.
7
+ terms:
8
+ - term_id: package_rule
9
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
10
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
11
+ relationship edges.'
12
+ content:
13
+ summary: Plan artifacts parse.
14
+ normative_text: An artifact that does not parse is invisible to every other rule, so its defects hide behind one
15
+ error.
16
+ fix_hint: Fix the syntax the finding reports.
17
+ exceptions:
18
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
19
+ metadata:
20
+ aliases:
21
+ - ATDD-BUN-PLANNER-PARSE
22
+ severity: 3
23
+ disposition: strict
24
+ introduced_in: 0.1.0
25
+ implementation:
26
+ type: validator
27
+ ref: planner_plan_integrity
@@ -0,0 +1,28 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.planner.reference-resolves
3
+ kind: rule
4
+ status: active
5
+ name: Typed plan references resolve
6
+ statement: Every typed reference an artifact makes (`wagon:`, `feature:`, `wmbt:`, `train:`, `interlocking:`, `journey:`)
7
+ names an artifact the plan declares. `contract:` references are resolved by the contract registry rules instead.
8
+ Package rule, strict.
9
+ terms:
10
+ - term_id: package_rule
11
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
12
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
13
+ relationship edges.'
14
+ content:
15
+ summary: Typed plan references resolve.
16
+ normative_text: A reference to nothing is a relationship the plan claims and cannot show.
17
+ fix_hint: Declare the referenced artifact, or correct the reference.
18
+ exceptions:
19
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
20
+ metadata:
21
+ aliases:
22
+ - ATDD-BUN-PLANNER-REFERENCE-RESOLVES
23
+ severity: 3
24
+ disposition: strict
25
+ introduced_in: 0.1.0
26
+ implementation:
27
+ type: validator
28
+ ref: planner_plan_integrity
@@ -0,0 +1,30 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.planner.schema
3
+ kind: rule
4
+ status: active
5
+ name: Plan artifacts satisfy their package-shipped schema
6
+ statement: Every recognized plan artifact (wagon, feature, WMBT and its acceptances, train, train interlocking,
7
+ journey topology, registries) satisfies its JSON Schema in `planner-schemas/`. A violation that belongs to a canonical
8
+ rule is reported under that rule (for example `planner.train.naming`); every other violation is reported here.
9
+ Package rule, strict.
10
+ terms:
11
+ - term_id: package_rule
12
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
13
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
14
+ relationship edges.'
15
+ content:
16
+ summary: Plan artifacts satisfy their package-shipped schema.
17
+ normative_text: The schemas are the shape every other rule assumes. An artifact that breaks its schema breaks
18
+ those assumptions silently.
19
+ fix_hint: Correct the field the finding names, as the schema requires.
20
+ exceptions:
21
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
22
+ metadata:
23
+ aliases:
24
+ - ATDD-BUN-PLANNER-SCHEMA
25
+ severity: 3
26
+ disposition: strict
27
+ introduced_in: 0.1.0
28
+ implementation:
29
+ type: validator
30
+ ref: planner_schema_validation
@@ -0,0 +1,26 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.planner.train-wagon-resolves
3
+ kind: rule
4
+ status: active
5
+ name: Train wagons resolve
6
+ statement: Every wagon a train lists under `wagons:` is declared as `wagon:<slug>`. Package rule, strict.
7
+ terms:
8
+ - term_id: package_rule
9
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
10
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
11
+ relationship edges.'
12
+ content:
13
+ summary: Train wagons resolve.
14
+ normative_text: A train ordering a wagon that does not exist cannot run.
15
+ fix_hint: Declare the wagon, or remove it from the train.
16
+ exceptions:
17
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
18
+ metadata:
19
+ aliases:
20
+ - ATDD-BUN-PLANNER-TRAIN-WAGON-RESOLVES
21
+ severity: 3
22
+ disposition: strict
23
+ introduced_in: 0.1.0
24
+ implementation:
25
+ type: validator
26
+ ref: planner_plan_integrity
@@ -0,0 +1,38 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.topology.e2e-location
3
+ kind: rule
4
+ status: active
5
+ name: Every interlocking route and exposed journey has an end-to-end test at its canonical path
6
+ statement: 'Every interlocking route has `<e2e_root>/interlockings/<interlocking>/<route>.routes.test.ts`, and every
7
+ exposed journey `<e2e_root>/journeys/<journey>.journey.test.ts`, each carrying a `test:{wagon}:{feature}:{acceptance}`
8
+ URN for a declared feature and binding `Acceptance: acc:{wagon}:{acceptance}` declared by a WMBT. On an exposed
9
+ journey whose surfaces include `frontend`, a Playwright spec (`*.e2e.ts`) substitutes for the Bun test when it
10
+ is bound to the route''s train (`// Train:`) or the journey (`// Journey:`) and carries a valid E2E or SMOKE test
11
+ URN for that same subject (`test:train:<id>:E2E-NNN-…`, `test:journey:<id>:SMOKE-NNN-…`). A browser spec carries
12
+ its identity as that URN instead of an `Acceptance:` line, which `tester.htmx.journey-no-acceptance-marker` forbids
13
+ on journey specs. Package rule, strict.'
14
+ terms:
15
+ - term_id: package_rule
16
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
17
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
18
+ relationship edges.'
19
+ - term_id: topology_settings
20
+ text: the `topology:` keys `plan_root`, `source_root`, `test_root`, `e2e_root` in `atdd-bun.yaml` (defaults `plan`,
21
+ `src/wagons`, `tests/wagons`, `e2e`).
22
+ content:
23
+ summary: Every interlocking route and exposed journey has an end-to-end test at its canonical path.
24
+ normative_text: 'One behaviour, one end-to-end proof at a path derived from the plan: a missing proof is found
25
+ by path, not by searching.'
26
+ fix_hint: Add the test at the path the finding names, or, on a frontend journey, a Playwright spec bound with
27
+ `// Train:` or `// Journey:`.
28
+ exceptions:
29
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
30
+ metadata:
31
+ aliases:
32
+ - ATDD-BUN-TOPOLOGY-E2E-LOCATION
33
+ severity: 3
34
+ disposition: strict
35
+ introduced_in: 0.6.0
36
+ implementation:
37
+ type: validator
38
+ ref: atdd_topology
@@ -0,0 +1,30 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.topology.feature-source-coverage
3
+ kind: rule
4
+ status: active
5
+ name: A feature with WMBTs has source
6
+ statement: A feature that owns WMBTs has at least one source component beneath `<source_root>/<wagon>/features/<feature>/`.
7
+ Package rule, strict.
8
+ terms:
9
+ - term_id: package_rule
10
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
11
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
12
+ relationship edges.'
13
+ - term_id: topology_settings
14
+ text: the `topology:` keys `plan_root`, `source_root`, `test_root`, `e2e_root` in `atdd-bun.yaml` (defaults `plan`,
15
+ `src/wagons`, `tests/wagons`, `e2e`).
16
+ content:
17
+ summary: A feature with WMBTs has source.
18
+ normative_text: A feature with behaviour to deliver and no implementation is a gap the plan already names.
19
+ fix_hint: Implement the feature beneath its directory, or move the WMBTs to the feature that delivers them.
20
+ exceptions:
21
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
22
+ metadata:
23
+ aliases:
24
+ - ATDD-BUN-TOPOLOGY-FEATURE-SOURCE-COVERAGE
25
+ severity: 3
26
+ disposition: strict
27
+ introduced_in: 0.6.0
28
+ implementation:
29
+ type: validator
30
+ ref: atdd_topology
@@ -0,0 +1,29 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.topology.feature-test-coverage
3
+ kind: rule
4
+ status: active
5
+ name: A feature with WMBTs has a test bound to one of its acceptances
6
+ statement: A feature that owns WMBTs has at least one test bound to one of its acceptances. Package rule, strict.
7
+ terms:
8
+ - term_id: package_rule
9
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
10
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
11
+ relationship edges.'
12
+ - term_id: topology_settings
13
+ text: the `topology:` keys `plan_root`, `source_root`, `test_root`, `e2e_root` in `atdd-bun.yaml` (defaults `plan`,
14
+ `src/wagons`, `tests/wagons`, `e2e`).
15
+ content:
16
+ summary: A feature with WMBTs has a test bound to one of its acceptances.
17
+ normative_text: Behaviour declared and never tested is a silent gap.
18
+ fix_hint: Add a test beneath the feature bound to one of its acceptances.
19
+ exceptions:
20
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
21
+ metadata:
22
+ aliases:
23
+ - ATDD-BUN-TOPOLOGY-FEATURE-TEST-COVERAGE
24
+ severity: 3
25
+ disposition: strict
26
+ introduced_in: 0.6.0
27
+ implementation:
28
+ type: validator
29
+ ref: atdd_topology
@@ -0,0 +1,31 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.topology.plan-location
3
+ kind: rule
4
+ status: active
5
+ name: Wagons, features and WMBTs live at their canonical plan paths
6
+ statement: Every wagon is declared at `<plan_root>/<wagon>/_<wagon>.yaml`, every feature at `<plan_root>/<wagon>/<feature>.yaml`,
7
+ and every WMBT at `<plan_root>/<wagon>/<WMBT>.yaml`. Package rule, strict.
8
+ terms:
9
+ - term_id: package_rule
10
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
11
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
12
+ relationship edges.'
13
+ - term_id: topology_settings
14
+ text: the `topology:` keys `plan_root`, `source_root`, `test_root`, `e2e_root` in `atdd-bun.yaml` (defaults `plan`,
15
+ `src/wagons`, `tests/wagons`, `e2e`).
16
+ content:
17
+ summary: Wagons, features and WMBTs live at their canonical plan paths.
18
+ normative_text: The plan is navigated by path as much as by identity. A document at a non-canonical path is found
19
+ by nothing that walks the layout, and two layouts in one repository make every tool guess.
20
+ fix_hint: Move the document to the path the finding names.
21
+ exceptions:
22
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
23
+ metadata:
24
+ aliases:
25
+ - ATDD-BUN-TOPOLOGY-PLAN-LOCATION
26
+ severity: 3
27
+ disposition: strict
28
+ introduced_in: 0.6.0
29
+ implementation:
30
+ type: validator
31
+ ref: atdd_topology
@@ -0,0 +1,33 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.topology.source-location
3
+ kind: rule
4
+ status: active
5
+ name: Feature source lives beneath its feature and carries a component URN
6
+ statement: 'When the plan models at least one wagon, feature or WMBT, every source file beneath `<source_root>`
7
+ carries `URN: component:{wagon}:{feature}:{name}:{frontend|backend}:{domain|application|integration|presentation}`
8
+ and lives beneath `<source_root>/<wagon>/features/<feature>/`, for a feature the plan declares. Package rule,
9
+ strict.'
10
+ terms:
11
+ - term_id: package_rule
12
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
13
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
14
+ relationship edges.'
15
+ - term_id: topology_settings
16
+ text: the `topology:` keys `plan_root`, `source_root`, `test_root`, `e2e_root` in `atdd-bun.yaml` (defaults `plan`,
17
+ `src/wagons`, `tests/wagons`, `e2e`).
18
+ content:
19
+ summary: Feature source lives beneath its feature and carries a component URN.
20
+ normative_text: Source is traced to the feature that owns it by its URN and found by its path. Either missing,
21
+ the feature cannot be shown to have an implementation.
22
+ fix_hint: Add the component URN header and move the file beneath its feature's directory.
23
+ exceptions:
24
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
25
+ metadata:
26
+ aliases:
27
+ - ATDD-BUN-TOPOLOGY-SOURCE-LOCATION
28
+ severity: 3
29
+ disposition: strict
30
+ introduced_in: 0.6.0
31
+ implementation:
32
+ type: validator
33
+ ref: atdd_topology
@@ -0,0 +1,34 @@
1
+ schema_version: 1.1.0
2
+ rule_id: atdd-bun.topology.test-location
3
+ kind: rule
4
+ status: active
5
+ name: Feature tests live beneath their feature and bind a declared acceptance
6
+ statement: 'When the plan models at least one wagon, feature or WMBT, every test beneath `<test_root>` carries `URN:
7
+ test:{wagon}:{feature}:{acceptance}`, lives beneath `<test_root>/<wagon>/features/<feature>/{unit,contract,integration}/`,
8
+ and binds `Acceptance: acc:{wagon}:{acceptance}` declared by a WMBT that the test''s own feature lists. Package
9
+ rule, strict.'
10
+ terms:
11
+ - term_id: package_rule
12
+ text: 'a rule of this package''s own gates (`atdd-bun.*`), realized by a package guard rather than a canonical
13
+ planner node. It is held to the same per-rule checks as every convention: a convention, strict, a failing fixture,
14
+ relationship edges.'
15
+ - term_id: topology_settings
16
+ text: the `topology:` keys `plan_root`, `source_root`, `test_root`, `e2e_root` in `atdd-bun.yaml` (defaults `plan`,
17
+ `src/wagons`, `tests/wagons`, `e2e`).
18
+ content:
19
+ summary: Feature tests live beneath their feature and bind a declared acceptance.
20
+ normative_text: A test proves an acceptance only when it names one that exists; its path says which feature and
21
+ which kind of test it is.
22
+ fix_hint: Add the test URN and Acceptance header, and move the test beneath its feature under unit/, contract/
23
+ or integration/.
24
+ exceptions:
25
+ - Vendored and generated trees (`node_modules`, `dist`, `build`, `_generated`) are never scanned.
26
+ metadata:
27
+ aliases:
28
+ - ATDD-BUN-TOPOLOGY-TEST-LOCATION
29
+ severity: 3
30
+ disposition: strict
31
+ introduced_in: 0.6.0
32
+ implementation:
33
+ type: validator
34
+ ref: atdd_topology
@@ -0,0 +1,16 @@
1
+ kind: implementation
2
+ subtype: guard
3
+ implementation_id: atdd_topology
4
+ emits_rule_ids:
5
+ - planner.wagon.features
6
+ - planner.feature.wagon-link
7
+ - atdd-bun.topology.plan-location
8
+ - atdd-bun.topology.source-location
9
+ - atdd-bun.topology.test-location
10
+ - atdd-bun.topology.e2e-location
11
+ - atdd-bun.topology.feature-source-coverage
12
+ - atdd-bun.topology.feature-test-coverage
13
+ realizes_convention:
14
+ - planner.wagon.features
15
+ - planner.feature.wagon-link
16
+ entrypoint: detect.mjs