π fix(needs-owner): a closed issue or pull request never keeps needs-owner
Slice: #639
Work item: https://github.com/veda-hq/niyam/issues/638. Alok added its approved label at 2026-11-25T11:59:29Z. The slice was added before that approval, so it needs no proposal of its own: niyam propose 639 printed propose: #639 needs no decision from AlokBansal8.
Why: the hourly sweep listed only open issues labelled needs-owner. The owner's π sends no event, and GitHub runs the hourly schedule only every few hours. So a slice that was π'd and then closed by its merge before the next sweep kept the label for good, as https://github.com/veda-hq/niyam/issues/604 and https://github.com/veda-hq/niyam/issues/578 did. Closed issues labelled needs-owner on 2026-11-25:
| Repository | Count |
|---|---|
| niyam | 28 |
| veda | 65 |
| athya_mono | 27 |
| athya-rules | 1 |
What it does
- The sweep (
src/asks.ts) now also takesneeds-owneroff every closed issue and pull request labelled with it, whether or not it was answered. Its first run after a repository moves its pin backfills that repository. - The needs-owner job in
.github/workflows/checks.ymlnow also runs when an issue is reopened. This file is named under the slice's Guards:.- A reopened issue is labelled again only where an ask on it still waits: no answer counts, and the owner put no
approvedlabel on it after the ask. - An issue that still has the label is left alone.
- A reopened issue is labelled again only where an ask on it still waits: no answer counts, and the owner put no
src/instant.tsis new. It reads ISO 8601 times strictly: an offset is required, and impossible dates are refused.- The reopened check compares instants, not text, because shuddhi's
strict-scalar-parserefuses both string>andDate.parse. - A time it cannot read counts against the approval, so the issue gets labelled.
- The reopened check compares instants, not text, because shuddhi's
- README (Needs you), the
niyam needs-ownerhelp line, anddocs/decisions.mdsay so. The Decision also records why anissues: closedtrigger was rejected: the sweep already covers it, and closing would race the merge.
Consumers: no consumer workflow changes. veda, athya_mono, athya-rules and niyam-sandbox get the fix when their pin moves to the release that carries it, which is 0.7.21, next after #640. This pull request releases nothing.
Evidence: pnpm check exits 0 locally. Pre-push ran it again on the branch after rebasing onto 6101176.
pnpm test: 2265 of 2265 pass, andpnpm test:scripts: 138 of 138.- New tests in
src/asks.test.ts:- the sweep clears closed issues and a closed PR, tolerating a 404 on delete, and fails on a 403 on the closed list;
- a reopened issue is labelled again, or left unlabelled after a π, a later owner approval, or no ask;
- an agent's approval, an earlier approval, an unreadable time, or a
+12:00time before the ask still relabels; - an already labelled reopened issue makes no requests.
- New tests in
src/instant.test.ts: UTC, fractions, offsets east and west, ordering that text gets wrong, leap days, and rejection of missing offsets, impossible dates, times and offsets. - Coverage:
src/asks.ts100% lines and 96.18% branches;src/instant.ts100% lines and 95.65% branches.
π€ Generated with Claude Code
Summary by cubic
Fixes needs-owner sticking to closed issues and pull requests, since the owner's π sends no event and the hourly sweep only listed open ones.
- The sweep now takes
needs-owneroff every closed issue or pull request, answered or not, and its first run after release clears the backlog. - The
needs-ownerjob now also runs when an issue is reopened, labelling it again only when an ask still waits: no counted answer and no ownerapprovedlabel after the latest ask. An issue still labelled is left alone; a reopened pull request is not judged again. - Adds
src/instant.ts, a strict ISO 8601 parser thatissue-types.tsnow shares, so both compare time instants rather than text; a time it cannot read counts against the approval.