Skip to content

Static analysis for test code and CI workflows.

Tests tell you what passed. Mjölnir tells you what you can trust.

Scan your test code and CI workflows for hidden failures. Get prioritized findings with the exact location, evidence, and a suggested fix.

npx mjolnir-qa@6.1.0

Run from your repository root · Node.js 22.18+

You get a scan report. Mjölnir does not run your tests or automatically apply the suggested fixes.

See an example report

What a finding looks likeThis example flags test failures hidden by CI commands. The report shows where to look first.

Your Repo
$ npx mjolnir-qa@latest  WORTHINESS  80/100  WORTHY  ███████████████████████▓░░░░░░  Held in worthy hands — 18 findings remain.  (32 raw pts / 7 test declarations — normalized)  (capped: deduction mass 32 pts — absolute ceiling 95)  DETECTED [playwright]  ▍ FIX THIS FIRST  Why it matters: 3 error findings can let a false-green or release-blocking test issue  survive review.  Next action: fix the highest score-gain item below, then re-run the changed scope.  $ mjolnir --scope changed  +8 pts  QA-CI-009 · .github/workflows/ci.yml:10  +8 pts  QA-CI-009 · .github/workflows/ci.yml:10  +8 pts  QA-CI-009 · .github/workflows/ci.yml:26  ▍ DIAGNOSTICS BY CATEGORY  QA-CI    ███████████▓░░░░  76  QA-PW    ██████████████▓░  95  QA-TEST  ████████████████  97  ▍ WHERE POINTS WERE LOST  ╭─────────────────────────────────────────╮  │ 3 × error   − 24                        │  │ 3 × warning −  7 (evidence-discounted)  │  │ 12 × info    −  1 (evidence-discounted) │  ╰─────────────────────────────────────────╯

Original output from a saved demo scan, replayed. Read the full report.

Follow a false green.
Find where trust breaks.

See the failure, the misleading result, and the repair in one view. Select any node for the practical next step.

01 / What the workflow does

02 / What you do next

Example: the test command exits 1. Mjölnir reads the workflow; it does not run or automatically repair your tests.

The tests fail. CI still passes.

A workflow can hide a failure after the test runner has reported it. Follow one command from the failing test to the misleading green step.

Illustrative shell outcome: npm test exits 1; the fallback true exits 0. The step returns the final success.

Read the rule and its evidence
EXAMPLE / NEXT COMMANDnpm test || true

1 / 5 · Autoplay pauses while you read or focus this guide

One change. Two saved scans.

A minimal workflow scanned with Mjölnir 5.0.0. The ignored-exit finding disappears after removing the fallback.

BEFOREnpm test || true1 finding · QA-CI-002Read the original scan ↗
AFTERnpm test0 findings in this scanRead the follow-up scan ↗

These are static scan results. Run the affected tests separately: this comparison does not establish that the tests pass.

Works with your stack

Languages

Test frameworks

CI

What a scan covers

  1. 01CI integrity
  2. 02Findings
  3. 03Worthiness score
  4. 04Evidence and trust
  5. 05Runtime forensics
  6. 06Measured rules
  7. 07CI and AI agents

01CI integrity

Read the workflow. Locate the finding.

Follow the scan through a real workflow. Each highlighted line connects the command to its finding, rule, and evidence.

3errors
2notes
33of 33 lines read
  • ERRORQA-CI-009 Job `test` pipes the test command into another tool without `set -o pipefail`.
  • ERRORQA-CI-009 Job `deploy-smoke` sequences commands with `; ` after the test command — the test result does not fail the step.
  • INFOQA-CI-010 Job `deploy-smoke` runs tests but its `if:` condition skips it on pull requests.
  • ERRORQA-CI-009 Job `deploy-smoke` pipes the test command into another tool without `set -o pipefail`.
  • INFOQA-CI-001 Job `security-scan` runs a verification gate under `continue-on-error: true`.
Read the CI guide
.github/workflows/ci.yml5 findings
1name: CI
2
3on: [push, pull_request]
4
5jobs:
6 test:
7 runs-on: ubuntu-latest
8 steps:
9 - uses: actions/checkout@v4
10 - run: npm test | tee test-results.log

QA-CI-009 Job `test` pipes the test command into another tool without `set -o pipefail`. E2 · deterministic · measured FP 0% · n=10

QA-CI-009 Job `deploy-smoke` sequences commands with `; ` after the test command — the test result does not fail the step. E2 · deterministic · measured FP 0% · n=10

11 - run: yarn test --coverage | tee coverage.log
12
13 lint:
14 runs-on: ubuntu-latest
15 steps:
16 - uses: actions/checkout@v4
17 - run: npm run lint; npm run typecheck
18
19 deploy-smoke:
20 runs-on: ubuntu-latest
21 if: github.event_name == 'push'

QA-CI-010 Job `deploy-smoke` runs tests but its `if:` condition skips it on pull requests. E0 · observation · measured FP 10% · n=10

22 steps:
23 - uses: actions/checkout@v4
24 - run: npm test; npm run smoke
25 - run: vitest run --coverage | tee vitest-results.log
26 - run: pnpm test | tee pnpm-results.log

QA-CI-009 Job `deploy-smoke` pipes the test command into another tool without `set -o pipefail`. E2 · deterministic · measured FP 0% · n=10

27

QA-CI-001 Job `security-scan` runs a verification gate under `continue-on-error: true`. E0 · observation · measured FP 11% · n=19

28 security-scan:
29 continue-on-error: true
30 runs-on: ubuntu-latest
31 steps:
32 - uses: actions/checkout@v4
33 - run: npm audit --audit-level=high
Explore four more patterns that can hide failures

