Repository navigation
[SCR-189] Check a filed issue and lint the forms - #191
itsryanarmani wants to merge 1 commit into
Conversation
The offline body check landed in #181. This is the half that needs the GitHub API and the template files on disk. check fetches an issue, validates its labels, and validates its body against the kind its label declares. Labels carry classification because issue types are an organisation feature and this account is a user, so /orgs/pooriaarab/issue-types returns 404. Exactly one label from each of four groups: two from one group is a contradiction, not extra information. Without a kind label there is nothing to check the headings against. Say so rather than guessing, but still run the rules that do not need a kind. That is not an edge case: 85 open issues across the fleet carry no labels at all, and content-rabbit#1134 has none plus a Parent: line in its body. lint asserts the forms still offer every heading the checker demands. Without it the two drift and an issue filed through the form fails the check the form exists to satisfy. selfcheck asserts each rule fires on a body built to break it, so a rule silently deleted shows up there rather than in a pull request that should have been refused.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Council-driven review + fixes
Read pr.diff and the full issue-standards.mjs/issue-standards.test.mjs against council-findings.md. All four correctness claims from GPT-5.6 (Codex) checked out against the actual code; the other three lenses returned no findings or timed out (nothing to verify there). I confirmed and fixed all four:
-
fetchIssueaccepted pull requests as issues (Major). GitHub'srepos/{owner}/{repo}/issues/{number}endpoint returns PRs too (a PR is an issue with apull_requestkey), socheck --repo o/n --number <PR#>would silently validate a PR's labels/body as though it were a filed issue. Fixed:fetchIssuenow throwsApiErrorwhenissue.pull_requestis present. -
--selfchecksilently swallowed other arguments (Major).parseArgsmatched--selfcheckanywhere in argv and returned immediately, so e.g.check --selfcheck --repo bogusran selfcheck and silently discardedcheck/--repo bogusinstead of erroring — exactly the "say so rather than guessing" failure mode this tool is built to avoid elsewhere. Fixed:--selfchecknow must be the only argument (besides--json), otherwise it's aConfigurationError. -
lintTemplatesmatched heading text anywhere in the raw YAML, not just in the field's own label (Major). A required heading's words surviving elsewhere in the file (a description, a comment, a different field) after the actual field was renamed/removed would make lint report a false pass — defeating the exact drift lint exists to catch. Fixed: now extracts onlylabel:lines and matches against those. -
Unexpected errors were misreported as "GitHub API" failures (Minor).
main()'s catch-all classified anything that wasn't aConfigurationErroras a GitHub API error by name check, so e.g. a filesystem error insidelintTemplates/runPrecheckwould print a misleading "check gh authentication" message. Fixed: classify byinstanceof ApiErrorexplicitly, with a generic "unexpected error" bucket for anything else (still exits 1, same as before).
All four fixes are pushed as 548f295, stacked cleanly on the current branch tip (the branch was force-updated/rebased upstream mid-review; I rebased my fix by cherry-picking rather than replaying, to avoid re-litigating already-merged history). Tests added for fixes 2 and 3 (fix 1 needs a live gh call / PR fixture to exercise and isn't mockable with this repo's existing test harness, so it's unit-untested like the rest of fetchIssue). I could not execute node issue-standards.test.mjs myself in this sandboxed environment (command execution was denied), so I traced the new and existing tests by hand against the updated code instead of getting a live pass/fail — flagging that as the residual gap in my own verification, not the PR's.
PR-standard check: branch/title/body match the scr-<issue>-<slug> / [SCR-189] <subject> / Closes #189 + ## What/## Why/## How I verified + Assisted-by: shape. Diff is 295 counted lines across 2 files (including my fix commit) — well under the 500-line/40-file caps.
Proof lens: ## How I verified names real commands (node issue-standards.test.mjs, ./issue-standards --selfcheck, check/lint against real content-rabbit issues/forms, git diff --stat for size) with results attached, and those results align with the diff's new surface (check, lint, --selfcheck). No gaps found there.
No Critical severity issues remain open.
🧑⚖️ Council
| Model | Lens | Result |
|---|---|---|
| GPT-5.6 (Codex) via OpenRouter | correctness | confirmed (4/4, all fixed) |
| Gemini 3 Pro | performance | no findings (timed out / 403) |
| Kimi K3 via OpenRouter | security | no findings |
| Grok 4.5 | maintainability | no findings (timed out) |
| GPT-5.6 (scope) | scope | no findings |
Closes #189
What
Adds
check,lintand--selfcheck: the half of the checker that needs the GitHub API and the template files on disk. Stacked on #190, which is the offline body check.Why
#190 can judge a body you already have. Nothing could fetch a filed issue, validate its labels, or notice that the forms and the checker had drifted apart.
Labels carry classification because GitHub issue types are an organisation feature and this is a user account. Exactly one label from each of four groups: kind, size, route, state. Two from one group is a contradiction, not extra information.
An issue with no kind label is still checked. There is nothing to validate the headings against, so it says so rather than guessing, but the rules that do not depend on a kind still run. That is not an edge case: 85 open issues across the fleet carry no labels at all.
lint exists because the forms are what people actually fill in. If a form stops offering a heading the checker demands, an issue filed through that form fails the check the form exists to satisfy. The two must not drift.
How I verified
Against content-rabbit issue 1134, the unlabelled issue with a parent written in prose that motivated both rules:
The parent line is the one that matters. It is found even though the issue carries no kind label, which is the case the rule was separated out for.
Against the forms merged in content-rabbit 1205:
The shipped forms and this checker agree, which is the property lint exists to hold.
Size, against the caps:
Note on how this was built
Delegated twice, failed twice, so I wrote it. Codex hit its usage limit and exited with no output and an untouched worktree. Two pi workers died at exit 144 on long generation jobs, while short scoped tasks on the same routes succeeded the same hour. Both outages are recorded in agent-routing.json via #188, and the lesson is in the routing note: judge a delegated job on its diff, never on its exit code.
Assisted-by: claude-personal-1:claude-opus-5