feat(cert): Sprint 2 — verificación pública + certificar en verde (el diferenciador)#61
Merged
Merged
Conversation
…pública (D1)
El diferenciador ("SLSA para QA": acta firmada verificable) estaba anulado por su
propia auth: POST /certificates/verify exigía login, así que un auditor/regulador/
cliente-final no podía verificar nada. La verificación es cripto pura (firma +
payload + clave pública, nada secreto ni de ningún tenant).
- POST /v2/certificates/verify ahora es PÚBLICO (sin get_current_user)
- GET /v2/certificates/pubkey (público) sirve la clave pública Ed25519 para
verificar offline, declarado antes de /certificates/{run_id} (ruta estática gana)
Claude-Session: https://claude.ai/code/session_01X1fZebDm9ABFwLU2v3mq46
…(D2) generate() y gate.publish() abortaban con "run sin veredictos de triaje" si no había fallos → un release donde todo pasa no emitía acta ni gate: justo el caso que un cliente quiere firmar. Ahora un run verde certifica como "apto". Para no certificar un run SIN TRIAR como verde, se distingue por el nº de fallos ingeridos (count_failures_for_run): 0 fallos = verde (apto); fallos > 0 sin veredictos = sin triar (ValueError). build_certificate/compute_verdict ya manejaban verdicts=[] (apto, risk_score=0, evidence=[]). Claude-Session: https://claude.ai/code/session_01X1fZebDm9ABFwLU2v3mq46
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
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.
Contexto
Sprint 2 de la auditoría
docs/auditoria/2026-07-02-siguiente-nivel/. Convierte el certificado firmado en algo que realmente cumple su tesis ("SLSA para QA"). Basado enmain(independiente del Sprint 1, PR #60).Cambios
D1 — Verificación PÚBLICA del certificado + clave pública
El diferenciador estaba anulado por su propia auth:
POST /certificates/verifyexigía login, así que un auditor/regulador/cliente-final no podía verificar nada. La verificación es criptografía pura (firma + payload + clave pública, nada secreto ni de ningún tenant).POST /v2/certificates/verifyahora es público (singet_current_user).GET /v2/certificates/pubkey(público) que sirve la clave pública Ed25519 para verificar offline. Declarado antes de/certificates/{run_id}para que la ruta estática gane (si no,{run_id}=pubkeylo capturaba → 401).D2 — Certificar releases en VERDE (el caso central "pasó QA")
generate()ygate.publish()abortaban con "run sin veredictos de triaje" si no había fallos → un release donde todo pasa no emitía acta ni gate, justo el caso que un cliente quiere firmar. Ahora un run verde certifica comoapto.count_failures_for_run): 0 fallos = verde (apto); fallos > 0 sin veredictos = sin triar (ValueError) — no se certifica un run sin triar.build_certificate/compute_verdictya manejabanverdicts=[](apto, risk_score=0, evidence=[]). El webhook ya enruta los runs verdes a generate/gate, así que funciona de punta a punta sin tocar el webhook.Test plan
tests/test_api_v2_certificates.py: verify accesible sin auth (200), pubkey público (200 / 503 si no hay clave).tests/test_certify_gate.py: run verde → success; run sin triar → ValueError.tests/test_certify_service_aieval.py: green run → apto/evidence=[]; sin triar → ValueError.Pendiente (Sprint 2 restante, no en este PR)
ai_evalfuera de la firma, JCS/RFC 8785). Requiere un cambio de canonicalización más profundo.https://claude.ai/code/session_01X1fZebDm9ABFwLU2v3mq46