š fix: work rules see a late addition when GITHUB_TOKEN hides which slice was added
Slice: #94
State #114 of P-39, a fix filed under the slice it fixes (P-40), reported by the 0114 coordinator.
On a private repository a workflow's GITHUB_TOKEN reads a work item's sub_issue_added events with sub_issue: null. Work rules matched additions by that number, so they found no late addition, owed nothing and passed: athya_mono #2547 passed on v0.5.9 for slice #2541, added 40 s after its work item's approval. Pre-push, with the agent's token, refused it.
src/work.ts:readSlicereads the slice's own timeline too. Itsparent_issue_addedevents are the slice's own, soGITHUB_TOKENcan tell when it was last added even with the parent hidden. The latest of those and any named addition counts. When an addition after approval names no issue and the slice records none, the check fails closed: "cannot tell when #N was added to work item #Pā¦".- Tests: the fake serves the slice's own timeline. New cases cover a late addition seen only from the slice's timeline, and the fail-closed case. The old "ignores the add of another slice" test, which treated a null
sub_issueas another slice, now has the slice's own record beside it.
Proof, sandbox (private) runs as GITHUB_TOKEN:
- 41331946314: work item #1's additions read
sub_issue: null; slice #4's own timeline hasparent_issue_addedat the addition's time. - 41332290514,
sliceProblemsfor #4 (approved) and #21 (planted, added after approval, not approved):
No version bump; the coordinator releases it as 0.5.13.
š¤ Generated with Claude Code
Summary by cubic
Fixes work rules missing late slice additions on private repositories, where a workflow's GITHUB_TOKEN reads sub_issue_added events with sub_issue: null and can't tell which slice was added.
- Reads the slice's own
parent_issue_addedtimeline events to determine when it was last added, alongside named additions. - A hidden addition after approval is put down to a sibling slice only when that sibling's own timeline records an addition at the same moment; otherwise it counts as this slice's addition and owes the owner's say, instead of passing.