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).
This commit is contained in:
+4
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@arbiter/evidence-dsl",
|
||||
"version": "1.0.0",
|
||||
"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",
|
||||
@@ -13,6 +13,7 @@
|
||||
"./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": [
|
||||
@@ -23,9 +24,10 @@
|
||||
"generate:parser": "node scripts/generate-parser.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@arbiter/core": "^1.0.1"
|
||||
"@arbiter/core": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rigor/core": "^3.1.0",
|
||||
"peggy": "^5.0.6"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user