mjolnir-qa 1.0.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,200 @@ Rule behavior changes (new rules, FP-rate changes against the corpus,
9
9
  severity changes) are first-class entries here — rule IDs are immutable
10
10
  once shipped, so this file is the record of what changed between versions.
11
11
 
12
+ ## [2.0.0] — 2026-09-17
13
+
14
+ ### Fixed
15
+
16
+ - **NPM publishing pipeline** — fixed npm upgrade syntax (`npm@11.19.1` instead of invalid `npm@11.9.1`), removed Windows local path leak from runtime docs that triggered pack-audit, enabling OIDC trusted publishing for NPM release.
17
+
18
+ ### Changed
19
+
20
+ - **Version bump** — bumped package version from 1.1.1 to 2.0.0 across all surfaces (package.json, ENGINE_VERSION, smithery.yaml, rule metadata, docs).
21
+
22
+ ## [Unreleased]
23
+
24
+ ## [1.1.1] — 2026-09-16
25
+
26
+ ### Fixed
27
+
28
+ - **Config type for exactOptionalPropertyTypes in test** — wire standalone modules into scan pipeline integration test fixture uses `{}` instead of `undefined` for the config field, fixing type compatibility with strict TypeScript settings.
29
+
30
+ ## [1.1.0] — 2026-09-15
31
+
32
+ ### Year-1 Roadmap Implementation — All 60 Tickets (Q1-Q4)
33
+
34
+ Complete implementation of the Mjolnir Master Engineering Roadmap & Product Specification v3.1. 178 files changed, ~22,500 lines added across 93 new source and test files.
35
+
36
+ ### Added
37
+
38
+ #### Q1 — Trust Core Correctness
39
+
40
+ - **Trust Invariant Registry** (`src/trust/invariants.ts`): Machine-readable registry of TI-001 through TI-020 with scope, status, quarter, and verification test references. CI enforcement gate for REQUIRED invariants.
41
+ - **Versioned Contract Registry** (`src/engine/contract-versions.ts`): 8 versioned contracts (engine, schema, contract, trustModel, scoringModel, evidenceSchema, forensicsSchema, frameworkSupportMatrix) with compatibility policies.
42
+ - **Expanded Semantic Run Identity** (`src/engine/run-identity.ts`): 7 new verdict-affecting fields (trustModelVersion, scoringModelVersion, frameworkSupportMatrixVersion, evidenceSchemaVersions, policyFingerprint, suppressionFingerprint, historicalEvidenceFingerprint). TI-015 and TI-017 enforced.
43
+ - **Scoring Validation** (`src/scorer/scoring-validation.ts`): Stage A validation against trust benchmark dataset. Score discrimination, severity preservation, E0 exclusion checks.
44
+ - **Finding Identity** (`src/engine/finding-identity.ts`): Unified fingerprint with `findingId`, `rootCauseId`, `deduplicationGroup`. Consolidated 4 scattered fingerprint implementations.
45
+ - **Evidence Level Enforcement** (`src/engine/evidence-enforcement.ts`): `deriveEvidenceLevel()` as sole authority. E0 gaming prevention. `detectEvidenceLevelGaming()` for manual override detection.
46
+ - **Config Validation** (`src/config/config-schema.ts`): JSON Schema draft-07 for `mjolnir.config.json`. Structural validation before semantic validation.
47
+ - **Rule Metadata Validation** (`src/rules/rule-metadata-schema.ts`): `RuleMetadataContract` interface. All 79 rules validated against contract. Doctor check 11 added.
48
+ - **Error Text Extraction**: All 5 parsers (Jest, JUnit, Playwright JSON, Vitest, Playwright Trace) now extract error text into `TestRecord.errors[]`.
49
+ - **Evidence Hygiene** (`src/forensics/evidence-hgiene.ts`): Secret redaction (AWS, GitHub, JWT, Bearer, API keys, passwords, private keys), control-character sanitization, bounded text ingestion (10KB cap).
50
+ - **Forensics Schema Versioning** (`src/forensics/schema-validation.ts`): `FORENSICS_SCHEMA_VERSION = 1` stamped on all reports.
51
+ - **Framework Support Inventory** (`src/frameworks/framework-inventory.ts`): 14 frameworks with F0-F5 maturity, support status, entity type, capabilities.
52
+ - **Framework Scorecards** (`src/frameworks/scorecard.ts`): 27 dimensions × 14 frameworks. Every MISSING/WEAK cell maps to a GAP-* ID.
53
+ - **Gap Registry** (`src/gaps/gap-registry.ts`): ~100 gaps registered with type, priority, status, cross-referenced against scorecards.
54
+ - **Requirement Traceability Matrix** (`src/traceability/rtm.ts`): 35 requirements (R-001 through R-035) with CI validation invariants.
55
+ - **Suppression Integrity** (`src/engine/suppression-integrity.ts`): Fingerprint (order-independent sha256), mass-suppression detection (50% threshold), unknown-rule detection, expired-suppression detection.
56
+ - **Performance Baselines** (`src/bench/regression-gates.ts`): 4 benchmark classes (small/medium/large/monorepo), 8 GOVERNANCE_POLICY regression gates, `peakMemory` tracking.
57
+ - **Trust Benchmark Schema** (`src/benchmark/trust-benchmark-schema.ts`): Dataset schema with 11 verification dimensions, blind evaluation protocol.
58
+ - **Measurement Status** (`src/rules/measurement-status.ts`): All 79 rules classified as MEASURED, PROVISIONAL, QUARANTINE, CORE, or EXTENDED.
59
+ - **Release Artifact Integrity** (`src/release/pack-audit.ts`, `src/release/version-consistency.ts`): Tarball hash verification, provenance attestation, version consistency checks.
60
+ - **Shared Adapter RunRules** (`src/engine/shared-run-rules.ts`): Formalized rule execution contract shared across all 7 adapters.
61
+ - **Workspace Discovery** (`src/discovery/ecosystem-detection.ts`): Multi-ecosystem detection (Node, Python, Java, .NET). Workspace structure detection for npm, lerna, nx, turbo, maven, gradle, .sln.
62
+ - **Pipeline Decomposition** (`src/engine/pipeline-stages.ts`): 6 explicit stages (Discovery → Parse → Rules → Correlation → PostProcess → Score) with typed interfaces and diagnostics.
63
+
64
+ #### Q2 — Framework & Semantic Intelligence
65
+
66
+ - **QA Semantic Model API** (`src/engine/semantic-model-api.ts`): 14 concepts (test, suite, assertion, action, navigation, wait, retry, locator, lifecycle, fixture, mock, parameterization, shared-state, async).
67
+ - **Assertion Quality** (`src/rules/families/assertion-quality.ts`): Anti-patterns: tautological, type-only, mock-return, truthy-only, length-only.
68
+ - **Test Independence** (`src/rules/families/test-independence.ts`): Anti-patterns: shared-mutable-state, order-dependency, fixture-leak, global-mutation, fs-side-effect.
69
+ - **Flaky-Pattern Detection** (`src/rules/families/flaky-patterns.ts`): 4 families: UNAWAITED_ASYNC, NONDETERMINISTIC_INPUT, UNMOCKED_EXTERNAL_DEPENDENCY, HARD_SLEEP.
70
+ - **Cross-Rule Evidence Correlation** (`src/engine/correlation-engine.ts`): CONVERGENT, CORROBORATED, AMPLIFIED conclusions. TI-009 enforced (E1+E1+E1 ≠ E2). Deterministic Map iteration.
71
+ - **Mutation Resilience** (`src/mutation/mutation-resilience.ts`): Corrected kill rate formula: `killed / (killed + survived)`.
72
+ - **Cross-Language No-Assertions** (`src/rules/families/no-assertions.ts`): Assertion vocabularies for Jest, Vitest, pytest, JUnit, NUnit, xUnit, TestNG.
73
+ - **Marker Registry** (`src/rules/families/marker-registry.ts`): Extensible registry with 9 frameworks × 6 semantics (skip, focus, retry, parameterize, fixture, category).
74
+ - **MCP Forensics Tools** (`src/mcp/tools/forensics-tools.ts`): Tool definitions for forensics-analyze, forensics-triage, error-text-extract.
75
+ - **Anti-Gaming Corpus** (`src/anti-gaming/corpus.ts`): 7 scenarios (AG-001 through AG-007) covering meaningless assertions, superficial coverage, finding splitting, rule suppression, test renaming, empty mocks, CI manipulation.
76
+ - **Framework Compatibility CI** (`src/frameworks/compat-ci.ts`): MINIMUM_SUPPORTED, REPRESENTATIVE_STABLE, LATEST_VALIDATED lanes for Playwright, Jest, pytest.
77
+ - **PR Comment Data Contract** (`src/integrations/github/pr-comment-contract.ts`): `PrCommentModelV1` with verdict-completeness state matrix enforcement.
78
+ - **Deterministic Markdown Renderer** (`src/integrations/github/pr-comment-renderer.ts`): TI-018 enforced (same model → byte-identical output). Information architecture: Answer → Evidence → Action.
79
+ - **Finding Prioritization** (`src/integrations/github/finding-prioritization.ts`): Sort by trust impact → false-green → severity → evidence strength. 3-5 expanded, rest collapsed.
80
+ - **Branding Contract** (`src/brand/pr-brand-contract.ts`): Product name, descriptor, verdict labels/icons, section order, terminology.
81
+ - **Completeness & Framework-Limitation UX** (`src/integrations/github/completeness-ux.ts`): Partial analysis warnings, framework limitation display.
82
+ - **Evidence Sanitization** (`src/integrations/github/evidence-sanitization.ts`): Markdown escaping, HTML injection prevention, link sanitization, RTL handling, text capping.
83
+
84
+ #### Q3 — Runtime & CI Evidence
85
+
86
+ - **Evidence Artifact Architecture** (`src/engine/evidence-artifacts.ts`): Versioned artifact schema with provider, fingerprint, completeness, provenance.
87
+ - **Runtime-Static Correlation** (`src/engine/runtime-static-correlation.ts`): Identity matching (EXACT/STRONG/APPROXIMATE/AMBIGUOUS), trust-level mapping. TI-016 enforced.
88
+ - **Flaky-Test Integration** (`src/forensics/flaky-integration.ts`): FlakinessLevel (NONE/SUSPECTED/CONFIRMED), retry evidence extraction.
89
+ - **Coverage Ingestion** (`src/engine/coverage-ingestion.ts`): Istanbul JSON and LCOV parsing. Contextual only — no automatic trust upgrade.
90
+ - **GitLab CI Adapter** (`src/adapters/gitlab-ci.ts`): Discovery, parsing, 3 CI verification risk rules (allow_failure, empty test stage, exit code suppression).
91
+ - **Retry/Quarantine Analysis** (`src/forensics/retry-analysis.ts`): Retry-only-pass detection, quarantine pattern analysis.
92
+ - **Workflow Bypass Detection** (`src/adapters/workflow-bypass.ts`): Path filter bypasses, conditional test execution, missing status checks.
93
+ - **Exit-Code Integrity** (`src/adapters/exit-code-integrity.ts`): `|| true`, `2>/dev/null`, continue-on-error, allow_failure detection.
94
+ - **Safe Output** (`src/forensics/safe-output.ts`): URL sanitization (javascript: prevention), path traversal detection, safe Markdown link construction.
95
+ - **Sticky Comment Publisher** (`src/integrations/github/pr-comment-publisher.ts`): `<!-- mjolnir-pr-comment:v1 -->` marker. Idempotent update, no duplicates.
96
+ - **GitHub Permissions** (`src/integrations/github/github-permissions.ts`): Permission validation, fork PR detection. Zero-network boundary preserved (fetchFn injected).
97
+ - **Job Summary Fallback** (`src/integrations/github/job-summary-fallback.ts`): GitHub Actions job summary when PR comment fails.
98
+ - **PR Comment Golden Suite** (`tests/integrations/github/pr-comment-golden.spec.ts`): Snapshot tests for all verdict+completeness combos.
99
+ - **Stale Guard** (`src/integrations/github/stale-guard.ts`): TI-020 enforced — stale artifacts cannot overwrite newer PR head.
100
+
101
+ #### Q4 — Scale & Production Hardening
102
+
103
+ - **Monorepo Analysis** (`src/engine/monorepo-analysis.ts`): Per-package trust with worst-package, average, configurable weighting strategies.
104
+ - **Incremental Analysis** (`src/engine/incremental-analysis.ts`): Content-hash change detection. TI-005 contract (incremental/full equivalence).
105
+ - **SARIF Compliance** (`src/reporter/sarif-compliance.ts`): v2.1.0 validation, finding/rule mapping.
106
+ - **Dependency Graph** (`src/engine/dependency-graph.ts`): Transitive dependency resolution for package.json, pyproject.toml, pom.xml.
107
+ - **Memory Profiling** (`src/bench/memory-profiling.ts`): Async memory measurement with advisory regression checks.
108
+ - **Package Provenance** (`src/release/provenance.ts`): npm provenance attestation verification.
109
+ - **SBOM Generation** (`src/release/sbom.ts`): SPDX and CycloneDX format support.
110
+ - **Reproducibility** (`src/release/reproducibility.ts`): Build reproducibility analysis (timestamps, random IDs, unpinned deps).
111
+ - **Conditional Stubs**: Rule SDK, Adapter SDK, Policy Packs (gated on adoption metrics).
112
+ - **Research Stubs**: CFG Research, Parallel Rules (gated on prerequisites).
113
+
114
+ ### Fixed
115
+
116
+ - **Greetings Workflow**: Updated `actions/first-interaction` to v1.3.1 with correct input names (`repo_token`, `issue_message`, `pr_message`).
117
+ - **ReDoS**: Bounded quantifiers in `evidence-sanitization.ts` and `test-independence.ts` regex patterns.
118
+ - **XSS**: Sanitized content in `pr-comment-publisher.ts` before rendering.
119
+ - **Determinism**: Sorted Map iteration in `correlation-engine.ts` for consistent output order.
120
+ - **Zero-Network Boundary**: `github-permissions.ts` uses injected `fetchFn` instead of global `fetch`.
121
+ - **Config Validation Error Messages**: Schema-first validation produces consistent error messages. Updated 5 test files to match.
122
+
123
+ ### Security
124
+
125
+ - Secret redaction in all error text extraction (AWS keys, GitHub tokens, JWT, Bearer, API keys, passwords, private keys).
126
+ - Control-character sanitization (NUL, BEL, BS, VT, FF, SO, SI, ESC, DEL, C1).
127
+ - Bounded text ingestion (10KB per error text).
128
+ - Evidence sanitization for PR comments (Markdown escaping, HTML injection prevention).
129
+ - Fork PR safety for comment publishing.
130
+ - Stale artifact concurrency guard (TI-020).
131
+
132
+ ### Changed
133
+
134
+ - `Finding` type extended with optional `findingId`, `rootCauseId`, `deduplicationGroup` fields (additive within schemaVersion 1).
135
+ - `ScanResult` extended with optional `scoringModelVersion` field.
136
+ - `RunIdentity` extended with `trustModelVersion`, `scoringModelVersion`, `frameworkSupportMatrixVersion`.
137
+ - `ForensicsReport` includes `forensicsSchemaVersion` field.
138
+ - `src/config/config.ts` `validate()` now calls `validateConfigSchema()` first.
139
+ - `src/commands/doctor.ts` gains check 11 (rule metadata contract validation).
140
+ - 4 fingerprint implementations consolidated into `src/engine/finding-identity.ts`.
141
+
142
+ ## [Unreleased] — Nordic brand pass
143
+
144
+ ### Changed
145
+
146
+ - Terminal report: section headers are marked `▍ TITLE` instead of
147
+ `▚ TITLE` (the ASCII fallback `= TITLE` is unchanged). The quadrant
148
+ glyph read as a rendering glitch rather than a mark.
149
+ - Terminal report: the score section no longer draws the four-state
150
+ block-art hammer above `WORTHINESS`. The verdict word already carries
151
+ the band without colour, the score is now the first thing on screen,
152
+ and the 100-state FORGED block is unchanged.
153
+ - Brand: one type family. Cinzel is retired from the site, the tokens
154
+ and the vendored fonts; headings and the wordmark are Geist. The marks
155
+ are redrawn: a Geist wordmark, and the ᛗ monogram drawn as a path and
156
+ stroked in the aurora. Docs pages take the aurora accent instead of
157
+ gold, which stays reserved for FORGED. README badges use the deep
158
+ aurora that carries shields.io's white text at 5.8:1.
159
+ - README rewritten. `score-gauge.svg` is now the worthiness scale with a
160
+ marker sweeping 0–100, drawn from `deriveScoreState`. The terminal
161
+ stills and the demo video share the website's terminal chrome. The
162
+ video is re-rendered (34 s), and its poster shows the report.
163
+
164
+ ### Fixed
165
+
166
+ - Website: missing URLs showed VitePress's stock 404 page. The site's
167
+ own page, which points to the rule catalog, was registered under a
168
+ theme key the default layout never reads. It now renders through the
169
+ layout's `not-found` slot.
170
+
171
+ ## [1.0.10] — 2026-09-12
172
+
173
+ ### Changes since 1.0.9
174
+
175
+ - Merge remediation/remote-first: complete R1-R10 trust-engineering train onto main
176
+ - Merge origin/main into remediation/remote-first
177
+ - chore: add testTimeout: 30_000 to vitest.config.ts
178
+ - chore: sync smithery.yaml in the release cut step (the registry must match the package)
179
+ - test: keep CI fixture scripts off the docs-consistency scanner (old `e2e` script -> `npx playwright test`)
180
+ - test: arms-coverage wave for the R1-R10 train (CI gates, adapters, parser, trace, release-trust, trust surfaces)
181
+ - docs: resync DEPTH-ADJUDICATION.md to the train's measured state (drift-lock)
182
+ - chore: re-baseline coverage ratchet after the R1-R10 train landing
183
+ - chore: exclude machine-local agent dirs via .mjolnirignore (self-scan honesty)
184
+ - chore: untrack machine-local skill symlinks (leaked in R3 1044461)
185
+ - Master-plan M0 docs truth (M0.2/M0.4/M0.5)
186
+ - chore: gitignore machine-local agent tool dirs (same class as .kilo/)
187
+ - Review hardening: MCP param cap measured in true bytes; pin the WI-18 unsupported-source asymmetry
188
+ - Wire provenance=bound invariant (plan 5.2 activation): scope-integrity + artifact-integrity prove the identity chain
189
+ - Fix: MCP stdio stream pollution (CLI entry tail in bundle), stale-dist e2e guard, freshness drift classes
190
+ - R10: 2.0 preparation — breaking-set inventory, migration draft, boundary-law guards (WI-25, 2.0.0)
191
+ - R9: Trust Artifact identity binding + HTML completion (WI-23+24, 1.4.0)
192
+ - R8: MCP runtime-evidence tools + Agent Safety (WI-21+22, 1.3.0)
193
+ - R7: Playwright capability matrix as a product surface (WI-20, 1.2.x)
194
+ - R6: forensic verdict taxonomy + Selector Health v2 (WI-18+19, 1.2.x)
195
+ - R5: Playwright trace ingester + false-green trace corpus (WI-17, 1.2.x)
196
+ - CI hardening: test-tsconfig conformance + unclassified-ceiling re-record
197
+ - R4c follow-up: wire the scope-integrity dimension into release-trust
198
+ - R4c: Evidence Graph + Scope Integrity + exit-code proofs (1.1.6)
199
+ - R4b: False-Green Attack Corpus + mutation/assertion-strength protocol (1.1.5)
200
+ - R4a: Trust Constitution + Release Trust Verdict (1.1.4)
201
+ - R4: blast-radius audit + machine-testable boundary contract (1.1.3)
202
+ - P6: quarantine remediation ledger + rework-or-retire the >=75 percent set (R3, 1.1.2)
203
+ - P3c: Jenkinsfile detection + rule arms + QA-CI-014 (R2, 1.1.1)
204
+ - P3b: Azure DevOps detection + rule extensions + QA-CI-013 (R1, 1.1.0)
205
+
12
206
  ## [1.0.9] — 2026-09-12
13
207
 
14
208
  ### Changes since 1