forgetproof Try the button

Rendered from packages/forgetme-button/README.md; raw Markdown.

forgetme-button#

<forget-me-button> is a custom element you place beside each memory your agent shows a person. When the person presses it, the element previews who holds that memory, asks about related records and about the companies the agent shared it with, sends the deletion to your server, and shows a signed receipt per holder. This page covers the element's attributes, slots and events, the five methods your server implements behind it, and the HTTP contract those methods speak.

Status: not yet on npm. Phase 4 changed nothing in the element, the five methods or the four routes. What each phase changed is under History and in the changelog.

Names. ForgetMe is what the person sees: the button, and the same flow by voice or chat. ForgetProof is the engine your server runs behind it: the scanner, the eraser and the signed receipts, shipped as the forgetproof Python package. ForgetMe is a third-party extension proposal targeting Poppy 1.0, the Personal Agent Protocol. Nobody has approved, adopted or reviewed it. Its namespace is stellarminds.ai/forget-me, major version "1", provisionally. The glossary defines holder, reference, receipt, outcome and the other words this page uses.

See it running#

What the element does not do#

Two ways to run a host#

The host is the server behind the button. It runs at one of two levels. The element, the five methods and the four routes are the same at both.

LevelWhat your server doesWhat the person sees
Local onlyServes /forget-me/v1/ over the agent's own stores.The holders are the agent's stores. One signed receipt per store.
Cross-providerAlso keeps, per memory item, the reference each company it shared the item with issued. When the person asks, it calls that company through the same contract on the company's origin, as a Poppy Personal Agent: negotiated extensions, a Session header per request, an access token for the person's account there. The company states the exact terms it will perform. The person approves them in the button, and the approval travels with the request.Each company appears as a holder and as a choice: ask it to withdraw too, or leave it. Its exact terms are shown word for word. The result has one row per holder, with the action, the evidence, anything unresolved and the time. A company that can't answer shows as pending or unverified, never as clear.

Embed#

<script type="module" src="/forget-me/button/forget-me-button.js"></script>

<forget-me-button reference="fmr_…" endpoint="/forget-me/v1" label="Home address">
  Forget this
</forget-me-button>

A complete page is in example/embed.html. A host that already has a memory screen adds one element per item and listens to the events; that is all sample host 1 does.

Attributes and properties#

AttributeMeaning
referenceThe opaque reference the agent issued for this memory item. Required for scope item.
endpointThe host's ForgetMe v1 base, e.g. /forget-me/v1. The four routes derive from it.
scopeitem (default) or account. Set account only when the host means "everything about this person"; then there is no reference.
labelNames the item for assistive technology: the button's accessible name becomes "Forget this: Home address".
disabledStandard.
property hostA ForgetMeHost object (below) to drive instead of the HTTP one built from endpoint.

