Skip to content

fix: report no-op block/unblock honestly and guard the tombstone lift (#209) - #279

Merged
abogartz merged 2 commits into
mainfrom
fix-issue-209-20261104T0115Z
Nov 4, 2026
Merged

abogartz merged 2 commits into
mainfrom
fix-issue-209-20261104T0115Z

Conversation

@ocsi-fixer

@ocsi-fixer ocsi-fixer Bot commented Nov 4, 2026

Copy link
Copy Markdown

Closes #209

What

removeBlock and removeTombstone returned true and republished their file even when they filtered nothing, and unblockMemory lifted the value tombstone whenever the row existed regardless of whether a block entry was removed. A no-op unblock of a never-blocked row therefore withdrew the rejection that still guarded a blocked identical copy, letting the value be re-ingested.

  • src/store/blocklist.ts — removeBlock returns false and skips the rewrite when nothing was filtered.
  • src/store/tombstones/tombstone.ts — removeTombstone returns false and skips the rewrite for an unknown ch.
  • src/viewer/mutate.ts — unblockMemory returns early false when removeBlock removed nothing, so the tombstone lift only follows an actual un-block.

Acceptance criteria and evidence

Ticket criteria (from the body's "Proposed scope"):

  1. removeBlock/removeTombstone accurately report no-op outcomes and skip needless rewrites. test/viewer-unblock-noop.test.ts: unknown-ts removeBlock returns false and fileIdentity(blocklistFile()) is byte-identical before/after (no rename happened); unknown-ch removeTombstone returns false, fileIdentity(rejectedFile()) unchanged, and /api/unreject returns {unrejected: false}.
  2. unblock should not lift a value rejection when the requested row was not unblocked. Rows A and B with identical content, blockMemory(B): unblockMemory(A) returns false, /api/unblock returns {unblocked: false}, B stays blocked, tombstone count stays 1.
  3. plus valid unblock behavior. unblockMemory(B) returns true, blocklist and tombstone counts drop to 0.

Proof (measured)

  • Repro first: new test file at merge-base 0fe0f61768774b50dda8378fd075a5d042d4f89d → 0 pass, 3 fail (each no-op returned true, the reported defect). On this branch → 3 pass, 17 expect() calls.
  • bun run typecheck — clean.
  • bun run lint — clean (biome lint + biome format, 223 files checked).
  • bun run test — 940 pass, 19 skip, 0 fail (959 tests, 91 files).
  • bun run test:e2e — 30 pass, 0 fail (src/ changed).

Deliberately not changed

Whether deliberately unblocking one real copy should lift a shared value rejection: the ticket explicitly does not decide this, so the pre-existing behavior (unblocking a real copy lifts the shared rejection) is preserved and pinned by the third test, not changed.

Note: the ticket cites src/blocklist.ts and src/tombstones.ts; those files moved to src/store/blocklist.ts and src/store/tombstones/tombstone.ts since bf9f4d2. Same code, same defects, reproduced at 0fe0f61.

…#209)

removeBlock and removeTombstone returned true and republished their file
even when they filtered nothing, and unblockMemory lifted the value
tombstone whenever the row existed regardless of whether a block entry
was removed. A no-op unblock of a never-blocked row withdrew the
rejection still guarding a blocked identical copy, letting the value be
re-ingested.

Both removals now return false and skip the rewrite when nothing was
filtered; unblockMemory lifts the tombstone only after an actual
un-block. Whether unblocking one real copy should lift a shared
rejection is explicitly undecided by the ticket, so that behavior is
pinned unchanged.
@ocsi-triager ocsi-triager Bot added the review:requested Human-admitted for autonomous review by ocsi-reviewer label Nov 4, 2026

@WhollyMindless WhollyMindless left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 05b5276c07d4cb842140435c10d2606b5f1fcc25. Approve for #209's scoped no-op fix. I filed the issue; the bot authored the implementation. This review independently checks that implementation, rather than claiming independent authorship of the finding.

Windows / Bun 1.4.4, isolated checkout:

  • viewer-unblock-noop, viewer, and tombstones: 56 pass, 267 assertions.
  • Same new regression file with only the three changed production files restored from 0fe0f61: 3 fail, each observing true where no change should return false. Restored the reviewed source afterward; checkout is clean.
  • The no-op checks run inside the existing store locks, before writeAtomic; the tests verify unchanged file identity for unknown block/tombstone selectors, not only a returned Boolean.
  • Direct and HTTP no-op unblock of never-blocked A leave identical-content B blocked and its value rejection present. A genuine unblock still removes the block and shared rejection, preserving the policy explicitly excluded from this ticket's scope.

The incremental main merge brings already-reviewed #278 and the release version; no additional #209 logic is hidden in that merge. No blocking finding. These focused tests and source tracing do not constitute a new full-suite or concurrent-writer stress run. Merge timing remains the maintainer's decision.

@ocsi-reviewer ocsi-reviewer 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.

APPROVE — head 05b5276c07d4cb842140435c10d2606b5f1fcc25, diff key 8fd8198d7c7932c95aebd133cd1944838cdb582b233c6065eabc761d000d28b6.

Contract (#209, authored by WhollyMindless — trusted; spec anchor a1101cf8f00adeea = recomputed hash, frozen): verbatim criteria from "Proposed scope":

  1. "Make removeBlock/removeTombstone accurately report no-op outcomes and skip needless rewrites" — met. src/store/blocklist.ts:87 and src/store/tombstones/tombstone.ts:400 return false on kept.length === lines.length before writeAtomic. Evidence: test/viewer-unblock-noop.test.ts:75-76 (removeBlock(unknown ts) → false, fileIdentity(blocklistFile()) byte-identical), :89-94 (removeTombstone(unknown ch) → false, /api/unreject → {unrejected:false}, fileIdentity(rejectedFile()) unchanged).
  2. "unblock should not lift a value rejection when the requested row was not unblocked" — met. src/viewer/mutate.ts:281 if (!removed) return false; before the load/lift. Evidence: test/viewer-unblock-noop.test.ts:98-115 — rows A/B identical content, blockMemory(B); unblockMemory(A) → false, /api/unblock → {unblocked:false}, blockedEntries() 1, tombstones() 1.
  3. "Test a stale/direct API call on never-blocked A while identical-content B remains blocked, plus valid unblock behavior" — met. Same file: real HTTP POST /api/unblock and /api/unreject (no mocks); valid path :120-122 unblockMemory(B) → true, counts → 0. The open question the ticket explicitly does not decide (deliberate unblock of one copy lifting the shared rejection) is pinned, not changed — correct scope.

Differential (red at merge-base): test/viewer-unblock-noop.test.ts copied onto 67e23ee (merge-base with main) → 0 pass, 3 fail, Expected: false Received: true at :75/:89/:112 — the reported no-ops-true defect. On this head → green.

Commands run (measured, at head): bun run typecheck clean; bun run lint 0 errors (130 infos), format clean 224 files; bun run test 961 ran / 19 skip / 0 fail; bun run test:e2e 30 / 0 (src/ changed).

Test integrity: file is purely additive (+124/-0); no skips, no weakened assertions; fileIdentity pins the no-rewrite claim.

Final gate re-check (verbatim): gh pr view 279 --json headRefOid → 05b5276c07d4cb842140435c10d2606b5f1fcc25; gh pr checks → lint pass, test pass, test-windows pass, smoke pass.

No findings. Human merges.

@abogartz
abogartz merged commit 45e835c into main Nov 4, 2026
4 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.15.21 🎉

The release is available on:

Your semantic-release bot 📦🚀

@abogartz
abogartz deleted the fix-issue-209-20261104T0115Z branch November 19, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released review:requested Human-admitted for autonomous review by ocsi-reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Viewer unblock: a no-op must not remove another copy's value rejection

2 participants