Above: every finding the demo repo scan reported for .github/workflows/ci.yml, at the line it reported. With SARIF upload or mjolnir --format github-summary, this is how the findings appear on the pull request.

02Findings

Every finding says where, how sure, and how to fix it.

This is the first finding from the demo repo scan, exactly as the terminal prints it. Each part of it answers one question.

See what it checks
  ✗ ERROR   QA-CI-009 · .github/workflows/ci.yml:10    [E2 · deterministic · measured FP 0% · n=10]    Finding Job `test` pipes the test command into another tool without `set -o pipefail`.    Fix     Add `shell: bash` with `set -o pipefail`, or split into two steps so the test            command's exit code is preserved.

03Worthiness score

Understand what your score means.

See which findings need attention. The score describes your test suite; it does not certify your product.

Read how the score works
Four verdicts. What each one means.A guide to the scoring bands · not a live repository score
ScoreVerdict & next step
0–49
UNWORTHY Score guide

Start with the highest-impact findings.

50–79
NEEDS WORK

Review the findings and address the largest deductions.

80–99
WORTHY

A strong score. Findings still need review.

100
FORGED

Exactly 100. A clean scan does not prove the tests pass.

04Evidence and trust

Knows the difference between reading code and seeing it run.

Most findings come from reading your code. Give Mjölnir the report of a real test run and it can confirm the code actually ran.

Read the definitions
Read from the code
  ✗ ERROR   QA-CI-009 · .github/workflows/ci.yml:10    [E2 · deterministic · measured FP 0% · n=10]    Finding Job `test` pipes the test command into another tool without `set -o pipefail`.    Fix     Add `shell: bash` with `set -o pipefail`, or split into two steps so the test            command's exit code is preserved.

Mjölnir read the workflow file. Nothing ran, so this finding stays at L2, proven in code.

Seen in a real run
  ℹ INFO    QA-PW-146 · e2e/checkout.spec.ts:5    [E0 · observation · measured FP 12% · n=17 · trust L3 · runtime: file executed]    Finding CSS/XPath string selector where a normalized locator is expected.    Fix     Normalize to Playwright's user-facing getters: getByRole('button', { name: '…'            }), getByLabel('…'), getByTestId('…'), or getByText('…') — they survive markup            refactors and match what a user actually perceives.

The Playwright report shows this spec file ran, so the finding reaches L3.

Read from code

Static evidence · L0–L2

  1. L0

    Noted

    Worth knowing. Not a claim that anything is wrong.

  2. L1

    Looks like it

    A pattern that usually means the problem was matched.

  3. L2

    Proven in code

    The code as written has the problem.

Observed in a run

Runtime evidence · L3–L5

  1. L3

    The file ran

    A real run executed the file the finding is in.

  2. L4

    The test ran

    A real run executed the test the finding is in.

  3. L5

    The run agrees

    The run's own result confirms the problem.

L3 is the boundary: a real run is required from here.

05Runtime forensics

Reads what actually ran.

Point it at a folder of test results. Playwright JSON, Jest and Vitest JSON, and JUnit XML from any runner all work.

Read the forensics guide
mjolnir explain --evidence ./test-results/
  ▍ FLAKINESS LEADERBOARD3 tests · 1 failed · 1 flaky · 1 retriedTRUE-FLAKE completes checkout with saved card (e2e/checkout.spec.ts)           ████████████████████ 6.0s · 2 attemptsFAILING    declines an expired card (e2e/checkout.spec.ts)           ████░░░░░░░░░░░░░░░░ 1.1s · 1 attempt

TRUE-FLAKE means the test failed at least once and then passed. Mjölnir flags it even though the final check was green.

06Measured rules

A published false-positive rate for each rule.

Each rate comes from at least 10 hand-classified findings in open-source repos. Rules with bad rates stay listed, in quarantine.

See all 79 rules

73of79

rules measured on real code

RuleCatchesFalse positivesSample
Extended
QA-PW-002Unawaited Playwright assertion0%n=20
QA-PY-001Focused test committed0%n=12
QA-CS-103Test without assertions0%n=11
QA-JV-103Test without assertions26%n=58
Quarantine
QA-TEST-001Focused test committed60%n=20

07CI and AI agents

Gates the pull request, and checks the agent.

Scan only what a branch touched, or hand the findings to an AI agent and let the re-scan prove the fix.

Connect an agent

In CI

With --scope changed it scans the files the branch touched and exits non-zero on new findings.

npx mjolnir-qa@6.1.0 --scope changed

Or add the GitHub Action:

- uses: Sergey-Bar/Mjolnir@v6
  with:
    version: 6.1.0
    scope: changed
    fail-on: error

With an AI agent

The agent writes the fix and Mjölnir re-scans to prove it. Each finding in the handoff says whether it is safe to apply or needs a person to confirm.

claude mcp add mjolnir -- npx -y mjolnir-qa@6.1.0 mcp
0
Clean at the gate
1
Findings at or above the gate
2
Partial scan. Inconclusive; investigate and rerun.
10
Usage error
20
Internal error

Exit codes are frozen, so you can build CI logic on them.

Where the score stops

  • It does not run your tests. A clean scan is not a passing suite.
  • It cannot tell when an assertion checks the wrong value. expect(total).toBe(41) looks healthy to it.
  • A perfect score means zero findings. Whether the suite covers your real risk is a separate question.
  • An empty repo scores null. With no tests to read, it has nothing to score.

Run it on your repo.

npx mjolnir-qa@6.1.0