feat: manifest.json with per-file SHA-256 integrity hashes#1
Open
ronaldtse wants to merge 1 commit into
Open
Conversation
Walks every language directory and emits a root-level manifest matching
Kotoshu::Integrity::Manifest's schema:
{ version, generated_at, repo_version, resource_count,
language_count, resources: { "<rel/path>": { size, sha256,
language, type, license?, source? } } }
279 resources across 93 languages. License/source pulled from each
language's package.json (SPDX identifier + repo URL) so the gem has
machine-readable attribution to surface in audit logs.
Re-runnable: scripts/generate_manifest.rb is idempotent modulo the
generated_at timestamp. CI should diff the committed manifest against a
fresh run on every PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
manifest.jsonat the repo root — the source of truth that the kotoshu gem'sKotoshu::Integrity::Manifestverifies downloads against.Generated by
scripts/generate_manifest.rb, which walks each language directory, hashesindex.dic/index.aff/index.js/rules.yaml, extracts license and source frompackage.json, and emits:{ "version": 1, "generated_at": "2026-06-26T...", "resources": { "en/index.dic": {"size": 12345, "sha256": "...", "language": "en", "type": "spelling", "license": "MIT", "source": "..."} } }Result
279 resources across 93 languages.
Why
The gem's ResourceManager rejects any download whose SHA-256 doesn't match the manifest. Without this file, downloads are unsigned.
Test plan
ruby scripts/generate_manifest.rbruns cleanlyKotoshu::Integrity::Manifest.parse(File.read('manifest.json'))succeedsverify_content!passes against every entry in the manifest