datalog: rule-shape validators in dl-add-rule! (253/253)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s
Two malformed-rule paths used to slip through:
- Empty head list `{:head () :body ()}` was accepted; the rule
would never fire but the relation-name lookup later returned
nil with confusing downstream errors.
- Non-list body (`{:head (...) :body 42}`) crashed in `rest`
during safety check with a cryptic "rest: 1 list arg".
dl-add-rule! now checks head shape (non-empty list with symbol
head) and body type (list) before any safety walk. Errors are
descriptive and surface at add time rather than during the next
saturation.
2 new eval tests.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"lang": "datalog",
|
||||
"total_passed": 251,
|
||||
"total_passed": 253,
|
||||
"total_failed": 0,
|
||||
"total": 251,
|
||||
"total": 253,
|
||||
"suites": [
|
||||
{"name":"tokenize","passed":29,"failed":0,"total":29},
|
||||
{"name":"parse","passed":22,"failed":0,"total":22},
|
||||
{"name":"unify","passed":28,"failed":0,"total":28},
|
||||
{"name":"eval","passed":36,"failed":0,"total":36},
|
||||
{"name":"eval","passed":38,"failed":0,"total":38},
|
||||
{"name":"builtins","passed":23,"failed":0,"total":23},
|
||||
{"name":"semi_naive","passed":8,"failed":0,"total":8},
|
||||
{"name":"negation","passed":10,"failed":0,"total":10},
|
||||
@@ -16,5 +16,5 @@
|
||||
{"name":"magic","passed":34,"failed":0,"total":34},
|
||||
{"name":"demo","passed":21,"failed":0,"total":21}
|
||||
],
|
||||
"generated": "2026-05-10T21:05:12+00:00"
|
||||
"generated": "2026-05-10T21:09:18+00:00"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user