šŸ› fix: Needs you counts a re-added slice's answers after its re-addition

Merged
AT
25d ago
+61-10

Slice: #99

Builds State #207 of P-40, found by Cubic on #206 (README.md:541) and filed there. Closes #207.

What changes

  • src/asks.ts: each owed ask carries a since, the ask's own time by default. For a Proposal: for the issue itself (a slice's addition, including one whose first line names no #N), the sweep reads the issue's own timeline and raises since to its latest parent_issue_added event, when that is later. A Decision:, a šŸ‘ and a batch answer on Approvals each count only after since, as the work rules count them after the slice's latest addition. So a slice taken out and added again, whose old proposal propose does not repost, stays on Needs you until the owner says so again.
  • The timeline is read only when such a proposal is owed, and a 404 reads as no addition. A State's drop proposal and a Needs you: ask keep their own times.
  • README: the sentence #206 added about this gap now says what the sweep does. A Record in docs/decisions.md.

One difference from the work rules, noted here rather than decided: readSlice also counts the work item's sub_issue_added events that name no issue (a private repository's workflow token reads them that way). The sweep reads only the slice's own parent_issue_added events, which that token reads in full, so it trails the work rules only where GitHub records an addition on the work item and not on the slice.

Evidence

pnpm check passes: typecheck, 1071 of 1071 tests under the 95/95/90 gate (asks.ts 100% lines, 97.36% branches, 100% functions), build, smoke.

New test in src/asks.test.ts, "one proposal at a time (#203)" › "counts an answer to a slice's addition only after the slice was last added (#207)", each case through both the hourly sweep and the comment event on Approvals:

  • re-added at 04:00 after the proposal at 01:00: a šŸ‘ at 03:00 → waits; at 06:00 → cleared.
  • a Decision: at 03:00 → waits; at 06:00 → cleared.
  • the batch at 05:00 → cleared after a re-addition at 04:00, waits after one at 06:00.
  • a šŸ‘ on State #30's drop at 03:00 still counts (the floor is the slice's alone), and an addition before the proposal changes nothing.

Every older test leaves the timeline unrouted (a 404), so they pin the no-addition path.

The version isn't bumped here; 0.5.36 follows, then athya_mono pins it.

šŸ¤– Generated with Claude Code


Summary by cubic

Fixes the sweep counting answers to a re-added slice's proposal from before the slice was added again, which wrongly cleared needs-owner while the work rules still owed the decision.

What changes

  • A proposal for the issue itself counts a Decision:, šŸ‘, or batch answer only after the issue's latest parent_issue_added event, read from its timeline only when such a proposal is owed; a 404 reads as no addition.
  • A State's drop proposal and a Needs you: ask keep their own times.
  • README.md and docs/decisions.md document the behavior and the one remaining difference from the work rules: the sweep reads only the slice's own events, missing additions GitHub records only on the work item.

Evidence

  • pnpm check passes; a new test in src/asks.test.ts covers šŸ‘, Decision:, batch, and State-drop cases through both the hourly sweep and the Approvals comment event, with older tests pinning the no-addition path.