@altopelago/sansa 0.14.2 → 0.15.0-rc.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.
Files changed (156) hide show
  1. package/CHANGELOG.md +118 -1
  2. package/README.md +96 -1
  3. package/conformance/README.md +8 -0
  4. package/conformance/aeonic-anchor-claims.json +133 -0
  5. package/conformance/aeonic-arithmetic-claims.json +60 -0
  6. package/conformance/aeonic-clock-claims.json +123 -0
  7. package/conformance/aeonic-comparison-claims.json +37 -0
  8. package/conformance/aeonic-datetime-claims.json +110 -0
  9. package/conformance/aeonic-rational-arithmetic-claims.json +72 -0
  10. package/conformance/aeonic-temporal-claims.json +105 -0
  11. package/conformance/cts-claims.json +17 -3
  12. package/conformance/results/aeonic-anchor-capacity.json +452 -0
  13. package/conformance/results/aeonic-anchor-snapshot-0.1.json +39 -0
  14. package/conformance/results/aeonic-arithmetic-snapshot-0.1.json +28 -0
  15. package/conformance/results/aeonic-clock-all-snapshot-0.1.json +49 -0
  16. package/conformance/results/aeonic-clock-arithmetic-snapshot-0.1.json +48 -0
  17. package/conformance/results/aeonic-clock-capacity.json +326 -0
  18. package/conformance/results/aeonic-clock-relations-snapshot-0.1.json +48 -0
  19. package/conformance/results/aeonic-comparison-snapshot-0.1.json +19 -0
  20. package/conformance/results/aeonic-datetime-all-snapshot-0.1.json +47 -0
  21. package/conformance/results/aeonic-datetime-arithmetic-snapshot-0.1.json +46 -0
  22. package/conformance/results/aeonic-datetime-capacity.json +302 -0
  23. package/conformance/results/aeonic-datetime-relations-snapshot-0.1.json +46 -0
  24. package/conformance/results/aeonic-rational-arithmetic-capacity.json +100 -0
  25. package/conformance/results/aeonic-rational-arithmetic-snapshot-0.2.json +30 -0
  26. package/conformance/results/aeonic-temporal-all-property-addressing-2026-11-16.json +39 -0
  27. package/conformance/results/aeonic-temporal-all-snapshot-0.1.json +39 -0
  28. package/conformance/results/aeonic-temporal-calendar-property-addressing-2026-11-16.json +38 -0
  29. package/conformance/results/aeonic-temporal-calendar-snapshot-0.1.json +38 -0
  30. package/conformance/results/aeonic-temporal-capacity-property-addressing-2026-11-16.json +136 -0
  31. package/conformance/results/aeonic-temporal-capacity.json +136 -0
  32. package/conformance/results/aeonic-temporal-relations-property-addressing-2026-11-16.json +38 -0
  33. package/conformance/results/aeonic-temporal-relations-snapshot-0.1.json +38 -0
  34. package/docs/aeonic-arithmetic.md +126 -0
  35. package/docs/aeonic-comparison.md +123 -0
  36. package/docs/aeonic-rational-arithmetic.md +167 -0
  37. package/docs/aeonic-temporal-civil-anchor.md +89 -0
  38. package/docs/aeonic-temporal-civil-clock.md +100 -0
  39. package/docs/aeonic-temporal-civil-date.md +124 -0
  40. package/docs/aeonic-temporal-civil-datetime.md +122 -0
  41. package/docs/api-contract.md +130 -3
  42. package/docs/capabilities.json +106 -2
  43. package/docs/child-identity-activation.md +93 -0
  44. package/docs/child-identity-candidate.md +60 -0
  45. package/docs/child-identity-tooling.md +31 -0
  46. package/docs/child-identity-workflows.md +102 -0
  47. package/docs/empty-keys-candidate.md +29 -0
  48. package/docs/migration-0.15.0.md +75 -0
  49. package/docs/property-addressing-implementation.md +118 -0
  50. package/docs/property-resolve-implementation.md +105 -0
  51. package/docs/property-selector-support.md +65 -0
  52. package/docs/property-selectors-api.d.ts +43 -0
  53. package/docs/property-selectors-api.pyi +27 -0
  54. package/docs/property-selectors-api.rs +48 -0
  55. package/docs/property-selectors-contract.md +168 -0
  56. package/docs/query-tool.md +32 -1
  57. package/docs/selector-cursor.md +45 -0
  58. package/docs/unicode-hardening.md +41 -0
  59. package/fixtures/address-v1.json +4 -3
  60. package/fixtures/child-identity-workflows/README.md +9 -0
  61. package/fixtures/child-identity-workflows/moved.aeon +10 -0
  62. package/fixtures/child-identity-workflows/original.aeon +10 -0
  63. package/fixtures/child-identity-workflows/reordered.aeon +10 -0
  64. package/fixtures/child-identity-workflows/replacement.aeon +10 -0
  65. package/fixtures/child-identity-workflows/workflows.json +89 -0
  66. package/fixtures/property-namespace-candidate-v1.json +336 -0
  67. package/fixtures/property-parser-candidate-v1.json +705 -0
  68. package/fixtures/property-query-candidate-v1.json +398 -0
  69. package/fixtures/property-resolve-candidate-v1.json +2702 -0
  70. package/fixtures/unicode-hardening-v1.json +401 -0
  71. package/package.json +30 -3
  72. package/scripts/calibrate-aeonic-anchor-capacity.py +294 -0
  73. package/scripts/calibrate-aeonic-clock-capacity.py +62 -0
  74. package/scripts/calibrate-aeonic-datetime-capacity.py +76 -0
  75. package/scripts/calibrate-aeonic-rational-capacity.py +85 -0
  76. package/scripts/calibrate-aeonic-temporal-capacity.py +95 -0
  77. package/scripts/cts-address.mjs +6 -2
  78. package/scripts/cts-aeonic-anchor.mjs +21 -0
  79. package/scripts/cts-aeonic-arithmetic-adapter.mjs +25 -0
  80. package/scripts/cts-aeonic-arithmetic.mjs +24 -0
  81. package/scripts/cts-aeonic-clock.mjs +24 -0
  82. package/scripts/cts-aeonic-comparison-adapter.mjs +30 -0
  83. package/scripts/cts-aeonic-comparison.mjs +25 -0
  84. package/scripts/cts-aeonic-datetime.mjs +24 -0
  85. package/scripts/cts-aeonic-rational-arithmetic-adapter.mjs +25 -0
  86. package/scripts/cts-aeonic-rational-arithmetic.mjs +24 -0
  87. package/scripts/cts-aeonic-temporal-civil-anchor-adapter.mjs +26 -0
  88. package/scripts/cts-aeonic-temporal-civil-clock-adapter.mjs +28 -0
  89. package/scripts/cts-aeonic-temporal-civil-date-adapter.mjs +28 -0
  90. package/scripts/cts-aeonic-temporal-civil-datetime-adapter.mjs +28 -0
  91. package/scripts/cts-aeonic-temporal.mjs +24 -0
  92. package/scripts/cts-instruction.mjs +4 -2
  93. package/scripts/cts-mutate.mjs +3 -2
  94. package/scripts/cts-resolve.mjs +17 -2
  95. package/scripts/playground.mjs +110 -0
  96. package/src/aeonic-arithmetic-binding.js +61 -0
  97. package/src/aeonic-arithmetic.d.ts +84 -0
  98. package/src/aeonic-arithmetic.js +276 -0
  99. package/src/aeonic-comparison.d.ts +86 -0
  100. package/src/aeonic-comparison.js +274 -0
  101. package/src/aeonic-convenience.d.ts +30 -0
  102. package/src/aeonic-convenience.js +45 -0
  103. package/src/aeonic-exact-number.js +34 -0
  104. package/src/aeonic-json.js +45 -0
  105. package/src/aeonic-rational-arithmetic.d.ts +86 -0
  106. package/src/aeonic-rational-arithmetic.js +417 -0
  107. package/src/aeonic-rational-json.js +51 -0
  108. package/src/aeonic-temporal-civil-anchor.d.ts +54 -0
  109. package/src/aeonic-temporal-civil-anchor.js +316 -0
  110. package/src/aeonic-temporal-civil-clock.d.ts +124 -0
  111. package/src/aeonic-temporal-civil-clock.js +388 -0
  112. package/src/aeonic-temporal-civil-date.d.ts +123 -0
  113. package/src/aeonic-temporal-civil-date.js +310 -0
  114. package/src/aeonic-temporal-civil-datetime.d.ts +138 -0
  115. package/src/aeonic-temporal-civil-datetime.js +501 -0
  116. package/src/index.d.ts +84 -1
  117. package/src/index.js +828 -183
  118. package/src/property-address.js +196 -0
  119. package/src/property-resolve.js +132 -0
  120. package/src/query-metadata.d.ts +16 -0
  121. package/src/query-metadata.js +25 -0
  122. package/src/selector-cursor.d.ts +19 -0
  123. package/src/selector-cursor.js +79 -0
  124. package/stress-tests/address/invalid.sansa-cases +0 -2
  125. package/stress-tests/address/valid.sansa-cases +3 -0
  126. package/tools/mutate-web/examples.mjs +1 -1
  127. package/tools/mutate-web/runtime.mjs +0 -2
  128. package/tools/playground/README.md +165 -0
  129. package/tools/playground/accessibility.js +91 -0
  130. package/tools/playground/aeon-highlight.js +77 -0
  131. package/tools/playground/aeon-source-composer.js +1077 -0
  132. package/tools/playground/anchor-examples.mjs +16 -0
  133. package/tools/playground/arithmetic-evaluator.mjs +28 -0
  134. package/tools/playground/arithmetic-model.mjs +187 -0
  135. package/tools/playground/arithmetic-worker.mjs +14 -0
  136. package/tools/playground/arithmetic.css +1 -0
  137. package/tools/playground/arithmetic.html +29 -0
  138. package/tools/playground/arithmetic.mjs +110 -0
  139. package/tools/playground/clock-examples.mjs +16 -0
  140. package/tools/playground/datetime-examples.mjs +22 -0
  141. package/tools/playground/examples.mjs +46 -0
  142. package/tools/playground/index.html +174 -0
  143. package/tools/playground/local.css +25 -0
  144. package/tools/playground/namespace.mjs +39 -0
  145. package/tools/playground/sansa-playground.js +1565 -0
  146. package/tools/playground/site.css +3914 -0
  147. package/tools/playground/temporal-examples.mjs +20 -0
  148. package/tools/playground/walkthrough.js +90 -0
  149. package/tools/playground/website-origin.json +16 -0
  150. package/tools/query-web/IDENTITY_SELECTORS.md +44 -0
  151. package/tools/query-web/app.js +4 -0
  152. package/tools/query-web/index.html +4 -0
  153. package/tools/query-web/runtime.mjs +70 -19
  154. package/tools/workflows/property-playground-assertions.mjs +33 -0
  155. package/tools/workflows/verify-child-identities.mjs +137 -0
  156. package/tools/workflows/verify-property-playground.mjs +48 -0
