Skip to content

rules: rule outcome is a skip-reason string re-classified by four predicates; one typed RuleOutcome #1661

Closed

Description

@nc9

A rule's outcome is encoded as status: "skipped" plus a skipReason string plus details.errored / details.timedOut (core-contracts/resolution.ts:183-238, rules/cloud.ts:123-133, report/skipped.ts, report/not-checked.ts:104-203). At least four predicates re-classify it: isRuleNotApplicableReason, NOT_CHECKED_SKIP_REASONS, isRuleWideGapSkipReason and the details.errored checks. They are read in merge-core.ts, merge-promise.ts, publish-meta.ts, publish-cap.ts, fail-on.ts and streaming.ts. A new reason string is silently misclassified, and a crashed rule can surface as "not checked".

Approach: RuleOutcome = ran | not_applicable | coverage_gap | timed_out | errored | disabled, and one classifyRuleOutcome(check) that every consumer calls. Keep the wire format (status, skipReason) as is, and add outcome beside it in JSON so agents stop parsing reason strings.

Acceptance Criteria

  • One classifier maps every existing skip reason to a RuleOutcome; a test fails if a reason string has no mapping
  • The four predicates are replaced by the classifier (or become one-line wrappers over it)
  • Report JSON includes outcome per rule result; existing fields unchanged
  • An errored rule and a timed-out rule are distinguishable in JSON and in --fail-on handling (test)
  • docs: report JSON reference lists the outcomes

Activity

  1. added
    P2
    size: M
    rules
    on Nov 10, 2026
  2. added theissue type on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2rulessize: M

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions