fix(reconstruction): qualify original process evidence at its owner
This commit is contained in:
1 parent
3914e72f1b
commit
a5de93a214
4 files changed
+85
-8
No files matched your search
@@ -17,6 +17,11 @@ input Evidence bundle. Contradictions, duplicate definitions or owners,
|
||||
residual unknowns, missing dependencies, and unavailable authority keep closure
|
||||
open or failed.
|
||||
|
||||
Original process authority requires observed `controlled-replay` Evidence with
|
||||
a supported process-capture provider and a valid capture payload. A matching
|
||||
operation or predicate alone does not establish that authority, including for
|
||||
reviewed obligations and manifest original cases.
|
||||
|
||||
Every fixture and verifier proof must bind its outcome to the exact owner
|
||||
implementation digest and obligation revision being evaluated. See
|
||||
[proof applicability](#proof-applicability) for the caller-produced contract.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { err, ok, type Result } from "../domain/result.js";
|
||||
import { parseProcessCaptureEvidence } from "./process/ProcessEvidence.js";
|
||||
import {
|
||||
reconstructionObligationProofSchema,
|
||||
type ReconstructionObligationProof,
|
||||
@@ -166,8 +167,8 @@ export const evidenceSupportsOriginalAuthority = (
|
||||
);
|
||||
if (authority === "process")
|
||||
return (
|
||||
evidence.operation === "capture_process_scenario" &&
|
||||
evidence.predicate_type === "rea.process-capture"
|
||||
evidence.authority === "controlled-replay" &&
|
||||
parseProcessCaptureEvidence(evidence).ok
|
||||
);
|
||||
return evidence.authority === "external-service";
|
||||
};
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
} from "../domain/reconstructionObligationLedgerSchemas.js";
|
||||
import { parseApplicationGraphEvidence } from "./javascript/JavaScriptApplicationEvidenceGraph.js";
|
||||
import { parseProcessCaptureEvidence } from "./process/ProcessEvidence.js";
|
||||
import { evidenceSupportsOriginalAuthority } from "./ReconstructionObligationAuthority.js";
|
||||
import {
|
||||
applicationObligationPolicy,
|
||||
semanticObligationPolicy,
|
||||
@@ -396,12 +397,7 @@ const graphReference = (
|
||||
const reviewedEvidenceState = (
|
||||
evidence: Evidence,
|
||||
): ReconstructionObligation["authority_references"][number]["state"] => {
|
||||
if (
|
||||
evidence.operation === "capture_process_scenario" &&
|
||||
evidence.predicate_type === "rea.process-capture" &&
|
||||
evidence.confidence === "observed"
|
||||
)
|
||||
return "observed";
|
||||
if (evidenceSupportsOriginalAuthority(evidence, "process")) return "observed";
|
||||
if (
|
||||
evidence.authority === "external-service" &&
|
||||
evidence.confidence === "observed"
|
||||
|
||||
@@ -12,7 +12,82 @@ import {
|
||||
import { createEvidence } from "../domain/evidence.js";
|
||||
import type { ReviewedReconstructionObligation } from "../domain/reconstructionObligationLedgerSchemas.js";
|
||||
|
||||
const registerOriginalProcessAuthorityCases = (): void => {
|
||||
it.each([
|
||||
{ kind: "controlled capture", defect: null, qualifies: true },
|
||||
{ kind: "static authority", defect: "authority", qualifies: false },
|
||||
{ kind: "foreign provider", defect: "provider", qualifies: false },
|
||||
{ kind: "malformed capture", defect: "payload", qualifies: false },
|
||||
] as const)(
|
||||
"qualifies original process authority for $kind",
|
||||
({ defect, qualifies }) => {
|
||||
const capture = processEvidence();
|
||||
const original = createEvidence(
|
||||
undefined,
|
||||
defect === "provider"
|
||||
? { id: "foreign", name: "Foreign observer", version: "1" }
|
||||
: capture.provider,
|
||||
{
|
||||
predicateType: capture.predicate_type,
|
||||
operation: capture.operation,
|
||||
parameters: {},
|
||||
result: defect === "payload" ? {} : capture.normalized_result,
|
||||
confidence: "observed",
|
||||
authority:
|
||||
defect === "authority" ? "shipped-artifact" : "controlled-replay",
|
||||
},
|
||||
);
|
||||
const reviewed = {
|
||||
...reviewedObligation("obl.reviewed.process", original.evidence_id),
|
||||
required_original_authority: "process" as const,
|
||||
};
|
||||
const result = build(
|
||||
request([original], {
|
||||
reviewed_obligations: [reviewed],
|
||||
manifest: {
|
||||
bindings: [
|
||||
{
|
||||
obligation_id: reviewed.obligation_id,
|
||||
owner: {
|
||||
module_path: "src/processOwner.ts",
|
||||
symbol: "runProcess",
|
||||
owner_sha256: "5".repeat(64),
|
||||
},
|
||||
parser_type: null,
|
||||
original_cases: [
|
||||
{
|
||||
kind: "positive",
|
||||
evidence_id: original.evidence_id,
|
||||
location: "/normalized_result/exit",
|
||||
},
|
||||
],
|
||||
fixtures: [],
|
||||
verifier: null,
|
||||
},
|
||||
],
|
||||
contradictions: [],
|
||||
},
|
||||
}),
|
||||
);
|
||||
const obligation = result.obligations.find(
|
||||
({ obligation_id }) => obligation_id === reviewed.obligation_id,
|
||||
);
|
||||
expect(obligation).toBeDefined();
|
||||
const diagnostics = new Set(
|
||||
obligation?.diagnostics.map(({ code }) => code),
|
||||
);
|
||||
expect(diagnostics.has("static-only")).toBe(!qualifies);
|
||||
expect(diagnostics.has("weak-original-case-authority")).toBe(!qualifies);
|
||||
expect(obligation?.authority_references[0]?.state === "observed").toBe(
|
||||
qualifies,
|
||||
);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
describe("reconstruction obligation ledger", () => {
|
||||
registerOriginalProcessAuthorityCases();
|
||||
|
||||
it("does not authenticate packaged-process proof with generic replay evidence", () => {
|
||||
const capture = processEvidence();
|
||||
const proof = proofEvidence("generic-packaged");
|
||||
|
||||
Reference in new issue
Block a user