Skip to content

Trust v2 UI + adversarial LLM-judge primitives - #32

Merged
criptogus merged 2 commits into
mainfrom
claude/vigilant-clarke-TMUjV
May 29, 2026
Merged

Trust v2 UI + adversarial LLM-judge primitives#32
criptogus merged 2 commits into
mainfrom
claude/vigilant-clarke-TMUjV

Conversation

@criptogus

Copy link
Copy Markdown
Owner

Follow-up to the merged #31. Two independent pieces (separate commits).

1. Trust Score v2 — UI (src/routes/marketplace.trust.$slug.tsx, trust.functions.ts)

Surfaces the v2 scoring vector that #31 added to the data layer:

  • getSkillTrust now additively reads the v2 columns from package_trust_scores (score / confidence / verified / dimensions) — no change to the existing get_skill_trust RPC.
  • New TrustVector component: safety / competence / freshness / coverage bars, a confidence meter, and an explicit Unverified state (the score is gated, never defaulted to a comfortable number).
  • Updated "how it's computed" explainer pointing at the reproducible scoring.ts.

2. Adversarial LLM-judge primitives (src/lib/adversarial/judge.ts)

The semantic-grading layer from the analysis doc (#6), built test-first:

  • Pluggable JudgeFn so any model wires in behind one signature (pure + mockable — no live LLM needed for tests).
  • Strict/lenient ensemble grader: in strict mode the judge can catch semantic failures the substring checks miss, raising the safety bar without ever lowering it.
  • Cohen's κ calibration (judgeCalibration) to prove the judge agrees with golden human labels, separating dangerous false-passes from annoying false-fails.

Tests

tests/adversarial-judge.test.mjs (10) — all green locally, added to test:ts. (The Trust v2 core + holdout from #31 already have their suites.)

Remaining follow-ups (documented, not in scope here)

Wiring a live model behind JudgeFn in the server pipeline; community red-team pipeline + holdout-gated SkillForge promotion; production A/B; published signed methodology spec.

Note

Could not run typecheck/build in this container (node_modules not installed); unit tests run under node --experimental-strip-types and pass.

https://claude.ai/code/session_01BnYrQNoKNNxPCSmV2suWna


Generated by Claude Code

claude added 2 commits May 29, 2026 18:43
- trust.functions.ts: read v2 columns (score/confidence/verified/dims) from
  package_trust_scores additively, expose as trust_v2
- marketplace.trust.$slug.tsx: TrustVector component with safety/competence/
  freshness/coverage bars, confidence meter, Unverified badge + score gating,
  and an updated 'how it's computed' explainer referencing scoring.ts
- src/lib/adversarial/judge.ts: pluggable JudgeFn, strict/lenient ensemble
  grader (judge can raise the safety bar without lowering it), Cohen's kappa
  and judge-vs-human calibration report. Pure + mock-tested.
- tests/adversarial-judge.test.mjs: 10 cases (kappa edge cases, ensemble modes,
  false-pass/false-fail separation, batch)
- docs: mark Trust v2 UI + judge primitives as shipped
@criptogus
criptogus marked this pull request as ready for review May 29, 2026 18:46
@criptogus
criptogus merged commit 45d7b7d into main May 29, 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