Skip to content

feat(memory): "where were we" for one of a product's end users (PRD-274 Wave 3, §5.7) - #1490

Merged
AutomatosAI merged 1 commit into
mainfrom
afp/w3-i-end-user-resume
Nov 12, 2026
Merged

AutomatosAI merged 1 commit into
mainfrom
afp/w3-i-end-user-resume

Conversation

@daarthur

@daarthur daarthur commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

PRD-274 §5.7, "where were we", for one of a product's end users. Decision 16 kept resume person-only "until Wave 3, when a key's end users have their own scope", and that scope is now in (#1484–#1487). This is the first of two stacked PRs that close off Wave 3:

  1. This PR: an end user's resume.
  2. A key's service user is cleaned up when the key is revoked or its workspace erased, and PRD-274 is updated (feat(auth): a key's service user goes with its workspace, and stays while the key is revoked (PRD-274) #1491).

GET /api/memory/end-users/{end_user_id}/resume (knowledge:read for a member, memory:read for a server key) answers the resume payload for that end user, the same shape as GET /api/memory/resume (PRD-206 S3). It contains:

  • their own recent conversations (chats.end_user_id, feat(chat): a server key's chat turn for one of its end users (PRD-274 Wave 3) #1486), each with its checkpoint, plus the next steps the checkpoints name;
  • the decisions and open loops in their facts and the workspace's, read as them (end_user:{id}):
    • a private fact of theirs is shown;
    • the workspace's are filtered as the other end-user routes filter them (_readable): nothing private to a person and, for a key, nothing an audience limits;
  • never another end user's conversation or fact. Their namespace is the only end-user namespace read, and the workspace read covers mem:{ws} alone.

It answers 404 for an unknown end user and 409 for one being erased (#1487).

build_end_user_resume_payload sits beside build_resume_payload in modules/memory/resume_context.py and reuses its pure assembly. Its thread query runs off the event loop.

How it was verified

  • tests/test_afp_w3_end_user_resume.py (2 tests; real database, real keys, stand-in memory service):

    • The resume holds both of their conversations, not another end user's or the key's own. The next step comes from their checkpoint.
    • The decisions are theirs, then the workspace's, leaving out a person's private one and an audience-limited one. Their private open loop is shown, and only their namespace is read.
    • An unknown end user gets 404. One being erased gets 409, and nothing is read.
  • test_the_routes_carry_the_gate_and_take_only_a_clean_end_user_id (feat(memory): a product's end users, scoped by workspace, with consent and erase (PRD-274 Wave 3) #1479) now includes this route with its gate.

  • With api/end_user_memory.py and resume_context.py back at main, all three fail.

  • Every test file touching resume or end users passes: 103 files, 1,801 tests.

  • The code shape check has no errors, and lint-imports and ruff are clean. The route manifest is regenerated; the only change is this route.

  • Tests added or updated, and they fail without this change

  • CI green (a lane marked non-required counts too)

  • Both editions considered: local (AUTH_EDITION=local) and hosted (the same code; with no durable store, their facts are empty)

  • UI change: screenshots below (none)

AI assistance

  • None
  • Assisted: tool(s): Claude Code; it wrote or changed: the route, the payload builder and the tests
  • I have read and understood every line of this change, and can explain it in review

Checklist (AGENTS.md)

  • Every commit signed off (git commit -s)
  • No secrets, customer data or credentials anywhere in the change
  • Settings through orchestrator/config.py; no hardcoded values
  • Replaced paths deleted in this pull request (no shims or V2 copies)
  • Migration (if any): one head, chained onto the current head, safe on a create_all-built database, head pins moved (none)
  • New routes the frontend calls are in orchestrator/reports/route-manifest.json (regenerated; the frontend doesn't call it)
  • Docs updated where behaviour changed (the module and route docstrings; PR 2 updates PRD-274)

🤖 Generated with Claude Code

…74 Wave 3, §5.7)

GET /api/memory/end-users/{id}/resume (knowledge:read for a member,
memory:read for a server key) answers the resume payload (PRD-206 S3) for the
end user: their own recent conversations (chats.end_user_id) with each one's
checkpoint and next step, and the decisions and open loops in their facts and
the workspace's, read as them (end_user:{id}). The workspace's are read as the
other end-user routes read them; no other end user's conversation or fact is
read. 404 for an unknown end user, 409 for one being erased.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Dave Arthur <davidarthur@hotmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
Pre-merge checks: Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Description check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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