Repository navigation
Conversation
Phase 1, PR 2 of .agents/plans/skill-evals-and-packages.plan.md. Follows #262 (merged). CLI: - New src/lib/integrity.ts (agentvouch-tree-v1). skill install and skills update check every download before they write: a tree against tree_hash, and a single SKILL.md against its manifest entry and the manifest against tree_hash. On a mismatch the CLI re-reads the skill once (a new version can be published during the download), then stops and writes nothing. - Stop before any download or payment when the skill has no published tree_hash, so a paid install cannot take the payment and then refuse to write. - Hash and write the exact /raw bytes. response.text() dropped a leading byte order mark. - Read downloads with the mirror limits (512 files, 8 MB). - Install metadata records tree_hash_algorithm and tree_hash_verified_at. - The CLI passes the shared tree-hash vectors. Web: - GET /api/skills/{id}/versions/{version}/archive serves one stored version, with the same access rules as /archive. - Upload rejects a file/folder path conflict ("docs" and "docs/a.md") with a 400, and putSkillTree rejects it too. Mirror sync skips such a skill, so it cannot fail the daily mirror cron. - Read stored trees with the mirror limits, so /raw?path= and /zip can serve a mirrored tree above the upload limits. Docs: docs/SKILL_TREE_HASH.md, web/public/skill.md (2.3.0), the CLI README, and the plan. Verified: format:check, lint, web and CLI typecheck, web vitest (166 files, 1613 tests), CLI vitest (18 files, 173 tests), Python vectors. next build --webpack compiled and ran TypeScript, then stopped at the /sitemap.xml prerender without DATABASE_URL. Not verified: the production sweep, and a live fetch from the new version route. Merge only after the sweep shows zero mismatches.
This branch was successfully deployed
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.
What this changes
Phase 1, PR 2 of
.agents/plans/skill-evals-and-packages.plan.md. Follows #262.CLI (
packages/agentvouch-cli)skill installandskills updatecheck every download before they write anything (newsrc/lib/integrity.ts, algorithmagentvouch-tree-v1):tree_hash.SKILL.md: compare its SHA-256 with the published file list, and check that list againsttree_hash.tree_hash, the CLI stops before it downloads or pays. Without this, a paid install could take the payment and then refuse to write./rawbytes. Before,response.text()dropped a leading byte order mark.<path>.agentvouch.jsonrecordstree_hash_algorithmandtree_hash_verified_at. The install output printstree_hash_verified.Web
GET /api/skills/{id}/versions/{version}/archive: one stored version, with the same access rules as/archive. Like/archive, it records a download event.docsanddocs/a.md) with a 400.putSkillTreerejects it too.path conflictdetail, like a size-limit violation. So one bad upstream skill cannot make the daily mirror cron return 500./raw?path=and/zipfailed for a mirrored tree above the upload limits (200 files, 5 MB).Docs:
docs/SKILL_TREE_HASH.md(client steps, Known gaps),web/public/skill.md(2.3.0: the version route and the download check), the CLI README, and the plan (status updates and one dated note).Run the sweep before merge
From
web/on the Mac, with the production values in.env.local:0: every stored version matches. Exit code1: findings. The JSON lists each finding with a code fromdocs/SKILL_TREE_HASH.md.main, the sweep still reads stored trees with the upload limits. A mirrored tree above 200 files or 5 MB then shows asfiles_unavailablewith an "exceeds cap" message. This PR fixes that reader, so on this branch such a tree is checked normally.Verified
npm run format:check,npm run lint,npm run typecheck, and CLItsc --noEmit.npm test: web 166 files, 1,613 tests; CLI 18 files, 173 tests.next build --webpackcompiled and ran TypeScript, then stopped at the/sitemap.xmlprerender because this workspace has noDATABASE_URL. The Vercel preview is the real build check.Not verified
tree_hash.chain-…ids) have no tree hash, so the CLI cannot check them. This is unchanged.Generated by Claude Code