Files
core/package.json
T
John Dvorak ed34df4474
CI / benchmark (push) Successful in 48s
CI / test (push) Successful in 5m26s
CI / publish (push) Has been skipped
feat: intermediate chain condition steps, graph-version cache invalidation, rolling-hash chain keys; fix vacuous rigor invariants
Chain intermediates (rule-based reachability):
- ChainRule: a condition step ({ rule, conditionStep }) at an INTERMEDIATE
  position is now EXPANDED from the current node — the rule's base edges'
  destinations, filtered by its defeaters/requirements — and traversal
  continues from each discovered node. Adds _expandRuleFromSrc / direct /
  logical(union/intersection) / defeasible / nested-chain expansion.
- RuleEvaluator: _subjectIsObject flag for unary predicate calls whose subject
  entity IS the object parameter (trusted(other) inside peer_trusted(user,
  other)); previously only subject-var unary calls (_subjectAsObject) were
  handled, so object-var unary defeaters never fired.

Graph-version cache invalidation:
- Arbiter gains a monotonic _graphVersion, incremented on every relation
  mutation. ChainRule result cache, RuleEvaluator rule-result cache, and
  DecisionCache rule cache now stamp entries with the graph version and treat
  any mismatch as a miss — graph mutations can no longer serve stale
  chain/authorization results.

Rolling-hash cache keys:
- UnifiedKeyManager.createChainKey now builds a 53-bit rolling hash (dual
  FNV-1a lanes, exact for ints/floats/strings/nested configs) instead of
  JSON.stringify — no string allocation or serialization on the chain-cache
  hot path. Composite keys stay structured strings because the direct-check
  cache pattern-invalidates by relation ID.

Rigor invariant migration (correctness):
- All 43 rigor test files' throw-based invariants ({ error, errorMessage } =>
  !error && !errorMessage) never saw fn throws — vacuous. Migrated to
  ({ actual }) => actual !== undefined, which fails on any thrown violation
  while passing legitimate null-skips. The migration immediately surfaced
  two latent bugs, now fixed:
    * node-manager/graph-indices skip paths returned bare undefined (falsy
      sentinel) — return { skipped: true }.
    * complex-graph-values-crucible expiry section rewrote values equal to the
      mutation loop's last write; the engine (by design) keeps the old
      timestamp on same-value rewrites so the pre-expiry grant never
      materialized. Now writes guaranteed-different values.
2026-08-03 13:26:42 -07:00

73 lines
3.7 KiB
JSON

{
"name": "@arbiter/core",
"version": "1.0.4",
"description": "Arbiter core engine: graph indices, relation/reachability, authorization rule evaluator, DSL/AST, condensed & sharded snapshots, and evidence fusion.",
"license": "ISC",
"author": "",
"type": "module",
"main": "src/index.js",
"exports": {
".": "./src/index.js",
"./package.json": "./package.json"
},
"files": [
"src/"
],
"scripts": {
"test": "node --test --test-force-exit \"tests/**/*.test.js\" \"tests/integration/*.js\"",
"test:all": "npm test",
"test:rules": "node --test --test-force-exit \"tests/rules/**/*.test.js\"",
"test:engine": "node --test --test-force-exit \"tests/engine/**/*.test.js\"",
"test:rigor": "node --test --test-force-exit \"tests/rigor/**/*.test.js\"",
"test:rigor:authz": "node --test --test-force-exit tests/rigor/authorization-graph.test.js tests/rigor/authorization-config-consistency.test.js",
"test:rigor:zanzibar": "node --test --test-force-exit tests/rigor/zanzibar-semantics.test.js tests/rigor/zanzibar-consistency.test.js tests/rigor/zanzibar-defeasible-dsl-comparator.test.js",
"test:rigor:model": "node --test --test-force-exit tests/rigor/model-based-graph.test.js tests/rigor/dsl-mutation-parity.test.js",
"test:rigor:snapshot": "node --test --test-force-exit tests/rigor/snapshot-parity.test.js",
"test:rigor:explain": "node --test --test-force-exit tests/rigor/check-explain-agreement.test.js",
"test:rigor:cache": "node --test --test-force-exit tests/rigor/cache-parity.test.js",
"test:rigor:batch": "node --test --test-force-exit tests/rigor/batch-loading-parity.test.js",
"test:rigor:overlay": "node --test --test-force-exit tests/rigor/overlay-precedence.test.js",
"test:core": "node --test --test-force-exit \"tests/core/**/*.test.js\"",
"test:ast": "node --test --test-force-exit \"tests/ast/**/*.test.js\"",
"test:property": "node --test --test-force-exit \"tests/property-based/**/*.test.js\"",
"test:integration": "node --test --test-force-exit \"tests/integration/*.js\"",
"test:perf": "RUN_PERF_TESTS=1 node --test --test-force-exit tests/engine/core-performance-targets.test.js",
"benchmark": "node --expose-gc scripts/benchmark.js",
"benchmark:core": "node benchmarks/core-performance-benchmark.js",
"benchmark:batch": "node benchmarks/batch-size-analysis.js",
"benchmark:chain": "node benchmarks/chain-rule-benchmark.js",
"benchmark:reachability": "node benchmarks/reachability-optimization-benchmark.js",
"benchmark:comparator": "node benchmarks/relational-comparator-benchmark.js",
"benchmark:business": "node benchmarks/business-operations-benchmark.js",
"benchmark:inference": "node benchmarks/benchmark-interval-inference.js",
"benchmark:b2c": "node benchmarks/b2c-auth-bench.js",
"benchmark:authz": "node benchmarks/b2c-auth-bench.js",
"benchmark:snapshot": "node benchmarks/arbiter-snapshot-boot-bench.js",
"benchmark:sharded": "node benchmarks/sharded-snapshot-build.js",
"benchmark:memory": "node benchmarks/memory-breakdown.js",
"benchmark:multi-hop": "node benchmarks/multi-hop-rule-bench.js",
"benchmark:save": "node --expose-gc scripts/benchmark.js --save",
"benchmark:complex": "node --expose-gc benchmarks/complex-query-bench.js",
"benchmark:complex-query": "node --expose-gc benchmarks/complex-query-bench.js"
},
"keywords": [
"zanzibar",
"authorization",
"graph",
"rebac",
"rule-engine",
"dsl"
],
"dependencies": {
"@tenere/pltc-core": "^0.6.3",
"heapify": "^1.0.2",
"uuidv7": "^1.0.2"
},
"devDependencies": {
"@rigor/core": "*",
"@tenere/benchmark-lib": "^2.0.1",
"fast-check": "^4.5.3",
"@arbiter/evidence-dsl": "^1.0.0"
}
}