T-VK8L-pr-classify-port
Status: closed/done · Impact: medium · Complexity: medium
classify_pr.ts is a deterministic verdict capability — a fixed enum
(CLEAN/NEEDS-RESPONSE/CONFLICTS/CI-FAILED/MERGED/CLOSED/ERROR) over gh
payloads with a --mock-state test seam — living in a skill directory.
By the S-0001 nature test it is born in lib. Promote it to
services/pr/ops/classify.ts; the per-PR cursor is the op’s own dedupe
ledger and travels with it.
| Location | Role today |
|---|---|
plugin/skills/pr-check/classify_pr.ts | verdict classifier + cursor read/write under .sdlc/pr-cursors/ |
plugin/skills/pr-check/tests/classify_pr.test.ts | imports ../classify_pr.ts by relative path (breaks on move) |
plugin/skills/pr-check/SKILL.md | invokes the script; orchestrate dispatches on the verdict |
Proposed
Section titled “Proposed”services/pr/ops/classify.ts (hidden pr noun); cursor path and
semantics unchanged; --mock-state fixture seam preserved; tests spawn
cli/sdlc.ts pr classify per the CLI-spawn mandate so the golden
survives the move.
Approach
Section titled “Approach”- Golden-snapshot verdicts + cursor side effects across the mock-state fixtures (each verdict class, plus the second-call no-new-comments case).
- Port the classifier core;
ghviactx.gh; cursor I/O unchanged. - Rewrite the test suite to spawn the CLI with
--mock-statefixtures. - Verify orchestrate’s verdict-line contract byte-matches.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/lib/services/pr/ops/classify.ts | new | the op (classifier + cursor) |
plugin/skills/pr-check/classify_pr.ts | modify | thins to forwarder until deletion |
plugin/skills/pr-check/tests/classify_pr.test.ts | modify | spawn cli/sdlc.ts pr classify |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: verdict golden parity across all mock-state fixtures via
sdlc pr classify --mock-state <fixture>. - AC-2: cursor semantics identical — second call on the same state reports no new comments; cursor file location unchanged.
- AC-3:
prnoun hidden from default--help, dispatches when addressed. - AC-4: pr-check skill behavior unchanged pre-codemod; full
bun testgreen.
Out of scope
Section titled “Out of scope”- pr-check / orchestrate prose (T-QL5F-skill-prose-codemod).
- Verdict enum or classification heuristics changes.
- Future
pr respond/pr close-outverbs (the hidden noun leaves room).
Dependencies
Section titled “Dependencies”Discovery context
Section titled “Discovery context”- Flagged borderline in planning; promoted by the S-0001 nature test during the adversarial redesign (the —mock-state seam shows it was already built to run off-process).