Skip to content

feat(facade): purge, user_id owner guard, and error codes (1.3.0) - #29

Merged
dani1005 merged 1 commit into
v1from
feat/facade-purge
Nov 6, 2026
Merged

dani1005 merged 1 commit into
v1from
feat/facade-purge

Conversation

@dani1005

@dani1005 dani1005 commented Nov 6, 2026

Copy link
Copy Markdown
Member

What

Facade coverage for what 1.3.0-rc2 (#28) generated, plus one cross-cutting error improvement.

Memory-space purge: purge_request / purge_confirm / purge_get / purge_wait.

  • Two calls stay two: there is deliberately no one-call purge, since the nonce step is the safety mechanism.
  • The scope ids are only ever what the call names; the client's app_id / project_id defaults never fill them in.
  • purge_confirm takes the purge_request result (or a bare nonce). While a purge is queued or running, the API spends the nonce and answers with that job, whatever its scope. Given the request, the facade compares scopes and raises EverOSError (running job on .job) instead of letting another purge pass as the caller's.
  • purge_wait shares the task_wait polling loop (backoff, 429/5xx retries); a timeout ends the wait, not the purge.

Owner guard: update(..., user_id=) and delete_by_ids(..., user_id=). A memory owned by anyone else is a 404 on update and skipped on delete. Documented to be set from the caller's own session, never from model output. delete_by_ids returns deleted.

Error codes: EverOSAPIError.code / .message, read from the error body (engine envelope, flat gateway shape, or a plain {"error": "..."}), so callers can branch on purge_in_progress and the like. Unparseable bodies leave both None.

quickstart.md: a purge section, user_id usage, method-table rows.

Checks

  • pytest tests test: 274 passed (11 new facade tests, none of the existing ones changed).
  • Against the live API, with calls that change nothing: purge_request on an empty project scope (nonce left to expire), extra-id 422, unknown job 404, update / delete_by_ids with user_id on a nonexistent id (404 / deleted=0), and .code parsed from engine and gateway errors.
  • Not exercised live: a confirm that collides with a running purge (needs a real purge); covered by unit tests.

🤖 Generated with Claude Code

- purge_request / purge_confirm / purge_get / purge_wait for the
  memory-space purge. Two calls stay two (no one-call purge), and the
  scope ids never come from the client's app_id / project_id defaults.
  purge_confirm takes the purge_request result and raises when the
  server answers with a different, already running purge (its nonce is
  spent and nothing of the caller's was queued). purge_wait shares the
  task_wait polling loop.
- update / delete_by_ids take user_id: a memory owned by anyone else is
  a 404 / skipped. Documented to be set from the caller's session, never
  from model output. delete_by_ids returns deleted.
- EverOSAPIError gains code / message read from the error body, so a
  caller can branch on e.g. purge_in_progress instead of a bare 409.
- quickstart: a purge section, user_id usage, method table rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

Reviewed the complete origin/v1...HEAD diff and surrounding facade/generated API code. I covered repository guidance (none is present), callers and generated model/method contracts, history, backward compatibility of the task_wait polling refactor, test changes (additive; not weakened), and the facade/generated-name architecture constraint. The purge two-step safety, explicit scope handling, owner guards, and structured API error extraction are consistent with the rc2 contract.

Validation: python -m pytest (274 passed), quickstart compile/drift smoke, facade/generated-name smoke, and git diff --check. GitHub CI is also green on Python 3.12, Python 3.14, and build.

@dani1005
dani1005 merged commit 40b126a into v1 Nov 6, 2026
3 checks passed
@dani1005
dani1005 deleted the feat/facade-purge branch November 6, 2026 23:25
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