refactor: extract Evidence DSL to @arbiter/evidence-dsl package
The Evidence DSL (ADR-000) compiles a natural DSL into core rule configurations — it is a separate concern from the engine. The AST had zero runtime coupling to the core (DSLCompiler takes the arbiter as a duck-typed argument; ip-utils were the only shared code, now local to the DSL package). This extraction removes the DSL surface from the core artifact entirely: - src/ast/ (748K, ~60 files) moved to @arbiter/evidence-dsl@1.0.0 - ip-utils moved with it (only the DSL consumed them) - generate-parser script + peggy devDep moved to the DSL package - the 8 DSL-consuming tests now import from @arbiter/evidence-dsl (deep-path exports: DSLCompiler, parser/*, generator/*, validation/*, interpreter/*) - package.json gains the devDependency, drops build:ast/generate:parser Tarball: AST-free. Rigor 251/251, full suite 838/776/0.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { rigor } from '@rigor/core';
|
||||
import { DSLCompiler } from '../../src/ast/DSLCompiler.js';
|
||||
import { DSLCompiler } from '@arbiter/evidence-dsl/DSLCompiler';
|
||||
|
||||
// Built-in types from lib/src/ast/validation/DSLPrelude.js are reserved (User, Account,
|
||||
// Device, AuthSession). Use non-reserved names so the validator accepts the DSL.
|
||||
@@ -215,8 +215,8 @@ describe('DSLCompiler → engine rule mapping (rigor)', () => {
|
||||
// multi_hop shape uses a plain variable binding instead. We bypass the
|
||||
// validator by directly exercising the parser→generator path: parse
|
||||
// only, then run the generator against the parsed AST.
|
||||
const { parse } = await import('../../src/ast/parser/DSLParser.js');
|
||||
const { RuleGenerator } = await import('../../src/ast/generator/RuleGenerator.js');
|
||||
const { parse } = await import('@arbiter/evidence-dsl/parser/DSLParser');
|
||||
const { RuleGenerator } = await import('@arbiter/evidence-dsl/generator/RuleGenerator');
|
||||
const dsl = `${DEFINITIONS}${FACTS}\nevidence canReach(a: Person, b: Person) { friend_of(a, f) { friend_of(f, b) } limit 5 }\n`;
|
||||
const program = parse(dsl);
|
||||
const generator = new RuleGenerator(arbiter);
|
||||
|
||||
@@ -17,7 +17,7 @@ import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { rigor } from '@rigor/core';
|
||||
import { Arbiter } from '../../src/index.js';
|
||||
import { DSLCompiler } from '../../src/ast/DSLCompiler.js';
|
||||
import { DSLCompiler } from '@arbiter/evidence-dsl/DSLCompiler';
|
||||
|
||||
const EPS = 1e-9;
|
||||
const POS = [0, 0.25, 0.5, 0.75, 1];
|
||||
|
||||
@@ -20,7 +20,7 @@ import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { rigor } from '@rigor/core';
|
||||
import { Arbiter } from '../../src/index.js';
|
||||
import { DSLCompiler } from '../../src/ast/DSLCompiler.js';
|
||||
import { DSLCompiler } from '@arbiter/evidence-dsl/DSLCompiler';
|
||||
|
||||
const EPS = 1e-9;
|
||||
const POSSIBILITIES = [0, 0.25, 0.5, 0.75, 1];
|
||||
|
||||
Reference in New Issue
Block a user