feat: sources wired as recency-gated injectables; transitive closure, NOT scoping, recompile-scope uninstall; targeted parse errors
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:
+4
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user