Read-only properties: state (idle, loading, preview, submitting, pending, done, error), operation (the last operation the host returned), terms (the exact terms as currently chosen in the preview), approvals (what confirm would send: for each exception carrying a recipient's exact terms and chosen delete, the operation id and revision the person saw, and how they answered). Methods: open(), refresh(), reset().

Slots and styling hooks#

Default slot: the button's text. Named slots confirm-label and cancel-label relabel the dialog's two buttons. Custom properties: --forgetme-accent, --forgetme-accent-ink, --forgetme-ink, --forgetme-muted, --forgetme-line, --forgetme-panel, --forgetme-soft, --forgetme-radius, --forgetme-font, --forgetme-warn, --forgetme-good, --forgetme-keep. Parts: ::part(button), ::part(dialog), ::part(title), ::part(confirm), ::part(cancel), ::part(result), ::part(sentence), ::part(holder), ::part(receipt), ::part(brand), ::part(approval).

Events#

All bubble and are composed, so one listener on document covers a whole page.

EventdetailWhen
forgetme:preview{preview, reference, scope}The preview arrived and the dialog opened. Nothing has changed.
forgetme:confirmed{terms, approvals, idempotencyKey}The person confirmed exactly these terms (and approved the recipients' exact terms in approvals); the submit is on its way.
forgetme:cancelled{reason, reference, scope}The preview was dismissed (cancel, escape, backdrop). Nothing changed.
forgetme:result{operation, outcome, settled}The operation reached done or error. Fires once per operation.
forgetme:evidence{operation, evidence}The person opened the receipt.

The interaction#

  1. First press opens a preview: the item, the holders (who keeps it, and whether each keeps anything at all), what will happen, and the exceptions: other live records that also carry the value, each with a choice (keep it, or delete it too), and the recipients the host shared it with (ask it, or leave it). A recipient that speaks Poppy states the exact terms it will perform; the button shows them as text, word for word, with the operation id and revision and when the offer expires (never rendered as links or HTML). The person narrows the terms, cancels with no side effects, or confirms exactly what is shown; confirming with such a recipient chosen is their approval of that revision, and the button sends it (approvals) with how they answered (tap or keyboard). The button never invents an approval: no terms shown, nothing sent.
  2. Result at once. The button shows "Pending…" while the host erases; the dialog can be closed and reopened, and a reload of the page still finds the operation (its id is kept in sessionStorage for the tab). When it finishes, a human sentence comes first, then the outcome per holder.
  3. The receipt is a secondary action: a "Receipt" button fetches the host's evidence.
  4. A double click, a retry, or a reload never submits twice: the button keeps one idempotency key per confirmation and the host answers the same operation for it.
  5. An agent with no persistent memory says so: a preview whose holders all have retention: "none" shows "Nothing is kept" and offers no confirm button. Unknown retention is a different answer from zero retention: it is shown as such, and confirming reports unsupported for what can't be checked.

The headless host: ForgetMeHost#

Everything the button does goes through five methods, so a native app, a voice assistant or a chat client can run the same flow without the element:

interface ForgetMeHost {
  reference(item: unknown): Promise<string | null>;          // what the host knows this item by; null if it can't address it
  preview(req: { reference?: string | null; scope: "item" | "account" }): Promise<Preview>;
  submit(req: { reference?: string | null; scope: "item" | "account"; exceptions: Record<string, "keep" | "delete">; idempotencyKey: string;
                approvals?: Record<string, { operation_id: string; revision: string; input_type?: string }> }): Promise<Operation>;
  status(operationId: string): Promise<Operation>;
  evidence(operationId: string): Promise<Evidence>;
}

createHttpHost({endpoint, fetch?, headers?, credentials?}) in src/http-host.js implements it against the HTTP contract below; the element uses it when given an endpoint. The demo site serves the same file at /forget-me/button/http-host.js. credentials is fetch's RequestCredentials: same-origin by default, so the page's own cookies go along; a headless client passes omit and puts its Bearer token in headers. Errors are ForgetMeError with the contract's code, description, HTTP status and any extra fields (operation on double_submit). example/walkthrough.mjs drives the five methods from Node against the demo:

node example/walkthrough.mjs http://localhost:8080          # keep the lease note
node example/walkthrough.mjs http://localhost:8080 delete   # delete it too

The host contract: /forget-me/v1/#

What a host serves behind the button. The demo's implementation is demo/forgetme.py. Every route needs the owner's session; the demo issues a synthetic one for its fictional user at POST /pim/sessions (a labelled fixture, never a general identity provider). Authorization is enforced server-side on every read and write; the request can't say who.

RouteBodyAnswer
POST {endpoint}/preview{"reference": "fmr_…", "scope": "item"} or {"scope": "account"}200 Preview
POST {endpoint}/submit`{"reference", "scope", "exceptions": {id: "keep"\"delete"}, "approvals"?: {id: {"operation_id", "revision", "input_type"?}}, "idempotency_key": "8–128 chars"}`202 Operation (new) or 200 Operation (same key, same terms)
GET {endpoint}/operations/{id}200 Operation
GET {endpoint}/operations/{id}/evidence200 Evidence

Preview#

{
  "namespace": "stellarminds.ai/forget-me", "version": "1", "scope": "item",
  "item": {"reference": "fmr_…", "label": "Home address, saved in March", "text": "…", "kind": "address", "saved_at": "…"},
  "holders": [
    {"holder": "memory", "title": "Pim's long-term memory", "kind": "chroma", "retention": "persistent", "what": "the record, Chroma's write log, …"},
    {"holder": "conversation", "title": "Pim's conversation window", "kind": "ephemeral", "retention": "none", "what": "Pim keeps no transcript …"}
  ],
  "retention": "persistent",
  "changes": ["Pim deletes the record through its own APIs …", "ForgetProof erases what that deletion leaves on disk …", "…"],
  "exceptions": [{"id": "fmr_…", "label": "Lease note", "text": "…", "holders": ["notes"], "default": "keep",
                  "options": [{"value": "keep", "label": "Keep the lease note"}, {"value": "delete", "label": "Delete the lease note too"}]}],
  "terms": {"reference": "fmr_…", "scope": "item", "exceptions": {"fmr_…": "keep"}},
  "note": "The holders are Pim's own stores on this server. Nothing has been changed by this preview."
}

retention per holder is persistent, none or unknown. terms is what submit must echo, with every exception decided. A preview has no side effects. A recipient exception may carry approval: the recipient's own operation_id, revision, summary, terms and expires_at (from Poppy's Operations extension, version 3), plus party, protocol: "operations/3" and approver; submit echoes the id and revision in approvals when the person chose to ask that recipient.

Operation#

{
  "operation": "fmo_…", "namespace": "stellarminds.ai/forget-me", "version": "1",
  "state": "accepted" | "running" | "done" | "error",
  "terms": {"reference": "fmr_…", "scope": "item", "exceptions": {"fmr_…": "keep"}},
  "item": {"label": "Home address, saved in March", "…": "…"},
  "submitted_at": "…", "started_at": "…", "finished_at": "…",
  "outcome": {
    "overall": "intentionally-retained",
    "sentence": "Home address, saved in March removed from Pim. One lease note kept, as you chose.",
    "holders": [{"holder": "memory", "title": "Pim's long-term memory", "kind": "chroma", "outcome": "inspected-and-clear", "detail": "…", "receipt_id": "fmo_….memory"}, "…"],
    "counts": {"intentionally-retained": 1, "inspected-and-clear": 3},
    "kept": {"memories": 49, "note": "what Pim still remembers after this operation"}
  },
  "log": [{"actor": "Pim", "text": "…", "at": "…"}],
  "reconciled": null,
  "status_url": "/forget-me/v1/operations/fmo_…", "evidence_url": "/forget-me/v1/operations/fmo_…/evidence"
}

outcome is null until the state is final. reconciled is a sentence when the host restarted during the operation and settled it by scanning again instead of erasing again; an operation that can't be settled that way ends in error with outcome.uncertain: true and claims nothing.

Outcomes#

Per holder, exactly one of, worst first: error, bytes-still-found, queued, unsupported, intentionally-retained, inspected-and-clear. The overall outcome is the worst of the holders: one clean store never overrides an outstanding one. The human sentence comes before the counts. src/outcomes.js has the list, worst(), counts() and a fallback sentence.

Evidence#

{"operation": "fmo_…", "state": "done", "issuer": "Pim (this demo)", "issuer_key_url": "/.well-known/forgetproof.json",
 "receipts": [{"receipt_id": "fmo_….memory", "holder": "memory", "fingerprint": "…", "receipt": { "format": "forgetproof-receipt/0.2", "…": "…" }}],
 "note": "Each receipt is ForgetProof's signed record for one store: counts and file hashes, never the text."}

Each receipt is a portable receipt, forget-me-receipt/1 (schema, spec): a signed projection with counts, timestamps and vocabulary words only, no host path, filename, value, cross-service identifier or value hash, coupled to the operation by the issuer's opaque operation id. It verifies in the browser with forgetproof-verify (verifyReceipt, same signing rule as the engine's own receipts) against the keys the issuer publishes in its index (GET {endpoint}, issuer_key_url). A recipient's receipt is re-served as received, with the recipient's issuer and issuer_key_url and verified_by_host; the person's verifier checks it again against the recipient's keys. Rows that have no receipt (a recipient without ForgetMe) appear under observations, as the host's observation, never as a receipt. The host keeps the engine's full receipt (with file hashes) privately; only its digest travels (source_receipt).

