Load Prolog config overrides safely #35

Merged
lost-rob0t merged 3 commits from fix/zara-004-prolog-config-overrides into fix/zara-003-fail-closed-commands 2026-07-18 20:48:38 +00:00
lost-rob0t commented 2026-07-18 20:19:49 +00:00 (Migrated from github.com)

What changed

  • replaced raw Prolog config consultation with an allowlisted fact reader
  • validates unqualified and correctly module-qualified supported overrides
  • installs overrides into kb_config or kb_intents ahead of defaults
  • tracks and erases prior user clauses during reload
  • rejects directives, unknown facts, invalid providers, and malformed values
  • adds isolated XDG tests for every required override and reload behavior

Why

User facts were previously consulted into the loader module, while runtime lookups queried other modules. Appended facts also lost to defaults selected with once/1.

Impact

The generated Prolog configuration works as written, overrides win deterministically, and reloads cannot accumulate stale user clauses. Python TOML and Prolog fact configuration remain separate and documented.

Validation

  • nix develop -c scripts/test-prolog-config.sh
  • nix develop -c scripts/test-command-routing.sh
  • nix develop -c pytest (11 passed)

Closes #5

## What changed - replaced raw Prolog config consultation with an allowlisted fact reader - validates unqualified and correctly module-qualified supported overrides - installs overrides into `kb_config` or `kb_intents` ahead of defaults - tracks and erases prior user clauses during reload - rejects directives, unknown facts, invalid providers, and malformed values - adds isolated XDG tests for every required override and reload behavior ## Why User facts were previously consulted into the loader module, while runtime lookups queried other modules. Appended facts also lost to defaults selected with `once/1`. ## Impact The generated Prolog configuration works as written, overrides win deterministically, and reloads cannot accumulate stale user clauses. Python TOML and Prolog fact configuration remain separate and documented. ## Validation - `nix develop -c scripts/test-prolog-config.sh` - `nix develop -c scripts/test-command-routing.sh` - `nix develop -c pytest` (11 passed) Closes #5
Sign in to join this conversation.
No description provided.