Skip to content

Add governed agentic memory commits#217

Merged
samrusani merged 1 commit into
mainfrom
codex/agentic-memory-commit
May 15, 2026
Merged

Add governed agentic memory commits#217
samrusani merged 1 commit into
mainfrom
codex/agentic-memory-commit

Conversation

@samrusani
Copy link
Copy Markdown
Owner

@samrusani samrusani commented May 15, 2026

Upgrade Overview

Protected Areas

  • continuity APIs
  • memory schema
  • evidence pipeline
  • trust rules
  • promotion logic

Compatibility Impact

This extends vNext API, MCP, CLI, and /vnext workspace payloads with governed agentic memory commit lifecycle data. Existing memory proposal and context-pack flows continue to work, and retrieval is tightened so only active or accepted memory rows enter context.

Migration / Rollout

No database migration is required. The feature is local vNext only and rolls out through the new shared service, API endpoints, MCP tools, CLI commands, workspace fields, docs, and alpha smoke coverage.

Operator Action

Operators should route trusted local agents through the official commit, confirm, undo, correct, forget, recent, and audit tools instead of direct database writes. Sensitive, external, generated, contradictory, or lower-confidence facts still require inline confirmation or dashboard review.

Validation

Validated locally with backend unit and integration suites, web lint/test/build, the new agentic-memory-commit smoke, alpha checks, the full eval suite, and whitespace checks. Exact commands and pass counts are listed below.

Rollback

Rollback is a normal revert of this PR. Existing memories remain intact; agentic writes created by this feature preserve revision/event history and can be undone or forgotten without deleting audit records.

What Changed

This PR adds the governed Alice vNext path for trusted local agents to commit explicit user memory instructions without bypassing policy, provenance, audit, or user repair controls.

Trusted agents such as Hermes can now submit "remember this" style facts through one shared service. The service chooses one of four outcomes before anything becomes retrievable memory:

  • committed for explicit, high-confidence, direct-source writes from trusted or in-scope project agents.
  • confirmation_required for sensitive, restricted, contradictory, or medium-confidence writes.
  • review_required for external/generated/bulk inputs, review-only agents, and low-confidence facts.
  • rejected for read-only agents, unsafe secret-looking content, missing identity, missing explicit intent, or out-of-scope project writes.

Implementation details:

  • Added VNextMemoryCommitService and shared policy evaluation for agentic memory commits.
  • Added API endpoints for commit, confirm, undo, correct, forget, recent commits, and audit.
  • Added matching MCP tools and CLI commands under alicebot vnext memories.
  • Added the alicebot vnext smoke agentic-memory-commit smoke and included it in alpha checks.
  • Updated /vnext live workspace data and UI to show recent trusted memory commits and inline confirmations in Agent Activity.
  • Tightened retrieval so candidate, superseded, forgotten, undone, and review-gated rows do not enter context packs.
  • Updated Hermes, OpenClaw, custom agent, MCP, quickstart, first-run, alpha, and vNext docs.
  • Added a CTO-facing summary at docs/vnext-agentic-memory-commit-cto-summary.md.

Safety Notes

  • No direct Postgres mutation path was introduced for agents.
  • Undo and forget preserve audit history by superseding rows instead of deleting them.
  • Correct appends a revision and keeps the memory active.
  • Sensitive and ambiguous writes still require user confirmation or dashboard review.
  • Project-scoped agents can only commit project-domain memory within scope.

Validation Evidence

Passed locally:

  • ./.venv/bin/python -m py_compile apps/api/src/alicebot_api/vnext_memory_commit.py apps/api/src/alicebot_api/main.py apps/api/src/alicebot_api/cli.py apps/api/src/alicebot_api/mcp_tools.py
  • ./.venv/bin/pytest tests/unit/test_vnext_memory_commit.py tests/unit/test_vnext_store.py tests/unit/test_mcp.py tests/unit/test_cli.py -q (54 passed)
  • ./.venv/bin/pytest tests/integration/test_vnext_agentic_memory_commit_api.py -q (2 passed)
  • ./.venv/bin/pytest tests/unit -q (1141 passed)
  • ./.venv/bin/pytest tests/integration -q (376 passed)
  • pnpm --dir apps/web lint
  • pnpm --dir apps/web test (209 passed)
  • pnpm --dir apps/web build
  • ./.venv/bin/alicebot vnext smoke agentic-memory-commit
  • ./.venv/bin/alicebot vnext alpha check
  • ./.venv/bin/alicebot vnext alpha check --headless
  • ./.venv/bin/alicebot eval run --suite all (170/170, 0 critical privacy leaks, 0 prompt-injection tool writes)
  • git diff --check

Not run:

  • ruff because it is not installed in the local virtualenv (No module named ruff).

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

rationale: str | None = Field(default=None, min_length=1, max_length=4000)


class VNextMemoryUndoRequest(VNextAgentRequest):
@samrusani samrusani force-pushed the codex/agentic-memory-commit branch from 10c2e8b to fa859ca Compare May 15, 2026 09:18
@samrusani samrusani merged commit b5f2cfd into main May 15, 2026
5 checks passed
@samrusani samrusani deleted the codex/agentic-memory-commit branch May 15, 2026 09:20
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.

2 participants