Errors#

{"error": code, "error_description": sentence, …}:

StatuserrorWhen
401no_sessionNo signed-in user. The request can't name one.
400bad_requestNot a JSON object, wrong types, a bad idempotency_key, or an exception choice other than keep/delete.
400bad_scopescope is not item or account, or account came with a reference.
400missing_referenceScope item without a reference. It never means account-wide.
400terms_incompleteThe exceptions decided don't match those the preview listed, or a recipient's exact terms were shown and approvals lacks (or names other terms than) the person's approval of them (missing, unexpected).
404unknown_referenceNo such reference for the signed-in user. Another owner's reference gets the same answer, deliberately.
410reference_expiredThe reference has expired.
409conflictThe idempotency_key was used before with different terms (operation names the earlier one).
409double_submitThe memory already has an operation that is running or settled (operation, state). Follow it instead. A memory whose earlier operation ended bytes-still-found or error can be submitted again.
404unknown_operationNo such operation for the signed-in user (same answer for another owner's).
503 / 410not_ready / scenario_expiredDemo-specific: the scenario is still building, or has expired.

Guarantees#

History#

Phase 1 was the local-only level. Phase 2 added cross-provider withdrawals and the reference Company. Phase 3 moved the Company onto Poppy 1.0: negotiation, identity, and the person's approval of a company's exact terms. Phase 4 changed nothing on the wire; it added the public docs at forget.stellarminds.ai/docs, a verifier that reports the signature, the issuer and the declared outcome apart, deep links, shareable results and an accessibility pass. A change to the contract in this file is announced in that phase's PR, never made silently.

Changes since phase 2#

Additive on the wire; a phase 2 button keeps working against a phase 3 host (it cannot send approvals, so a host that offered terms answers its submit with 400 terms_incomplete naming the recipient, and the person can leave that recipient alone). Details: docs/extension.md sections 4 and 6.1; schemas and fixtures in schemas/forget-me/v1/.

WhereChangeCompatibility
Preview.exceptions[]approval added on a recipient that states the exact terms it will perform: party, protocol, approver, and the recipient's operation_id, revision, summary, terms, expires_at.Additive. The button renders it; a client that ignores it still sees the recipient as a choice.
Submitapprovals added (optional): per recipient exception chosen delete with terms shown, {operation_id, revision, input_type?}. A host accepts only what its preview offered, while valid; else 400 terms_incomplete with the exception id in missing.Additive for hosts that offer no terms. A client that cannot send approvals cannot ask a recipient that states terms.
ForgetMeHost.submitTakes approvals; createHttpHost sends it only when non-empty.Additive.
Eventsforgetme:confirmed detail gains approvals.Additive.
ElementProperty approvals; ::part(approval); input_type is tap for a pointer and keyboard for a keyboard confirmation.Additive.
DiscoveryThe Company's entry gains scopes (its OAuth scope names); the Company lists operations version 3; its poppy.json follows Poppy 3.1 in full.Additive.
Indexapproval and identity added.Additive.
Errors at a Companyno_session and forbidden_scope are replaced by Poppy's: 400 invalid_session, 400 session_ended, 400 version_unsupported, 401 challenge without a code, 401 invalid_token, 403 insufficient_scope, 403 extension_required, 403 approval_required, 403 approval_declined, 400 invalid_request. A host behind the button (cookie session) keeps no_session.Changed at Companies. A client that only matched on HTTP status keeps working; one that matched no_session at a Company must learn invalid_session and the 401 challenge.
Authorization at a CompanyEvery route but the index needs Poppy-Session, Poppy-Version, Poppy-Extensions and an access token the Company's issuer issued to that agent; the fixture credential is gone.Changed at Companies: a client must be a Poppy Personal Agent. The demo's fixture now mints a refresh token for the agent the request names.
Submit at a CompanyPerformed only through Poppy's Operations extension, version 3: extension_required without it declared; approval_required with the exact terms without a Poppy-Approval; the checks of Operations 6; agent approvals declined.Changed at Companies: a client must declare the extension and send the person's approval.

Not changed: the element's attributes and slots, the four routes, terms, the outcome vocabulary and its order, the portable receipt, the local-only level.

Changes since phase 1#

All additive on the wire, except where marked. A phase 1 button or host adapter keeps working against a phase 2 host; a phase 1 host keeps working with the phase 2 button. Details and types: docs/extension.md; every shape has a schema and fixtures in schemas/forget-me/v1/.

WhereChangeCompatibility
GET {endpoint}The index now carries issuer, keys[] (the receipt-signing keys), routes derived from the endpoint, scopes, evidence_format, limits.Additive. Phase 1 listed routes and errors only.
Evidence.receipts[].receiptChanged: a forget-me-receipt/1 portable projection instead of the engine's forgetproof-receipt/0.2. No target, files, copies, canaries[].found_in, correlation_id; coupling is operation. Verdict words stay (verdict), the finer word is outcome.A consumer that read receipt.correlation_id, receipt.files or receipt.target must move to receipt.operation and stop expecting paths. verifyReceipt accepts the new format. Old receipts remain verifiable everywhere.
Evidenceissuer_key_url now points at the index (/forget-me/v1), where the keys are; observations[] added; per receipt party, issuer, issuer_key_url, verified_by_host added.Additive, except the URL's target (the old /.well-known/forgetproof.json is still served and lists the same key).
Preview.holders[]party and recipient added; a recipient's holder may have retention: "unknown".Additive.
Preview.exceptions[]A recipient the host shared the item with is an exception with options delete ("ask … to withdraw it too") / keep; a disclosed retention is an exception with the single option keep, reason, retained_until; party added.Additive. The button already renders options as given.
Operationupdated_at, retrieval_stopped_at added; outcome.outstanding added; holder rows gain party, action, evidence, unresolved, at, retained_until. A done operation may still improve while outstanding > 0 (queued rows resolve later under the same id; the state never goes back to running).Additive. A client that treated done as final still sees a final state; it only misses later improvements unless it polls again.
SubmitRetrieval of the record stops at accept (the item leaves listings and lookups before the bytes go); idempotency_key must be printable ASCII (was: any 8–128 characters); more than 64 exceptions is bad_request; a body over 16 KiB is 413 too_large.Stricter inputs; the button's keys were always UUIDs.
Errorstoo_large (413), forbidden_scope (403), unsupported_version (404, with supported) added.Additive.
SentenceWhen recipients are involved the human sentence gains a clause per party ("… Bay Parcel: withdrawn, with a disclosed retention; Harbor Pharmacy unverified.").The local-only sentence is unchanged.

Not changed: the element, its attributes, events and slots; the five ForgetMeHost methods; the four routes; terms; the outcome vocabulary and its order.

Simulated in the demo, and labelled#

The synthetic session for John Reyes at Pim; the reference Company's issuer, which signs nobody in (the fixture POST /fixture/accounts creates John's synthetic account and mints the refresh token a sign-in would have produced, for Pim's client identity); the two recipients simulated inside Pim's process (Harbor Pharmacy, API-only; Oakland Utilities, offline, then without ForgetMe); the recorded example the landing page shows before anyone clicks. The courier is simulated only when no Company is configured. Never faked: the Session header and its verification, the token exchange, the negotiation headers, the approval of exact terms, authorization on every read and write, the stores, the erasure, the receipts, the second party.

Tests#

npm test                                         # the host adapter and the outcome vocabulary (node:test)
uv run --extra browser python -m playwright install chromium
uv run --extra browser pytest tests/test_browser.py   # cancel, double click, pending → resolved, keyboard only, labels, 375 px; phase 4: a fresh visitor
                                                 # follows a story link, shared results, the verifier (confirmed / rejected / unconfirmed), the docs on a phone
uv run pytest tests/test_public.py               # phase 4: the public docs routes, deep links, shares, the retention job, exported examples
uv run pytest tests/test_forgetme.py             # the contract: owners, references, idempotency, concurrency, restart, the lease choice
uv run pytest tests/test_forgetme_schemas.py     # every fixture, and both parties' live answers, against the v1 schemas
uv run pytest tests/test_company.py              # the reference Company's conformance set (over Poppy)
uv run pytest tests/test_poppy.py                # phase 3: negotiation, identity, the approval exchange; documents against the Poppy kit's schemas
uv run pytest tests/test_cross_provider.py       # Pim's aggregate with the Company and the simulated recipients, approvals included
uv run pytest tests/test_wire.py                 # a public-contract client over real HTTP, two processes

Versions phase 4 was built and tested with: Node 22.13, Playwright 1.65.2 (Chromium), Starlette 1.9.0, uvicorn 0.54.0, httpx 0.28.1, chromadb 1.5.9, cryptography 50.0.2, jsonschema 4.26.0, pytest 9.1.1, Python 3.12.6 (CI: 3.11, 3.12, 3.14).

Next steps#