feat(d3): violation_records write on DENY — component 2 step 5 (final)#121
Merged
Conversation
evaluate_envelope writes ONE violation_records row per DENY eval, atomic with the eval-row (same tx -> violation-write failure rolls back the eval-row, no split-state). Contract: id app-generated, adjudicator_type='evaluator', violation_type=comma-joined violated constraint types, interaction_proof_id=NULL (gated pre-action), principal_did=agent_did, reversed=false, all TEXT. ALLOW writes none. 29 server-venv tests green (4 new: deny-writes-violation, allow-no-violation, violation-failure-rolls-back-eval, multiple-constraints-one-record).
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.
Evaluator (Komponente 2) Schritt 5 — letzter Baustein. Verweist Evaluator-Brief v4 (#115).
Write-Contract
evaluate_envelopeschreibt bei Gesamt-DENY EINENviolation_records-Eintrag, atomar mit dem signierten eval-row (dieselbe Transaktion → schlägt der violation-write fehl, rollt auch das eval-row zurück, kein Split-State).idapp-generiert (viol_+uuid, kein default);adjudicator_type='evaluator';violation_type= komma-getrennte Liste der verletzten Constraint-Typen;interaction_proof_id=NULL(Evaluator gated pre-action → IPR evtl. noch nicht da);principal_did=agent_did;reversed=false;confirmed_at/created_atserver-set; alle TEXT.Design-Entscheidung: ein violation_record pro Eval (nicht pro Constraint)
Ein eval-row = eine Entscheidung → ein Verstoß-Eintrag. Mehrere verletzte Constraints werden als komma-getrennte
violation_type-Liste aggregiert (z.B.allowed_domains,max_transaction_value) + alle reasons indescription. Das hält 1:1 zur Entscheidung und vermeidet N Rows pro Eval.Tests (server-venv, 29 grün; 4 neu)
DENY→violation-row + eval-row in selber tx (adjudicator_type/principal_did/violation_type/interaction_proof_id=NULL/reversed geprüft); ALLOW→KEIN violation-row; violation-write-failure→eval-row mit-zurückgerollt (Atomarität); mehrere Constraints→ein Record mit komma-Liste.
Konformität
§3.1 + §3.2 ✅. NICHT auf Live (Code+Tests). Eine Komponente = ein PR.
Komponente 2 KOMPLETT
Migration (#116/#117) → Signing (#118) → Core (#119) → Endpoint (#120) → violation-write (dieser PR). NEXT: Komponente 3 (enforce-mode-Chokepoint) + Acceptance-Gate D-1.
🤖 Generated with Claude Code