Skip to content

projector(items): persist an item deletion marker so stale replays cannot resurrect a deleted issue (follow-up of #4210) #6782

Closed

Description

@developing-today

Problem

PR #6775 (fix for #4210) makes an issues deleted event remove the item's pmp_items row via the new deleteItem. Codex review on that PR (finding 4500146162, P2) identified the remaining hole, out of #4210's filed scope:

There is no item-level deletion marker. If an older, previously unprocessed issues or issue_comment delivery arrives after the deletion, upsertItem unconditionally inserts the absent item again (pm-stack/projector/src/store.ts), and applyComment upserts the containing issue before processing the comment (pm-stack/projector/src/projector.ts). An in-flight reconciliation response can likewise reinsert the issue through reconcileStream. The deleted issue reappears in /items; the comment tombstones retained by #6775's fix do not protect the containing item.

GitHub issue numbers are never reused within a repo, so a durable marker keyed by item ref cannot block a legitimate future item.

Acceptance criteria

  • Deleting an item persists a deletion marker (ref + deletion source timestamp) that survives the row's removal.
  • Webhook upsert paths (issues, issue_comment, pull_request_review(_comment), push-adjacent item writes) and reconcileStream refuse to recreate an item whose ref carries a deletion marker with a source timestamp >= the incoming event's — i.e. deletions are absorbing for stale replays, mirroring the comment-tombstone contract in upsertComment.
  • A test at projector level (fake store) and store level: opened → deleted → stale opened/comment replay leaves the item absent; a genuinely newer event is handled per the marker rule decided in implementation and covered by a test.
  • Existing projector suite stays green (bun test in pm-stack/projector).

Origin

Filed by repo-worker-code lane code-y from PR #6775's Codex review (finding 4500146162), dispositioned there as: valid, but a new mechanism beyond #4210's acceptance criteria — tracked here instead of expanding that PR.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 7, 2026
  2. dezren39 commented on Nov 7, 2026

    @dezren39
    Member

    Picked up by repo-worker-code-u — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-u posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  3. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 7, 2026
  4. dezren39 commented on Nov 7, 2026

    @dezren39
    Member

    Progress from repo-worker-code-u: claimed: revalidating against fresh GitHub state

  5. dezren39 commented on Nov 7, 2026

    @dezren39
    Member

    Picked up by repo-worker-code-q — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-q posts progress markers; after 30 minutes of silence any other worker may pick this up.)

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-q — FALLBACK MODE (queue backend down; fleet queue health timed out after 94s this shift, fallback executed manually via gh per §0a)
    • Session / ID: repo-queue-worker-shift-q run, 2026-11-06 21:46 CST (fallback mode; no queue task id — issue projector(items): persist an item deletion marker so stale replays cannot resurrect a deleted issue (follow-up of #4210) #6782 is the task)
    • Found via: fallback scan equivalent — gh issue list --label queue/queued; projector(items): persist an item deletion marker so stale replays cannot resurrect a deleted issue (follow-up of #4210) #6782 carries queue/queued + status/needs-triage, no comments/claim markers at all, no queue/claimed/work/* labels, no hard-stop labels (held / user/owned / do-not-merge / do-not-auto-edit)
    • Task: small fix per the acceptance criteria: persist an item deletion marker in the pm-stack projector store so stale webhook/reconcile replays cannot resurrect a deleted item, mirroring the existing comment-tombstone contract in upsertComment; projector-level and store-level tests; existing projector suite stays green.
    • Expectation: branch + PR with tests (opened → deleted → stale replay leaves item absent; newer-event rule decided and tested); merge under standing criteria when verified.
  6. added and removed on Nov 7, 2026
  7. 10 remaining items

  8. dezren39 commented on Nov 7, 2026

    @dezren39
    Member

    Picked up by repo-worker-code-w — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-w posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  9. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 7, 2026
  10. dezren39 commented on Nov 7, 2026

    @dezren39
    Member

    Progress from repo-worker-code-w: shepherding PR #6792: Codex P2 finding (projector.ts:230 early return skips markCommentDeleted, losing comment tombstones) - fixing on the PR branch, then bun test suite

  11. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    🤖 Agent note · done (fixed_merged) — posted via the developing.today GitHub App: the user token is secondary-rate-limited and the fallback release verb just failed on that limit; this note carries the terminal outcome durably (the release will be retried / the claim goes stale harmlessly — the work is merged and the issue is closed).

  12. removed
    queue/claimedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/queue-workerFiled or worked by the queue/worker pilottask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions