Repository navigation
feat(verify): report one status field per rule - #629
Conversation
|
@claude /review |
|
Claude finished @theCodeDrift's task in 2m 37s —— View job Review completeReview mode: incremental — read 0 prior review thread(s) before reviewing.
AssessmentThis is a clean, well-scoped PR. I read Correctness
Schema
Docs/recipes
Tests
No correctness, security, or performance issues found, and no concrete inline comments to post. |
Read; the review raised no findings, so there is nothing to change. — AI Coding Agent |
…refused Each verify --json rule result now carries status (passed, failed, not-run, refused), built by one constructor that derives ok, ran and refused from it. commands/verify.ts and report/draft.ts read status instead of combining the old fields. Additive for existing --json consumers; validate reports no status.
9a2802b to
9840916
Compare
What changed
A rule's
verifyresult had four outcomes (passed, failed after its tests ran, failed before they ran, refused by the execution policy) spread across three fields:ok,ranandrefused. Each consumer combined them with its own precedence, andcommands/verify.tsdid not checkranat all. A consumer readingokalone could report a rule that never ran as passing.This adds one discriminator, computed once by the producer:
status: "passed" | "failed" | "not-run" | "refused"on everyRuleVerificationand in theverify --jsonschema (schemas/rule-check.ts), described as the field to branch on.verification()inrules/inspect.ts, builds everyRuleVerification. It derivesok,ranandrefusedfromstatus, sook: truewithran: false(orok: truewithrefused) has no spelling any more.status:commands/verify.ts(marks, summary counts, exit code) andreport/draft.ts(the report's test status) no longer referenceranorrefused. Behavior is unchanged:not-runstill counts as a failure (exit 1, ✗, reportfail), andrefusedstays its own outcome (○, exit 2, reportrefused).ok,ranandrefusedare still emitted for existing--jsonconsumers; their schema descriptions now say they are derived fromstatus.validateruns no tests and does not emitstatus; the schema says so.validate-rule(topic v10),create-sg-rule(v13) andcreate-vale-rule(v20) namestatus.verify-status-fieldadds the requirement "Verify reports one outcome per rule" tocli-rule-validation(ADDED, so no existing scenario is touched) and is archived in this PR. Single-PR delivery shape.patchfor@taskless/cli(0.y.z, additive field).How it was tested
test/verify-status.test.ts: for all four outcomes,ok/ran/refusedagree withstatus,refusedis absent unless refused, andstatussurvives the--jsonoutput schema.statusispassedandfailedfor sg rules,not-runfor an sg rulevalidaterejects (exit 1) and for a Vale rule stopped at validate,refusedfor a runtime rule without--dangerously-run-scripts,failedfor a runtime rule whose fail case did not fire, and absent fromvalidate --json.pnpm typecheck,pnpm lintandpnpm --filter @taskless/cli test(154 files, 2976 tests) pass. The archived spec keeps all 61 prior scenarios and adds 5.Fixes #627