initial commit: @arbiter/core authorization engine with js-rigor hardening

Zanzibar-style authorization graph engine (direct/chain/TTU/defeasible/
binary modes, condensed snapshots, value relations) with 39 rigor test
campaigns. Includes fixes for snapshot binary writer/reader format
mismatch (snapshot-of-snapshot corruption), possibility write-boundary
validation, empty-graph snapshot serialization, relation lookup cache
direction collision, config-redefinition cache invalidation, binary
threshold semantics, defeasible compiled routing, and comparator
reason whitelisting.
This commit is contained in:
John Dvorak
2026-07-31 13:44:06 -07:00
commit 717ae1031e
373 changed files with 654131 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { describe, test } from 'node:test';
import assert from 'node:assert/strict';
import fc from 'fast-check';
import { Arbiter } from '../../src/core/Arbiter.js';
describe('Fast-check: node id mapping invariants', () => {
test('resolveNodeId/resolveKey round-trip', () => {
fc.assert(
fc.property(
fc.set(fc.string({ minLength: 1, maxLength: 12 }), { minLength: 1, maxLength: 20 }),
(keys) => {
const arbiter = new Arbiter();
for (const key of keys) {
arbiter.addNode(key, 'generic');
}
for (const key of keys) {
const id = arbiter.resolveNodeId(key);
assert.ok(id !== undefined && id !== null);
const roundTrip = arbiter.resolveKey(id);
assert.strictEqual(roundTrip, key);
}
}
),
{ numRuns: 50 }
);
});
});