Skip to content

id(currency_poc): failed_transfers recording marks every chain leg and already-posted IDs — an identical retry of a posted transfer returns the cached failure instead of Exists (PR #6367) #6627

Closed

Description

@dezren39

Finding (unaddressed PR review comments)

PR #6367 — "id(currency_poc): remember failed transfer IDs in InMemoryLedger (IdAlreadyFailed)" — is still open, and three review findings on the same defect were never fixed or responded to. The 24-hour grace period for open PRs has passed (comments 2026-11-05T20:09–20:15Z; rechecked 2026-11-06).

Essence of the comments: when a chain fails, the failure-recording block inserts every leg of the chain into failed_transfers with the failing leg's error. Codex: "Do not mark an already-posted ID as failed when rejecting a conflicting submission" — if a transfer already posted and a later submission reuses its ID with different fields, ExistsWithDifferentFields gets permanently cached against the posted ID, and because validate_and_stage checks failed_transfers before transfers, every subsequent byte-identical retry of the original successful transfer returns the cached error instead of Exists, breaking the documented idempotent-retry contract. CodeRabbit (6014): "When a chain fails on leg B, every leg, including valid leg A, is stored with B's error. Resubmitting A in a valid chain then returns B's error instead of posting. Legs after B, which were never validated, are also stored. Store only chain[failing_offset].id." CodeRabbit (6024): "Skip any ID that is already in self.transfers."

No-response evidence

  • None of the three inline threads has any reply (fresh gh api pulls/6367/comments read, 2026-11-06).
  • GraphQL reviewThreads for PR id(currency_poc): remember failed transfer IDs in InMemoryLedger (IdAlreadyFailed) #6367: all three threads are isResolved: false.
  • PR head is unchanged since the reviews: head 7d5d64f9402afec929275a8d494611aa727f84d0 is the PR's single commit and exactly the commit Codex reviewed; no fix commit followed the comments.

Still-live evidence

Read on the PR head (7d5d64f9, 2026-11-06), pkgs/id/src/currency_poc/ledger.rs (failure-recording block, ~lines 386–400):

if !matches!(
    error,
    TransferError::LinkedEventFailed | TransferError::LinkedEventChainOpen
) {
    for transfer in chain {
        self.failed_transfers.insert(transfer.id, error);
    }
}

The loop inserts every chain leg, with no self.transfers (already-posted) check and no restriction to the failing offset — all three findings reproduce verbatim on the current head.

Dedupe: searched open/closed issues for "failed_transfers", "6367", "IdAlreadyFailed", "ledger failed transfer" on 2026-11-06 — no issue covers this recording defect. Issue #6150 is the parent task PR #6367 implements (the ledger previously forgot failed IDs entirely); it does not record this over-recording defect in the implementation.

Acceptance criteria

  • Fix the defect: record a failure only for the transfer that actually failed (the failing offset), and never record an ID that is already posted in self.transfers; add/extend tests covering (a) a valid sibling leg of a failed chain remains submittable, and (b) a byte-identical retry of an already-posted transfer still returns Exists after a conflicting submission with the same ID was rejected; OR resolve this issue with a documented decision explaining why the current behavior stands.
  • Do not reply to or resolve the source PR review threads from the fix work (per the pr-comment-review job rules); the correction lands in the PR itself or is decided here.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/highImportant and time-sensitive
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 6, 2026
  2. developing-today commented on Nov 6, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-code-k — 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-k posts progress markers; after 30 minutes of silence any other worker may pick this up.)

    Lane K triage: verifying the failed_transfers over-recording finding against PR #6367's current head and the unresolved review threads (Codex P2 + 2 CodeRabbit Major, all on ledger.rs:398).

  5. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 7, 2026
  6. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  7. 89 remaining items

  8. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor
    • Session / ID: task 11002
    • Found via: monitor reconciliation
    • Task: Claim evaporated — task 11002 is queued unclaimed (attempts 3) while the issue carried claimed/parked labels. Labels reset to queue/queued + status/needs-triage so the next claim starts from the truth.
    • Expectation: s — re-claim and work from the checkpoint stage named in the task progress, if any.
    • Links: task 11002
  9. added
    work/assignedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed on Nov 7, 2026
  10. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: picked_up
    task: 11002
    worker: repo-worker-code
    lane: 262eb403-3347-4a7c-ba6b-e7bc263ca853
    at: 2026-11-07T21:41:38Z
    note: The required lane-aware claim was rejected as unknown_lane_id. A lane-less claim accidentally claimed this task and was parked immediately; no issue or PR work was performed. Fresh reads show issue #6627 open and PR #6367 open at head 49650b3, with relevant checks still queued.

  11. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: parked
    task: 11002
    worker: repo-worker-code
    lane: 262eb403-3347-4a7c-ba6b-e7bc263ca853
    at: 2026-11-07T21:41:38Z
    reason: repo-queue rejected the supplied lane id as unknown_lane_id. The fallback lane-less claim was parked without doing task work; PR #6367 is open at head 49650b3 and its checks remain queued, so no parallel work was started.
    resume: Register this lane, then re-claim with the exact --lane id and revalidate issue #6627 / PR #6367 and the existing triage/fix evidence before continuing.

  12. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Fixed and landed via PR #6367 (merged 2026-11-07T23:55Z, merge commit 13b997a).

    What landed on the PR branch after this issue was filed:

    • The failure-recording block in pkgs/id/src/currency_poc/ledger.rs now records ONLY chain[failing_offset], skips any ID already posted in self.transfers, and skips caching when an earlier Exists leg already broke the chain (the later leg was never attempted).
    • Tests covering both acceptance scenarios: failed_chain_records_only_the_failing_leg (valid sibling leg remains submittable), conflicting_submission_does_not_poison_a_posted_transfer (byte-identical retry returns Exists after a conflicting submission was rejected with ExistsWithDifferentFields), plus exists_break_leaves_later_failing_leg_submittable for the Codex P2 scenario.

    Verification (overnight lane 2, 2026-11-07): cargo test currency_poc in pkgs/id on the PR head — 53 passed, 0 failed. Sibling findings #6628 and #6629 were closed by the same body of work. The three source review threads on PR #6367 were not replied to or resolved from this work, per the issue instructions. Closing as complete.

  13. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 | event: done | task: 11002 | worker: repo-worker-code | lane: code-q | at: 2026-11-08T00:07:00Z | note: Triage re-verified fresh by lane code-q: issue #6627 is CLOSED (2026-11-07T23:55:45Z) and PR #6367 is MERGED (merge commit 13b997a). The closing comment on this issue records the fix (ledger.rs records only the failing leg, skips already-posted IDs) and cargo test currency_poc 53 passed. Completing task 11002 as already_done; in-flight labels stripped.

  14. removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 8, 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/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivesource/pr-comment-reviewFiled by the pr-comment-review jobstatus:donetask/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