Repository navigation
feat: Anthropic provider + /v1/messages ingress (ADR-0001 start set) - #4
Merged
Merged
Conversation
…ctable Every Nth entry's head hash is appended to a separate anchor file (Audit:AnchorPath on an independent storage domain, Audit:AnchorEvery cadence; both-or-neither, validated fail-closed). Verification requires the log to contain every anchored count with exactly the anchored hash: truncation past an anchor and coherent whole-log rewrites both fail. Rotation archives log and anchors together. ADR-0007 also records the Postgres verdict: the file stays the evidence of record; DB triggers are HA or runtime-editable config, never bundled. Tests prove the gap closure explicitly: the same truncated log passes plain verification and fails anchored verification.
- anchor failure now returns ZERO trusted entries (a coherent forgery has no trustworthy prefix); the graph projector gates on verification validity instead of discarding it — forged history can no longer be projected or aggregated - audit log write failure halts the appliance (FailFast) — serving without evidence is the thing this product exists to prevent; anchor write failure warns loudly and widens exposure by one cadence only, never killing the primary drain - rotation archives stale anchors even when the log is missing - anchor monotonicity enforced (tamper tell on the anchor file itself) - tests: restart continuity, anchors-without-log, malformed anchors, anchor-archive-not-deleted
…y + empty-return tests A forged prefix ending in a deliberate break can no longer dodge anchor comparison: anchors within the verified prefix are always evaluated, and any contradiction returns zero trusted entries. Doc comments updated; tests pin monotonicity, the empty-return contract on hash mismatch, and the walk-break-dodge attack.
Official Anthropic SDK over IChatClient, opt-in via Anthropic:ApiKey; the configured model joins the permitted set mid-list (explicit request only, never default escalation). The /v1/messages dialect works with or without the provider: x-api-key auth, string-or-block content normalization, Anthropic error taxonomy on every denial path, Messages SSE event protocol with lazy header commit. One pipeline, two dialects, cross-protocol routing (Anthropic wire in, any permitted adapter out). Tests +10: wire mapping (content forms, system, roles, response shape, error taxonomy table) and integration (401/403/502 shapes, PII fail- closed, streamed pre-flight denial stays JSON, cross-protocol route).
…text partial CI CS8785: splitting [JsonSerializable] across two partial declarations of the same JsonSerializerContext collided the source generator's hint names (CovenantJsonContext.Boolean.g.cs), which made the generator bail and left both CovenantJsonContext and AuditJsonContext without their generated members (CS0534). All registrations now live on the single attributed declaration in OpenAiContracts.cs.
…xception on double StopAsync WebApplicationFactory disposal can invoke StopAsync more than once; Channel.Writer.Complete() throws on an already-completed channel, which surfaced as flaky teardown failures in the integration tests. TryComplete is idempotent.
Registry resolves from DI (ConfigureTestServices override wins); the pipeline becomes a lazily-resolved singleton. Unlocks success paths an unroutable provider never reaches. +5 tests through the real Host with a stub provider: OpenAI buffered + SSE serving, Anthropic buffered + SSE serving (cross-protocol), served request in evidence with attributed spend. Raises coverage over response building, SSE emission, attribution.
…ernance logic) The runsettings landed on main via the CI PR; this branch predated it, so local coverage runs errored on the missing file. Identical content — dedupes on merge.
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.
Official Anthropic SDK over IChatClient (opt-in via Anthropic:ApiKey; the model joins the permitted set mid-list, explicit-request only, never default escalation). The /v1/messages dialect works with or without the provider: x-api-key auth (Bearer fallback), string-or-block content normalization, Anthropic error taxonomy on every denial, Messages SSE event protocol with lazy header commit. One pipeline, two dialects, cross-protocol routing. 15 tests: wire mapping, SSE event well-formedness (parsed), error taxonomy, and integration (401/403/502 shapes, PII fail-closed, streamed pre-flight stays JSON, Bearer fallback, cross-protocol route). Verifier agent: APPROVE; both should-fixes (SSE-JSON coverage, Bearer test) closed.