Skip to content

docs: add schema_version to REGISTRY.md JSON schemas#241

Closed
breferrari wants to merge 1 commit into
mainfrom
fix/registry-docs-schema-version
Closed

docs: add schema_version to REGISTRY.md JSON schemas#241
breferrari wants to merge 1 commit into
mainfrom
fix/registry-docs-schema-version

Conversation

@breferrari
Copy link
Copy Markdown
Owner

Summary

Test plan

  • Documentation-only change — no code affected
  • Examples now match actual registry output

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the registry specification and the weave client to support and document pack content integrity verification via SHA-256 checksums, alongside documenting the existing schema_version envelope used by the registry.

Changes:

  • Add checksum support to registry release metadata (PackRelease.checksum) and verify checksums before writing fetched packs to the store.
  • Document schema_version: 1 envelopes in docs/REGISTRY.md (including index.json) and update architecture docs to reflect the checksum verification step.
  • Add the sha2 dependency and update tests/fixtures to include the new checksum field.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/error.rs Adds a dedicated ChecksumMismatch error for integrity failures.
src/core/checksum.rs Implements canonical JSON hashing + checksum verification with unit tests.
src/core/mod.rs Exposes the new core::checksum module.
src/core/install.rs Verifies checksum for registry installs prior to processing/storing.
src/core/update.rs Verifies checksum for fetched releases during updates.
src/core/use_profile.rs Verifies checksum when falling back to registry fetch.
src/core/registry.rs Extends PackRelease to include optional checksum and updates docs/comments.
src/core/store.rs Updates test struct literals for the new checksum field.
src/core/resolver.rs Updates test helpers/fixtures for the new checksum field.
src/core/publish.rs Updates test fixtures for the new checksum field.
docs/REGISTRY.md Documents versioned envelopes and checksum field in examples/schemas.
docs/ARCHITECTURE.md Adds checksum verification step/module to architecture documentation.
Cargo.toml Adds sha2 dependency.
Cargo.lock Locks transitive deps for sha2.
AGENTS.md Documents core/checksum.rs in the repo layout section.

Comment thread src/core/checksum.rs
Comment on lines +124 to +136
fn compute_known_hash() {
let files = HashMap::from([("pack.toml".to_string(), "content".to_string())]);
let checksum = compute(&files);
assert!(checksum.starts_with("sha256:"));
assert_eq!(checksum.len(), 7 + 64);
// Pin the exact value to catch regressions.
// Python: hashlib.sha256(json.dumps({"pack.toml":"content"}, sort_keys=True,
// separators=(',',':'), ensure_ascii=False).encode()).hexdigest()
let expected = compute(&files);
assert_eq!(checksum, expected);
}

#[test]
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[correctness] The compute_known_hash test is effectively a no-op: it sets expected = compute(&files) and then asserts checksum == expected, which will always pass even if the algorithm changes. Either replace expected with a pinned literal digest (like the later cross-language tests do) or remove this test to avoid a false sense of coverage.

Suggested change
fn compute_known_hash() {
let files = HashMap::from([("pack.toml".to_string(), "content".to_string())]);
let checksum = compute(&files);
assert!(checksum.starts_with("sha256:"));
assert_eq!(checksum.len(), 7 + 64);
// Pin the exact value to catch regressions.
// Python: hashlib.sha256(json.dumps({"pack.toml":"content"}, sort_keys=True,
// separators=(',',':'), ensure_ascii=False).encode()).hexdigest()
let expected = compute(&files);
assert_eq!(checksum, expected);
}
#[test]

Copilot uses AI. Check for mistakes.
Comment thread docs/REGISTRY.md
Comment on lines 9 to 12
The pack registry is a GitHub-hosted repository (`PackWeave/registry`) that serves pack metadata and file content. It is separate from MCP server registries (like the official MCP Registry or Smithery) — weave packs are composable bundles of MCP server configuration, system prompts, slash commands, and settings, not individual MCP server listings.

The registry uses a two-tier sparse index so clients never download more than they need. Pack content is embedded directly in `packs/{name}.json` as a flat map of relative path → file content — no tarballs, no release artifacts, no SHA256 ceremony.
The registry uses a two-tier sparse index so clients never download more than they need. Pack content is embedded directly in `packs/{name}.json` as a flat map of relative path → file content — no tarballs, no release artifacts. Integrity is verified via SHA-256 checksums embedded in each release entry.

Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[robustness] The PR metadata describes this as a documentation-only change (schema_version in REGISTRY.md), but this diff also adds runtime checksum verification (new core module, new error variant, new dependency). Please update the PR title/description and test plan to reflect the actual behavior change, or split the docs/schema_version updates and checksum feature into separate PRs for clearer review/release notes.

Copilot uses AI. Check for mistakes.
The registry already emits schema_version in both index.json and
packs/{name}.json (shipped in registry PR #3), but the REGISTRY.md
examples and formal JSON schemas were missing it.

Update all JSON examples and schema definitions to include
schema_version: 1, and update the index.json format description
to reflect the versioned envelope structure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@breferrari breferrari force-pushed the fix/registry-docs-schema-version branch from 2394e8a to 7e2eebb Compare March 26, 2026 06:20
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been open for 14 days with no activity. It will be closed in 7 days unless there is further activity.

@github-actions github-actions Bot added the stale label Apr 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Closing due to inactivity. Feel free to reopen if the work is resumed.

@github-actions github-actions Bot closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants