@afokapu/atdd-bun 0.10.22 → 0.10.24

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.
@@ -27,6 +27,9 @@ for (const root of readRoots()) {
27
27
  if (!text) continue;
28
28
  const masked = maskLiteralsAndComments(text);
29
29
  for (const m of masked.matchAll(BARE_FETCH)) {
30
+ // A method DEFINED as fetch is not a call: Bun.serve({ async fetch(request) { … } }) is the inbound handler, and
31
+ // Bun requires that name (resolver-os #iFlkkL7jvEbC). A definition's parameter list is followed by its body.
32
+ if (m[0].startsWith("fetch") && /^\([^()]*\)\s*(?::\s*[^{=;]+)?\{/.test(masked.slice(m.index + m[0].length - 1))) continue;
30
33
  violations.push({ rule_id: RULE, file, ...locate(text, m.index),
31
34
  evidence: `${layerOf(file)} layer calls the platform HTTP primitive directly; route it through the centralized client in integration/` });
32
35
  }
@@ -111,10 +111,17 @@ const violations = [];
111
111
 
112
112
  for (const root of parseJsonEnv("ATDD_SCAN_ROOTS", [])) {
113
113
  for (const croot of consumerRoots(root, excludes)) {
114
- const contracts = [];
114
+ // Only a wagon some train carries moves Cargo, so only its contract can be honoured or broken in Cargo-moving code.
115
+ // A wagon no train's sequence carries yet (implemented, composed in a later tranche) is not judged until one does
116
+ // (S4 #qSWeDfXJVXcv; the convention's exception is per wagon, not per repository).
117
+ const contracts = [], carried = new Set();
115
118
  for (const f of walk(join(croot, PLAN_ROOT), (p) => /\.ya?ml$/.test(p), excludes)) {
116
- const c = wagonContract(read(f));
117
- if (c) contracts.push({ file: f, ...c });
119
+ const text = read(f), c = wagonContract(text);
120
+ if (c) contracts.push({ file: f, wagon: text.match(/^wagon:\s*["']?([^"'#\s]+)/m)?.[1] ?? null, ...c });
121
+ let doc;
122
+ try { doc = Bun.YAML.parse(text); } catch { continue; }
123
+ if (doc && typeof doc.train_id === "string" && Array.isArray(doc.sequence))
124
+ for (const step of doc.sequence) for (const end of [step?.from, step?.to]) if (typeof end === "string" && end.startsWith("wagon:")) carried.add(end.slice(6).trim());
118
125
  }
119
126
  if (!contracts.length) continue; // no declared contract
120
127
 
@@ -128,6 +135,7 @@ for (const root of parseJsonEnv("ATDD_SCAN_ROOTS", [])) {
128
135
 
129
136
  const blob = wagonCode.map((s) => maskComments(s.text)).join("\n");
130
137
  for (const c of contracts) {
138
+ if (c.wagon && !carried.has(c.wagon)) continue; // no train carries this wagon yet
131
139
  for (const [kind, names] of [["produce", c.produce], ["consume", c.consume]]) {
132
140
  for (const name of names) {
133
141
  if (blob.includes(name)) continue;
@@ -0,0 +1,5 @@
1
+ train_id: train:orders:checkout
2
+ sequence:
3
+ - step: 1
4
+ from: customer:active
5
+ to: wagon:confirm-order
@@ -0,0 +1,5 @@
1
+ train_id: train:orders:checkout
2
+ sequence:
3
+ - step: 1
4
+ from: customer:active
5
+ to: wagon:confirm-order
package/integrity.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.10.22",
2
+ "version": "0.10.24",
3
3
  "files": {
4
4
  "HOOK_AUDIT.md": "5329d840db37671b1918f688ead26865473b87db73dbc75f7c8b2a8bbe8d6d43",
5
5
  "PLANNER_PORT.md": "fb5935bac8b7ac18994de21e43ace3a5ef8cd55f85b0e3349fca261280054f11",
@@ -196,7 +196,7 @@
196
196
  "detectors/atdd_traceability_closure/fixtures/dirty/test/no-binding.test.ts": "ea8b5b0d0bfdc397b93fb0e7d1ad99fac1a2f52f4f46bc8c9f0e9783d7402c55",
197
197
  "detectors/bun_clean_architecture_detector/atdd.implementation.yaml": "c8682568ee3489c4e79661a59a71cfa3c25f444b03bbe151997e3650ea7e1110",
198
198
  "detectors/bun_clean_architecture_detector/checks/_map.json": "7d680405e8514bb3c35f1e44d7441c7fd4595a231e9e6a8a1969fd30c4327f88",
199
- "detectors/bun_clean_architecture_detector/checks/a_boundaries_http_client.mjs": "46486e6e9ddd0e3de4681d440bc730ed18b1e0b1357ce45807c6d331a87bbe26",
199
+ "detectors/bun_clean_architecture_detector/checks/a_boundaries_http_client.mjs": "87ff421176965a782c4c371a27fd34be1877ced147598245a465f7ca9bb4e4d4",
200
200
  "detectors/bun_clean_architecture_detector/checks/a_commons_application_no_integration.mjs": "08ae694a2d8b9284f1042eef188e5ea3e51bcc0c753a693bff09a0e5ef0fd74d",
201
201
  "detectors/bun_clean_architecture_detector/checks/a_commons_cross_feature.mjs": "e501e1dfc2dc9cc8894e2220cd5a04c76749647a42d9cc982f21fbbe8216a0ea",
202
202
  "detectors/bun_clean_architecture_detector/checks/a_commons_domain_no_outbound.mjs": "f61e52fbe3554d095cc47cff131d5c8a6e8020adf79fe6312362ab9580539f1f",
@@ -437,7 +437,7 @@
437
437
  "detectors/bun_interlocking_infrastructure/checks/interlocking_station_routing.mjs": "0221f5a8b49763388affefff670bc2a452e539e7658b08f6230a52f13edd36bd",
438
438
  "detectors/bun_interlocking_infrastructure/checks/journey_runner_boundary.mjs": "570e4aef423881aed982b8f25a8d553f939d1ab82271236525c14efe3a20cd4a",
439
439
  "detectors/bun_interlocking_infrastructure/checks/journey_station_routing.mjs": "bfd4899a604c34de621475ce155e527b9281d1174c6daa13a2abc7bebabf2cde",
440
- "detectors/bun_interlocking_infrastructure/checks/wagon_contract_honoured.mjs": "728f710827295472dadec182fcdf6c3e8fc44cdedeae53a669754be8435fdd7f",
440
+ "detectors/bun_interlocking_infrastructure/checks/wagon_contract_honoured.mjs": "91f612dc6e1d5ef4ab29b4442f3e3d6ef972c7aac0abac9777d7d207a6ad6ba3",
441
441
  "detectors/bun_interlocking_infrastructure/detect.mjs": "54c02f428596e057f828def0d68360b220b55dbf962b46694a21bc423ce57218",
442
442
  "detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/server.ts": "36913357fdd3c5e375829a0554c605d70f5c05e2e83349f47505741598f6eb15",
443
443
  "detectors/bun_interlocking_infrastructure/fixtures/clean/interlocking_delegates/src/match/wagon.ts": "ea202fa15fdf9d1391b1ae23343c9d1b09fcf8ef14f1dccfb8114ffaedea97c1",
@@ -464,6 +464,7 @@
464
464
  "detectors/bun_interlocking_infrastructure/fixtures/clean/journey_station_routing/plan/_journeys/public.yaml": "840aac51f72c481650eea661e9fc414a9d157350234b67cfb7a977c201a0bdee",
465
465
  "detectors/bun_interlocking_infrastructure/fixtures/clean/journey_station_routing/server.ts": "7fdfdeb8727d654bffec15d30cc65463791dc9c002557f364eb04e51fe5f27f4",
466
466
  "detectors/bun_interlocking_infrastructure/fixtures/clean/journey_station_routing/src/trains/journey.ts": "2729867d88b4e5c955451b8d812392a91ca6da7d5601c64d27a84a3deb879d01",
467
+ "detectors/bun_interlocking_infrastructure/fixtures/clean/wagon_contract_honoured/plan/_trains/checkout.yaml": "8bcf77e3d624e538472e778b4b3058809c1f4931c172b863f0826f0f07bcb892",
467
468
  "detectors/bun_interlocking_infrastructure/fixtures/clean/wagon_contract_honoured/plan/orders/_orders.yaml": "502aabeeb5a23a538f3a67ae4bb9dbd91ed4e7302f1bed5248186d07d035e47e",
468
469
  "detectors/bun_interlocking_infrastructure/fixtures/clean/wagon_contract_honoured/src/orders/wagon.ts": "ba4ab28f3a576135a12de1390663ed107cf04652f554c9f28d6ce1fff43d4c08",
469
470
  "detectors/bun_interlocking_infrastructure/fixtures/dirty/interlocking_delegates/server.ts": "36913357fdd3c5e375829a0554c605d70f5c05e2e83349f47505741598f6eb15",
@@ -491,6 +492,7 @@
491
492
  "detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_station_routing/plan/_journeys/public.yaml": "840aac51f72c481650eea661e9fc414a9d157350234b67cfb7a977c201a0bdee",
492
493
  "detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_station_routing/server.ts": "20d41fe5d1da6fa6f8b9e9800d83d3278638a555fac80f25a9b6b49cac973bf5",
493
494
  "detectors/bun_interlocking_infrastructure/fixtures/dirty/journey_station_routing/src/trains/journey.ts": "2729867d88b4e5c955451b8d812392a91ca6da7d5601c64d27a84a3deb879d01",
495
+ "detectors/bun_interlocking_infrastructure/fixtures/dirty/wagon_contract_honoured/plan/_trains/checkout.yaml": "8bcf77e3d624e538472e778b4b3058809c1f4931c172b863f0826f0f07bcb892",
494
496
  "detectors/bun_interlocking_infrastructure/fixtures/dirty/wagon_contract_honoured/plan/orders/_orders.yaml": "502aabeeb5a23a538f3a67ae4bb9dbd91ed4e7302f1bed5248186d07d035e47e",
495
497
  "detectors/bun_interlocking_infrastructure/fixtures/dirty/wagon_contract_honoured/src/orders/wagon.ts": "23807627b7bb3e08355f23fe712c0060313e89588507f720929ff1998a2e2c69",
496
498
  "detectors/bun_responsive_detector/atdd.implementation.yaml": "419f71d76c00b9cff615d7a66bcad47a85af083ec5efc5e3b7781e5aab23367a",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afokapu/atdd-bun",
3
- "version": "0.10.22",
3
+ "version": "0.10.24",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/afokapu/atdd-bun.git"