Files
evidence-dsl/package.json
T
John Dvorak 0a744329e6
CI / publish (push) Successful in 10s
CI / test (push) Successful in 13s
feat: fix lowering, DSLRuntime wrapper, rigor oracle + rejection campaigns
Lowering fixes (validate/lower/compile into known-correct core structures):
- tuple_to_userset: structural classification by object-side predicate
  (owner(*g, doc) { member_of(user, g) } -> tuple_to_userset with direction
  'in'/'out'); the old heuristic routed every outer-wildcard to chain.
- relational_comparator: operands now lower to real direct-rule configs
  (evaluateFrom derived from evidence param positions; expectedValue for
  literal args) instead of raw AST nodes the engine could not evaluate.
- defeasible: multi-level bodies (NEVER/REQUIRES/ALWAYS/WHEN/UNLESS) merge
  into one five-level rule instead of ANDed level-only rules that always
  resolved 0; nested PatternMatches flatten to N-step chains; unary predicate
  calls mark _subjectAsObject (subject-as-object semantics).
- validation: reject duplicate fact/evidence definitions.

DSLRuntime (higher-order DSL+Core wrapper):
- typed addNode/updateNodeData/addRelation/updateRelation against the DSL
  schema (known types, relation params, field types, value-carrying facts);
- check() derives the evidence's injectable partial-graph requirements,
  retrieves missing facts through caller data callbacks, injects them, and
  delegates, returning requiredFacts/providedFacts/missingFacts.

js-rigor campaigns:
- generative oracle: generate legal DSL per construct and compare every
  verdict against an independent hand-computed oracle (8 constructs x P grid)
  plus an exhaustive deterministic sweep;
- illegal mutations: one-flaw perturbations of a valid program must be
  reliably rejected (duplicate evidence/fact, arity/type mismatches, reserved
  built-ins, malformed syntax), with a control that must compile.

Depends on @arbiter/core@^1.0.2 (reason codes + _subjectAsObject).
2026-08-03 10:58:29 -07:00

34 lines
1.1 KiB
JSON

{
"name": "@arbiter/evidence-dsl",
"version": "1.1.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.2"
},
"devDependencies": {
"@rigor/core": "^3.1.0",
"peggy": "^5.0.6"
}
}