Skip to content

feat: accept a content flag only where it appears now - #30

Merged
oxyc merged 1 commit into
mainfrom
feat/accept-only-here
Dec 1, 2026
Merged

oxyc merged 1 commit into
mainfrom
feat/accept-only-here

Conversation

@oxyc

@oxyc oxyc commented Dec 1, 2026

Copy link
Copy Markdown
Member

Accepting a content flag used to cover its value (an iframe host, a script) anywhere on the site, now and later. That's right for a tool in active use, but wrong for old content nobody adds to: a new page embedding the same host should flag again.

  • accept --only-here (Store.AcceptPinned): each content flag carries a Pin, a hash of its places and count, and the decision is stored as ID@Pin. The checker accepts on ID or ID@Pin, so a new place changes the pin and brings the flag back. A pinned accept replaces an unpinned one of the same value, and anything but a content flag is refused.
  • The postmeta scan skips revisions' and trashed posts' meta, as the posts scan already does. Otherwise every edit would add revision meta and move the pin, and counts would include copies. Checked read-only on one site: 95 meta hits for a host became the 7 on published posts.

go test ./..., go vet and gofmt pass. New: TestAcceptPinned, plus a pinned case in TestContent (holds in place, comes back in a new place). README and CLI usage updated. foreman needs the matching flag on data-audit accept after this merges.

🤖 Generated with Claude Code

accept --only-here (Store.AcceptPinned) stores ID@Pin, where Pin hashes the places a content value appears and how many: old content nobody adds to stays quiet, and the flag comes back when the value turns up on a new page. The content scan leaves out revisions' and trashed posts' meta, as it already did their posts, so an edit doesn't move the pin (and counts stop including copies).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oxyc
oxyc merged commit 9db065a into main Dec 1, 2026
2 checks passed
@oxyc
oxyc deleted the feat/accept-only-here branch December 1, 2026 21:53
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