@xemahq/repo-build-tooling 0.2.0 → 0.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xemahq/repo-build-tooling",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Dev-time build tooling shared by every Xema repository. Ships as plain ESM with zero dependencies so the published artifact is the reviewed source.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Neuralchowder Inc. <developer@xema.dev> (https://xema.dev)",
@@ -17,7 +17,6 @@
17
17
  },
18
18
  "type": "module",
19
19
  "files": [
20
- "src",
21
20
  "README.md"
22
21
  ],
23
22
  "bin": {
@@ -322,8 +322,16 @@ function reExportsReach(entry, target, depth = 6, seen = new Set()) {
322
322
  * @param {string} subpath physical path inside the package, e.g. `dist/agent-composition/lib/x`
323
323
  * @param {string} original the full leaked specifier, for the proof and the error
324
324
  */
325
+ // NUL is the separator in the cache key because it cannot occur in a package
326
+ // name or a subpath, so no two distinct specifiers can collide on a
327
+ // concatenation. It MUST stay spelled as the unicode ESCAPE, never as a raw NUL
328
+ // byte in the source: one raw byte makes every binary-skipping search tool
329
+ // (ugrep, ripgrep, `grep -I`) classify the WHOLE file as binary and skip it
330
+ // silently, and a file no search can read is a file no audit, no review and no
331
+ // boundary check covers. Enforced by the aggregator boundary gate
332
+ // `grep-readable-sources`.
325
333
  function publicSpecifierFor(resolveFrom, pkg, subpath, original) {
326
- const cacheKey = `${pkg}${subpath}`;
334
+ const cacheKey = `${pkg}\u0000${subpath}`;
327
335
  if (specifierCache.has(cacheKey)) return specifierCache.get(cacheKey);
328
336
 
329
337
  let target;
@@ -1,54 +0,0 @@
1
- /**
2
- * The whole check rests on ONE predicate — `satisfies` — so that is what these
3
- * tests attack.
4
- *
5
- * The failure this guard exists to prevent is subtle in exactly one place: npm's
6
- * `^0.y.z` rule pins the MINOR, not the major. A `satisfies` that treats `^` as
7
- * "same major" uniformly would call `0.3.0` a match for `^0.2.0` and report a
8
- * clean scan over all 58 real violations — a check that reports green while
9
- * examining everything and concluding nothing. Every 0.x case below is aimed at
10
- * that specific wrong implementation.
11
- */
12
- import assert from 'node:assert/strict';
13
- import test from 'node:test';
14
-
15
- import { satisfies } from './check-workspace-range-matches-local.mjs';
16
-
17
- test('^0.y.z pins the MINOR — the rule the whole check turns on', () => {
18
- // The real defect: a client moved 0.2.0 -> 0.3.0 and fell out of every
19
- // consumer's range, silently dropping the build edge.
20
- assert.equal(satisfies('0.3.0', '^0.2.0'), false);
21
- assert.equal(satisfies('0.2.9', '^0.2.0'), true);
22
- assert.equal(satisfies('0.2.0', '^0.2.1'), false); // below the floor
23
- assert.equal(satisfies('1.0.0', '^0.2.0'), false);
24
- });
25
-
26
- test('^x.y.z (x > 0) pins the MAJOR', () => {
27
- assert.equal(satisfies('1.9.3', '^1.2.0'), true);
28
- assert.equal(satisfies('2.0.0', '^1.2.0'), false);
29
- assert.equal(satisfies('1.1.0', '^1.2.0'), false); // below the floor
30
- });
31
-
32
- test('~ pins the minor at every major', () => {
33
- assert.equal(satisfies('1.2.9', '~1.2.0'), true);
34
- assert.equal(satisfies('1.3.0', '~1.2.0'), false);
35
- assert.equal(satisfies('0.2.9', '~0.2.0'), true);
36
- assert.equal(satisfies('0.3.0', '~0.2.0'), false);
37
- });
38
-
39
- test('>= is a floor with no ceiling', () => {
40
- assert.equal(satisfies('7.5.0', '>=0.14.0'), true);
41
- assert.equal(satisfies('0.13.0', '>=0.14.0'), false);
42
- });
43
-
44
- test('an exact range means exactly that version', () => {
45
- assert.equal(satisfies('1.2.3', '1.2.3'), true);
46
- assert.equal(satisfies('1.2.4', '1.2.3'), false);
47
- });
48
-
49
- test('a prerelease is compared on its release part, never string-wise', () => {
50
- // `0.3.0-rc.1` must not read as "less than 0.3.0 therefore outside ^0.2.0
51
- // is fine" — the range check has to reach the same verdict as `0.3.0`.
52
- assert.equal(satisfies('0.3.0-rc.1', '^0.2.0'), false);
53
- assert.equal(satisfies('0.2.5-rc.1', '^0.2.0'), true);
54
- });