@afokapu/atdd-bun 0.10.12 → 0.10.14

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.
@@ -217,8 +217,10 @@ function appFile(croot) {
217
217
  /* absent */
218
218
  }
219
219
  }
220
+ // Beyond the named files, only the module that declares the map counts: a test or wagon that imports it only
221
+ // mentions it, and taking the first mention made a route test the Station Master (C1, #MjeoAs7SZUHk).
220
222
  for (const f of walkFiles(croot, isTs)) {
221
- if (/\bJOURNEY_MAP\b/.test(readText(f))) return f;
223
+ if (!/\.(test|spec)\.[cm]?[jt]sx?$/.test(f) && /\b(?:const|let|var)\s+JOURNEY_MAP\b/.test(readText(f))) return f;
222
224
  }
223
225
  return null;
224
226
  }
@@ -24,10 +24,19 @@
24
24
  // acceptances, so a one-acceptance-per-file naming rule would fragment a real
25
25
  // suite. Both levels are parsed here.
26
26
  import { readFileSync, statSync, readdirSync, writeFileSync } from "node:fs";
27
- import { join, extname, sep } from "node:path";
27
+ import { dirname, join, extname, sep } from "node:path";
28
+ import { fileURLToPath } from "node:url";
28
29
 
29
30
  export const DEFAULT_EXCLUDES = ["node_modules", "dist", "build", ".next", ".git", "_generated"];
30
31
  export const TEST_RE = /\.(test|spec)\.[cm]?[jt]sx?$/;
32
+
33
+ // atdd-bun generates atdd-bun.integrity.test.ts and forbids editing it, so no tester rule judges it. It is recognised by
34
+ // its content, the package's template with the version filled in, never by name or header: a copy of either earns nothing.
35
+ const INTEGRITY_TEMPLATE = (() => { try { return readFileSync(join(dirname(fileURLToPath(import.meta.url)), "../../templates/agents/atdd-bun.integrity.test.ts"), "utf8"); } catch { return null; } })();
36
+ function isGeneratedIntegrityTest(path) {
37
+ if (!INTEGRITY_TEMPLATE || !path.endsWith("atdd-bun.integrity.test.ts")) return false;
38
+ try { return readFileSync(path, "utf8").replace(/^(\/\/ Generated by @afokapu\/atdd-bun )\S+?(\. Do not edit)/, "$1{{VERSION}}$2") === INTEGRITY_TEMPLATE; } catch { return false; }
39
+ }
31
40
  export const PHASES = new Set(["RED", "UNIT", "SMOKE", "E2E"]);
32
41
  export const LAYERS = new Set(["domain", "application", "integration", "presentation", "assembly"]);
33
42
 
@@ -50,7 +59,7 @@ function isExcluded(path, excludes) {
50
59
  export function* walkTests(root, excludes) {
51
60
  let st;
52
61
  try { st = statSync(root); } catch { return; }
53
- if (st.isFile()) { if (TEST_RE.test(root)) yield root; return; }
62
+ if (st.isFile()) { if (TEST_RE.test(root) && !isGeneratedIntegrityTest(root)) yield root; return; }
54
63
  let names;
55
64
  try { names = readdirSync(root); } catch { return; }
56
65
  for (const name of names) {
@@ -59,7 +68,7 @@ export function* walkTests(root, excludes) {
59
68
  let cst;
60
69
  try { cst = statSync(full); } catch { continue; }
61
70
  if (cst.isDirectory()) yield* walkTests(full, excludes);
62
- else if (TEST_RE.test(full)) yield full;
71
+ else if (TEST_RE.test(full) && !isGeneratedIntegrityTest(full)) yield full;
63
72
  }
64
73
  }
65
74
 
package/integrity.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.10.12",
2
+ "version": "0.10.14",
3
3
  "files": {
4
4
  "HOOK_AUDIT.md": "5329d840db37671b1918f688ead26865473b87db73dbc75f7c8b2a8bbe8d6d43",
5
5
  "PLANNER_PORT.md": "fb5935bac8b7ac18994de21e43ace3a5ef8cd55f85b0e3349fca261280054f11",
@@ -329,7 +329,7 @@
329
329
  "detectors/bun_green_traceability_detector/urn_header.mjs": "004b0ed1f71ec476fb57a959d302da4b5869ff91be049865a806bedca40f55b9",
330
330
  "detectors/bun_interlocking_binding/atdd.implementation.yaml": "8df233a7c337d38ab4fc92a309273b91fe713b27507a4b2cfa66ffc7a948d520",
331
331
  "detectors/bun_interlocking_binding/checks/interlocking_runtime_executes.mjs": "ea4c32914a007962012e9062cc64063fa939ff0a59c07960c34872d058720955",
332
- "detectors/bun_interlocking_binding/detect.mjs": "42767b7d329b5b2623de37f450c416fe6feb4a7ae737201376e93aa74d493dea",
332
+ "detectors/bun_interlocking_binding/detect.mjs": "b70be185c0d8323de42a25d17c363a7d9451fa92c3172a82a3b6b662582195c8",
333
333
  "detectors/bun_interlocking_binding/fixtures/clean/e2e/interlockings/match-resolution/trace.test.ts": "5dadc041ca9825f404340ca428e14bbff5e00824ca6c25464f21cd2ce56044d8",
334
334
  "detectors/bun_interlocking_binding/fixtures/clean/plan/_trains/_interlockings/match-resolution.yaml": "11884309beb9bcceccfeda7917ea73d51a530366db5eb60772b03cf5eeb239cd",
335
335
  "detectors/bun_interlocking_binding/fixtures/clean/plan/_trains/train:match:match-resolution-standard.yaml": "a7067661a723e02e0e844e6b90ad187f620dd328e1b9be45163c04db1919ce77",
@@ -641,7 +641,7 @@
641
641
  "detectors/bun_tester_discipline_detector/fixtures/dirty/unresolvable_binding.test.ts": "fd878356127cd66c05a1ab2c461982366f3a757895decf19cf24634f2c476d44",
642
642
  "detectors/bun_tester_discipline_detector/fixtures/dirty/vacuous.red.test.ts": "deea6befc7f87aa54b52df40f1032e4b547cb1336da3aec985c76aeb5097364a",
643
643
  "detectors/bun_tester_discipline_detector/fixtures/dirty/wrongruntime.test.ts": "041e421ef2b2810545020b5945733822dcae416d3360657217d3bab901cc2cdd",
644
- "detectors/bun_tester_discipline_detector/test_header.mjs": "d843c3dcb87ae8f07923f346daf0e5f4a4415e5704894e3845a4c38f6987ef68",
644
+ "detectors/bun_tester_discipline_detector/test_header.mjs": "f4b5934bb08cfc3b3c0b4fc33b4136662c6643f1cad9e47d270214b5b2b48cd4",
645
645
  "detectors/bun_ts_metrics_detector/atdd.implementation.yaml": "6ced804a5fdc82b6cd52be21ebacefa5d3261fca03a391178b2bf21186776364",
646
646
  "detectors/bun_ts_metrics_detector/checks/_map.json": "ed7c198564a80252f92e8ba2f50352daa1476ea88a23bfc0b3630e58c688f95d",
647
647
  "detectors/bun_ts_metrics_detector/checks/ts_complexity_cyclomatic.mjs": "56640b3a0f565c45a73b7c174adb1d6b4b6ac24d286a907bc1426f013cd6039e",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afokapu/atdd-bun",
3
- "version": "0.10.12",
3
+ "version": "0.10.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/afokapu/atdd-bun.git"