[RAGE 001] Durable memory_remember + memory_get vertical slice #2

Open
lost-rob0t wants to merge 0 commits from rage/001-remember-get into main
lost-rob0t commented 2026-08-31 19:10:13 +00:00 (Migrated from github.com)

Implements the focused first vertical slice for #1.

What landed

  • Prolog-first memory_remember/4 and memory_get/3 domain API.
  • Stable opaque memory/source/audit/project IDs.
  • Exact lossless source storage separated from symbolic projection state.
  • Stable project namespace resolution from explicit ID / canonical remote, with path only as an alias/hint and no project→global fallback.
  • Explicit read/session-write/project-write/global-write capability checks.
  • Trust/provenance supplied by host context rather than inferred from memory text.
  • Atomic logical remember mutation containing project creation when needed, source, memory/version, and audit event.
  • Backend-neutral storage boundary with a single-process UTF-8 snapshot bootstrap persisted via same-directory temp file + rename.
  • Thin MCP stdio adapter supporting stateless MCP 2026-07-28 discovery/per-request metadata plus legacy 2025-11-25 initialize compatibility.
  • MCP unsupported protocol response -32022 with requested/supported versions.
  • Nix flake/dev shell/app/test gate.
  • PlUnit domain and MCP regression suite.

Storage claim

This is intentionally a single-process bootstrap backend. It does not claim database-grade multi-process concurrency. The domain/tool contract is backend-neutral so a stronger store can replace it later.

Verification status

Draft intentionally. Tests are authored but have not been executed in the current ChatGPT implementation environment because it does not provide swipl or nix.

Before this PR is ready, run locally:

nix flake check

or at minimum:

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

Do not merge or close #1 until that executable verification is green.

Test coverage authored

  • opaque/distinct IDs and no silent duplicate conflation;
  • exact Unicode/whitespace source round-trip;
  • close/reopen restart durability;
  • project isolation and known-ID read authorization;
  • unresolved project never becomes global;
  • project writer cannot write global;
  • failed authorization rolls back newly-created project state and all memory/audit effects;
  • audit emission;
  • provenance/trust separation;
  • SSH/HTTPS project remote normalization;
  • explicit session fallback;
  • modern server/discover and stateless remember→get tool smoke path;
  • unsupported protocol -32022;
  • legacy initialize compatibility.

Explicitly deferred

  • memory_search;
  • memory_recall and prose adequacy compiler;
  • natural-language forgetting;
  • embeddings/vector retrieval;
  • temporal contradiction/supersession reasoning beyond base lifecycle/version fields;
  • consolidation workers;
  • generated-rule activation/self-optimization;
  • SQLite/RocksDB migration.

The point of this PR is to make those later slices build on a real durability + identity + authority contract instead of inventing their own.

Implements the focused first vertical slice for #1. ## What landed - Prolog-first `memory_remember/4` and `memory_get/3` domain API. - Stable opaque memory/source/audit/project IDs. - Exact lossless source storage separated from symbolic projection state. - Stable project namespace resolution from explicit ID / canonical remote, with path only as an alias/hint and no project→global fallback. - Explicit read/session-write/project-write/global-write capability checks. - Trust/provenance supplied by host context rather than inferred from memory text. - Atomic logical remember mutation containing project creation when needed, source, memory/version, and audit event. - Backend-neutral storage boundary with a single-process UTF-8 snapshot bootstrap persisted via same-directory temp file + rename. - Thin MCP stdio adapter supporting stateless MCP `2026-07-28` discovery/per-request metadata plus legacy `2025-11-25` initialize compatibility. - MCP unsupported protocol response `-32022` with requested/supported versions. - Nix flake/dev shell/app/test gate. - PlUnit domain and MCP regression suite. ## Storage claim This is intentionally a single-process bootstrap backend. It does **not** claim database-grade multi-process concurrency. The domain/tool contract is backend-neutral so a stronger store can replace it later. ## Verification status **Draft intentionally. Tests are authored but have not been executed in the current ChatGPT implementation environment because it does not provide `swipl` or `nix`.** Before this PR is ready, run locally: ```sh nix flake check ``` or at minimum: ```sh nix develop --command swipl -q -s test/run_tests.pl ``` Do not merge or close #1 until that executable verification is green. ## Test coverage authored - opaque/distinct IDs and no silent duplicate conflation; - exact Unicode/whitespace source round-trip; - close/reopen restart durability; - project isolation and known-ID read authorization; - unresolved project never becomes global; - project writer cannot write global; - failed authorization rolls back newly-created project state and all memory/audit effects; - audit emission; - provenance/trust separation; - SSH/HTTPS project remote normalization; - explicit session fallback; - modern `server/discover` and stateless remember→get tool smoke path; - unsupported protocol `-32022`; - legacy initialize compatibility. ## Explicitly deferred - `memory_search`; - `memory_recall` and prose adequacy compiler; - natural-language forgetting; - embeddings/vector retrieval; - temporal contradiction/supersession reasoning beyond base lifecycle/version fields; - consolidation workers; - generated-rule activation/self-optimization; - SQLite/RocksDB migration. The point of this PR is to make those later slices build on a real durability + identity + authority contract instead of inventing their own.
lost-rob0t (Migrated from github.com) reviewed 2026-08-31 19:10:23 +00:00
lost-rob0t (Migrated from github.com) left a comment

Implementation review pass completed before opening this draft. Scope is intentionally limited to the durable remember/get vertical slice. No merge approval yet: executable SWI-Prolog/Nix verification is still required.

Implementation review pass completed before opening this draft. Scope is intentionally limited to the durable remember/get vertical slice. No merge approval yet: executable SWI-Prolog/Nix verification is still required.
nsaspy changed title from WIP: [RAGE 001] Durable memory_remember + memory_get vertical slice to [RAGE 001] Durable memory_remember + memory_get vertical slice 2026-09-04 14:38:35 +00:00
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin rage/001-remember-get:rage/001-remember-get
git switch rage/001-remember-get

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