Files
amethyst/quartz/plans
Claude 6ac2903a3a fix(quartz): live negentropy index — same-batch displacement, no-op kind-5, rebuild cap
Audit follow-ups on the live NIP-77 index, all with the store/scan
equivalence test extended to cover them:

- Same-batch replaceable displacement left a dead id in the index.
  applyAfterCommit applied all removes before all adds, so when a later
  row in one transaction displaced an earlier row of the same batch (two
  versions of one replaceable — the mirror-backfill hot path), the
  displaced row's remove no-op'd against an index that hadn't taken its
  add yet, then the add re-inserted it: the index advertised an id the
  trigger had already deleted. recordAccepted now cancels the pending add
  instead of queueing a remove (added is a LinkedHashSet for O(1)
  cancel).

- A kind-5 that deleted nothing (a delete broadcast for events this relay
  never stored — the common case) still invalidated the whole index,
  forcing a full-scan rebuild under the writer mutex on the next
  NEG-OPEN. DeletionRequestModule.insert now returns the rows it deleted;
  recordAccepted only invalidates when that count is > 0, else records the
  kind-5 as a plain row.

- The first NEG-OPEN over a corpus larger than the serve cap scanned the
  whole table uncapped, built a full index that could never produce a
  snapshot, and then maintained it forever for zero benefit.
  liveNegentropySnapshot now caps the rebuild scan at maxEntries + 1 and
  leaves the index unpopulated when the corpus is over-cap (the scan path
  answers NEG-ERR, as before).

- delete/deleteExpired/clearDB invalidate() moved inside the writer mutex
  so no NEG-OPEN can seal a snapshot of just-deleted rows, and no
  concurrent rebuild can be discarded by a late invalidate.

Also corrects the ~40 B/event heap figure to ~140 B (IdAndTime keeps the
id as a 64-char hex string, not 32 bytes) in the strategy/plan docs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TtDNpayEYvJH7QuPswND3A
2026-07-04 02:31:40 +00:00
..

quartz plans

Audited 2026-06-30. 11 plans: 7 shipped (archived), 0 in-progress, 3 queued, 1 closed (negative result).

Queued

Plan Summary
2026-05-08-local-headers-explorer.md Headers-only Bitcoin P2P client to verify NIP-03 OTS attestations without a trusted block explorer.
2026-06-12-giftwrap-deletion-requests.md Let a recipient-authored kind-5 delete/block a gift wrap (kind 1059) addressed to them.
2026-07-03-incremental-negentropy-storage.md Always-current (created_at, id) index so cold NEG-OPENs stop paying a full scan + seal (~340 ms at 50k vs strfry's ~21 ms).
2026-07-04-small-req-floor.md Small-REQ dispatch floor: decomposed, inline fast path tried and reverted (no wire-level win); floor is transport-side.

Archived (shipped)

Plan Summary
archive/2026-06-03-fix-nip46-bunker-double-resume-plan.md Fix NIP-46 bunker double-resume crash and retry id-reuse races via Channel-per-request + fresh id per attempt.
archive/2026-06-04-auth-scope-vs-policy.md Move relay-server authenticated-identity state from the policy into the engine-owned connection scope.
archive/2026-06-09-clink.md Implement CLINK (Offers/Debits/Manage) Lightning-over-Nostr pointers, events, and client/server in Quartz.
archive/2026-06-11-runstr-interop.md RUNSTR kind-1301 workout events and supporting fitness kinds in Quartz plus Amethyst fitness screens.
archive/2026-06-19-napplet-nip5a-resolver.md Platform-agnostic NIP-5A static-site resolver verifying content-addressed Blossom blobs against signed manifests.
archive/2026-06-20-powr-interop.md Parse and render the POWR/NIP-101e kind-1301 strength-workout dialect alongside the existing RUNSTR dialect.
archive/2026-06-28-git-smart-http-browser.md Git smart-HTTP v2 client to browse NIP-34 repo file trees and render source from the clone URL.