Skip to content

docs: require a scenario for every detection rule - #148

Merged
sepehr-safari merged 1 commit into
mainfrom
docs/rule-scenario-invariant
Jul 30, 2026
Merged

docs: require a scenario for every detection rule#148
sepehr-safari merged 1 commit into
mainfrom
docs/rule-scenario-invariant

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

Closes #140.

Three of the 16 detection rules shipped with no scenario exercising them:
TIMEOUT_NO_HEARTBEAT, FIRMWARE_UPDATE_FAILURE and
REPEATED_BOOT_NOTIFICATION. A rule with no scenario has no regression guard, so
nothing in the corpus catches it breaking.

REPEATED_BOOT_NOTIFICATION is the worked example: it landed in #114 and no
scenario followed, because the "How to Add a Detection Rule" checklist never asked
for one. The final step audits existing scenarios for false positives, which is
the negative half of coverage. The positive half, a scenario whose
expectedFailures contains the new code, was never requested.

Changes

  • States the invariant at the top of "Contributing Detection Rules".
  • Adds it as step 7 of the checklist, paired with the step 6 false-positive audit.
    Step 6 confirms a rule stays quiet where it should; step 7 confirms it fires
    where it should.

The three uncovered rules are being filled by #137, #138 and #139. This is the
process change that stops a fourth appearing.

Verification

pnpm format:check and pnpm lint pass. Documentation only; no changeset, since
CONTRIBUTING.md is not in the package files list.

Three of the 16 detection rules shipped without a scenario exercising them:
TIMEOUT_NO_HEARTBEAT, FIRMWARE_UPDATE_FAILURE and REPEATED_BOOT_NOTIFICATION.
REPEATED_BOOT_NOTIFICATION shows how the gap opens: it landed in #114 and no
scenario followed, because nothing in the guide asked for one.

States the invariant at the top of "Contributing Detection Rules" and adds it as
step 7 of "How to Add a Detection Rule", next to the existing false-positive
audit, so both directions of coverage are requested in the same place. Step 6
confirms a rule stays quiet where it should; step 7 confirms it fires where it
should.

Closes #140
@sepehr-safari sepehr-safari added type:docs Documentation improvements package:repo Repository-level changes labels Jul 30, 2026
@sepehr-safari
sepehr-safari merged commit ab968f0 into main Jul 30, 2026
2 checks passed
@sepehr-safari
sepehr-safari deleted the docs/rule-scenario-invariant branch July 30, 2026 07:05
sepehr-safari added a commit that referenced this pull request Jul 30, 2026
Keeps the living document current after the 0.4.4 release and today's pipeline
work, which reached main through the changesets release PR and issue-only
activity, neither of which touches this file.

Records 0.4.4 (firmware-update-failure, Issue #138, PR #147) and moves the
package status table to 0.4.4.

Updates the external contribution pipeline: the third good-first-issue completing
(#138, the same contributor's second, shipped in 0.4.4), the #140 invariant
landing in PR #148, the third external contributor arriving and taking #137, and
the patch-not-minor convention holding on its own for 0.4.4. Adds current rule
coverage: two of sixteen rules still lack a scenario, and the corpus arithmetic to
the v1.0 target now reads 17 plus #108, #137 and #139.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:repo Repository-level changes type:docs Documentation improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: require a scenario for every detection rule

1 participant