@@ -9,7 +9,7 @@ const root = resolve(here, '..');
9
9
  const ctsRoot = process.env.AEONITE_CTS_ROOT
10
10
  ? resolve(process.env.AEONITE_CTS_ROOT)
11
11
  : resolve(root, '..', '..', 'aeonite-org', 'aeonite-cts', 'cts');
12
- const manifestPath = readArg('--cts') ?? resolve(ctsRoot, 'sansa', 'v1', 'sansa-address-parser-cts.v1.json');
12
+ const manifestPath = readArg('--cts') ?? resolve(ctsRoot, 'sansa', 'v1', process.argv.includes('--child-identity') ? 'sansa-child-identity-parser-cts.v1.next.json' : 'sansa-address-parser-cts.v1.json');
13
13
 
14
14
  const manifest = readJson(manifestPath);
15
15
  let pass = 0;
@@ -22,7 +22,8 @@ for (const suiteRef of manifest.suites ?? []) {
22
22
  const suite = readJson(suitePath);
23
23
  console.log(`\n--- Suite: ${suite.title} ---`);
24
24
 
25
- for (const test of suite.tests ?? []) {
25
+ const excluded = new Set(suiteRef.exclude_tests ?? []);
26
+ for (const test of (suite.tests ?? []).filter(test => !excluded.has(test.id))) {
26
27
  const failures = runTest(test);
27
28
  if (failures.length > 0) {
28
29
  fail += 1;
@@ -56,6 +57,9 @@ function runTest(test) {
56
57
  failures.push(`error mismatch: expected ${expectedCode}, got ${actualCode}`);
57
58
  }
58
59
  }
60
+ if (Number.isInteger(expected.index) && result.errors?.[0]?.index !== expected.index) {
61
+ failures.push(`index mismatch: expected ${expected.index}, got ${result.errors?.[0]?.index ?? null}`);
62
+ }
59
63
  return failures;
60
64
  }
61
65
 
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { dirname, resolve, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
6
+ const args = process.argv.slice(2), settings = new Map();
7
+ for (let i = 0; i < args.length; i += 2) {
8
+ if (!['--cts-root', '--cts', '--specs-root', '--report'].includes(args[i]) || !args[i + 1] || settings.has(args[i])) {
9
+ throw new Error('Expected unique --cts-root, --cts, --specs-root or --report arguments');
10
+ }
11
+ settings.set(args[i], args[i + 1]);
12
+ }
13
+ const ctsRoot = resolve(settings.get('--cts-root') ?? process.env.AEONITE_CTS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-cts/cts'));
14
+ const specsRoot = resolve(settings.get('--specs-root') ?? process.env.AEONITE_ANCHOR_SPECS_ROOT ?? process.env.AEONITE_SPECS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-specs'));
15
+ const command = [join(dirname(ctsRoot), 'runners/run_aeonic_temporal_civil_anchor.py'),
16
+ '--manifest', settings.has('--cts') ? resolve(settings.get('--cts')) : join(ctsRoot, 'aeonic-temporal-civil-anchor/v1/aeonic-temporal-civil-anchor-cts.v1.snapshot-0.1.json'),
17
+ '--specs-root', specsRoot, '--cwd', root, '--sut', 'node scripts/cts-aeonic-temporal-civil-anchor-adapter.mjs'];
18
+ if (settings.has('--report')) command.push('--report', resolve(settings.get('--report')));
19
+ const result = spawnSync(process.env.PYTHON ?? 'python3', command, { cwd: root, stdio: 'inherit' });
20
+ if (result.error) throw result.error;
21
+ process.exitCode = result.status ?? 1;
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import { evaluateAeonicArithmeticStructuredJson, evaluateAeonicArithmeticText } from '../src/aeonic-arithmetic.js';
3
+ import { parseArithmeticEnvelope } from '../src/aeonic-arithmetic-binding.js';
4
+
5
+ const object = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
6
+ const scalar = (v) => typeof v === 'string' && !/[\uD800-\uDFFF]/u.test(v);
7
+ const closed = (v, names) => Object.keys(v).every((k) => names.includes(k));
8
+ try {
9
+ if (process.argv.length !== 2) throw new Error('Unknown adapter argument');
10
+ const chunks = [];
11
+ for await (const chunk of process.stdin) chunks.push(chunk);
12
+ const input = parseArithmeticEnvelope(new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks)));
13
+ if (!object(input) || !['lane', 'case_id', 'fixture', 'policy'].every((k) => Object.hasOwn(input, k)) ||
14
+ input.lane !== 'aeonic-arithmetic' || !scalar(input.case_id) || !input.case_id.length ||
15
+ !object(input.fixture) || !object(input.policy) || !closed(input.policy, ['resourceLimits'])) throw new Error('Malformed CTS envelope');
16
+ const fixture = input.fixture, structured = Object.hasOwn(fixture, 'request');
17
+ if (!closed(fixture, ['request', 'requestText']) || structured === Object.hasOwn(fixture, 'requestText') ||
18
+ (!structured && !scalar(fixture.requestText))) throw new Error('Invalid fixture binding');
19
+ const evaluate = structured ? evaluateAeonicArithmeticStructuredJson : evaluateAeonicArithmeticText;
20
+ const result = evaluate(structured ? fixture.request : fixture.requestText, input.policy);
21
+ const ok = result.outcome === 'value';
22
+ process.stdout.write(JSON.stringify({ ok, errors: ok ? [] : [{ code: result.reason, path: null, span: null, phase: null }], warnings: [], result }) + '\n');
23
+ } catch (error) {
24
+ process.stderr.write('CTS harness failure: ' + error.message + '\n'); process.exitCode = 1;
25
+ }
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { dirname, resolve, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
7
+ const args = process.argv.slice(2);
8
+ const settings = new Map();
9
+ for (let i = 0; i < args.length; i += 2) {
10
+ if (!['--cts-root', '--cts', '--specs-root', '--report'].includes(args[i]) || !args[i + 1] || settings.has(args[i])) {
11
+ throw new Error('Expected unique --cts-root, --cts, --specs-root or --report path arguments');
12
+ }
13
+ settings.set(args[i], resolve(args[i + 1]));
14
+ }
15
+ const ctsRoot = resolve(settings.get('--cts-root') ?? process.env.AEONITE_CTS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-cts/cts'));
16
+ const specsRoot = resolve(settings.get('--specs-root') ?? process.env.AEONITE_SPECS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-specs'));
17
+ const adapter = 'node scripts/cts-aeonic-arithmetic-adapter.mjs';
18
+ const command = [join(dirname(ctsRoot), 'runners/run_aeonic_arithmetic.py'),
19
+ '--manifest', settings.get('--cts') ?? join(ctsRoot, 'aeonic-arithmetic/v1/aeonic-arithmetic-cts.v1.snapshot-0.1.json'),
20
+ '--specs-root', specsRoot, '--cwd', root, '--sut', adapter];
21
+ if (settings.has('--report')) command.push('--report', settings.get('--report'));
22
+ const result = spawnSync(process.env.PYTHON ?? 'python3', command, { cwd: root, stdio: 'inherit' });
23
+ if (result.error) throw result.error;
24
+ process.exitCode = result.status ?? 1;
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { dirname, resolve, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
6
+ const args = process.argv.slice(2), settings = new Map();
7
+ for (let i = 0; i < args.length; i += 2) {
8
+ if (!['--cts-root', '--cts', '--specs-root', '--report', '--capability-set'].includes(args[i]) || !args[i + 1] || settings.has(args[i])) {
9
+ throw new Error('Expected unique --cts-root, --cts, --specs-root, --report or --capability-set arguments');
10
+ }
11
+ settings.set(args[i], args[i + 1]);
12
+ }
13
+ const choice = settings.get('--capability-set') ?? 'all';
14
+ if (!['all', 'relations', 'arithmetic'].includes(choice)) throw new Error('Invalid capability selection');
15
+ const ctsRoot = resolve(settings.get('--cts-root') ?? process.env.AEONITE_CTS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-cts/cts'));
16
+ const specsRoot = resolve(settings.get('--specs-root') ?? process.env.AEONITE_CLOCK_SPECS_ROOT ?? process.env.AEONITE_SPECS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-specs'));
17
+ const command = [join(dirname(ctsRoot), 'runners/run_aeonic_temporal_civil_clock.py'),
18
+ '--manifest', settings.has('--cts') ? resolve(settings.get('--cts')) : join(ctsRoot, 'aeonic-temporal-civil-clock/v1/aeonic-temporal-civil-clock-cts.v1.snapshot-0.1.json'),
19
+ '--specs-root', specsRoot, '--cwd', root, '--capability-set', choice,
20
+ '--sut', 'node scripts/cts-aeonic-temporal-civil-clock-adapter.mjs --capability-set ' + choice];
21
+ if (settings.has('--report')) command.push('--report', resolve(settings.get('--report')));
22
+ const result = spawnSync(process.env.PYTHON ?? 'python3', command, { cwd: root, stdio: 'inherit' });
23
+ if (result.error) throw result.error;
24
+ process.exitCode = result.status ?? 1;
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import { evaluateAeonicComparisonText } from '../src/index.js';
3
+ import { evaluateAeonicComparisonStructuredJson } from '../src/aeonic-comparison.js';
4
+ import { parseStrictJson } from '../src/aeonic-json.js';
5
+
6
+ const scalar = (value) => typeof value === 'string' && !/[\uD800-\uDFFF]/u.test(value);
7
+ const object = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
8
+ const closed = (value, keys) => Object.keys(value).every(key => keys.includes(key));
9
+ try {
10
+ if (process.argv.length !== 2) throw new Error('Unexpected adapter argument');
11
+ const chunks = [];
12
+ for await (const chunk of process.stdin) chunks.push(chunk);
13
+ const envelope = parseStrictJson(new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks)));
14
+ if (!object(envelope) || !closed(envelope, ['lane', 'case_id', 'fixture', 'policy']) ||
15
+ envelope.lane !== 'aeonic-operations' || !scalar(envelope.case_id) || !envelope.case_id ||
16
+ !object(envelope.fixture) || !object(envelope.policy) || !closed(envelope.policy, ['resourceLimits'])) {
17
+ throw new Error('Malformed CTS input envelope');
18
+ }
19
+ const fixture = envelope.fixture;
20
+ const structured = Object.hasOwn(fixture, 'request');
21
+ if (!closed(fixture, ['request', 'requestText']) || structured === Object.hasOwn(fixture, 'requestText') ||
22
+ !structured && !scalar(fixture.requestText)) throw new Error('Invalid comparison fixture binding');
23
+ const evaluate = structured ? evaluateAeonicComparisonStructuredJson : evaluateAeonicComparisonText;
24
+ const result = evaluate(structured ? fixture.request : fixture.requestText, { resourceLimits: envelope.policy.resourceLimits });
25
+ const ok = result.outcome === 'value';
26
+ process.stdout.write(JSON.stringify({ ok, errors: ok ? [] : [{ code: result.reason, path: null, span: null, phase: null }], warnings: [], result }) + '\n');
27
+ } catch (error) {
28
+ process.stderr.write(`Aeonic comparison CTS harness failure: ${error.message}\n`);
29
+ process.exitCode = 1;
30
+ }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { dirname, resolve, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
7
+ const args = process.argv.slice(2);
8
+ const settings = new Map();
9
+ for (let i = 0; i < args.length; i += 2) {
10
+ if (!['--cts-root', '--cts', '--specs-root', '--report'].includes(args[i]) || !args[i + 1] || settings.has(args[i])) {
11
+ throw new Error('Expected unique --cts-root, --cts, --specs-root or --report path arguments');
12
+ }
13
+ settings.set(args[i], resolve(args[i + 1]));
14
+ }
15
+ const ctsRoot = settings.get('--cts-root') ?? process.env.AEONITE_CTS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-cts/cts');
16
+ const specsRoot = settings.get('--specs-root') ?? process.env.AEONITE_SPECS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-specs');
17
+ const adapter = 'node scripts/cts-aeonic-comparison-adapter.mjs';
18
+ const command = [join(dirname(ctsRoot), 'runners/run_aeonic_operations.py'),
19
+ '--manifest', settings.get('--cts') ?? join(ctsRoot, 'aeonic-operations/v1/aeonic-operations-cts.v1.snapshot-0.1.json'),
20
+ '--specs-root', specsRoot, '--cwd', root, '--capability-set', 'baseline',
21
+ '--sut', adapter, '--without-declared-order-sut', adapter];
22
+ if (settings.has('--report')) command.push('--report', settings.get('--report'));
23
+ const result = spawnSync(process.env.PYTHON ?? 'python3', command, { cwd: root, stdio: 'inherit' });
24
+ if (result.error) throw result.error;
25
+ process.exitCode = result.status ?? 1;
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { dirname, resolve, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
6
+ const args = process.argv.slice(2), settings = new Map();
7
+ for (let i = 0; i < args.length; i += 2) {
8
+ if (!['--cts-root', '--cts', '--specs-root', '--report', '--capability-set'].includes(args[i]) || !args[i + 1] || settings.has(args[i])) {
9
+ throw new Error('Expected unique --cts-root, --cts, --specs-root, --report or --capability-set arguments');
10
+ }
11
+ settings.set(args[i], args[i + 1]);
12
+ }
13
+ const choice = settings.get('--capability-set') ?? 'all';
14
+ if (!['all', 'relations', 'arithmetic'].includes(choice)) throw new Error('Invalid capability selection');
15
+ const ctsRoot = resolve(settings.get('--cts-root') ?? process.env.AEONITE_CTS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-cts/cts'));
16
+ const specsRoot = resolve(settings.get('--specs-root') ?? process.env.AEONITE_DATETIME_SPECS_ROOT ?? process.env.AEONITE_SPECS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-specs'));
17
+ const command = [join(dirname(ctsRoot), 'runners/run_aeonic_temporal_civil_datetime.py'),
18
+ '--manifest', settings.has('--cts') ? resolve(settings.get('--cts')) : join(ctsRoot, 'aeonic-temporal-civil-datetime/v1/aeonic-temporal-civil-datetime-cts.v1.snapshot-0.1.json'),
19
+ '--specs-root', specsRoot, '--cwd', root, '--capability-set', choice,
20
+ '--sut', 'node scripts/cts-aeonic-temporal-civil-datetime-adapter.mjs --capability-set ' + choice];
21
+ if (settings.has('--report')) command.push('--report', resolve(settings.get('--report')));
22
+ const result = spawnSync(process.env.PYTHON ?? 'python3', command, { cwd: root, stdio: 'inherit' });
23
+ if (result.error) throw result.error;
24
+ process.exitCode = result.status ?? 1;
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import { evaluateAeonicRationalArithmeticStructuredJson, evaluateAeonicRationalArithmeticText } from '../src/aeonic-rational-arithmetic.js';
3
+ import { parseRationalArithmeticEnvelope } from '../src/aeonic-rational-json.js';
4
+
5
+ const object = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
6
+ const scalar = (v) => typeof v === 'string' && !/[\uD800-\uDFFF]/u.test(v);
7
+ const closed = (v, names) => Object.keys(v).every((k) => names.includes(k));
8
+ try {
9
+ if (process.argv.length !== 2) throw new Error('Unknown adapter argument');
10
+ const chunks = [];
11
+ for await (const chunk of process.stdin) chunks.push(chunk);
12
+ const input = parseRationalArithmeticEnvelope(new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks)));
13
+ if (!object(input) || !['lane', 'case_id', 'fixture', 'policy'].every((k) => Object.hasOwn(input, k)) ||
14
+ input.lane !== 'aeonic-rational-arithmetic' || !scalar(input.case_id) || !input.case_id.length ||
15
+ !object(input.fixture) || !object(input.policy) || !closed(input.policy, ['resourceLimits'])) throw new Error('Malformed CTS envelope');
16
+ const fixture = input.fixture, structured = Object.hasOwn(fixture, 'request');
17
+ if (!closed(fixture, ['request', 'requestText']) || structured === Object.hasOwn(fixture, 'requestText') ||
18
+ (!structured && !scalar(fixture.requestText))) throw new Error('Invalid fixture binding');
19
+ const evaluate = structured ? evaluateAeonicRationalArithmeticStructuredJson : evaluateAeonicRationalArithmeticText;
20
+ const result = evaluate(structured ? fixture.request : fixture.requestText, input.policy);
21
+ const ok = result.outcome === 'value';
22
+ process.stdout.write(JSON.stringify({ ok, errors: ok ? [] : [{ code: result.reason, path: null, span: null, phase: null }], warnings: [], result }) + '\n');
23
+ } catch (error) {
24
+ process.stderr.write('CTS harness failure: ' + error.message + '\n'); process.exitCode = 1;
25
+ }
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { dirname, resolve, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
7
+ const args = process.argv.slice(2);
8
+ const settings = new Map();
9
+ for (let i = 0; i < args.length; i += 2) {
10
+ if (!['--cts-root', '--cts', '--specs-root', '--report'].includes(args[i]) || !args[i + 1] || settings.has(args[i])) {
11
+ throw new Error('Expected unique --cts-root, --cts, --specs-root or --report path arguments');
12
+ }
13
+ settings.set(args[i], resolve(args[i + 1]));
14
+ }
15
+ const ctsRoot = resolve(settings.get('--cts-root') ?? process.env.AEONITE_CTS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-cts/cts'));
16
+ const specsRoot = resolve(settings.get('--specs-root') ?? process.env.AEONITE_SPECS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-specs'));
17
+ const adapter = 'node scripts/cts-aeonic-rational-arithmetic-adapter.mjs';
18
+ const command = [join(dirname(ctsRoot), 'runners/run_aeonic_rational_arithmetic.py'),
19
+ '--manifest', settings.get('--cts') ?? join(ctsRoot, 'aeonic-rational-arithmetic/v1/aeonic-rational-arithmetic-cts.v1.snapshot-0.2.json'),
20
+ '--specs-root', specsRoot, '--cwd', root, '--sut', adapter];
21
+ if (settings.has('--report')) command.push('--report', settings.get('--report'));
22
+ const result = spawnSync(process.env.PYTHON ?? 'python3', command, { cwd: root, stdio: 'inherit' });
23
+ if (result.error) throw result.error;
24
+ process.exitCode = result.status ?? 1;
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import { evaluateAeonicCivilAnchorStructuredJson, evaluateAeonicCivilAnchorText } from '../src/aeonic-temporal-civil-anchor.js';
3
+ import { parseRationalArithmeticEnvelope } from '../src/aeonic-rational-json.js';
4
+
5
+ const object = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
6
+ const scalar = (v) => typeof v === 'string' && !/[\uD800-\uDFFF]/u.test(v);
7
+ const closed = (v, names) => Object.keys(v).every((k) => names.includes(k));
8
+ try {
9
+ if (process.argv.length !== 2) throw new Error('No adapter options are supported');
10
+ const capabilities = ['anchoring'];
11
+ const chunks = [];
12
+ for await (const chunk of process.stdin) chunks.push(chunk);
13
+ const input = parseRationalArithmeticEnvelope(new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks)));
14
+ if (!object(input) || !['lane', 'case_id', 'fixture', 'policy'].every((k) => Object.hasOwn(input, k)) ||
15
+ input.lane !== 'aeonic-temporal-civil-anchor' || !scalar(input.case_id) || !input.case_id.length ||
16
+ !object(input.fixture) || !object(input.policy) || !closed(input.policy, ['resourceLimits'])) throw new Error('Malformed CTS envelope');
17
+ const fixture = input.fixture, structured = Object.hasOwn(fixture, 'request');
18
+ if (!closed(fixture, ['request', 'requestText']) || structured === Object.hasOwn(fixture, 'requestText') ||
19
+ (!structured && !scalar(fixture.requestText))) throw new Error('Invalid fixture binding');
20
+ const evaluate = structured ? evaluateAeonicCivilAnchorStructuredJson : evaluateAeonicCivilAnchorText;
21
+ const result = evaluate(structured ? fixture.request : fixture.requestText, { ...input.policy, capabilities });
22
+ const ok = result.outcome === 'value';
23
+ process.stdout.write(JSON.stringify({ ok, errors: ok ? [] : [{ code: result.reason, path: null, span: null, phase: null }], warnings: [], result }) + '\n');
24
+ } catch (error) {
25
+ process.stderr.write('CTS harness failure: ' + error.message + '\n'); process.exitCode = 1;
26
+ }
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ import { evaluateAeonicCivilClockStructuredJson, evaluateAeonicCivilClockText } from '../src/aeonic-temporal-civil-clock.js';
3
+ import { parseRationalArithmeticEnvelope } from '../src/aeonic-rational-json.js';
4
+
5
+ const object = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
6
+ const scalar = (v) => typeof v === 'string' && !/[\uD800-\uDFFF]/u.test(v);
7
+ const closed = (v, names) => Object.keys(v).every((k) => names.includes(k));
8
+ try {
9
+ const args = process.argv.slice(2);
10
+ const choice = args.length === 0 ? 'all' : args.length === 2 && args[0] === '--capability-set' ? args[1] : null;
11
+ if (!['all', 'relations', 'arithmetic'].includes(choice)) throw new Error('Use --capability-set all|relations|arithmetic');
12
+ const capabilities = choice === 'all' ? ['relations', 'arithmetic'] : [choice];
13
+ const chunks = [];
14
+ for await (const chunk of process.stdin) chunks.push(chunk);
15
+ const input = parseRationalArithmeticEnvelope(new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks)));
16
+ if (!object(input) || !['lane', 'case_id', 'fixture', 'policy'].every((k) => Object.hasOwn(input, k)) ||
17
+ input.lane !== 'aeonic-temporal-civil-clock' || !scalar(input.case_id) || !input.case_id.length ||
18
+ !object(input.fixture) || !object(input.policy) || !closed(input.policy, ['resourceLimits'])) throw new Error('Malformed CTS envelope');
19
+ const fixture = input.fixture, structured = Object.hasOwn(fixture, 'request');
20
+ if (!closed(fixture, ['request', 'requestText']) || structured === Object.hasOwn(fixture, 'requestText') ||
21
+ (!structured && !scalar(fixture.requestText))) throw new Error('Invalid fixture binding');
22
+ const evaluate = structured ? evaluateAeonicCivilClockStructuredJson : evaluateAeonicCivilClockText;
23
+ const result = evaluate(structured ? fixture.request : fixture.requestText, { ...input.policy, capabilities });
24
+ const ok = result.outcome === 'value';
25
+ process.stdout.write(JSON.stringify({ ok, errors: ok ? [] : [{ code: result.reason, path: null, span: null, phase: null }], warnings: [], result }) + '\n');
26
+ } catch (error) {
27
+ process.stderr.write('CTS harness failure: ' + error.message + '\n'); process.exitCode = 1;
28
+ }
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ import { evaluateAeonicTemporalStructuredJson, evaluateAeonicTemporalText } from '../src/aeonic-temporal-civil-date.js';
3
+ import { parseRationalArithmeticEnvelope } from '../src/aeonic-rational-json.js';
4
+
5
+ const object = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
6
+ const scalar = (v) => typeof v === 'string' && !/[\uD800-\uDFFF]/u.test(v);
7
+ const closed = (v, names) => Object.keys(v).every((k) => names.includes(k));
8
+ try {
9
+ const args = process.argv.slice(2);
10
+ const choice = args.length === 0 ? 'all' : args.length === 2 && args[0] === '--capability-set' ? args[1] : null;
11
+ if (!['all', 'relations', 'calendar'].includes(choice)) throw new Error('Use --capability-set all|relations|calendar');
12
+ const capabilities = choice === 'all' ? ['relations', 'calendar'] : [choice];
13
+ const chunks = [];
14
+ for await (const chunk of process.stdin) chunks.push(chunk);
15
+ const input = parseRationalArithmeticEnvelope(new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks)));
16
+ if (!object(input) || !['lane', 'case_id', 'fixture', 'policy'].every((k) => Object.hasOwn(input, k)) ||
17
+ input.lane !== 'aeonic-temporal-civil-date' || !scalar(input.case_id) || !input.case_id.length ||
18
+ !object(input.fixture) || !object(input.policy) || !closed(input.policy, ['resourceLimits'])) throw new Error('Malformed CTS envelope');
19
+ const fixture = input.fixture, structured = Object.hasOwn(fixture, 'request');
20
+ if (!closed(fixture, ['request', 'requestText']) || structured === Object.hasOwn(fixture, 'requestText') ||
21
+ (!structured && !scalar(fixture.requestText))) throw new Error('Invalid fixture binding');
22
+ const evaluate = structured ? evaluateAeonicTemporalStructuredJson : evaluateAeonicTemporalText;
23
+ const result = evaluate(structured ? fixture.request : fixture.requestText, { ...input.policy, capabilities });
24
+ const ok = result.outcome === 'value';
25
+ process.stdout.write(JSON.stringify({ ok, errors: ok ? [] : [{ code: result.reason, path: null, span: null, phase: null }], warnings: [], result }) + '\n');
26
+ } catch (error) {
27
+ process.stderr.write('CTS harness failure: ' + error.message + '\n'); process.exitCode = 1;
28
+ }
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ import { evaluateAeonicCivilDateTimeStructuredJson, evaluateAeonicCivilDateTimeText } from '../src/aeonic-temporal-civil-datetime.js';
3
+ import { parseRationalArithmeticEnvelope } from '../src/aeonic-rational-json.js';
4
+
5
+ const object = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
6
+ const scalar = (v) => typeof v === 'string' && !/[\uD800-\uDFFF]/u.test(v);
7
+ const closed = (v, names) => Object.keys(v).every((k) => names.includes(k));
8
+ try {
9
+ const args = process.argv.slice(2);
10
+ const choice = args.length === 0 ? 'all' : args.length === 2 && args[0] === '--capability-set' ? args[1] : null;
11
+ if (!['all', 'relations', 'arithmetic'].includes(choice)) throw new Error('Use --capability-set all|relations|arithmetic');
12
+ const capabilities = choice === 'all' ? ['relations', 'arithmetic'] : [choice];
13
+ const chunks = [];
14
+ for await (const chunk of process.stdin) chunks.push(chunk);
15
+ const input = parseRationalArithmeticEnvelope(new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks)));
16
+ if (!object(input) || !['lane', 'case_id', 'fixture', 'policy'].every((k) => Object.hasOwn(input, k)) ||
17
+ input.lane !== 'aeonic-temporal-civil-datetime' || !scalar(input.case_id) || !input.case_id.length ||
18
+ !object(input.fixture) || !object(input.policy) || !closed(input.policy, ['resourceLimits'])) throw new Error('Malformed CTS envelope');
19
+ const fixture = input.fixture, structured = Object.hasOwn(fixture, 'request');
20
+ if (!closed(fixture, ['request', 'requestText']) || structured === Object.hasOwn(fixture, 'requestText') ||
21
+ (!structured && !scalar(fixture.requestText))) throw new Error('Invalid fixture binding');
22
+ const evaluate = structured ? evaluateAeonicCivilDateTimeStructuredJson : evaluateAeonicCivilDateTimeText;
23
+ const result = evaluate(structured ? fixture.request : fixture.requestText, { ...input.policy, capabilities });
24
+ const ok = result.outcome === 'value';
25
+ process.stdout.write(JSON.stringify({ ok, errors: ok ? [] : [{ code: result.reason, path: null, span: null, phase: null }], warnings: [], result }) + '\n');
26
+ } catch (error) {
27
+ process.stderr.write('CTS harness failure: ' + error.message + '\n'); process.exitCode = 1;
28
+ }
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { dirname, resolve, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
6
+ const args = process.argv.slice(2), settings = new Map();
7
+ for (let i = 0; i < args.length; i += 2) {
8
+ if (!['--cts-root', '--cts', '--specs-root', '--report', '--capability-set'].includes(args[i]) || !args[i + 1] || settings.has(args[i])) {
9
+ throw new Error('Expected unique --cts-root, --cts, --specs-root, --report or --capability-set arguments');
10
+ }
11
+ settings.set(args[i], args[i + 1]);
12
+ }
13
+ const choice = settings.get('--capability-set') ?? 'all';
14
+ if (!['all', 'relations', 'calendar'].includes(choice)) throw new Error('Invalid capability selection');
15
+ const ctsRoot = resolve(settings.get('--cts-root') ?? process.env.AEONITE_CTS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-cts/cts'));
16
+ const specsRoot = resolve(settings.get('--specs-root') ?? process.env.AEONITE_TEMPORAL_SPECS_ROOT ?? process.env.AEONITE_SPECS_ROOT ?? resolve(root, '../../aeonite-org/aeonite-specs'));
17
+ const command = [join(dirname(ctsRoot), 'runners/run_aeonic_temporal_civil_date.py'),
18
+ '--manifest', settings.has('--cts') ? resolve(settings.get('--cts')) : join(ctsRoot, 'aeonic-temporal-civil-date/v1/aeonic-temporal-civil-date-cts.v1.snapshot-0.1.json'),
19
+ '--specs-root', specsRoot, '--cwd', root, '--capability-set', choice,
20
+ '--sut', 'node scripts/cts-aeonic-temporal-civil-date-adapter.mjs --capability-set ' + choice];
21
+ if (settings.has('--report')) command.push('--report', resolve(settings.get('--report')));
22
+ const result = spawnSync(process.env.PYTHON ?? 'python3', command, { cwd: root, stdio: 'inherit' });
23
+ if (result.error) throw result.error;
24
+ process.exitCode = result.status ?? 1;
@@ -9,7 +9,7 @@ const root = resolve(here, '..');
9
9
  const ctsRoot = process.env.AEONITE_CTS_ROOT
10
10
  ? resolve(process.env.AEONITE_CTS_ROOT)
11
11
  : resolve(root, '..', '..', 'aeonite-org', 'aeonite-cts', 'cts');
12
- const manifestPath = readArg('--cts') ?? resolve(ctsRoot, 'sansa', 'v1', 'sansa-instruction-cts.v1.json');
12
+ const manifestPath = readArg('--cts') ?? resolve(ctsRoot, 'sansa', 'v1', 'sansa-instruction-cts.v1.next.json');
13
13
 
14
14
  const manifest = readJson(manifestPath);
15
15
  let pass = 0;
@@ -23,7 +23,8 @@ for (const suiteRef of manifest.suites ?? []) {
23
23
  const namespaces = buildNamespaces(suite.fixtures?.namespaces ?? []);
24
24
  console.log(`\n--- Suite: ${suite.title} ---`);
25
25
 
26
- for (const test of suite.tests ?? []) {
26
+ const excluded = new Set(suiteRef.exclude_tests ?? []);
27
+ for (const test of (suite.tests ?? []).filter(test => !excluded.has(test.id))) {
27
28
  const failures = runTest(test, namespaces);
28
29
  if (failures.length > 0) {
29
30
  fail += 1;
@@ -54,6 +55,7 @@ function runTest(test, namespaces) {
54
55
 
55
56
  if (mode === 'target') {
56
57
  if (!result.ok) {
58
+ if (expected.ok) failures.push('instruction rejected before expected successful target validation');
57
59
  compareError(expected, result, failures);
58
60
  return failures;
59
61
  }
@@ -10,7 +10,7 @@ const root = resolve(here, '..');
10
10
  const ctsRoot = process.env.AEONITE_CTS_ROOT
11
11
  ? resolve(process.env.AEONITE_CTS_ROOT)
12
12
  : resolve(root, '..', '..', 'aeonite-org', 'aeonite-cts', 'cts');
13
- const manifestPath = readArg('--cts') ?? resolve(ctsRoot, 'sansa', 'v1', 'sansa-mutate-cts.v1.json');
13
+ const manifestPath = readArg('--cts') ?? resolve(ctsRoot, 'sansa', 'v1', 'sansa-mutate-cts.v1.next.json');
14
14
 
15
15
  const manifest = readJson(manifestPath);
16
16
  let pass = 0;
@@ -23,7 +23,8 @@ for (const suiteRef of manifest.suites ?? []) {
23
23
  const suite = readJson(suitePath);
24
24
  console.log(`\n--- Suite: ${suite.title} ---`);
25
25
 
26
- for (const test of suite.tests ?? []) {
26
+ const excluded = new Set(suiteRef.exclude_tests ?? []);
27
+ for (const test of (suite.tests ?? []).filter(test => !excluded.has(test.id))) {
27
28
  const namespaces = buildNamespaces(suite.fixtures?.namespaces ?? []);
28
29
  const failures = runTest(test, namespaces);
29
30
  if (failures.length > 0) {
@@ -9,7 +9,7 @@ const root = resolve(here, '..');
9
9
  const ctsRoot = process.env.AEONITE_CTS_ROOT
10
10
  ? resolve(process.env.AEONITE_CTS_ROOT)
11
11
  : resolve(root, '..', '..', 'aeonite-org', 'aeonite-cts', 'cts');
12
- const manifestPath = readArg('--cts') ?? resolve(ctsRoot, 'sansa', 'v1', 'sansa-resolve-cts.v1.json');
12
+ const manifestPath = readArg('--cts') ?? resolve(ctsRoot, 'sansa', 'v1', process.argv.includes('--child-identity') ? 'sansa-child-identity-resolve-cts.v1.next.json' : 'sansa-resolve-cts.v1.json');
13
13
 
14
14
  const manifest = readJson(manifestPath);
15
15
  let pass = 0;
@@ -23,7 +23,8 @@ for (const suiteRef of manifest.suites ?? []) {
23
23
  const namespaces = buildNamespaces(suite.fixtures?.namespaces ?? []);
24
24
  console.log(`\n--- Suite: ${suite.title} ---`);
25
25
 
26
- for (const test of suite.tests ?? []) {
26
+ const excluded = new Set(suiteRef.exclude_tests ?? []);
27
+ for (const test of (suite.tests ?? []).filter(test => !excluded.has(test.id))) {
27
28
  const failures = runTest(test, namespaces);
28
29
  if (failures.length > 0) {
29
30
  fail += 1;
@@ -69,7 +70,12 @@ function runTest(test, namespaces) {
69
70
  options.maxBindings = test.input.maxBindings;
70
71
  }
71
72
 
73
+ if (Object.hasOwn(test.input ?? {}, 'maxIdentityInspections')) options.maxIdentityInspections = test.input.maxIdentityInspections;
74
+ fixture.resetIdentityCalls();
72
75
  const result = resolveAddress(source, fixture.namespace, options);
76
+ if (Number.isSafeInteger(expected.identityCalls) && fixture.identityCalls() !== expected.identityCalls) {
77
+ failures.push(`identityCalls mismatch: expected ${expected.identityCalls}, got ${fixture.identityCalls()}`);
78
+ }
73
79
 
74
80
  if (result.ok !== Boolean(expected.ok)) {
75
81
  failures.push(`ok mismatch: expected ${Boolean(expected.ok)}, got ${result.ok}`);
@@ -89,6 +95,9 @@ function runTest(test, namespaces) {
89
95
  failures.push(`selectorIndex mismatch: expected ${expected.selectorIndex}, got ${actualSelectorIndex ?? null}`);
90
96
  }
91
97
  }
98
+ if (typeof expected.identity === 'string' && result.errors?.[0]?.identity !== expected.identity) {
99
+ failures.push(`identity mismatch: expected ${expected.identity}, got ${result.errors?.[0]?.identity ?? null}`);
100
+ }
92
101
  if (Number.isSafeInteger(expected.limit) && result.errors?.[0]?.limit !== expected.limit) {
93
102
  failures.push(`limit mismatch: expected ${expected.limit}, got ${result.errors?.[0]?.limit ?? null}`);
94
103
  }
@@ -111,10 +120,16 @@ function buildNamespaces(entries) {
111
120
  const byAddress = new Map();
112
121
  const parents = new Map();
113
122
  indexBindingTree(entry.root, byAddress, parents);
123
+ let identityCalls = 0;
114
124
  output.set(entry.id, {
115
125
  byAddress,
126
+ identityCalls: () => identityCalls,
127
+ resetIdentityCalls: () => { identityCalls = 0; },
116
128
  namespace: {
117
129
  root: entry.root,
130
+ ...(entry.supportsIdentity === true
131
+ ? { identity: (binding) => { identityCalls += 1; return binding.identity; } }
132
+ : {}),
118
133
  children: (binding) => binding.children ?? [],
119
134
  attributeSpace: (binding) => binding.attributeSpace,
120
135
  ...(entry.supportsParentTraversal === true