{"version":3,"file":"evidence-mapping.d.ts","sourceRoot":"","sources":["../../../src/core/reliability/evidence-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACX,+BAA+B,EAC/B,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,WAAW,qBAAqB;IACrC,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,+BAA+B,CAAC;IAC3C,UAAU,EAAE,wBAAwB,CAAC;IACrC,SAAS,EAAE,qBAAqB,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,+BAA+B,GAAG,MAAM,CAElF;AAED,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE,qBAAqB,CA6DrF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,gBAAgB,GAAG,mBAAmB,EAAE,CASxF","sourcesContent":["/**\n * Mapping between Reliability Kernel verification kinds and the durable\n * Long-Horizon evidence/authority model.\n *\n * This single table keeps the runtime evidence type, the ledger evidence type,\n * the evidence authority classification, and the required trusted capability in\n * agreement so that deterministic verification evidence is always authoritative\n * (never an agent claim) and always satisfies the criterion's requiredEvidence.\n */\n\nimport type {\n\tEvidenceAuthorityClassification,\n\tEvidenceCollectorType,\n\tEvidenceLedgerCapability,\n\tEvidenceRequirement,\n} from \"../long-horizon/index.js\";\nimport type { VerificationKind } from \"./types.js\";\n\nexport interface LedgerEvidenceMapping {\n\t/** Ledger evidence `type` string (matches the ledger's authority derivation). */\n\tledgerType: string;\n\tauthority: EvidenceAuthorityClassification;\n\tcapability: EvidenceLedgerCapability;\n\tcollector: EvidenceCollectorType;\n}\n\n/**\n * Trusted evidence source ids must be unique per grant (one source id → one\n * grant). We derive a stable, authority-scoped source id for runtime evidence.\n */\nexport function runtimeSourceId(authority: EvidenceAuthorityClassification): string {\n\treturn `runtime:${authority}`;\n}\n\nexport const VERIFICATION_EVIDENCE_MAP: Record<VerificationKind, LedgerEvidenceMapping> = {\n\tcommand: {\n\t\tledgerType: \"command-result\",\n\t\tauthority: \"command-result\",\n\t\tcapability: \"evidence:command-result\",\n\t\tcollector: \"build-system\",\n\t},\n\ttest: {\n\t\tledgerType: \"test-result\",\n\t\tauthority: \"test-result\",\n\t\tcapability: \"evidence:test-result\",\n\t\tcollector: \"test-runner\",\n\t},\n\tbuild: {\n\t\tledgerType: \"build-result\",\n\t\tauthority: \"command-result\",\n\t\tcapability: \"evidence:command-result\",\n\t\tcollector: \"build-system\",\n\t},\n\tlint: {\n\t\tledgerType: \"runtime-observation\",\n\t\tauthority: \"runtime-observation\",\n\t\tcapability: \"evidence:runtime-observation\",\n\t\tcollector: \"trusted-collector\",\n\t},\n\ttypecheck: {\n\t\tledgerType: \"runtime-observation\",\n\t\tauthority: \"runtime-observation\",\n\t\tcapability: \"evidence:runtime-observation\",\n\t\tcollector: \"trusted-collector\",\n\t},\n\tfile_exists: {\n\t\tledgerType: \"file-change\",\n\t\tauthority: \"repository-observation\",\n\t\tcapability: \"evidence:repository-observation\",\n\t\tcollector: \"repository-scanner\",\n\t},\n\tfile_absent: {\n\t\tledgerType: \"file-change\",\n\t\tauthority: \"repository-observation\",\n\t\tcapability: \"evidence:repository-observation\",\n\t\tcollector: \"repository-scanner\",\n\t},\n\tfile_contains: {\n\t\tledgerType: \"file-change\",\n\t\tauthority: \"repository-observation\",\n\t\tcapability: \"evidence:repository-observation\",\n\t\tcollector: \"repository-scanner\",\n\t},\n\tsearch_no_matches: {\n\t\tledgerType: \"repository-state\",\n\t\tauthority: \"repository-observation\",\n\t\tcapability: \"evidence:repository-observation\",\n\t\tcollector: \"repository-scanner\",\n\t},\n\tgit_diff_scope: {\n\t\tledgerType: \"file-change\",\n\t\tauthority: \"repository-observation\",\n\t\tcapability: \"evidence:repository-observation\",\n\t\tcollector: \"repository-scanner\",\n\t},\n};\n\n/**\n * Derive the durable ledger `requiredEvidence` for a verification kind. This is\n * what makes a criterion satisfiable only by authoritative, matching evidence.\n */\nexport function evidenceRequirementForKind(kind: VerificationKind): EvidenceRequirement[] {\n\tconst mapping = VERIFICATION_EVIDENCE_MAP[kind];\n\treturn [\n\t\t{\n\t\t\tallowedTypes: [mapping.ledgerType],\n\t\t\tminAuthority: mapping.authority,\n\t\t\tminPassingStatus: \"pass\",\n\t\t},\n\t];\n}\n"]}