feat(reputation): add versioned outbound reputation contracts - #175
feat(reputation): add versioned outbound reputation contracts#175seonghobae wants to merge 40 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Current-head repair after fresh Task-1 contract review:
Hostile regression commit Normal exact-current workflows have materialized but are non-passing: CI |
Scope
Starts the first Wardnet-owned outbound destination-reputation implementation slice from protected
main@a52ccd0a24a727d9349bb32def7713882d8cad1e.This PR remains Draft. It adds a pure Rust, transport-neutral contract core for Wardnet's destination maliciousness / SOC evidence bounded context. It does not implement outbound transport authorization, DNS resolution, redirect/proxy/TLS policy, browser acquisition, sandbox execution, provider fetching, cross-service SQL, or mutable sibling dependencies. Executable egress authority remains with EgressWeave; this crate consumes canonical destination subjects rather than reparsing network syntax.
RED -> causal GREEN
The initial hostile contract slice covers unsupported schema/wrong direction, blank authenticated workload or purpose, ambiguous non-host subdomain scope, protect policy without required authorities, invalid evidence time/confidence, empty source eligibility, and stable exact-host fixture round-trip. The earliest temporary
pull_requestrescue runs used default checkout and therefore exercised GitHub's synthetic merge ref; they are retained only as candidate-base causal evidence, not exact source-head evidence.A later review found that
DecisionEnvelopeV1did not bind a decision to authenticatedDestinationContextV1or immutableevidence_generation; the contract now carries and validates both. Older rescue runs for that finding also used the synthetic PR merge ref, so they remain causal candidate-base evidence only.Evidence lifecycle review then found that
EvidenceRecordV1::validate_at()acceptedenforcement_eligible=trueevidence withprovenance_refs=[]. Exact-source RED85770857c0f8a5bff21dd7722960209e45b19d5f, run34018925748/ job101447782353, explicitly checked out/asserted that SHA, passed formatting, and failed onlyrejects_enforcement_evidence_without_provenance. Minimum fix71086b18d7f3cf91f1e9952a9183af6f43874811rejects it with typedMissingEnforcementProvenance; exact-source run34019072047/ job101448177910verified that SHA and passed all 8 contract tests plus the two then-existing decision-binding tests. The temporary workflow was removed.A subsequent review found the decision-side analogue: an adverse
known_maliciousorsuspiciousdecision could validate withevidence_refs=[]. An initial structural harness commit3d83ec71cba2e9e10f1b6078729cc34acf6fd070failed compile before the intended typed error existed and is not used as semantic RED. Executable exact-source REDba962a105d9e38f48cd9df206733314fd2a4b56c, run34019322175/ job101448849227, passed exact SHA assertion and formatting; all 8 contract tests plus two prior binding tests passed; onlydecision_envelope_rejects_untraceable_adverse_assessmentfailed because validation returned success. Minimum fixef8fed6edf65b14389703130000bad4769eafe4arequires nonempty evidence refs for adverse assessments and returns typedMissingDecisionEvidence;unknownstill permits the absence of adverse evidence. Exact-source run34019401076/ job101449062125asserted that SHA and passed fmt, all 8 contract tests and all 3 binding tests. The temporary workflow was removed in cleanup56292904fddbb249212c54758def26ff72b801c3.The next security review checked assessment/action consistency against the design's protect precedence.
DecisionEnvelopeV1still acceptedassessment=known_malicious, valid adverse evidence, andaction=allow, which could serialize a hard-threat assessment as a positive reputation gate. Exact-source RED7e33ee8c0086073faf1f8c4bb8cd9df62ceec5da, run34019672058/ job101449796560, explicitly checked out/asserted that SHA, passed formatting and all 8 contract tests plus the three prior binding tests, and failed onlydecision_envelope_rejects_known_malicious_allow. Minimum fix94c0ddeae6750ed4d2033b859be3472a746d03edtreats any adverse (known_maliciousorsuspicious) assessment paired withallowas typedUnsafeAdverseAllow, while preserving the separate transport-authorization boundary. Exact-source run34019753543/ job101450021347passed exact SHA assertion, formatting, all contract tests and all four decision-binding regressions. The purpose-complete rescue workflow was removed in cleanupd34cc92be22366b8e18e6a203bc6455eef52c1b1.All predecessor exact-source GREEN runs above are causal evidence only. Normal repository CI/security/coverage/review evidence must be reacquired on the current cleanup head before readiness or merge.
Contract boundary
DestinationSubjectV1is already-canonical input from its owning canonicalization boundary; this crate does not claim DNS/URL/IP/TLS canonicalization authority.Allowis not executable transport authorization and cannot override an EgressWeave denial.Repository / owner discipline
docs/product-technical-gap-baseline.md; docs(gaps): add exact-head readiness baseline #130 remains its sole writer.context-graph-contracts, EA, EgressWeave, quarantine, contextual-orchestrator, or appguardrail source.