Skip to content

feat: enforce causal lesson access policy - #19

Merged
wrightpt merged 4 commits into
mainfrom
agent/causal-lesson-access-v2
Aug 3, 2026
Merged

wrightpt merged 4 commits into
mainfrom
agent/causal-lesson-access-v2

Conversation

@wrightpt

@wrightpt wrightpt commented Aug 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add opt-in, server-resolved caller authentication for causal-lesson boundaries while preserving classify as the default compatibility mode
  • enforce exact durable-scope grants and sensitivity clearance across lesson reads, writes, replay, crystallization, consolidation, eviction, reflection, audit/diagnostics, import/export, crystals, and insights
  • server-stamp correction actors and fresh global human approval identity/time; callers and service principals cannot forge global approval
  • bind crystals and insights to lesson provenance and fail closed on hidden, malformed, missing, or mismatched source lessons
  • reserve portable full-database import/export and protected Obsidian export for restricted all-scopes operators with the matching capability
  • forward caller identity through MCP/HTTP shims, hooks, replay CLI, viewer, Pi, Hermes, OpenClaw, and OpenCode
  • guard both MCP proxy transports against sending bearer secrets or caller tokens over non-loopback plaintext HTTP; warn once by default and fail before the request with AGENTMEMORY_REQUIRE_HTTPS=1
  • preserve bounded structured 401/403/503 engine diagnostics through both MCP proxy transports
  • keep session-start retrieval within a verified caller context instead of minting service authority from caller-controlled event fields
  • make lesson audit projections authorize every referenced lesson ID, including supersession replacements

Validation

  • combined blocker-remediation suite: 7 files, 94 tests passed
  • npm test: 159 files, 1,676 tests passed
  • npm run skills:check: 15 skills passed
  • npm run build: passed
  • git diff --check: passed
  • exact pushed head: ce10a9e629c1f1bfba472b763cbe80d04ffcb369

The standard npm test command intentionally excludes test/integration.test.ts.

Safety and rollout

Enforcement is opt-in. This PR does not provision tokens, activate enforce, rebuild the global package, restart agentmemory.service, update agentmemory-lock.json, or mutate live lesson/action/lease state. Rollout requires a separately authorized policy, deployment, and non-live validation step.

Known residuals:

  • StateKV has no transaction spanning every non-lesson collection. Import preflights collection shapes and all lesson authority before writing, and the lesson batch restores exact preimages on failure, but a later full multi-collection storage failure can still require operator repair.
  • the lesson mutation lock is process-local and does not provide cross-process serialization
  • replay and crystallization currently do not return explicit persisted/rejected lesson counts when authorization filters some writes
  • hybrid/vector causal-lesson retrieval and automatic contradiction discovery remain follow-up work
  • legacy implicit-worktree visibility is available only through the explicit read-only compatibility capability; new enforced caller writes cannot use it

@wrightpt
wrightpt marked this pull request as ready for review August 3, 2026 05:46
@wrightpt
wrightpt merged commit c363c61 into main Aug 3, 2026
@wrightpt
wrightpt deleted the agent/causal-lesson-access-v2 branch August 3, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant