datalog: dl-set-strategy! validates known strategy values
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
`dl-set-strategy!` accepted any keyword silently — typos like `:semi_naive` or `:semiNaive` were stored uninspected and the saturator then used the default. The user never learned their setting was wrong. Validator added: strategy must be one of `:semi-naive`, `:naive`, `:magic` (the values currently recognised by the saturator and magic-sets driver). Unknown values raise with a clear message that lists the accepted set. 1 regression test; conformance 276/276. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -359,6 +359,16 @@
|
||||
(do (dl-set-strategy! db :magic) (dl-get-strategy db)))
|
||||
:magic)
|
||||
|
||||
;; Unknown strategy values are rejected so typos don't silently
|
||||
;; fall back to the default.
|
||||
(dl-et-test!
|
||||
"unknown strategy rejected"
|
||||
(dl-et-throws?
|
||||
(fn ()
|
||||
(let ((db (dl-make-db)))
|
||||
(dl-set-strategy! db :semi_naive))))
|
||||
true)
|
||||
|
||||
;; dl-saturated?: no-work-left predicate.
|
||||
(dl-et-test! "saturated? after saturation"
|
||||
(let ((db (dl-program
|
||||
|
||||
Reference in New Issue
Block a user