Repository navigation
feat(facade): purge, user_id owner guard, and error codes (1.3.0) - #29
Conversation
- 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
left a comment
There was a problem hiding this comment.
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.
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.app_id/project_iddefaults never fill them in.purge_confirmtakes thepurge_requestresult (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 raisesEverOSError(running job on.job) instead of letting another purge pass as the caller's.purge_waitshares thetask_waitpolling loop (backoff, 429/5xx retries); a timeout ends the wait, not the purge.Owner guard:
update(..., user_id=)anddelete_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_idsreturnsdeleted.Error codes:
EverOSAPIError.code/.message, read from the error body (engine envelope, flat gateway shape, or a plain{"error": "..."}), so callers can branch onpurge_in_progressand the like. Unparseable bodies leave bothNone.quickstart.md: a purge section,user_idusage, method-table rows.Checks
pytest tests test: 274 passed (11 new facade tests, none of the existing ones changed).purge_requeston an empty project scope (nonce left to expire), extra-id 422, unknown job 404,update/delete_by_idswithuser_idon a nonexistent id (404 /deleted=0), and.codeparsed from engine and gateway errors.🤖 Generated with Claude Code