Skip to content

purge: erase a claim's text from every index, by handle - #72

Merged
vu1n merged 3 commits into
mainfrom
claude/project-thread-2el781-purge
Oct 31, 2026
Merged

vu1n merged 3 commits into
mainfrom
claude/project-thread-2el781-purge

Conversation

@vu1n

@vu1n vu1n commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Requested by Vu · project thread

Memory is append-only, so a leaked key or a badly wrong lesson had no way out: reject hides a claim, but its text stays in the row, FTS, pointers and the recall queries that found it.

kypp purge HANDLE... --reason … (local MemoryStore.purge; over KYPP_URL, operator op purge) blanks subject/content to [purged] and clears code_refs, source_ids, metadata, verify and embedding. It deletes the claim's FTS and code_pointers rows, nulls claim_usages.query, and sets rejected. The row stays as a tombstone so the handle still resolves. Only the reason is logged (defrag_log operator:purge). The hosted op reaches any claim by handle (anyClaim: every scope and lane), because a key can leak into a room or user scope. It is operator-only, never an MCP tool.

This changes the rule "memory is append-only": purge is now the one erase (store.md gotcha updated). Not covered: local observations a claim was distilled from, and the unactivated claim_command_* tables.

Merging deploys to kypp.vu1n.dev: waiting for Vu's ok.

Verification: a contract test on all three local adapters (no trace of the key in any table, search and pointer lookups empty, a reason is required). A Worker operator test (another user's claim, FTS/pointer rows present before and gone after, usage queries nulled, verify cleared, logged). CLI tests for remote purge. unittest discover OK, worker npm test 330 pass, typecheck clean, featuremap.py check 0 broken.


Generated by Claude Code

Memory is append-only, so a leaked key or a badly wrong lesson stayed
in the claim row, FTS, pointers and recall queries forever. kypp purge
(local MemoryStore.purge, hosted operator op) blanks the claim's text,
anchors, embedding and verify, drops its index rows and usage queries,
and keeps a rejected [purged] tombstone. Only the reason is logged.
@vu1n vu1n self-assigned this Oct 31, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T08:08:26.199973Z 103d1ef New commits
🔒 Security Review ✅ Completed 2026-10-31T08:09:25.599907Z 103d1ef New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98992d411a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread kypp/store.py Resolved

@vu1n vu1n left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

VPS review of 98992d4: 3 finding(s), 4 blocking.

The change adds claim purging with rejected tombstones in local and hosted stores. It is not safe to merge yet: purge leaves sensitive text in copied usage queries and earlier audit reasons, and an in-flight local verifier can revive a tombstone.

Comment thread worker/src/store.ts Resolved
Comment thread worker/src/store.ts Resolved
Comment thread kypp/store.py Resolved
… reasons

A recall query is stored on each claim it returned, so purging one claim
left the key in its siblings' usage rows. Purge now clears every copy,
blanks the claim's earlier defrag_log reasons, and local mark_verified
skips claims without a verify command so an in-flight run can't revive
a tombstone.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 502d2c1c15

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread kypp/store.py Resolved

@vu1n vu1n left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

VPS review of 502d2c1: 1 finding(s), 1 blocking.

The change adds claim purging locally and in the hosted Worker. It is not safe to merge yet: an in-flight recall can restore sensitive query text after purge completes.

Comment thread worker/src/store.ts Resolved
…-2el781-purge

# Conflicts:
#	tests/test_store_contract.py

@vu1n vu1n left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

VPS review of 103d1ef: 1 finding(s), 1 blocking.

The change adds claim purging across local and hosted stores. It is not safe to merge yet: an in-flight recall can write an erased query back into usage records after purge completes.

Comment thread worker/src/store.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 103d1efec4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread kypp/store.py Resolved
@vu1n
vu1n merged commit 1b32b95 into main Oct 31, 2026
3 of 4 checks passed
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.

1 participant