Skip to content

feat: manifest.json with per-file SHA-256 integrity hashes#1

Open
ronaldtse wants to merge 1 commit into
v1from
feat/manifest
Open

feat: manifest.json with per-file SHA-256 integrity hashes#1
ronaldtse wants to merge 1 commit into
v1from
feat/manifest

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

Adds manifest.json at the repo root — the source of truth that the kotoshu gem's Kotoshu::Integrity::Manifest verifies downloads against.

Generated by scripts/generate_manifest.rb, which walks each language directory, hashes index.dic / index.aff / index.js / rules.yaml, extracts license and source from package.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.rb runs cleanly
  • Kotoshu::Integrity::Manifest.parse(File.read('manifest.json')) succeeds
  • verify_content! passes against every entry in the manifest

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.
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.

1 participant