Add governed agentic memory commits#217
Merged
Merged
Conversation
There was a problem hiding this comment.
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): |
10c2e8b to
fa859ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade Overview
Protected Areas
Compatibility Impact
This extends vNext API, MCP, CLI, and
/vnextworkspace 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-commitsmoke, 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:
committedfor explicit, high-confidence, direct-source writes from trusted or in-scope project agents.confirmation_requiredfor sensitive, restricted, contradictory, or medium-confidence writes.review_requiredfor external/generated/bulk inputs, review-only agents, and low-confidence facts.rejectedfor read-only agents, unsafe secret-looking content, missing identity, missing explicit intent, or out-of-scope project writes.Implementation details:
VNextMemoryCommitServiceand shared policy evaluation for agentic memory commits.alicebot vnext memories.alicebot vnext smoke agentic-memory-commitsmoke and included it in alpha checks./vnextlive workspace data and UI to show recent trusted memory commits and inline confirmations in Agent Activity.docs/vnext-agentic-memory-commit-cto-summary.md.Safety Notes
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 lintpnpm --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,0critical privacy leaks,0prompt-injection tool writes)git diff --checkNot run:
ruffbecause it is not installed in the local virtualenv (No module named ruff).