mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-04 18:36:54 +02:00
Census 36776104571's question preserved the contract ('behaving exactly like the
scheduler', 'scheduler parity holds by construction') and excluded work with
'Existing copies and helper hardening stay unchanged'. Accept exactly/parity as
preservation (negated forms refuse) and a bare noun list that stays unchanged as
an exclusion for the expansion scan only; verb-led clauses still refuse.
1 line
4.8 KiB
JSON
1 line
4.8 KiB
JSON
{"questions":[{"question":"D1 — Parser source for the two new Retry-After callers\nProject/branch/task: repo on main; plan review of PLAN.md for the future src/import-worker.ts and src/sync-route.ts.\nELI10: Both new callers need to turn a Retry-After header into a wait time, capped at an hour, with a fallback when the header is missing or junk, behaving exactly like the scheduler. The scheduler already gets that from a tested shared function in lib/retry-after.ts. The plan instead writes a fresh copy of that parser inside each new file. Copies drift: probing the real parser shows quirks a fresh copy would probably handle differently (for example \"-5\" and \"1.5\" are treated as dates and cap at 3600 instead of falling back).\nStakes if we pick wrong: two new parsers that silently disagree with the scheduler on edge cases, with no test that would notice.\nRecommendation: A because it reuses proven code with zero semantic risk, and the extra contract assertions cost a few lines while closing the gaps the callers actually depend on.\nCompleteness: A=10/10, B=7/10, C=4/10\nPros / cons:\nA) Reuse lib, extend contract test (recommended) (human: ~1.5 h / CC: ~5 min)\n ✅ Callers import retrySeconds(value, now, fallback) exactly as src/scheduler.ts does, so scheduler parity holds by construction rather than by test.\n ✅ Adds about seven assertions to test/retry-after.test.ts for empty/whitespace, '0', the 3600/3601 ceiling, past date → 0, unsafe integer, and sub-second ceil; each catches a real regression.\n ✅ Saves about 24 implementation lines versus two local copies (about 4 added instead of 28).\n ❌ A defect in lib/retry-after.ts now reaches three callers instead of one; the contract test is the mitigation.\nB) Reuse lib, existing test only (human: ~1 h / CC: ~3 min)\n ✅ Same import wiring and line savings as A with no change to the shared test file.\n ✅ Smallest possible diff: two imports plus the two integration tests already planned.\n ❌ The five existing assertions leave empty string, past dates, the exact ceiling boundary and unsafe integers unasserted, so a later helper edit could break the callers unnoticed.\nC) Local parser per caller (human: ~3 h / CC: ~10 min)\n ✅ Each caller is self-contained; a change to the shared helper cannot affect it.\n ✅ Matches the current draft, so the plan text needs no rewrite.\n ❌ Adds two more ~14-line copies (src/retry-route.ts and src/retry-worker.ts are already copies) and needs parity tests to hold the fixed contract, which the probe shows is easy to get subtly wrong.\nNet: Reuse trades a slightly larger shared blast radius for guaranteed scheduler parity and a smaller diff; the only real question is whether to close the contract-test gaps now (A) or leave them (B).","header":"Parser reuse","multiSelect":false,"options":[{"label":"Reuse lib, extend contract test (recommended)","description":"✅ Callers import retrySeconds(value, now, fallback) exactly as src/scheduler.ts does, so scheduler parity holds by construction rather than by test.\n✅ Adds about seven assertions to test/retry-after.test.ts for empty/whitespace, '0', the 3600/3601 ceiling, past date → 0, unsafe integer, and sub-second ceil; each catches a real regression.\n✅ Saves about 24 implementation lines versus two local copies (about 4 added instead of 28).\n❌ A defect in lib/retry-after.ts now reaches three callers instead of one; the contract test is the mitigation.\nCompleteness 10/10. Effort human: ~1.5 h / CC: ~5 min. Integration tests per caller prove import wiring, injected now, fallback pass-through and the 3600 ceiling. Existing copies and helper hardening stay unchanged."},{"label":"Reuse lib, existing test only","description":"✅ Same import wiring and line savings as A with no change to the shared test file.\n✅ Smallest possible diff: two imports plus the two integration tests already planned.\n❌ The five existing assertions leave empty string, past dates, the exact ceiling boundary and unsafe integers unasserted, so a later helper edit could break the callers unnoticed.\nCompleteness 7/10. Effort human: ~1 h / CC: ~3 min. Same integration-test obligations as A. Existing copies and helper hardening stay unchanged."},{"label":"Local parser per caller","description":"✅ Each caller is self-contained; a change to the shared helper cannot affect it.\n✅ Matches the current draft, so the plan text needs no rewrite.\n❌ Adds two more ~14-line copies (src/retry-route.ts and src/retry-worker.ts are already copies) and needs parity tests to hold the fixed contract, which the probe shows is easy to get subtly wrong.\nCompleteness 4/10. Effort human: ~3 h / CC: ~10 min. Each caller needs a parity test against lib/retry-after.ts over the same edge-case list plus its integration test. Existing copies and helper hardening stay unchanged."}]}]} |