Skip to content

feat: add npm run report for machine-readable fixture summary - #80

Open
Violetlove200100 wants to merge 2 commits into
Gryd-lock:mainfrom
Violetlove200100:feat/report-command-63
Open

feat: add npm run report for machine-readable fixture summary#80
Violetlove200100 wants to merge 2 commits into
Gryd-lock:mainfrom
Violetlove200100:feat/report-command-63

Conversation

@Violetlove200100

Copy link
Copy Markdown

Summary

Implements npm run report as requested in #63 — a dependency-free script that emits a deterministic, machine-readable JSON summary of the fixture dataset.

Changes

  • scripts/report.mjs — new script using only Node.js built-ins (node:crypto, node:fs, node:path, node:url)
  • package.json — adds "report": "node scripts/report.mjs" to scripts
  • README.md — new Fixture Report section documenting all output fields and redirect usage

Output fields

Field Description
version package version from package.json
generated_at ISO 8601 timestamp
totals destination and scores entry counts
label_counts per-label counts (clean / suspicious / malicious)
type_counts per-type counts (account, asset, …)
risk_pattern_counts count per risk pattern, sorted alphabetically
score_bands low (0–24), medium-low (25–49), medium-high (50–74), high (75–100)
transactions sorted list of .xdr files with SHA-256 hashes
file_hashes SHA-256 of destinations.json, scores.json, CHANGELOG.md

Acceptance criteria

  • npm run report emits valid deterministic JSON
  • Output includes label/type/risk-pattern counts
  • Output includes transaction files with hashes, version, and file hashes
  • Repeated runs are byte-identical when inputs are unchanged (verified)
  • README documents the command

Testing

npm run report          # emits JSON to stdout
npm run validate        # still passes — no regressions

Determinism verified by stripping generated_at and diffing two consecutive runs — output is identical.

Closes #63

Violetlove200100 and others added 2 commits August 17, 2026 19:43
- Add scripts/report.mjs: dependency-free script that emits deterministic
  JSON with version, generated_at, totals, label_counts, type_counts,
  risk_pattern_counts, score_bands, transactions (with SHA-256), and
  file_hashes for destinations.json, scores.json, and CHANGELOG.md.
- Add 'report' entry to package.json scripts.
- Document the command in README.md under a new 'Fixture Report' section.

Repeated runs are byte-identical when inputs are unchanged.

Closes Gryd-lock#63
- Drop the generated_at timestamp from scripts/report.mjs so repeated runs
  are byte-identical (acceptance criterion for Gryd-lock#63), and hash package.json
  alongside the other inputs
- Update the README report section to match
- Add a CI job asserting npm run report emits valid, byte-identical JSON
- Fix a pre-existing syntax error in scripts/check-secrets.mjs that kept the
  secret-check CI job from running (broken since it was introduced in Gryd-lock#49)

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a machine-readable fixture summary command

1 participant