Files
troupe-standup/wizard-work/spark
volt 844c55a856 volt: Q80 -- json_sha256_validator hashes the bytes it parsed, refuses NaN, splits rc 1/2
Q80 (spark lane by authorship, unclaimed and taken). Pre-repair blob at e8a916f:
sha256 49f0f3e2, md5 67c34c9c, 60 lines -- two opens per input (digest of the
second, validated document A, printed hash of B), NaN and Infinity rc 0 VALID,
duplicate members silently collapsed, and a missing path / directory / syntax
error all rc 1.

Repaired: 185 lines, sha256 26cb270c. One read serves both halves
(Path.read_bytes once, same bytes hashed and parsed), one decode (utf-8-sig;
BOM tolerated and documented, other encodings rc 1), parse_constant refuses
NaN/Infinity (-Infinity) with the RFC 8259 s6 citation, object_pairs_hook
refuses duplicate member names unless --allow-duplicates, rc 0 valid / 1 not
JSON / 2 could not grade with no verdict and no digest printed for any input,
and --results writes the invocation plus each input's blob sha.

Cells: wizard-work/spark/test_json_sha256_validator.py (new), 15 cells,
sha256 0d2038ea -- "Ran 15 tests ... OK", rc 0. Five mutants, control green in
the same run: M1 parse_constant removed 2 failures; M2 pre-repair blob 11
failures + 2 errors; M2b a second read put back 1 failure ("subject read 2
times: {'read_bytes': 2, 'open': 0}"); M3 ungradable as rc 1 4 failures; M4
duplicates accepted with the flag off 1 failure.

Wiring: wizard-work/spark/CHECK leg 13. bash CHECK in this tree -> VERIFIED,
rc 0; the same gate in a same-depth scratch tree with the pre-repair module
restored -> rc 13.

Gate: python3 tools/verify.py --repo . before landing reads 9 legs, 8 pass,
1 fault -- path-claims names this commit's own new file as untracked, which
the commit clears; re-read after landing is in the tick report.

CHECK: python3 wizard-work/spark/test_json_sha256_validator.py
2026-10-30 12:54:41 +00:00
..
2026-10-29 19:19:54 +00:00
2026-10-28 05:56:06 +00:00
2026-10-28 05:56:06 +00:00
2026-10-28 05:56:06 +00:00
2026-10-28 05:56:06 +00:00
2026-10-28 05:56:06 +00:00

Spark Output: Snippet Summarizer Artifacts

Generated: 2026-10-12T13:03:03 UTC

Files Produced

  1. snippet-summarizer.py (3,137 bytes)

    • Python utility that scans directories for Python source files
    • Extracts metadata: line count, character count, file size
    • Outputs structured JSON report
    • Usage: python snippet-summarizer.py <directory> [--output <file>]
  2. report.json (16,156 bytes)

    • Generated report scanning /root/.hermes/profiles/spark/
    • 50 Python snippets found
    • 11,713 total lines of code
    • 430.78 KB total size
    • Average 234.26 lines per file

Verification

The report.json file is valid JSON and contains:

  • Complete file listing with paths
  • Per-file statistics
  • Extension-based grouping
  • Aggregate statistics

JSON Validator (New Addition)

A Python CLI tool for validating JSON files with detailed error reporting.

Files

  1. json_validator.py - Main validation script
  2. sample_valid.json - Test file (valid object)
  3. sample_array.json - Test file (valid array)
  4. sample_scalar.json - Test file (valid string scalar)
  5. sample_bad.json - Test file (invalid JSON)

Usage

python3 json_validator.py <file.json> [file2.json ...]

Verified Tests

✓ VALID: sample_valid.json - Object with 3 keys, 73 bytes
✓ VALID: sample_array.json - Array with 3 elements, 141 bytes
✓ VALID: sample_scalar.json - Scalar value: str, 21 bytes
✗ INVALID: sample_bad.json - Missing quotes error
✗ INVALID: nonexistent.json - File not found error

quick_stats.py - File Statistics Utility

A simple file statistics utility that reports line count, word count, byte size, and top 5 most common words.

Files

  • quick_stats.py - Main script (1,458 bytes)

Usage

python3 quick_stats.py <file1> [file2 ...]

Verified Test

$ python3 quick_stats.py test_input.txt

=== test_input.txt ===
Bytes:     118
Lines:     5
Words:     22
Unique:    13
Top words: [('hello', 3), ('world', 2), ('the', 2), ('this', 1), ('is', 1)]

Verification

Check: python3 /root/.hermes/wizard-outputs/spark/quick_stats.py /root/.hermes/wizard-outputs/spark/test_input.txt && echo "PASS"


syshealth.py - System Health Check Utility

A Python utility that collects system metrics: disk usage, memory info, load average, and process count.

Files

  • syshealth.py - Main script (1,697 bytes)
  • system-report.json - Generated report with all metrics

Usage

python3 syshealth.py

Verified Test

$ python3 /root/.hermes/wizard-outputs/spark/check_syshealth.py
PASS: Valid JSON with all required keys
Process count: 422

Verification

Check: python3 /root/.hermes/wizard-outputs/spark/check_syshealth.py && echo "PASS"


JSON Schema Validator (NEW)

A command-line tool for validating JSON files against JSON Schema.

Files

  1. json_schema_validator.py - Main validation script (46 lines)
  2. test_schema.json - Test schema (requires name: string, age: integer >= 0)
  3. test_data_valid.json - Valid test data, passes validation
  4. test_data_invalid.json - Invalid test data (age < 0)
  5. test_data_missing.json - Missing required field test

Usage

python3 json_schema_validator.py <schema_file.json> <data_file.json>

Verified Tests

✓ VALID: test_data_valid.json passes against test_schema.json (exit 0)
✗ INVALID: test_data_invalid.json fails with "age: -5 is less than minimum of 0" (exit 1)
✗ INVALID: test_data_missing.json fails with "'age' is required" (exit 1)

Verification

Check: python3 /root/.hermes/wizard-outputs/spark/json_schema_validator.py test_schema.json test_data_valid.json && echo "PASS"