feat: sources wired as recency-gated injectables; transitive closure, NOT scoping, recompile-scope uninstall; targeted parse errors
CI / test (push) Successful in 20s
CI / publish (push) Has been skipped

BEHAVES AS transitive now emits bounded multi_hop configs (direct checks and
evidence references), fixing a silent no-op. NOT builds keep _subjectAsObject
scoping so unary predicates negate the right node, and value-typed evidence
objects gate by exact edge value. Recompiling a scope uninstalls its stale
relation configs (compileMultiple coexistence preserved). Sources become
injectable relations honored by requiredFacts with a within-X recency gate.
Duplicate definition fields and three common declaration mistakes (within on a
fact, two BEHAVES clauses, limit on a non-pattern body) now produce targeted
errors. Provider edges referencing unknown nodes are warned and dropped.
This commit is contained in:
John Dvorak
2026-08-03 20:27:13 -07:00
parent 4d498b07e8
commit 2a7f4c315b
10 changed files with 556 additions and 28 deletions
+4 -2
View File
@@ -39,13 +39,15 @@ export class DSLCompiler {
const programNode = {
definitions: program.body.filter(s => s.type === 'Definition'),
facts: program.body.filter(s => s.type === 'Fact'),
sources: program.body.filter(s => s.type === 'Source'),
evidence: program.body.filter(s => s.type === 'Evidence'),
measures: program.body.filter(s => s.type === 'Measure'),
validate: () => ({ isValid: true, errors: [], warnings: [] })
};
// Generate rules from AST
const generationResult = this.generator.generateRules(programNode);
// Generate rules from AST (scoped to the program name so recompiling a
// scope revokes its stale relations without touching other scopes).
const generationResult = this.generator.generateRules(programNode, programName);
if (!generationResult.success) {
return {