feat: complete evidence restructuring worktree
This commit is contained in:
@@ -313,7 +313,11 @@ function copyS3Evidence(value: unknown): EvidenceSource | undefined {
|
||||
}
|
||||
|
||||
function copyEvidence(value: unknown, id: string): WorkspaceEvidence | undefined {
|
||||
const source = exactRecord(value, ["source", "policy"]);
|
||||
// The backend's canonical YAML parser materializes the evidence schema version
|
||||
// in responses, even though the browser draft does not need to retain it.
|
||||
const source = exactRecord(value, ["schema_version", "source", "policy"]);
|
||||
const schemaVersion = source?.schema_version;
|
||||
if (!source) return undefined;
|
||||
if (!source) return undefined;
|
||||
const type = record(source.source)?.type;
|
||||
const evidenceSource = type === "filesystem"
|
||||
@@ -324,7 +328,9 @@ function copyEvidence(value: unknown, id: string): WorkspaceEvidence | undefined
|
||||
? copyS3Evidence(source.source)
|
||||
: undefined;
|
||||
const policy = copyEvidencePolicy(source.policy);
|
||||
return evidenceSource && policy ? { source: evidenceSource, policy } : undefined;
|
||||
return (schemaVersion === 1 || schemaVersion === 2) && evidenceSource && policy
|
||||
? { source: evidenceSource, policy }
|
||||
: undefined;
|
||||
}
|
||||
|
||||
function oneOf<T extends string>(value: unknown, choices: readonly T[]): T | undefined {
|
||||
|
||||
Reference in New Issue
Block a user