chore: slim evidence model per ADR 0010#60
Merged
Conversation
Drop dead types and theater fields after the evidence-model cartography
showed three cuts paying off with zero risk:
- EvidenceExcerpt: 100% write-only. Produced by tsc filter, never read.
- Evidence (typed record): zero importers in src/ or tests/.
- CommandObservation.{relatedFiles,suggestedNextActions,verificationHints}:
369/369 historical observations had all three empty.
Reshape Finding to SARIF-flavored fields (ruleId, message, location?,
evidenceRefs[]) so future Semgrep/CodeQL/biome ingest maps 1:1 without a
translator. Wire findings into renderObservationMd so Finding stops being
write-only — the tsc filter's output now surfaces in observation.md.
Pre-ADR-0010 observations remain readable: zod's z.object strips unknown
fields by default, so old JSON round-trips without error.
Verified: typecheck clean, 349 tests pass, 0 fail.
Address 6 soft issues from the post-dev code review of ADR 0010. Renderer (src/render/render-observation.ts): - Render location.column (file:line:column, tsc-native shape) — fixes the 'parsed but never consumed' theater the slim model attacks. - Restructure renderFindingLine to use a single em-dash separator between the structured prefix and the message. No more double em-dash when ruleId is absent but location present. - Drop dead '?? ""' on String.split(_, 1)[0] (always non-empty). Tests (tests/render-observation.test.ts): - Add 9 positive tests for the '## Findings' section: full finding, ruleId-absent, location-absent, minimal, multi-line message, line-without-column, file-only, multiple findings, empty findings. Docs: - docs/adr/0001-core-abstractions.md: rewrite the supporting-types sentence so it no longer inlines 'Evidence' and 'EvidenceExcerpt' as canonical (both removed by ADR 0010). - docs/plans/filter-engine/00-decisions.md L271 & L300: strikethrough obsolete 'excerpts[].lineStart/lineEnd' refs and clarify the post-0010 replacement. Verification: bun run typecheck → pass bun test → 358 pass / 0 fail (was 349, +9 new tests) bun run check → 69 files, 0 fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Postmortem-001 and the post-ADR-0007 review surfaced that Mira's evidence model was overbuilt: 7 domain types, 3 of them with zero or write-only consumers, 3 theater fields on
CommandObservation(relatedFiles,suggestedNextActions,verificationHints) that were always empty in 369/369 historical observations on disk.Findingwas a Mira-invented shape (title,description,excerpts) parallel to industry-standard SARIF 2.1, the 12-year-old OASIS interchange format already produced by clang, rustc, biome, ESLint 9, Semgrep, CodeQL, and consumed by Agent Audit and most CI quality gates in 2026.ADR 0010 (new) records the four cuts.
What changed
Domain model (slim per ADR 0010):
Evidencerecord (zero importers).EvidenceExcerpt(write-only).CommandObservation.{relatedFiles, suggestedNextActions, verificationHints}(always empty in 369/369 historical obs;z.objectstrip-mode keeps backward compat).Findingto SARIF-flavored:{ id, severity, ruleId?, message, location?, evidenceRefs[] }. 1:1 mapping documented insrc/core/finding.ts.Renderer:
Finding[]intorenderObservationMd(## Findingssection). Type is no longer write-only.file:line:column(tsc-native shape).Filter:
src/filter/filters/tsc/index.tsemits the new shape.Docs:
docs/adr/0010-slim-evidence-model.md(new).docs/adr/0001-core-abstractions.mdmarked partially superseded.docs/domain-model.mdslim revision.CLAUDE.mdcore abstractions list updated.docs/plans/filter-engine/*annotated with ADR 0010 banners; obsoleteexcerptsrefs struck through.Eval fixture:
eval/scenarios/B1/base.patchrewritten to anchor on post-slim observation schema.How to verify
Empirical backward-compat check: parsed all 369
.mira/runs/*/observation.jsonagainst the new schema → 369/369 round-trip cleanly (strip-mode handles dropped fields).Risk / rollback
CommandObservation.relatedFiles(or the two other dropped fields) breaks. Scope: none known — Mira's only consumers are CLI, MCP, and the renderer, all updated here.Finding.title/Finding.description/Finding.excerptsbreaks. Scope: filter + renderer + tests, all updated here. No externalFinding-producing tools in tree.git revert 819ee86 36ae658. ADR 0001 line 38 mention restores to inline form; ADR 0010 becomes a planning document. No data migration needed (no on-disk format change, only schema shape changed).Review notes
Post-dev review (fresh-context reviewer) ran typecheck + tests + biome + empirical 369-obs parse and returned FLAG verdict. The 6 soft issues flagged were addressed in commit
819ee86(post-review follow-up) before this PR.