Skip to content

B-22: stats --json in SKILL.md matches the real payload in zero keys #285

Description

@gfargo

Severity: medium — SKILL.md is the agent-facing contract.

skill/SKILL.md:261-281 documents a flat payload: filesProcessed, operationsSucceeded, operationsFailed,
bytesBefore, bytesAfter, bytesSaved, percentReduction, lastRunAt, breakdown.

Actual output (stats.ts:70-83 + db.ts:593-604) is nested:
{ site, url, stats: { siteName, filesTouched, totalOps, succeeded, failed, skipped, bytesSaved, bytesIn, lastRanAt, byOperation }, overview, formats, recent, history }.

Every documented key except site is wrong; bytesSaved exists but at the wrong depth; percentReduction,
bytesAfter and breakdown don't exist at all, and lastRanAt is epoch ms rather than the documented ISO string.
The stats MCP tool and the localpress://stats resource return the same payload verbatim, so an agent following
SKILL.md reads undefined everywhere.


Extracted from a repo audit performed 2026-07 (the audit doc it came from was proposed via an unmerged docs PR).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions