From a9e4eea3341920b697d1bddf7eac1ac109bf352b Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 10 May 2026 21:18:04 +0000 Subject: [PATCH] datalog-plan: log parser/safety bug-hunt round (7 bugs fixed) --- plans/datalog-on-sx.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plans/datalog-on-sx.md b/plans/datalog-on-sx.md index 7ce6b29d..8a10cd0d 100644 --- a/plans/datalog-on-sx.md +++ b/plans/datalog-on-sx.md @@ -15,7 +15,7 @@ for rose-ash data (e.g. federation graph, content relationships). ## Status (rolling) -`bash lib/datalog/conformance.sh` → **239/239 across 11 suites** +`bash lib/datalog/conformance.sh` → **256/256 across 11 suites** (tokenize, parse, unify, eval, builtins, semi_naive, negation, aggregates, api, magic, demo). Source is ~3100 LOC, tests ~2900 LOC, public API documented in `lib/datalog/datalog.sx`. @@ -320,6 +320,21 @@ large graphs. _Newest first._ +- 2026-05-10 — Bug-hunt round on parser/safety surfaced 7 real + bugs, each fixed with regression tests: + - Reserved relation names (`not`, `count`, `<`, `is`, ...) were + accepted as rule/fact heads — would silently shadow built-ins. + - Negative number literals (`n(-1).`) failed to parse — users + had to express them as `(- 0 1)` or via `is`. + - Unterminated block comment `/* ...` silently consumed the + rest of the input. Now raises with the position. + - Same silent-consume bug in unterminated string / quoted-atom. + - Empty-list rule head and non-list rule body weren't validated; + they'd crash later in `rest`. dl-add-rule! now checks shape. + - dl-magic-query with non-list / non-dict goal crashed cryptically. + - Tokenizer silently swallowed unrecognised characters (`?`, `!`, + `#`, `@`, etc.) — typos produced confusing downstream errors. + - 2026-05-08 — Phase 6 driver: `dl-magic-query db query-goal`. Builds a fresh internal db from the caller's EDB + magic seed + rewritten rules, saturates, queries, returns substitutions —