Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA
TypeScript
{
"schema": "gstack-detector-corpus/v1",
"case": "plan-eng-multi-finding-batching",
"detector": "test/helpers/eng-seeded-coverage.ts#createEngBatchingIssueCounter",
"series_identity": "57a825b033078a7b",
"source": {
"run": "37176837432",
"sha": "7249f014648202840af294b730ac244e03ce514c",
"lane": "periodic",
"artifact": "paid-slice-1-a1",
"path": "shards/skill-e2e-plan-eng-multi-finding-batching/pty-count/ci-37176837432-1-eval-slices-1/plan-eng-review-1791087925106-l3TgIg"
},
"census_outcome": "passed",
"expected": "pass",
"justification": "Census pass: three review-phase questions each bound to their own saved decision-ledger record (R IDs) in the plan; the counter credits each once.",
"input": {
"calls": [
{
"sessionId": "f639c2ad-c78e-40de-be08-40b0ac614f36",
"toolUseId": "toolu_01UMCDB7ntEy9gZoZPgr2P6t",
"answeredAt": "2026-10-04T04:28:00.234Z",
"answer": "Library hooks + custom curve (recommended)",
"question": {
"question": "D1 — Use the job library's retry hooks, or build a custom inline scheduler?\nProject/branch/task: gstack-plan-count-jikZRT on main, plan \"Add background job retry framework\".\nELI10: The plan writes its own retry timer inside each of 5 workers even though the job library already ships retry hooks that do the same job. The only stated reason is control over the delay curve, and retry hooks normally let you plug in your own delay function. Writing your own scheduler means you also own attempt counting, persistence of retry state across restarts, and every bug in those.\nStakes if we pick wrong: a hand-rolled scheduler that loses retry state on a worker restart drops or double-runs jobs silently, and you maintain five copies of it.\nRecommendation: A because the library hook almost certainly accepts a custom delay function, which gives the curve control the plan wants with none of the scheduling code [Layer 1: proven built-in over reinvention].\nCompleteness: A=10/10, B=6/10, C=n/a (investigation only)\nPros / cons:\nA) Library retry hooks + custom backoff function (recommended)\n ✅ The library already persists attempt counts and schedules the next run, so restarts do not lose retry state\n ✅ The curve lives in one small pure function that is trivial to unit test and reuse across all 5 workers\n ❌ If the hook does not expose a per-job delay function, you need a shim or a library upgrade before this works\nB) Custom inline scheduler in each worker (as planned)\n ✅ Complete control over timing with no dependency on the library's hook semantics\n ✅ No need to learn or verify the library's retry API before starting\n ❌ You own attempt counting, persistence across restarts and the dispatch loop, in five places (human: ~3 days / CC: ~40 min, plus ongoing maintenance)\nC) Investigate the hook API first (bounded, mechanism stays pending)\n ✅ Settles the one open fact (does the hook take a delay function) before committing to either design\n ✅ Cheap: read one library signature and one existing hook usage (human: ~1h / CC: ~5 min)\n ❌ Delays the decision; the review continues with the mechanism unresolved\nNet: you are trading a few minutes of reading the library's hook API against owning a scheduler forever.",
"header": "Retry mechanism",
"multiSelect": false,
"options": [
{
"label": "Library hooks + custom curve (recommended)",
"description": "Use the existing job library's retry hook and pass the exponential-backoff curve in as one small function. The library keeps attempt counts and schedules the retry; workers only supply the curve. Completeness 10/10. Human ~1 day / CC ~10 min. Risk: hook may not accept a per-job delay function; verify at the first worker. Maintenance: one function."
},
{
"label": "Custom inline scheduler",
"description": "Build the exponential-backoff scheduler inline in each of the 5 workers as the plan proposes. Completeness 6/10. Human ~3 days / CC ~40 min. Risk: retry state lost on restart unless you also persist attempts; five copies to maintain. Maintenance: high."
},
{
"label": "Investigate hook API first",
"description": "Bounded investigation only: read the library's retry hook signature and one existing usage, confirm whether it accepts a custom delay function. Approves no implementation; R1 stays pending and all other rows stay pending. Human ~1h / CC ~5 min."
}
]
}
},
{
"sessionId": "f639c2ad-c78e-40de-be08-40b0ac614f36",
"toolUseId": "toolu_01JeD5JExNnckpJZk87yproz",
"answeredAt": "2026-10-04T04:29:18.756Z",
"answer": "Idempotent delivery + retry (recommended)",
"question": {
"question": "D2 — What delivery guarantee does processWebhookJob keep once it can retry?\nProject/branch/task: gstack-plan-count-jikZRT on main, plan \"Add background job retry framework\".\nELI10: Today a webhook is sent at most once: if the send fails, it is dropped, never duplicated. Adding retries flips that. If the request reaches the receiver but the response times out, the retry sends the same webhook again, and the receiver sees two. Receivers that charge a card or create a record on each webhook will do it twice.\nStakes if we pick wrong: duplicate side effects at every customer receiving your webhooks, with no way for them to tell a retry from a new event.\nRecommendation: A because an idempotency key plus a persisted delivery record keeps retries safe for receivers and costs one small table or column and one header.\nCompleteness: A=10/10, B=7/10, C=3/10\nPros / cons:\nA) Idempotent delivery with per-job delivery record (recommended)\n ✅ Retries recover from transient receiver outages without ever recording two successful deliveries for one job\n ✅ The `Idempotency-Key` header is the standard way webhook receivers dedupe, so well-built receivers drop the duplicate automatically\n ❌ Needs a persisted delivery-state record (pending / delivered / ambiguous) written before each send, plus a migration (human: ~1 day / CC: ~15 min)\nB) Exclude processWebhookJob from the retry framework\n ✅ Preserves today's at-most-once behavior exactly, so the existing contract and its regression test stay simple\n ✅ Smallest change: this worker just does not wire the retry hook\n ❌ Webhooks still vanish on any transient failure, which is the pain this plan exists to fix\nC) At-least-once with no dedup\n ✅ Simplest retry wiring; no delivery table and no header\n ✅ Every job eventually delivers or dead-letters\n ❌ Every ambiguous send produces a visible duplicate at the receiver and pushes the dedup burden onto every customer\nNet: one header and one state record versus either keeping the drops or shipping duplicates to customers.",
"header": "Webhook semantics",
"multiSelect": false,
"options": [
{
"label": "Idempotent delivery + retry (recommended)",
"description": "Persist a per-job delivery record (pending / delivered / ambiguous) written before each send; send `Idempotency-Key: <job id>` on every attempt; on retry, skip the send if the record is already `delivered`, otherwise resend with the same key so the receiver can dedupe. Completeness 10/10. Human ~1 day / CC ~15 min. Risk: needs a migration; receivers that ignore the header may still see a duplicate after an ambiguous send, which is the documented limit."
},
{
"label": "Exclude webhooks from retries",
"description": "Keep processWebhookJob on its current at-most-once path and do not wire the retry hook for it. The other 4 workers retry. Completeness 7/10. Human ~0 / CC ~0. Risk: webhook drops on transient failure continue."
},
{
"label": "At-least-once, no dedup",
"description": "Wire the retry hook for processWebhookJob with no delivery record and no idempotency header; document to receivers that delivery is at-least-once. Completeness 3/10. Human ~1h / CC ~5 min. Risk: duplicate side effects at receivers."
}
]
}
},
{
"sessionId": "f639c2ad-c78e-40de-be08-40b0ac614f36",
"toolUseId": "toolu_01RKj7piBifaror2JZpqmmKJ",
"answeredAt": "2026-10-04T04:30:12.398Z",
"answer": "Max attempts + dead-letter (recommended)",
"question": {
"question": "D3 — What happens when a job keeps failing: cap attempts and dead-letter it, cap and drop, or retry forever?\nProject/branch/task: gstack-plan-count-jikZRT on main, plan \"Add background job retry framework\".\nELI10: Some jobs will never succeed: a receiver that returns 410 Gone, a payload that fails validation. The plan never says when to stop retrying or where the job goes when you do. Retry forever and those poison jobs sit in the queue burning worker time. Drop them and you lose the evidence of what went wrong. Dead-letter them and someone at 3am can see the job, the last error, and replay it.\nStakes if we pick wrong: either an ever-growing queue of jobs that will never complete, or silently lost work with no record.\nRecommendation: A because a finite cap plus a dead-letter set is the standard pattern and most job libraries already ship the dead set, so the cost is one setting and one alert.\nCompleteness: A=10/10, B=6/10, C=2/10\nPros / cons:\nA) Finite max attempts + dead-letter set with alert (recommended)\n ✅ Poison jobs leave the live queue after a bounded number of attempts, so healthy jobs are not starved\n ✅ The dead set keeps the job and its last error, so an operator can inspect and replay instead of guessing\n ❌ Needs a dead set (library-provided or one table) and one alert wired to it (human: ~half day / CC: ~10 min)\nB) Finite max attempts, discard on exhaustion\n ✅ Bounded retries with the least code: one setting and one error log line\n ✅ No dead-letter storage to operate or prune\n ❌ Exhausted jobs are gone; the only trace is a log line, so replay means re-creating the job by hand\nC) Unbounded retries (plan as written)\n ✅ No job is ever declared failed, so nothing needs an operator decision\n ✅ Zero additional code beyond the curve\n ❌ A permanently failing job retries forever, and once the delay cap is hit it consumes a worker slot on every cycle\nNet: a few lines of configuration and one alert versus either an unbounded poison queue or silently discarded work.",
"header": "Terminal policy",
"multiSelect": false,
"options": [
{
"label": "Max attempts + dead-letter (recommended)",
"description": "Finite max attempts (default 5, per-worker override) on the library retry hook. On exhaustion, move the job and its last error to the library's dead set if it has one, otherwise to a dead-letter table; emit one metric and alert on dead-letter growth. Includes tests for the exhaustion path. Completeness 10/10. Human ~half day / CC ~10 min."
},
{
"label": "Max attempts, discard",
"description": "Finite max attempts (default 5, per-worker override). On exhaustion, log the job id and last error at error level and drop the job. Includes a test for the exhaustion path. Completeness 6/10. Human ~1h / CC ~5 min. Risk: no replay path."
},
{
"label": "Unbounded retries",
"description": "No attempt limit; the job retries on the curve until it succeeds. Completeness 2/10. Human ~0 / CC ~0. Risk: poison jobs never leave the queue."
}
]
}
}
],
"planEvents": [
{
"at": "2026-10-04T04:27:24.084Z",
"write": "# Eng review report: Add background job retry framework\n\nReview target (fixed): `PLAN.md` in `gstack-plan-count-jikZRT` (branch `main`, commit e9dce01), plan title \"Add background job retry framework\".\nReport file: this document (destination requested by the user).\nReviewer: /plan-eng-review (gstack), session 692-1791087913-3b742802, 2026-10-04.\n\n## Original plan (unchanged copy)\n\n```markdown\n# Plan: Add background job retry framework\n\n## Architecture\nWe'll roll a custom exponential-backoff scheduler inline in each worker\nrather than use the existing job library's built-in retry hooks. Same\nshape as the library version, but we want full control over the curve.\n\n## Code quality\nThe retry envelope (compute delay, log attempt, dispatch) is duplicated\nacross 5 worker files with copy-pasted bodies. We will leave the\nduplication for now and refactor \"later.\"\n\n## Tests\nThe existing `processWebhookJob()` flow gets rewritten as part of this\nchange. No regression test for the prior at-most-once delivery guarantee\nis planned.\n\n## Performance\nOn every retry we re-fetch the full job payload from the database, then\niterate the payload to recompute the dependency graph. Could cache the\ngraph on the first attempt; not planned.\n```\n\n## Review preparation notes\n\n- Repository contents at review time: `PLAN.md`, `CLAUDE.md` only. No worker source, job library, tests or `TODOS.md` are present, so every code-level claim below is calibrated against the plan text and marked unverified where the code would be needed.\n- Test framework: unknown (0 test files detected, no `## Testing` section in CLAUDE.md). The plan proposes no framework, so no framework question is asked.\n- Prior learnings: none found (project-scoped search).\n- Design doc: none. User asked to skip the /office-hours prerequisite.\n- Outside voice: `codex_reviews` is disabled in config.\n- Complexity count (proposed work): 5 worker files changed, 0 new classes/services (scheduler is inline per the plan). Below the 8-file / 2-class gate, so the structure question is skipped.\n\n## Decision ledger\n\n### R1: Retry mechanism — library retry hooks vs custom inline scheduler\nFinding: #1, P1, confidence 8/10, PLAN.md:7-9, reviewer: plan-eng-review (Scope Challenge)\nMotivating lines (PLAN.md:7-9): \"We'll roll a custom exponential-backoff scheduler inline in each worker rather than use the existing job library's built-in retry hooks. Same shape as the library version, but we want full control over the curve.\"\nPlan baseline: original proposal, custom inline exponential-backoff scheduler in each of 5 workers; no prior approval.\nRuntime evidence: unknown. The job library and worker files are not in this repository, so the hook API (whether it accepts a custom delay function) could not be read. The plan itself states the custom version has the \"same shape\" as the library's.\nComparison grid:\n\n| Choice | Current | A) Library hooks + custom curve | B) Custom inline scheduler | C) Investigate hook API first |\n|---|---|---|---|---|\n| R1 retry mechanism | custom inline scheduler per worker (proposed) | library's retry hook, with the backoff curve supplied as one small function; library owns scheduling, persistence and attempt counting | custom scheduler written inline in each worker, as proposed | bounded: read the library's retry hook signature and confirm it accepts a per-job delay function; mechanism stays pending until confirmed |\n| R2 webhook delivery semantics | unspecified, pending | pending | pending | pending |\n| R3 terminal failure policy (max attempts, dead-letter) | unspecified, pending | pending | pending | pending |\n| R4 jitter | unspecified, pending | pending | pending | pending |\n| R5 delay cap | unspecified, pending | pending | pending | pending |\n| R6 shared retry envelope | duplicated across 5 workers (proposed) | pending | pending | pending |\n| R7 regression coverage for processWebhookJob | none planned | pending | pending | pending |\n| R8 dependency-graph caching | re-fetch and recompute every retry (proposed) | pending | pending | pending |\n\nQuestion D1:\nD1 — Use the job library's retry hooks, or build a custom inline scheduler?\nProject/branch/task: gstack-plan-count-jikZRT on main, plan \"Add background job retry framework\".\nELI10: The plan writes its own retry timer inside each of 5 workers even though the job library already ships retry hooks that do the same job. The only stated reason is control over the delay curve, and retry hooks normally let you plug in your own delay function. Writing your own scheduler means you also own attempt counting, persistence of retry state across restarts, and every bug in those.\nStakes if we pick wrong: a hand-rolled scheduler that loses retry state on a worker restart drops or double-runs jobs silently, and you maintain five copies of it.\nRecommendation: A because the library hook almost certainly accepts a custom delay function, which gives the curve control the plan wants with none of the scheduling code [Layer 1: proven built-in over reinvention].\nCompleteness: A=10/10, B=6/10, C=n/a (investigation only)\nPros / cons:\nA) Library retry hooks + custom backoff function (recommended)\n ✅ The library already persists attempt counts and schedules the next run, so restarts do not lose retry state\n ✅ The curve lives in one small pure function that is trivial to unit test and reuse across all 5 workers\n ❌ If the hook does not expose a per-job delay function, you need a shim or a library upgrade before this works\nB) Custom inline scheduler in each worker (as planned)\n ✅ Complete control over timing with no dependency on the library's hook semantics\n ✅ No need to learn or verify the library's retry API before starting\n ❌ You own attempt counting, persistence across restarts and the dispatch loop, in five places (human: ~3 days / CC: ~40 min, plus ongoing maintenance)\nC) Investigate the hook API first (bounded, mechanism stays pending)\n ✅ Settles the one open fact (does the hook take a delay function) before committing to either design\n ✅ Cheap: read one library signature and one existing hook usage (human: ~1h / CC: ~5 min)\n ❌ Delays the decision; the review continues with the mechanism unresolved\nNet: you are trading a few minutes of reading the library's hook API against owning a scheduler forever.\nHeader: Retry mechanism\nOptions:\nA) Library hooks + custom curve\nUse the existing job library's retry hook and pass the exponential-backoff curve in as one small function. The library keeps attempt counts and schedules the retry; workers only supply the curve. Completeness 10/10. Human ~1 day / CC ~10 min. Risk: hook may not accept a per-job delay function; verify at the first worker. Maintenance: one function.\nB) Custom inline scheduler\nBuild the exponential-backoff scheduler inline in each of the 5 workers as the plan proposes. Completeness 6/10. Human ~3 days / CC ~40 min. Risk: retry state lost on restart unless you also persist attempts; five copies to maintain. Maintenance: high.\nC) Investigate hook API first\nBounded investigation only: read the library's retry hook signature and one existing usage, confirm whether it accepts a custom delay function. Approves no implementation; R1 stays pending and all other rows stay pending. Human ~1h / CC ~5 min.\n\nState: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n"
},
{
"at": "2026-10-04T04:28:51.035Z",
"old": "State: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n",
"new": "State: approved\nActual answer: A) Library hooks + custom curve (D1 answer)\nAccepted scope: replace the proposed inline scheduler with the job library's retry hook in all 5 workers; the exponential-backoff curve is one small pure function passed to the hook; the library owns attempt counting, scheduling and persistence. Includes the unit test for the curve function and the hook wiring per worker. Verify at the first worker that the hook accepts a per-job delay function; if not, stop and reopen R1.\nHistory: none\n\nScope Challenge result: scope accepted as-is (feature list unchanged; D1 changes the mechanism, not the scope). MODE = FULL_REVIEW.\n\n### R2: processWebhookJob delivery semantics under retry\nFinding: #2, P1, confidence 9/10, PLAN.md:17-19, reviewer: plan-eng-review (Architecture)\nMotivating lines (PLAN.md:17-19): \"The existing `processWebhookJob()` flow gets rewritten as part of this change. No regression test for the prior at-most-once delivery guarantee is planned.\"\nPlan baseline: original proposal; the rewrite adds retries to a flow that today guarantees at-most-once delivery, with no statement of the new guarantee. No prior approval.\nRuntime evidence: unknown. `processWebhookJob()` is not in this repository; the at-most-once guarantee is taken from the plan's own statement. The semantic shift is definitional: any retry after an ambiguous send (timeout after the request left the box) can deliver the same webhook twice.\nComparison grid:\n\n| Choice | Current | A) Idempotent delivery + retry | B) Exclude webhooks from retries | C) At-least-once, no dedup |\n|---|---|---|---|---|\n| R1 retry mechanism | approved: library hooks + curve (D1) | unchanged (D1) | unchanged (D1) | unchanged (D1) |\n| R2 webhook delivery semantics | at-most-once today; rewrite adds retries with no stated guarantee | retries allowed; a persisted per-job delivery record plus an `Idempotency-Key` header (job id) guarantees at most one successful delivery is recorded and lets receivers drop duplicates from ambiguous sends | processWebhookJob keeps today's at-most-once path; retry hook not wired for this one worker | retries allowed; duplicates possible; receivers are told delivery is at-least-once |\n| R3 terminal failure policy | unspecified, pending | pending | pending | pending |\n| R4 jitter | unspecified, pending | pending | pending | pending |\n| R5 delay cap | unspecified, pending | pending | pending | pending |\n| R6 shared retry envelope | duplicated across 5 workers (proposed) | pending | pending | pending |\n| R7 regression coverage for processWebhookJob | none planned | pending (contract to protect becomes \"at most one successful delivery per job\") | pending (contract to protect stays \"at most one send per job\") | pending (contract becomes \"every job eventually delivered or dead-lettered\") |\n| R8 dependency-graph caching | re-fetch and recompute every retry (proposed) | pending | pending | pending |\n\nQuestion D2:\nD2 — What delivery guarantee does processWebhookJob keep once it can retry?\nProject/branch/task: gstack-plan-count-jikZRT on main, plan \"Add background job retry framework\".\nELI10: Today a webhook is sent at most once: if the send fails, it is dropped, never duplicated. Adding retries flips that. If the request reaches the receiver but the response times out, the retry sends the same webhook again, and the receiver sees two. Receivers that charge a card or create a record on each webhook will do it twice.\nStakes if we pick wrong: duplicate side effects at every customer receiving your webhooks, with no way for them to tell a retry from a new event.\nRecommendation: A because an idempotency key plus a persisted delivery record keeps retries safe for receivers and costs one small table or column and one header.\nCompleteness: A=10/10, B=7/10, C=3/10\nPros / cons:\nA) Idempotent delivery with per-job delivery record (recommended)\n ✅ Retries recover from transient receiver outages without ever recording two successful deliveries for one job\n ✅ The `Idempotency-Key` header is the standard way webhook receivers dedupe, so well-built receivers drop the duplicate automatically\n ❌ Needs a persisted delivery-state record (pending / delivered / ambiguous) written before each send, plus a migration (human: ~1 day / CC: ~15 min)\nB) Exclude processWebhookJob from the retry framework\n ✅ Preserves today's at-most-once behavior exactly, so the existing contract and its regression test stay simple\n ✅ Smallest change: this worker just does not wire the retry hook\n ❌ Webhooks still vanish on any transient failure, which is the pain this plan exists to fix\nC) At-least-once with no dedup\n ✅ Simplest retry wiring; no delivery table and no header\n ✅ Every job eventually delivers or dead-letters\n ❌ Every ambiguous send produces a visible duplicate at the receiver and pushes the dedup burden onto every customer\nNet: one header and one state record versus either keeping the drops or shipping duplicates to customers.\nHeader: Webhook semantics\nOptions:\nA) Idempotent delivery + retry\nPersist a per-job delivery record (pending / delivered / ambiguous) written before each send; send `Idempotency-Key: <job id>` on every attempt; on retry, skip the send if the record is already `delivered`, otherwise resend with the same key so the receiver can dedupe. Completeness 10/10. Human ~1 day / CC ~15 min. Risk: needs a migration; receivers that ignore the header may still see a duplicate after an ambiguous send, which is the documented limit.\nB) Exclude webhooks from retries\nKeep processWebhookJob on its current at-most-once path and do not wire the retry hook for it. The other 4 workers retry. Completeness 7/10. Human ~0 / CC ~0. Risk: webhook drops on transient failure continue.\nC) At-least-once, no dedup\nWire the retry hook for processWebhookJob with no delivery record and no idempotency header; document to receivers that delivery is at-least-once. Completeness 3/10. Human ~1h / CC ~5 min. Risk: duplicate side effects at receivers.\n\nState: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n"
},
{
"at": "2026-10-04T04:29:54.828Z",
"old": "State: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n",
"new": "State: approved\nActual answer: A) Idempotent delivery + retry (D2 answer)\nAccepted scope: processWebhookJob is wired to the retry hook (per D1). Add a persisted per-job delivery record with states pending / delivered / ambiguous, written before each send and updated after; send `Idempotency-Key: <job id>` on every attempt; on retry, skip the send when the record is `delivered`, otherwise resend with the same key. Includes the migration for the record and the tests that prove the contract \"at most one successful delivery recorded per job\" (R7 carries the regression contract). Documented limit: receivers that ignore the header may see one duplicate after an ambiguous send.\nHistory: none\n\n### R3: Terminal failure policy — max attempts and dead-letter handling\nFinding: #3 (Architecture list item 2), P1, confidence 8/10, PLAN.md:7-9, reviewer: plan-eng-review (Architecture)\nMotivating lines (PLAN.md:7-9): \"We'll roll a custom exponential-backoff scheduler inline in each worker ... we want full control over the curve.\" No attempt limit or exhausted-job handling appears anywhere in the plan.\nPlan baseline: original proposal; retries with no stated attempt limit and no stated behavior when retries run out. No prior approval.\nRuntime evidence: unknown. The job library is not in this repository; most job libraries' retry hooks include a max-attempts setting and a dead/failed set, but this one's defaults are unverified.\nComparison grid:\n\n| Choice | Current | A) Max attempts + dead-letter | B) Max attempts, discard | C) Unbounded retries |\n|---|---|---|---|---|\n| R1 retry mechanism | approved (D1) | unchanged (D1) | unchanged (D1) | unchanged (D1) |\n| R2 webhook semantics | approved (D2) | unchanged (D2) | unchanged (D2) | unchanged (D2) |\n| R3 terminal failure policy | unspecified | finite max attempts (default 5, per-worker override, measured in attempts); on exhaustion move the job and its last error to the library's dead set or a dead-letter table and emit one metric/alert | finite max attempts (default 5); on exhaustion log the error and drop the job | no limit; job retries until it succeeds |\n| R4 jitter | unspecified, pending | pending | pending | pending |\n| R5 delay cap | unspecified, pending | pending | pending | pending |\n| R6 shared retry envelope | duplicated across 5 workers (proposed) | pending | pending | pending |\n| R7 regression coverage | pending (contract fixed by D2) | pending | pending | pending |\n| R8 dependency-graph caching | re-fetch and recompute every retry (proposed) | pending | pending | pending |\n\nQuestion D3:\nD3 — What happens when a job keeps failing: cap attempts and dead-letter it, cap and drop, or retry forever?\nProject/branch/task: gstack-plan-count-jikZRT on main, plan \"Add background job retry framework\".\nELI10: Some jobs will never succeed: a receiver that returns 410 Gone, a payload that fails validation. The plan never says when to stop retrying or where the job goes when you do. Retry forever and those poison jobs sit in the queue burning worker time. Drop them and you lose the evidence of what went wrong. Dead-letter them and someone at 3am can see the job, the last error, and replay it.\nStakes if we pick wrong: either an ever-growing queue of jobs that will never complete, or silently lost work with no record.\nRecommendation: A because a finite cap plus a dead-letter set is the standard pattern and most job libraries already ship the dead set, so the cost is one setting and one alert.\nCompleteness: A=10/10, B=6/10, C=2/10\nPros / cons:\nA) Finite max attempts + dead-letter set with alert (recommended)\n ✅ Poison jobs leave the live queue after a bounded number of attempts, so healthy jobs are not starved\n ✅ The dead set keeps the job and its last error, so an operator can inspect and replay instead of guessing\n ❌ Needs a dead set (library-provided or one table) and one alert wired to it (human: ~half day / CC: ~10 min)\nB) Finite max attempts, discard on exhaustion\n ✅ Bounded retries with the least code: one setting and one error log line\n ✅ No dead-letter storage to operate or prune\n ❌ Exhausted jobs are gone; the only trace is a log line, so replay means re-creating the job by hand\nC) Unbounded retries (plan as written)\n ✅ No job is ever declared failed, so nothing needs an operator decision\n ✅ Zero additional code beyond the curve\n ❌ A permanently failing job retries forever, and once the delay cap is hit it consumes a worker slot on every cycle\nNet: a few lines of configuration and one alert versus either an unbounded poison queue or silently discarded work.\nHeader: Terminal policy\nOptions:\nA) Max attempts + dead-letter\nFinite max attempts (default 5, per-worker override) on the library retry hook. On exhaustion, move the job and its last error to the library's dead set if it has one, otherwise to a dead-letter table; emit one metric and alert on dead-letter growth. Includes tests for the exhaustion path. Completeness 10/10. Human ~half day / CC ~10 min.\nB) Max attempts, discard\nFinite max attempts (default 5, per-worker override). On exhaustion, log the job id and last error at error level and drop the job. Includes a test for the exhaustion path. Completeness 6/10. Human ~1h / CC ~5 min. Risk: no replay path.\nC) Unbounded retries\nNo attempt limit; the job retries on the curve until it succeeds. Completeness 2/10. Human ~0 / CC ~0. Risk: poison jobs never leave the queue.\n\nState: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n"
}
]
}
}