refactor: make classmap data consistent, validated and generated - #16
Conversation
The hex suffix was a 1.2.94 build timestamp reused by maps with different contents; index.json already records each file and its digest. Drops the unindexed 1020040 map, a strict subset of the indexed one.
…y to VERIFICATION.md META.json now has a fixed schema_version 2 field set. required_paths uses one status vocabulary, source replaces inherited_from, and notes, statistics, guards and verification runs move to each key's VERIFICATION.md. 1020099 no longer lists its stale upgrade button as unverified, and its notes no longer claim that stock 1.2.99 ships readable class names.
… 2 layout promote_inherited.py writes META.json and VERIFICATION.md and runs the validator on the new key before publishing it.
Per-build match counts move from prose notes into a hits object. Shipped CLIs ignore unknown patch fields.
…biguous META values
publish_key.py replaces promote_inherited.py. A derived key takes a candidate map and overlay, with --stale and --note for the decisions the reports can't make, and gets the same report checks, generated META.json and VERIFICATION.md, validation and index rollback.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (48)
💤 Files with no reviewable changes (4)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe PR standardizes published classmap files and metadata, adds classmap validation to the workflow and promotion tooling, updates release classmaps and verification records, and stores exposure-patch hit counts in structured fields with stricter validation. ChangesClassmap publication
Exposure-patch hit counts
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant Actions as GitHub Actions
participant Validator as validate_classmaps.py
participant Releases as Key release files
Actions->>Validator: Run classmap validation
Validator->>Releases: Scan keys and read published files
Releases-->>Validator: Return classmaps and metadata
Validator-->>Actions: Return validation status and errors
Merge Risk: ⚪ Minimal · up to The canonical filename migration preserves every published release, with consistent metadata and index checksums. No merge-blocking issue was identified; merge after the remaining normal CI checks pass. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The reviewed changes strengthen consistency checks without establishing a new security weakness. Risk remains low rather than minimal because compatibility with the external client and recovery from interrupted or concurrent publication are not fully demonstrated. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 6 files. (38 skipped: 38 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks each map with care Comment |
Node 24 runs the scripts directly, pnpm check runs tsc and every data check, and CI installs the pinned toolchain. The JSON renderer is byte-identical to the Python one for every published file.
renderJson sorts keys by code point, integer-like keys included. Files must be valid UTF-8, a null onMiss is rejected as the CLI would, Rust-style named groups and leading flags compile, each check reports its own failure, and pnpm fix FILE formats a single file. The scripts require Node 24.2 for import.meta.main.
… to their verified map A derived key keeps its source's unchanged stale leaves and the migrate leaves whose hashed classes left the stock CSS. A path missing from that CSS counts as observed only through its stock class. --drop-required, --replace and --overlay cover the remaining decisions, and META.json records verified_classmap_sha256 so a map edited after verification fails validation. VERIFICATION.md records the classmap, overlay and target CSS digests.
Summary
Makes the published data consistent and machine-checked, and makes a new key something a person or an agent generates rather than hand-writes. No staged class changes for any key.
Data
main-contextMenu-menuItemButton). Each is now the one stock hash that the css-map rewrites to that name and that is present in the stock 1.2.99.317 or 1.3.0.277 archive. 1030000 is byte-identical to 1030001 again.classmap.json(the old hex suffix was a 1.2.94 build timestamp reused by four maps with different contents). All JSON has two-space indentation, sorted keys, and no empty placeholder groups. The unindexed 1020040 map, a strict subset of the indexed one, is removed.schema_version,classmap_key,spotify_version,status,generated,source,required_paths(enum statuses),stale_leaves,unverified_leaves,verified_classmap_sha256. Notes, statistics and verification runs move to each key'sVERIFICATION.md. Contradictions fixed: 1020099 listed a leaf as both stale and unverified, and claimed stock 1.2.99 ships readable class names (it ships only hashes). The 1.3.0 history gets a correction: its Encore classes are in the stock CSS inside@layer encore, which the static verifier skipped until refactor(scripts): port the classmap capture tooling to TypeScript cli#3973.hitsobject.Tooling (TypeScript, Node 24.2+,
pnpm check)scripts/validate-classmaps.tsruns in CI. It checks layout, canonical form, and META claims against the files: leaves exist, lists agree withrequired_paths, inherited maps are byte-identical to their source in the same minor, no leaf stores a Spicetify name, and a map changed after verification fails its recorded digest.pnpm publish-keypublishes inherited and derived keys from the CLI reports. For a derived key it carries over the source's unchanged stale leaves and the leaves the migrate report kept with a vanished hashed class. It counts a path missing from the stock CSS as observed only through its stock class. It takes--stale,--drop-required,--noteand--replace, validates the key and every key inheriting from it, and rolls back the key andindex.jsonon failure.pnpm fixformats every JSON file and rebuilds the index;pnpm fix FILEformats a candidate map.AGENTS.mdrecords the conventions the code doesn't make obvious. The README describes the full pipeline for unchanged patches, changed classes, and fixes to published keys.Compatibility
status,spotify_version,classmap_keyandstale_leavesfrom META and file names fromindex.json. All are kept, and the index field names are unchanged. Unknown META and patch fields are ignored.classmap.json.Verification
pnpm check(tsc, index, validator, expose, 57 tests) passes at every commit.main, both served locally. For every leaf of all 13 keys the staged class is identical, and a cache upgraded frommainequals a fresh install.Merge order
expose.json. Its release gate compares against this repo's published digest.