Expand description
§mollify-types
The shared, versioned data contract for Mollify. Every command emits a
JSON envelope with a discriminating top-level kind; downstream agents and
CI depend on this JSON shape, not on Mollify’s internal Rust types.
Invariants (ported from fallow’s design — see RESEARCH.md §2.11):
- Determinism: identical input → byte-identical output. All collections that reach output are sorted deterministically before serialization.
- Evidence, not decisions: every
Findingcarries a stableFinding::fingerprint, aConfidencetier, and a humanreason. - Candidate/verifier separation:
Actions are proposed; onlyauto_fixable+Confidence::Certainmay be applied without a human.
Structs§
- Action
- A proposed, machine-actionable remediation for a finding. The agent decides
whether to apply it; Mollify never auto-applies non-
Certainfindings. - Audit
Report - The full audit envelope: a quality score plus the findings.
- File
Metrics - Maintainability and size metrics for one file.
- Finding
- A single piece of deterministic evidence. The atom of every report.
- Findings
Report - A report that is just a sorted list of findings plus a summary.
- Location
- A source location, 1-based line/column, workspace-relative path.
- Metrics
Report - Per-file code metrics (radon/wily-style), plus project totals.
- Metrics
Totals - Project-wide metric totals.
- Summary
- Aggregate counts, always present so CI can gate without scanning findings.
Enums§
- Attribution
- Whether a finding was introduced by the current change or inherited from the
base. The PR gate (
--gate new-only) keys onAttribution::Introduced. - Category
- The five co-equal analysis areas (plus dependency hygiene), mirroring fallow’s “never reduce it to a dead-code tool” rule.
- Confidence
- Confidence tier attached to every finding. This is the core honesty mechanism: Python dead-code detection is undecidable in general, so Mollify never claims boolean certainty.
- Report
- The kind-discriminated output envelope.
kindlets clients switch on the result type and iteratefindings. - Severity
- Severity controls CI exit behavior.
Constants§
- SCHEMA_
VERSION - Current schema version of the JSON contract. Bump the minor on additive changes, the major on breaking ones. Agent skills pin to this.
Functions§
- sort_
findings - Deterministic ordering for findings: by path, then line, then rule, then fingerprint. Call before serializing any report.