feat(prolog): add durable symbolic knowledge store #33

Open
nsaspy wants to merge 1 commit from fix/prolog-long-term-kb into main
Owner

What changed

  • Add a durable SWI-Prolog library(persistency) knowledge store for long-term symbolic memory.
  • Add project, global, and explicit session scopes; project identity is shared across worktrees via repository identity.
  • Add typed knowledge for memory, bug, failure_path, invariant, decision, workaround, and warning.
  • Add lifecycle states active, resolved, and superseded, plus explicit forget for deletion.
  • Extend prolog-verify with remember, recall, resolve, supersede, forget, and context.
  • Generate .prolog/knowledge.kb as an active read-only projection for verification/reasoning.
  • Preserve the proof boundary: durable knowledge is historical context; .prolog/facts.kb plus current machine observations remain authoritative proof.
  • Serialize durable DB operations so concurrent agents/worktrees do not race.
  • Add documentation for knowledge semantics and regression coverage for project/global precedence, bug resolution, projection, and memory use without an initialized verification workspace.

Default store

$XDG_DATA_HOME/prolog-verification/knowledge.db (normally ~/.local/share/prolog-verification/knowledge.db), overridable with PROLOG_VERIFY_DB.

Validation

  • prolog-verify.py compiles cleanly.
  • All 8 tests/test_prolog_verification.py cases pass locally when run in shards (the complete single invocation exceeds the local tool-call wall clock, not a test failure).
  • Coverage includes existing stale-evidence, observation, Brave, and stop-hook behavior plus durable bug memory, resolution, project-over-global precedence, projection, and memory use without an initialized verification workspace.
## What changed - Add a durable SWI-Prolog `library(persistency)` knowledge store for long-term symbolic memory. - Add `project`, `global`, and explicit `session` scopes; project identity is shared across worktrees via repository identity. - Add typed knowledge for `memory`, `bug`, `failure_path`, `invariant`, `decision`, `workaround`, and `warning`. - Add lifecycle states `active`, `resolved`, and `superseded`, plus explicit `forget` for deletion. - Extend `prolog-verify` with `remember`, `recall`, `resolve`, `supersede`, `forget`, and `context`. - Generate `.prolog/knowledge.kb` as an active read-only projection for verification/reasoning. - Preserve the proof boundary: durable knowledge is historical context; `.prolog/facts.kb` plus current machine observations remain authoritative proof. - Serialize durable DB operations so concurrent agents/worktrees do not race. - Add documentation for knowledge semantics and regression coverage for project/global precedence, bug resolution, projection, and memory use without an initialized verification workspace. ## Default store `$XDG_DATA_HOME/prolog-verification/knowledge.db` (normally `~/.local/share/prolog-verification/knowledge.db`), overridable with `PROLOG_VERIFY_DB`. ## Validation - `prolog-verify.py` compiles cleanly. - All 8 `tests/test_prolog_verification.py` cases pass locally when run in shards (the complete single invocation exceeds the local tool-call wall clock, not a test failure). - Coverage includes existing stale-evidence, observation, Brave, and stop-hook behavior plus durable bug memory, resolution, project-over-global precedence, projection, and memory use without an initialized verification workspace.
feat(prolog): add durable symbolic knowledge store
Some checks failed
Nix / flake (pull_request) Failing after 9s
7b1d7e1773
Some checks failed
Nix / flake (pull_request) Failing after 9s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/prolog-long-term-kb:fix/prolog-long-term-kb
git switch fix/prolog-long-term-kb

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff fix/prolog-long-term-kb
git switch fix/prolog-long-term-kb
git rebase main
git switch main
git merge --ff-only fix/prolog-long-term-kb
git switch fix/prolog-long-term-kb
git rebase main
git switch main
git merge --no-ff fix/prolog-long-term-kb
git switch main
git merge --squash fix/prolog-long-term-kb
git switch main
git merge --ff-only fix/prolog-long-term-kb
git switch main
git merge fix/prolog-long-term-kb
git push origin main
Sign in to join this conversation.
No description provided.