Skip to content

Trust Badge API: certify any skill file, even ones we don't host - #41

Merged
criptogus merged 1 commit into
mainfrom
claude/repo-analysis-product-improvements-5ne3ub
Jul 4, 2026
Merged

criptogus merged 1 commit into
mainfrom
claude/repo-analysis-product-improvements-5ne3ub

Conversation

@criptogus

Copy link
Copy Markdown
Owner

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

  1. POST /api/public/certify { name, type, content } — runs the file through the same proprietary engine as the review_skill MCP 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).
  2. 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.
  3. GET /api/public/certifications/<id> — public verification record: anyone holding the file runs sha256sum and compares with content_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_certifications table (migration 20260610130000), RLS enabled with public-read policy (certifications are public by design; writes go through the service role only).

Surface

  • New /certify page documenting the flow (curl + response examples), linked from the home Proof section ("Certify your own skill →"), the docs (§5 Certification API) and the sitemap.
  • Pure helpers in src/lib/certify/core.ts with unit tests (tests/certify.test.mjs, wired into npm test): SHA-256 vector, request validation, badge value/URLs, SVG rendering.

Also: repo now passes strict typecheck

main recently committed the router type registration in routeTree.gen.ts, which turned on strict Link/search typing and surfaced 26 pre-existing errors. All fixed at the source:

  • Route search schemas declare optional keys (login, signup, account.billing, generate) so Links don't need explicit search.
  • discover's search reducers typed against the route schema instead of Record<string, unknown>.
  • shared_runs / leaderboard rows get explicit shapes.

tsc --noEmit is now clean repo-wide; 101/101 tests pass; production build succeeds.

https://claude.ai/code/session_01YFTRsBwhQuQQkR6cQVcxZJ


Generated by Claude Code

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
criptogus marked this pull request as ready for review July 4, 2026 12:23
@criptogus
criptogus merged commit 8b41cfe into main Jul 4, 2026
1 check passed
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.

2 participants