Repository navigation
Trust Badge API: certify any skill file, even ones we don't host - #41
Merged
Merged
Conversation
Implements the Trust Badge API from the product analysis roadmap (docs/product-analysis-2026-06.md §5.1) — turn the review engine into an acquisition channel by certifying skills we don't host: - POST /api/public/certify runs any skill file through the same proprietary engine as the review_skill MCP tool (now exported), screens it with the prompt-injection guard, and stores the verdict keyed by the file's SHA-256 (new external_certifications table, RLS-enabled with public read). - GET /api/badges/certified/<id>.svg renders an embeddable 'skill audit' badge — deliberately distinct from the registry Trust Score, which carries adversarial + real-world evidence. - GET /api/public/certifications/<id> is the public verification record: hash the file you were given, compare content_sha256. - /certify documents the flow (linked from the home Proof section, docs and sitemap). Pure helpers live in src/lib/certify/core.ts with unit tests wired into npm test. Also fixes all 26 strict type errors surfaced when main committed the router type registration: route search schemas now declare optional keys (login, signup, billing, generate), discover's search reducers are typed against the route schema, and shared_runs / leaderboard rows get explicit shapes. https://claude.ai/code/session_01YFTRsBwhQuQQkR6cQVcxZJ
criptogus
marked this pull request as ready for review
July 4, 2026 12:23
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
Implements the Trust Badge / Certification API from the product analysis roadmap (
docs/product-analysis-2026-06.md§5.1): the review engine becomes an acquisition channel by certifying skill files we don't host — every embedded badge is a backlink to the platform.How it works
POST /api/public/certify{ name, type, content }— runs the file through the same proprietary engine as thereview_skillMCP tool (computeReview, now exported — one scorer, two doors), screens it with the prompt-injection guard, and persists the verdict keyed by the file's SHA-256. Returns score, grade, badge URL, verify URL and a ready-to-paste markdown snippet. Rate-limited (10/h per IP, best-effort per isolate).GET /api/badges/certified/<id>.svg— embeddable shields-style badge labeled "skill audit" (e.g.B · 84/100), deliberately distinct from the registry Trust Score, which carries adversarial + real-world evidence the audit alone doesn't.GET /api/public/certifications/<id>— public verification record: anyone holding the file runssha256sumand compares withcontent_sha256; a match proves that exact content earned that score on the issued date. Injection-guard findings are part of the record, so a hostile file can't launder a clean badge.Schema
New
external_certificationstable (migration20260610130000), RLS enabled with public-read policy (certifications are public by design; writes go through the service role only).Surface
/certifypage documenting the flow (curl + response examples), linked from the home Proof section ("Certify your own skill →"), the docs (§5 Certification API) and the sitemap.src/lib/certify/core.tswith unit tests (tests/certify.test.mjs, wired intonpm test): SHA-256 vector, request validation, badge value/URLs, SVG rendering.Also: repo now passes strict typecheck
mainrecently committed the router type registration inrouteTree.gen.ts, which turned on strictLink/search typing and surfaced 26 pre-existing errors. All fixed at the source:login,signup,account.billing,generate) soLinks don't need explicitsearch.discover's search reducers typed against the route schema instead ofRecord<string, unknown>.shared_runs/ leaderboard rows get explicit shapes.tsc --noEmitis now clean repo-wide; 101/101 tests pass; production build succeeds.https://claude.ai/code/session_01YFTRsBwhQuQQkR6cQVcxZJ
Generated by Claude Code