RAGE 002: durable symbolic projections and symbolic-first recall #3

Open
nsaspy wants to merge 23 commits from rage/002-symbolic-projection-recall into main
Owner

What this slice does

Adds the first durable symbolic projection + recall vertical slice on top of the existing exact-source memory boundary.

  • preserve exact source text unchanged
  • persist structured symbolic projections separately from source text
  • keep predicates/arguments as non-executable data
  • add stable projection IDs
  • canonicalize native Prolog atom / MCP string arguments into one symbolic representation
  • add memory_recall/4 with exact predicate matching and positional JSON null wildcards
  • require read authority before recall candidate generation
  • enforce namespace visibility before recall
  • rank session → project → global matches
  • render compact Markdown-like recall packets with visible trust class
  • automatically attach exact source prose for lossy / context_required projections
  • allow explicit exact-source expansion with include_source
  • keep source storage successful when projection parsing fails (projection_error)
  • keep external_untrusted / unknown sources as evidence-only rather than semantic projections (blocked_untrusted)
  • expose projections + memory_recall through MCP
  • migrate v1 snapshots forward to v2 without losing existing memories

Safety / authority boundary

A supplied projection is structured data, never an arbitrary Prolog goal. Projection failure cannot roll back the exact source memory. Low-trust external evidence can be retained for audit/history without being promoted into semantic recall.

Example

A source memory can carry a projection like:

{
  "predicate": "prefers",
  "arguments": ["user", "prolog", "constraint_solving"],
  "statement": "User prefers Prolog for constraint solving.",
  "quality": "exact"
}

and be recalled with:

{
  "predicate": "prefers",
  "arguments": ["user", null, "constraint_solving"]
}

No model-provided predicate is executed as a Prolog goal.

Tests authored

Adds PlUnit coverage for projection round-trip, canonical argument representation, JSON-null wildcard matching, non-destructive projection failure, untrusted evidence-only admission, read authority, source fallback/expansion, scope ordering, project isolation, restart durability, v1 snapshot migration, and MCP recall output.

Verification state

Draft intentionally. The ChatGPT implementation environment does not have swipl or nix, so executable verification has not been run here.

Before marking ready:

nix flake check

or at minimum:

nix develop --command swipl -q -s test/run_tests.pl

Deferred

Automatic prose → symbolic extraction, natural-language search/recall, contradiction/supersession, temporal truth, generated rules, embeddings, and natural-language forgetting remain later slices.

## What this slice does Adds the first durable symbolic projection + recall vertical slice on top of the existing exact-source memory boundary. - preserve exact source text unchanged - persist structured symbolic projections separately from source text - keep predicates/arguments as non-executable data - add stable projection IDs - canonicalize native Prolog atom / MCP string arguments into one symbolic representation - add `memory_recall/4` with exact predicate matching and positional JSON `null` wildcards - require read authority before recall candidate generation - enforce namespace visibility before recall - rank session → project → global matches - render compact Markdown-like recall packets with visible trust class - automatically attach exact source prose for `lossy` / `context_required` projections - allow explicit exact-source expansion with `include_source` - keep source storage successful when projection parsing fails (`projection_error`) - keep `external_untrusted` / `unknown` sources as evidence-only rather than semantic projections (`blocked_untrusted`) - expose projections + `memory_recall` through MCP - migrate v1 snapshots forward to v2 without losing existing memories ## Safety / authority boundary A supplied projection is structured data, never an arbitrary Prolog goal. Projection failure cannot roll back the exact source memory. Low-trust external evidence can be retained for audit/history without being promoted into semantic recall. ## Example A source memory can carry a projection like: ```json { "predicate": "prefers", "arguments": ["user", "prolog", "constraint_solving"], "statement": "User prefers Prolog for constraint solving.", "quality": "exact" } ``` and be recalled with: ```json { "predicate": "prefers", "arguments": ["user", null, "constraint_solving"] } ``` No model-provided predicate is executed as a Prolog goal. ## Tests authored Adds PlUnit coverage for projection round-trip, canonical argument representation, JSON-null wildcard matching, non-destructive projection failure, untrusted evidence-only admission, read authority, source fallback/expansion, scope ordering, project isolation, restart durability, v1 snapshot migration, and MCP recall output. ## Verification state **Draft intentionally.** The ChatGPT implementation environment does not have `swipl` or `nix`, so executable verification has not been run here. Before marking ready: ```sh nix flake check ``` or at minimum: ```sh nix develop --command swipl -q -s test/run_tests.pl ``` ## Deferred Automatic prose → symbolic extraction, natural-language search/recall, contradiction/supersession, temporal truth, generated rules, embeddings, and natural-language forgetting remain later slices.
This pull request can be merged automatically.
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 rage/002-symbolic-projection-recall:rage/002-symbolic-projection-recall
git switch rage/002-symbolic-projection-recall

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 rage/002-symbolic-projection-recall
git switch rage/002-symbolic-projection-recall
git rebase main
git switch main
git merge --ff-only rage/002-symbolic-projection-recall
git switch rage/002-symbolic-projection-recall
git rebase main
git switch main
git merge --no-ff rage/002-symbolic-projection-recall
git switch main
git merge --squash rage/002-symbolic-projection-recall
git switch main
git merge --ff-only rage/002-symbolic-projection-recall
git switch main
git merge rage/002-symbolic-projection-recall
git push origin main
Sign in to join this conversation.
No description provided.