@afokapu/atdd-bun 0.10.23 → 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.
@@ -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.23",
2
+ "version": "0.10.24",
3
3
  "files": {
4
4
  "HOOK_AUDIT.md": "5329d840db37671b1918f688ead26865473b87db73dbc75f7c8b2a8bbe8d6d43",
5
5
  "PLANNER_PORT.md": "fb5935bac8b7ac18994de21e43ace3a5ef8cd55f85b0e3349fca261280054f11",
@@ -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.23",
3
+ "version": "0.10.24",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/afokapu/atdd-bun.git"