Files
evidence-dsl/package.json
T
John Dvorak 4d498b07e8
CI / publish (push) Successful in 9s
CI / test (push) Successful in 18s
feat: bounded self-recursion (transitive closure) for evidence
An evidence whose config contains a chain step referencing ITSELF is now
unrolled at compile time into a bounded transitive closure: a union of paths
— base, hop+base, hop²+base, …, hop^N+base — where `hop` is the recursive
chain's steps before the self-reference and the depth N comes from the
pattern's `limit N` (or the compiler's maxRecursionDepth default, 3). The
base (the evidence's non-recursive statements) is verified as a condition
step at each path's terminal node, so the engine needs no new machinery.

- Chain configs carry the pattern's `limit` as maxDepth.
- resolveEvidenceReferences detects a self-reference (_findSelfReference),
  extracts the base (_extractBase), and unrolls (_unrollRecursiveEvidence).
- Pure recursion with no base case is a compile-time error; mutual cycles
  between distinct evidence remain a compile-time error.

Example: can_access_via = can_access OR (reports_to + can_access_via) up to
the declared limit grants access inherited up a reporting chain.

Tests: Recursion (unroll shape, base + multi-hop grants, depth-limit
enforcement, default depth, pure-recursion error, mutual-cycle guard).
2026-08-03 16:35:19 -07:00

34 lines
1.1 KiB
JSON

{
"name": "@arbiter/evidence-dsl",
"version": "1.11.0",
"description": "Evidence DSL v2 compiler: translates the natural Evidence DSL (ADR-000) into @arbiter/core relation configurations.",
"license": "ISC",
"type": "module",
"main": "src/index.js",
"exports": {
".": "./src/index.js",
"./package.json": "./package.json",
"./DSLCompiler": "./src/DSLCompiler.js",
"./parser/DSLParser": "./src/parser/DSLParser.js",
"./parser/GeneratedParser": "./src/parser/GeneratedParser.js",
"./generator/RuleGenerator": "./src/generator/RuleGenerator.js",
"./validation/DSLValidation": "./src/validation/DSLValidation.js",
"./runtime/DSLRuntime": "./src/runtime/DSLRuntime.js",
"./interpreter/BuiltInFunctions": "./src/interpreter/BuiltInFunctions.js"
},
"files": [
"src/"
],
"scripts": {
"test": "node --test --test-force-exit \"tests/**/*.test.js\"",
"generate:parser": "node scripts/generate-parser.js"
},
"dependencies": {
"@arbiter/core": "^1.0.4"
},
"devDependencies": {
"@rigor/core": "^3.1.0",
"peggy": "^5.0.6"
}
}