@cosyte/x12 0.0.7 → 0.0.8

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/CHANGELOG.md CHANGED
@@ -365,6 +365,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
365
365
 
366
366
  ### Tests
367
367
 
368
+ - **The PHI-scanner suite stopped paying 30 of its 32 `tsx` start-ups, and the global `testTimeout`
369
+ now says what it does and does not cover.** No library code, no public surface and no timeout value
370
+ changed; `scripts/phi-scan.ts` and `scripts/attw.mjs` are untouched.
371
+
372
+ Nearly every case in `test/scripts/phi-scan.test.ts` spawns the scanner. Counted at runtime on
373
+ both trees with a `spawnSync` shim: **32 spawns across 32 cases, all under `tsx`**, becoming
374
+ **36 spawns across 33 cases, 34 under `node` and 2 under `tsx`**. So 30 `tsx` start-ups were
375
+ removed and 2 were kept deliberately, in the equivalence case below. The scanner is type-annotated
376
+ Node that needs erasing and nothing more, and Node 22.18 or newer strips types itself, so the
377
+ spawns now use `process.execPath`. Measured on a 12-CPU cgroup quota with
378
+ `availableParallelism()` 12 and other workers running (load average 8.9 to 11.3, a realistic
379
+ condition rather than a quiet one): one scanner start is a 441 ms median under `tsx` against
380
+ 149 ms under `node`, seven runs each. Interleaved BASE/HEAD under `pnpm test:coverage`, two rounds
381
+ each so the arms share a load condition, that file went 17.2 s / 17.5 s to 8.6 s / 8.6 s, and
382
+ 15.7 s to 6.6 s run on its own. Total CPU across all workers went 58.9 s / 58.4 s to
383
+ 50.5 s / 49.5 s. Those medians predict 8.2 s off this file (32 starts converted, less the 2 `node`
384
+ and 2 `tsx` starts the new case adds) against 9.1 s measured, so the model is the right shape and
385
+ about 11% light, not a match.
386
+
387
+ **The substitution is pinned as an equivalence rather than assumed.** The gate consumers actually
388
+ run (`pnpm phi-scan`, the pre-commit hook, CI) still invokes `tsx`, so one new case drives both
389
+ runners over the same violator and the same clean file and requires the same exit code, stdout and
390
+ stderr. It is the only place `tsx` is still spawned, and a simulated divergence reds it. **Scope it
391
+ honestly:** that case drives `paths` mode on one hit and one clean file, so it pins the exit-0 and
392
+ exit-1 verdicts and not the exit-2 refusals, nor all-mode, nor `--staged`. It is aimed at the only
393
+ divergence these two runners plausibly have, which is at module load, and a load-time divergence
394
+ cannot be confined to the routes it does not drive.
395
+
396
+ **What this did not buy, stated because the two figures diverge:** it removed about 8.6 s of CPU
397
+ but barely moved the suite's critical path (17.2 s / 17.5 s to 16.3 s / 16.7 s), which is now
398
+ `test/scripts/attw-gate.test.ts`. That file is deliberately left alone: measured, one `attw --pack`
399
+ on a trivial two-file package is 1,596 ms median, of which the real `npm pack` is 462 ms and the
400
+ rest is attw's own analysis. There is no runner to substitute there, pinning the real binary is the
401
+ point of that gate, and each of its cases already carries its own 60 s ceiling.
402
+
403
+ **`vitest.config.ts` now documents the scope of `testTimeout: 10_000`, which is narrower than it
404
+ looks in both directions.** It is a floor for ordinary tests, not where slow work gets its room:
405
+ the three slowest suites already take per-test ceilings, and the 10 MB+ 834 stream measured
406
+ 8.9 s / 10.0 s / 9.3 s / 9.1 s across the four interleaved runs, so it sits AT the 10 s global on a
407
+ merely-loaded box (a 10.0 s reading is not evidence of which side of the bar it fell), and measured
408
+ 24.1 s under heavier load on the same box. It is green only on its own 120 s ceiling. Raising the
409
+ global to
410
+ fit it would hand the same leash to all 1,100-odd tests and turn a genuinely hung test from broken
411
+ into merely slow. It is also **not a liveness net**: measured on this tree with vitest 4.1.4, an
412
+ async overrun reds at the ceiling, a finite synchronous overrun reds only after the work returns,
413
+ and an infinite synchronous loop produces no verdict at all, wedging the worker until it is killed
414
+ from outside (45 s, exit 143, no pass/fail line). That is the failure mode
415
+ `X12-CALLER-VALUE-RESIDUALS` hit for real, and the defence against it is the source scan in
416
+ `test/builder-array-bounds.test.ts`, not any timeout value.
417
+
368
418
  - **The default emit mode's guarantees are locked against the whole committed corpus, not just the 13
369
419
  goldens.** The goldens are already in the serializer's image, so they could only ever demonstrate
370
420
  the easy half of the round trip. `test/serialize.test.ts` now discovers every `.edi` fixture from
package/dist/index.cjs CHANGED
@@ -9892,7 +9892,7 @@ var profiles = Object.freeze({
9892
9892
  });
9893
9893
 
9894
9894
  // src/index.ts
9895
- var VERSION = "0.0.7";
9895
+ var VERSION = "0.0.8";
9896
9896
 
9897
9897
  exports.ACK_BUILD_ERROR_CODES = ACK_BUILD_ERROR_CODES;
9898
9898
  exports.ALL_WARNING_MESSAGES = ALL_WARNING_MESSAGES;