Skip to content

chore(purchase): drop the unreachable 'approved' entry from the claim funnel's from-set #1814

Closed

Description

@cristim

claimAndExecuteWithin (internal/purchase/manager.go:217) claims a purchase execution with the from-set approved, pending, notified. Once #1812 (issue #399) removes the execute-by-ID path, no executor reaches it with an approved row:

  • the approve paths claim from pending, notified;
  • the cron sweep lists only pending, notified rows (GetPendingExecutions);
  • stranded approved rows go through the re-drive (claimAndRedrive).

So the approved entry is unreachable in production. It's still a wider claim than any caller needs, and the gated flag (exec.Status == "pending" || exec.Status == "notified") means an approved row would skip the claimed-row gate checks if a future caller ever passed one.

Proposed: drop approved from the from-set, and add a test showing that a claim on an approved row fails with ErrExecutionNotInExpectedStatus.

Integration tests that seed approved rows into this funnel must move to notified first. #1812 already did this for redshift_gate_integration_test.go.

#399 deliberately left it out, to keep that change a pure removal. It's recorded in known-issues.md. Raised by claude-ui-fix-1's review of #1812.

Activity

  1. cristim commented on Nov 10, 2026

    @cristim
    MemberAuthor

    Claimed by claude-fleet (coordinator assignment). Premise check against the current main first, then a direct commit with the test the issue asks for.

  2. cristim commented on Nov 10, 2026

    @cristim
    MemberAuthor

    Landed on main (170db82). The claim funnel's from-set is now pending and notified; the gated flag is gone, so the step cap is rechecked for any claimed row that has recommendations. Unit test TestClaimAndExecuteWithin_AnApprovedRowIsNotClaimable pins the from-set and the benign refusal; integration test TestSingleClaim_FunnelRefusesAnApprovedRow (compiled, needs the DB env to run) shows an approved row is left unbought; tests that seeded approved rows use notified; the known-issues entry is removed. Verified: two cold review rounds (their should-fix, deleting gated, applied), mutation probes killed, pinned golangci-lint v2.10.1 unfiltered plain and -tags integration: 0 new, go vet both tags, scoped tests plus ./internal/mocks. Main CI at 170db82: pre-commit, CI - Build & Test and Deploy to AWS Lambda succeeded (the frontend sentinel was cancelled by the next push).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions