Skip to content

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
29.7 KB
Raw Blame
{
 "schema": "gstack-detector-corpus/v1",
 "case": "plan-eng-multi-finding-batching",
 "detector": "test/helpers/eng-seeded-coverage.ts#createEngBatchingIssueCounter",
 "series_identity": "57a825b033078a7b",
 "source": {
  "run": "37179171083",
  "sha": "db91607a7fd9419592eb63e036149920304e32b5",
  "lane": "periodic",
  "artifact": "paid-slice-1-a1",
  "path": "shards/skill-e2e-plan-eng-multi-finding-batching/pty-count/ci-37179171083-1-eval-slices-1/plan-eng-review-1791090853086-Li4aER"
 },
 "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": "fe0156ca-72d4-4134-9411-fa163af1fec9",
    "toolUseId": "toolu_01F5N5AsP7A3K1QHxnzZNetz",
    "answeredAt": "2026-10-04T05:16:20.889Z",
    "answer": "Library hook + custom curve (recommended)",
    "question": {
     "question": "D1 — Rebuild retry scheduling, or drive the library's retry hook with a custom curve?\nProject/branch/task: main — plan \"Add background job retry framework\", PLAN.md:7-9.\nELI10: The job library you already run has a retry hook. The plan rewrites that machinery by hand inside every worker, admitting it is the \"same shape as the library version\", purely to own the delay curve. Most job libraries let you plug in your own delay function, so you can usually get full control over the curve without rebuilding attempt counting, max-attempt cutoffs, dead-lettering and crash recovery.\nStakes if we pick wrong: a hand-rolled scheduler that loses the attempt counter on a crash either retries forever or drops the job silently, and five copies means five places to get it wrong.\nRecommendation: A because the plan states no behavioral difference from the library version, and a custom backoff function inside the library hook gives the same curve control with the library's persistence and cutoffs intact. [Layer 1: reuse the installed dependency]\nCompleteness: A=10/10, B=4/10, C=n/a (investigation only, approves nothing)\nPros / cons:\nA) Library retry hook + custom backoff function (recommended) (human: ~1 day / CC: ~20 min)\n  ✅ Keeps the library's attempt persistence, max-attempt cutoff and dead-letter handling, which the plan would otherwise have to reimplement\n  ✅ Full control of the delay curve lives in one small pure function that is trivial to unit test\n  ❌ Must confirm the installed library version exposes a custom delay callback; if it does not, the curve may need an upgrade or a thin adapter\nB) Custom inline scheduler per worker (as proposed) (human: ~1 week + ongoing / CC: ~2 h + ongoing)\n  ✅ Zero dependence on the library's hook semantics or version\n  ✅ Curve, logging and dispatch can be tuned per worker independently\n  ❌ Reimplements attempt counting, cutoffs, dead-lettering, jitter and crash-mid-retry handling that the library already provides, and does so five times\nC) Investigate first: bounded probe of the library's hook API (human: ~1 h / CC: ~5 min)\n  ✅ Settles the one open fact (does the hook accept a custom delay function?) before committing\n  ✅ Costs almost nothing and leaves every other choice untouched\n  ❌ Approves no implementation; R1 stays pending until the probe result comes back\nNet: you are trading a small compatibility check against owning (and testing) retry-state machinery five times over.",
     "header": "Retry mechanism",
     "multiSelect": false,
     "options": [
      {
       "label": "Library hook + custom curve (recommended)",
       "description": "Use the existing job library's retry hook and supply one custom exponential-backoff function for the delay curve. Keeps the library's attempt persistence, max-attempt cutoff and dead-letter path. Completeness 10/10. Effort human ~1 day / CC ~20 min. Risk: the installed version must expose a custom delay callback. R2-R5 stay pending."
      },
      {
       "label": "Custom inline scheduler (as planned)",
       "description": "Keep the plan as written: a hand-rolled exponential-backoff scheduler inline in each of the 5 workers. Must reimplement attempt counting, cutoffs, dead-lettering, jitter and crash-mid-retry recovery. Completeness 4/10. Effort human ~1 week plus ongoing maintenance / CC ~2 h plus ongoing. R2-R5 stay pending."
      },
      {
       "label": "Investigate the library hook first",
       "description": "Bounded probe only: read the installed job library's retry hook API and confirm whether it accepts a caller-supplied delay function. Approves no implementation. R1 stays pending until the probe reports back; R2-R5 stay pending."
      }
     ]
    }
   },
   {
    "sessionId": "fe0156ca-72d4-4134-9411-fa163af1fec9",
    "toolUseId": "toolu_01PXLYa3xPTYq262TeeqQ3Sb",
    "answeredAt": "2026-10-04T05:17:55.867Z",
    "answer": "At-least-once + idempotency key (recommended)",
    "question": {
     "question": "D2 — When webhooks start retrying, what delivery guarantee do receivers get?\nProject/branch/task: main — plan \"Add background job retry framework\", PLAN.md:17-19.\nELI10: Today a webhook is sent at most once: if it fails, it is gone, but the receiver never sees a duplicate. Adding retries flips that. A send that timed out may have actually landed, so the retry delivers the same event twice. Receivers that charge a card or create a record on each webhook will do it twice. The standard fix is an idempotency key: a stable id per delivery that goes out with every attempt, plus a record on our side so a retry never re-sends something already confirmed.\nStakes if we pick wrong: duplicate webhooks cause double side effects at every customer endpoint, and nobody on our side sees an error.\nRecommendation: A because retries on webhooks are only safe when receivers can dedupe, and the key plus delivery record is a small addition that turns the silent-duplicate failure into a defined contract. [Layer 1: standard webhook practice]\nCompleteness: A=10/10, B=7/10, C=3/10\nPros / cons:\nA) At-least-once with idempotency key + delivery record (recommended) (human: ~2 days / CC: ~30 min)\n  ✅ Receivers can dedupe on a stable id; the contract becomes explicit and documentable\n  ✅ A persisted delivery record stops a retry from re-sending an attempt that already succeeded\n  ❌ Adds a small write per attempt and a schema change for the delivery record\nB) Keep retries off for processWebhookJob (human: ~1 h / CC: ~5 min)\n  ✅ Preserves today's at-most-once guarantee with no receiver-facing change\n  ✅ Smallest possible change to the webhook path\n  ❌ Failed webhooks are still dropped silently, which is the pain this plan exists to fix\nC) Retries on, no idempotency key (as proposed) (human: ~0 / CC: ~0)\n  ✅ No extra schema or header work\n  ✅ Ships fastest\n  ❌ Receivers get duplicate deliveries with no way to detect them; double side effects at customer endpoints\nNet: a small id plus one table row per delivery versus silently duplicating customer-visible side effects.",
     "header": "Webhook guarantee",
     "multiSelect": false,
     "options": [
      {
       "label": "At-least-once + idempotency key (recommended)",
       "description": "Enable retries on processWebhookJob through the library hook (R1). Send a stable per-delivery idempotency id on every attempt, persist a delivery record and check it before each send so a confirmed attempt is never re-sent. Completeness 10/10. Effort human ~2 days / CC ~30 min. R2-R5 stay pending; R3's regression contract will target this guarantee."
      },
      {
       "label": "Retries off for webhooks only",
       "description": "Keep processWebhookJob at-most-once with no retries; the other 4 workers get retries via R1. Failed webhooks remain dropped. Completeness 7/10. Effort human ~1 h / CC ~5 min. R2-R5 stay pending; R3's regression contract will target at-most-once."
      },
      {
       "label": "Retries on, no idempotency (as planned)",
       "description": "Enable retries on processWebhookJob with no idempotency key or delivery record. Receivers may receive duplicates. Completeness 3/10. Effort none beyond R1. R2-R5 stay pending; R3's regression contract will have to document the duplicate-delivery behavior."
      }
     ]
    }
   },
   {
    "sessionId": "fe0156ca-72d4-4134-9411-fa163af1fec9",
    "toolUseId": "toolu_018ey1K9ffDscnzBtDJ24dZ5",
    "answeredAt": "2026-10-04T05:18:53.539Z",
    "answer": "Full jitter (recommended)",
    "question": {
     "question": "D3 — Should the backoff curve add random jitter?\nProject/branch/task: main — plan \"Add background job retry framework\", PLAN.md:7-9.\nELI10: When a downstream service goes down, every job that touches it fails in the same second. With a pure exponential curve they all wake up again in the same second, hit the service together and knock it over again. Jitter spreads each retry randomly across its window so the retries trickle in instead of arriving as a wave. It is one line in the delay function.\nStakes if we pick wrong: a recovering dependency gets re-flattened by our own synchronized retry storm, and the outage lasts longer than it needed to.\nRecommendation: A because full jitter is the standard remedy for synchronized retries and costs one random call inside a function that is already being written. [Layer 1]\nCompleteness: A=10/10, B=7/10\nPros / cons:\nA) Full jitter (recommended) (human: ~30 min incl. test / CC: ~3 min)\n  ✅ Spreads retries uniformly across the window, so a recovering dependency sees a trickle, not a wave\n  ✅ One expression in the delay function; the unit test seeds the RNG and asserts the range\n  ❌ Individual retry timing is no longer exactly predictable from the attempt number alone\nB) No jitter, deterministic exponential (human: ~0 / CC: ~0)\n  ✅ Retry timing is exactly predictable, which makes log reading trivial\n  ✅ Nothing extra to write or test\n  ❌ Every job that failed together retries together, recreating the overload that caused the failure\nNet: predictable timestamps in logs versus not DDoSing your own dependencies after an outage.",
     "header": "Jitter",
     "multiSelect": false,
     "options": [
      {
       "label": "Full jitter (recommended)",
       "description": "Delay = random(0, min(cap, base * 2^attempt)). Unit test seeds the RNG and asserts the delay stays within [0, bound]. Completeness 10/10. Effort human ~30 min / CC ~3 min. R5b (cap) and R5c (exhaustion) stay pending and are asked next."
      },
      {
       "label": "No jitter",
       "description": "Delay = base * 2^attempt, deterministic. Completeness 7/10. Effort none. R5b and R5c stay pending and are asked next."
      }
     ]
    }
   }
  ],
  "planEvents": [
   {
    "at": "2026-10-04T05:15:44.250Z",
    "write": "# Eng Review — PLAN.md (\"Add background job retry framework\")\n\nTarget (fixed): <fixture>\nReport file: this file (user-requested destination)\nReview: /plan-eng-review, session 693-1791090838-01c198b5, branch main, commit 2f3995b\nDate: 2026-10-04\nRuntime evidence note: the repository contains only CLAUDE.md and PLAN.md. The worker files, job library and `processWebhookJob()` named in the plan are not present in this checkout, so all runtime evidence below is `unknown` and findings are calibrated against the plan text.\n\n## Original plan (unchanged copy)\n\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## Decision ledger\n\n### R1: Retry mechanism — library retry hooks vs custom inline scheduler\nFinding: S1, P1, confidence 8/10, PLAN.md:7-9, reviewer: plan-eng-review (native)\nPlan baseline: original proposal — \"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.\" No prior approval.\nRuntime evidence: unknown. The job library and worker files are not in this checkout; whether the library's retry hook accepts a caller-supplied delay function is unverified.\nComparison grid:\n\n| Choice | Current | A | B | C |\n|---|---|---|---|---|\n| R1 retry mechanism | custom inline scheduler per worker (proposed) | library retry hook + one custom backoff function | custom inline scheduler per worker (as proposed) | unchanged, pending; bounded probe of the library hook API only |\n| R2 shared retry envelope vs 5 copies | 5 copy-pasted bodies (proposed) | pending | pending | pending |\n| R3 at-most-once regression test for processWebhookJob | none planned (proposed) | pending | pending | pending |\n| R4 dependency-graph cache across retries | none planned (proposed) | pending | pending | pending |\n| R5 backoff curve details (jitter, cap, max attempts) | unspecified | pending | pending | pending |\n\nQuestion D1:\nD1 — Rebuild retry scheduling, or drive the library's retry hook with a custom curve?\nProject/branch/task: main — plan \"Add background job retry framework\", PLAN.md:7-9.\nELI10: The job library you already run has a retry hook. The plan rewrites that machinery by hand inside every worker, admitting it is the \"same shape as the library version\", purely to own the delay curve. Most job libraries let you plug in your own delay function, so you can usually get full control over the curve without rebuilding attempt counting, max-attempt cutoffs, dead-lettering and crash recovery.\nStakes if we pick wrong: a hand-rolled scheduler that loses the attempt counter on a crash either retries forever or drops the job silently, and five copies means five places to get it wrong.\nRecommendation: A because the plan states no behavioral difference from the library version, and a custom backoff function inside the library hook gives the same curve control with the library's persistence and cutoffs intact. [Layer 1: reuse the installed dependency]\nCompleteness: A=10/10, B=4/10, C=n/a (investigation only, approves nothing)\nPros / cons:\nA) Library retry hook + custom backoff function (recommended) (human: ~1 day / CC: ~20 min)\n  ✅ Keeps the library's attempt persistence, max-attempt cutoff and dead-letter handling, which the plan would otherwise have to reimplement\n  ✅ Full control of the delay curve lives in one small pure function that is trivial to unit test\n  ❌ Must confirm the installed library version exposes a custom delay callback; if it does not, the curve may need an upgrade or a thin adapter\nB) Custom inline scheduler per worker (as proposed) (human: ~1 week + ongoing / CC: ~2 h + ongoing)\n  ✅ Zero dependence on the library's hook semantics or version\n  ✅ Curve, logging and dispatch can be tuned per worker independently\n  ❌ Reimplements attempt counting, cutoffs, dead-lettering, jitter and crash-mid-retry handling that the library already provides, and does so five times\nC) Investigate first: bounded probe of the library's hook API (human: ~1 h / CC: ~5 min)\n  ✅ Settles the one open fact (does the hook accept a custom delay function?) before committing\n  ✅ Costs almost nothing and leaves every other choice untouched\n  ❌ Approves no implementation; R1 stays pending until the probe result comes back\nNet: you are trading a small compatibility check against owning (and testing) retry-state machinery five times over.\nHeader: Retry mechanism\nOptions:\nA) Library hook + custom curve (recommended)\nUse the existing job library's retry hook and supply one custom exponential-backoff function for the delay curve. Keeps the library's attempt persistence, max-attempt cutoff and dead-letter path. Completeness 10/10. Effort human ~1 day / CC ~20 min. Risk: the installed version must expose a custom delay callback. R2-R5 stay pending.\nB) Custom inline scheduler (as planned)\nKeep the plan as written: a hand-rolled exponential-backoff scheduler inline in each of the 5 workers. Must reimplement attempt counting, cutoffs, dead-lettering, jitter and crash-mid-retry recovery. Completeness 4/10. Effort human ~1 week plus ongoing maintenance / CC ~2 h plus ongoing. R2-R5 stay pending.\nC) Investigate the library hook first\nBounded probe only: read the installed job library's retry hook API and confirm whether it accepts a caller-supplied delay function. Approves no implementation. R1 stays pending until the probe reports back; R2-R5 stay pending.\n\nState: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n"
   },
   {
    "at": "2026-10-04T05:16:59.272Z",
    "old": "State: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n",
    "new": "State: approved\nActual answer: A) Library hook + custom curve — D1 answer\nAccepted scope: Drop the custom inline scheduler from the plan. All 5 workers use the job library's built-in retry hook; the delay curve is one custom exponential-backoff function supplied to that hook. First implementation step: confirm the installed library version exposes a custom delay callback (if not, upgrade or add a thin adapter). Unit tests for the delay function are required proof of this approved behavior and are carried forward without a further question. R2-R5 remain pending.\nHistory: none\n\n### Scope Challenge record\nfeature answers: none proposed (feature list unchanged: retry framework across 5 workers incl. processWebhookJob); structure: complexity gate not tripped (5 files, 0 new classes/services), structure question skipped; accepted scope: R1 approved per D1 (library hook + custom curve replaces custom inline scheduler); pending remedies: R2, R3, R4, R5.\nScope Challenge result: scope reduced per recommendation (custom scheduler build removed; features unchanged).\n"
   },
   {
    "at": "2026-10-04T05:17:03.002Z",
    "old": "## Decision ledger\n",
    "new": "## Working plan (current, with approved changes applied)\n\n### Architecture (R1 approved, D1)\nUse the existing job library's built-in retry hooks in all 5 workers. Supply one custom exponential-backoff delay function to the hook for full control of the curve. The custom inline scheduler is removed. First step: confirm the installed library exposes a custom delay callback. Curve details (jitter, cap, max attempts, dead-letter): R5 pending.\n\n### Code quality\nR2 pending (shared envelope vs 5 copies).\n\n### Tests\nUnit tests for the custom delay function: required proof of R1. R3 pending (at-most-once regression contract for `processWebhookJob()`).\n\n### Performance\nR4 pending (dependency-graph cache across retries).\n\n## Decision ledger\n"
   },
   {
    "at": "2026-10-04T05:17:33.381Z",
    "old": "Scope Challenge result: scope reduced per recommendation (custom scheduler build removed; features unchanged).\n",
    "new": "Scope Challenge result: scope reduced per recommendation (custom scheduler build removed; features unchanged).\n\n### R6: Webhook delivery guarantee once retries are enabled on processWebhookJob\nFinding: A1, P1, confidence 8/10, PLAN.md:17-19, reviewer: plan-eng-review (native), Section 1 Architecture\nPlan baseline: original proposal — \"The existing `processWebhookJob()` flow gets rewritten as part of this change. No regression test for the prior at-most-once delivery guarantee is planned.\" Retries are added to this job; nothing in the plan preserves or replaces the at-most-once guarantee. R1 approved (D1): retries run through the library hook. No prior approval for R6.\nRuntime evidence: unknown. `processWebhookJob()` and its callers are not in this checkout; whether webhook receivers tolerate duplicate deliveries is unverified.\nComparison grid:\n\n| Choice | Current | A | B | C |\n|---|---|---|---|---|\n| R6 webhook delivery guarantee | at-most-once today (plan text); proposed: retried with no dedupe, i.e. at-least-once with duplicates | at-least-once with an idempotency key: stable per-delivery id sent with every attempt and a persisted delivery record checked before each send | retries stay off for processWebhookJob; at-most-once preserved; the other 4 workers get retries | retries on with no idempotency key (as proposed); receivers may see duplicates |\n| R1 retry mechanism | approved (D1): library hook + custom curve | unchanged | unchanged | unchanged |\n| R2 shared envelope | pending | pending | pending | pending |\n| R3 regression contract for processWebhookJob | pending | pending (contract shape follows R6) | pending (contract shape follows R6) | pending (contract shape follows R6) |\n| R4 graph cache | pending | pending | pending | pending |\n| R5 curve details | pending | pending | pending | pending |\n\nQuestion D2:\nD2 — When webhooks start retrying, what delivery guarantee do receivers get?\nProject/branch/task: main — plan \"Add background job retry framework\", PLAN.md:17-19.\nELI10: Today a webhook is sent at most once: if it fails, it is gone, but the receiver never sees a duplicate. Adding retries flips that. A send that timed out may have actually landed, so the retry delivers the same event twice. Receivers that charge a card or create a record on each webhook will do it twice. The standard fix is an idempotency key: a stable id per delivery that goes out with every attempt, plus a record on our side so a retry never re-sends something already confirmed.\nStakes if we pick wrong: duplicate webhooks cause double side effects at every customer endpoint, and nobody on our side sees an error.\nRecommendation: A because retries on webhooks are only safe when receivers can dedupe, and the key plus delivery record is a small addition that turns the silent-duplicate failure into a defined contract. [Layer 1: standard webhook practice]\nCompleteness: A=10/10, B=7/10, C=3/10\nPros / cons:\nA) At-least-once with idempotency key + delivery record (recommended) (human: ~2 days / CC: ~30 min)\n  ✅ Receivers can dedupe on a stable id; the contract becomes explicit and documentable\n  ✅ A persisted delivery record stops a retry from re-sending an attempt that already succeeded\n  ❌ Adds a small write per attempt and a schema change for the delivery record\nB) Keep retries off for processWebhookJob (human: ~1 h / CC: ~5 min)\n  ✅ Preserves today's at-most-once guarantee with no receiver-facing change\n  ✅ Smallest possible change to the webhook path\n  ❌ Failed webhooks are still dropped silently, which is the pain this plan exists to fix\nC) Retries on, no idempotency key (as proposed) (human: ~0 / CC: ~0)\n  ✅ No extra schema or header work\n  ✅ Ships fastest\n  ❌ Receivers get duplicate deliveries with no way to detect them; double side effects at customer endpoints\nNet: a small id plus one table row per delivery versus silently duplicating customer-visible side effects.\nHeader: Webhook guarantee\nOptions:\nA) At-least-once + idempotency key (recommended)\nEnable retries on processWebhookJob through the library hook (R1). Send a stable per-delivery idempotency id on every attempt, persist a delivery record and check it before each send so a confirmed attempt is never re-sent. Completeness 10/10. Effort human ~2 days / CC ~30 min. R2-R5 stay pending; R3's regression contract will target this guarantee.\nB) Retries off for webhooks only\nKeep processWebhookJob at-most-once with no retries; the other 4 workers get retries via R1. Failed webhooks remain dropped. Completeness 7/10. Effort human ~1 h / CC ~5 min. R2-R5 stay pending; R3's regression contract will target at-most-once.\nC) Retries on, no idempotency (as planned)\nEnable retries on processWebhookJob with no idempotency key or delivery record. Receivers may receive duplicates. Completeness 3/10. Effort none beyond R1. R2-R5 stay pending; R3's regression contract will have to document the duplicate-delivery behavior.\n\nState: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n"
   },
   {
    "at": "2026-10-04T05:18:32.600Z",
    "old": "R2-R5 stay pending; R3's regression contract will have to document the duplicate-delivery behavior.\n\nState: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n",
    "new": "R2-R5 stay pending; R3's regression contract will have to document the duplicate-delivery behavior.\n\nState: approved\nActual answer: A) At-least-once + idempotency key — D2 answer\nAccepted scope: processWebhookJob retries through the library hook (R1). Every attempt carries a stable per-delivery idempotency id (header). A persisted delivery record is written per delivery and checked before each send so a confirmed attempt is never re-sent. Schema change for the delivery record is in scope. R3's regression contract targets this at-least-once-with-idempotency guarantee. R2-R5 remain pending.\nHistory: none\n\n### R5a: Jitter on the backoff curve\nFinding: A2, P2, confidence 7/10, PLAN.md:7-9, reviewer: plan-eng-review (native), Section 1 Architecture\nPlan baseline: original proposal — \"exponential-backoff scheduler ... we want full control over the curve.\" Curve details are unspecified. R1 approved (D1): the curve is one custom delay function supplied to the library hook. No prior approval for jitter.\nRuntime evidence: unknown. No existing curve or worker code in this checkout.\nComparison grid:\n\n| Choice | Current | A | B |\n|---|---|---|---|\n| R5a jitter | unspecified | full jitter: delay = random(0, min(cap, base * 2^attempt)) | none: delay = base * 2^attempt (deterministic) |\n| R5b delay cap | unspecified, pending | pending | pending |\n| R5c exhaustion handling (max attempts, dead-letter) | unspecified, pending | pending | pending |\n| R1 retry mechanism | approved (D1) | unchanged | unchanged |\n| R6 webhook guarantee | approved (D2) | unchanged | unchanged |\n| R2, R3, R4 | pending | pending | pending |\n\nQuestion D3:\nD3 — Should the backoff curve add random jitter?\nProject/branch/task: main — plan \"Add background job retry framework\", PLAN.md:7-9.\nELI10: When a downstream service goes down, every job that touches it fails in the same second. With a pure exponential curve they all wake up again in the same second, hit the service together and knock it over again. Jitter spreads each retry randomly across its window so the retries trickle in instead of arriving as a wave. It is one line in the delay function.\nStakes if we pick wrong: a recovering dependency gets re-flattened by our own synchronized retry storm, and the outage lasts longer than it needed to.\nRecommendation: A because full jitter is the standard remedy for synchronized retries and costs one random call inside a function that is already being written. [Layer 1]\nCompleteness: A=10/10, B=7/10\nPros / cons:\nA) Full jitter (recommended) (human: ~30 min incl. test / CC: ~3 min)\n  ✅ Spreads retries uniformly across the window, so a recovering dependency sees a trickle, not a wave\n  ✅ One expression in the delay function; the unit test seeds the RNG and asserts the range\n  ❌ Individual retry timing is no longer exactly predictable from the attempt number alone\nB) No jitter, deterministic exponential (human: ~0 / CC: ~0)\n  ✅ Retry timing is exactly predictable, which makes log reading trivial\n  ✅ Nothing extra to write or test\n  ❌ Every job that failed together retries together, recreating the overload that caused the failure\nNet: predictable timestamps in logs versus not DDoSing your own dependencies after an outage.\nHeader: Jitter\nOptions:\nA) Full jitter (recommended)\nDelay = random(0, min(cap, base * 2^attempt)). Unit test seeds the RNG and asserts the delay stays within [0, bound]. Completeness 10/10. Effort human ~30 min / CC ~3 min. R5b (cap) and R5c (exhaustion) stay pending and are asked next.\nB) No jitter\nDelay = base * 2^attempt, deterministic. Completeness 7/10. Effort none. R5b and R5c stay pending and are asked next.\n\nState: pending\nActual answer: unanswered\nAccepted scope: none\nHistory: none\n"
   },
   {
    "at": "2026-10-04T05:18:39.019Z",
    "old": "Use the existing job library's built-in retry hooks in all 5 workers. Supply one custom exponential-backoff delay function to the hook for full control of the curve. The custom inline scheduler is removed. First step: confirm the installed library exposes a custom delay callback. Curve details (jitter, cap, max attempts, dead-letter): R5 pending.\n\n### Code quality\nR2 pending (shared envelope vs 5 copies).\n\n### Tests\nUnit tests for the custom delay function: required proof of R1. R3 pending (at-most-once regression contract for `processWebhookJob()`).",
    "new": "Use the existing job library's built-in retry hooks in all 5 workers. Supply one custom exponential-backoff delay function to the hook for full control of the curve. The custom inline scheduler is removed. First step: confirm the installed library exposes a custom delay callback. Curve details: R5a jitter, R5b cap, R5c exhaustion handling pending.\n\nWebhook delivery (R6 approved, D2): `processWebhookJob()` retries through the hook. Every attempt carries a stable per-delivery idempotency id; a persisted delivery record is checked before each send so a confirmed attempt is never re-sent. Delivery-record schema change is in scope. Guarantee becomes at-least-once with receiver-side dedupe on the id.\n\n### Code quality\nR2 pending (shared envelope vs 5 copies).\n\n### Tests\nUnit tests for the custom delay function: required proof of R1. Tests for the idempotency id and delivery-record check: required proof of R6. R3 pending (regression contract for `processWebhookJob()` under the new guarantee)."
   }
  ]
 }
}