Repository navigation
feat(purchase): atomic plan-step claim, shared suppressions and account checks - #800
Conversation
Each plan account now buys only its own recommendations and its row carries its own totals. A step with no recommendations, or a rec not attributed to one of the plan's accounts, fails loudly instead of completing or being dropped. Refs #631. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eal-recommendations
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eal-recommendations
…nd account checks Refs #631 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eal-recommendations
|
Warning Review limit reached
This review includes 26 billable files and costs up to $6.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 57 minutes for your next included review. View limit details
Comment |
Merge-gate review (independent, adversarial, money path): CHANGES REQUESTEDReviewed SHA: Blocking findings
Non-blocking
Verified (holds)
|
…all was submitted Outcome-unknown and refused re-drive failures keep their suppressions. Adds sweep and compare-and-set tests. Refs #631. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merge-gate re-review: CHANGES REQUESTED (one test gap; code is correct)Head was Code: holdsEvery Blocking: the post-submission side of the guard is not pinned through the real path
Only the direct Verified at e120847 (git archive, GOTOOLCHAIN=go1.26.9, macOS, repo test lock)
|
…ressions Refs #631 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merge-gate re-review: APPROVEDReviewed SHA: Closes the earlier test gap
Verified at 105501c (git archive, GOTOOLCHAIN=go1.26.9, macOS, repo test lock)
|
Refs #631 (PR2a of the split; PR2b adds the resolver). No resolver yet, so no user-visible change: bare steps still fail once.
What
Prerequisites that make attaching real recommendations to a plan step safe:
getOrCreateExecutionnow runs underLockPurchasePlanTxand is keyed on (plan_id, step_number), not onplan.NextExecutionDate. ANY existing row for the step (failed, partially_completed, expired, canceled, completed, in flight) blocks creation; only a pending/notified ROOT row (no account, retry_attempt_n 0) is adopted. New store methodsListExecutionsForPlanStepTx,SetExecutionRecommendationsIfEmptyTx(CAS),ExpireExecutionAtomic.buildSuppressionsmoved toconfig.BuildSuppressions.Manager.AttachResolvedRecommendationswrites recs + suppressions in one tx (called by PR2b).executeSingleAccountrefuses a plan row whose selected recs are not attributed to the row's own account (strict; direct execute unchanged).Evidence (fixture/mock + real Postgres via testcontainers)
go testandgo test -tags integrationfor purchase and api,go testfor config/server/analytics, golangci-lint clean, under the repo test lock.🤖 Generated with Claude Code