Skip to main content
shrike report --json prints one object described by schemas/cleanup-report.schema.json. The report is a deterministic projection of engine facts: it groups, counts, and explains; it never adds a deletion candidate. The schema version is "1.0" and the top-level object is closed (additionalProperties: false). Consumers should branch on mode, ignore unknown future schema versions explicitly, and treat every string as data.

Top-level fields

base.ref is the ref you passed when it is known, otherwise null; base.commit and head.commit are full commit IDs. graphHash is present when the engine returned one. Paths are repository-relative POSIX strings. Symbol keys are path#Name. A dirty tree sets head.dirty: true. The report is still deterministic, but it is local feedback rather than a CI receipt.

summary

The displayed percentage is deadWeightBasisPoints / 100, rounded to one decimal place. The raw fraction always accompanies it. removableLines can never exceed analyzedLines; if it would, the command fails closed instead of reporting an impossible metric.

groups[] and items[]

Each group has a directory, removableLines, removableSymbols, removableFiles, and items. Groups are sorted by directory; use the item arrays for deterministic detail. An item has: A branch item’s trigger names the file, a kind (removed-import, removed-call, removed-jsx, removed-route, renamed-export, removed-re-export, changed-dynamic, indirect), a human change, and certainty. It is explainability, not deletion authority. A whole file has kind: "file", reason: "whole-file", and counts its declared lines once. It never also appears as a symbol item for the same file.

preexisting

Branch reports include { symbols, files, lines }: dead code present at HEAD that the plan does not attribute to this branch. These lines are excluded from summary.removableLines, so a branch report measures the branch, not the repository’s history.

protected[]

Protected rows have path, an optional symbol, a reason, and an optional detail. Reasons are entry-role, public-api, unknown-edge, probable-edge, unparsed-file, generated-file, test-entry, external-referrer, blast-radius, workspace-boundary, policy, oversized, and other. Protected items are never in a deletion batch.

dependencies[]

Each row has package, directory, name, kind (unused, unlisted, or transitive), and "advisory": true. Dependencies are reported separately and are advisory. Shrike never removes or edits a dependency in this report or in clean.

diagnostics

total, actionable, and informational are counts. groups contains up to six grouped entries, each with category, code, count, actionable, and the sorted files that contributed. They describe analysis coverage and unresolved conditions; they do not change the metric.

Determinism

  • Identical input produces byte-identical JSON.
  • No timestamps, random IDs, locale-dependent numbers, or absolute host paths appear in the report.
  • Arrays are sorted with stable, case-sensitive comparisons: groups by directory, items by path then symbol then id, protected items by path then symbol then reason, dependencies by package then name then kind then directory.
  • The report is built from one analysis. It does not re-read source files for line counts.
  • Adding a field is a schema change. Consumers should use schemaVersion and tolerate additive fields only after the schema version is bumped and documented.

Example

This is a complete, schema-valid current report with one group:
The head.graphHash and base.graphHash fields are optional. The preexisting field is omitted from current reports. Optional item fields (symbol, name, trigger) are omitted when they do not apply.

Next