Repository navigation
Expand file tree
/
Copy pathprogress_diff_query_ports.ts
More file actions
65 lines (62 loc) · 2.47 KB
/
Copy pathprogress_diff_query_ports.ts
File metadata and controls
65 lines (62 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
export type ProgressEvidenceProfile = 'framed-v1' | 'immutable-tree-v1';
/** Immutable repository comparison supplied by trusted code; no workspace or mutation capabilities. */
export interface ProgressRecoveryCounters {
readonly files: number;
readonly bytes: number;
readonly requests: number;
readonly treeEntries: number;
}
export interface ProgressRecoveryUsage {
readonly frames: number;
readonly current: ProgressRecoveryCounters;
readonly total: ProgressRecoveryCounters;
}
export interface ProgressPartSourceIdentity {
readonly id: string;
readonly digest: string;
readonly ordinal: number;
readonly total: number;
}
export interface ProgressEvidenceProtocol {
readonly version: ProgressEvidenceProfile;
readonly attemptId: string;
readonly preimageSha: string;
readonly sourcesDigest: string;
readonly manifestDigest: string;
readonly requiredPaths: readonly string[];
readonly unitCount: number;
readonly recovery: ProgressRecoveryUsage | null;
readonly assessmentContextDigest?: string;
}
export interface ProgressDiffPartition {
readonly id: string;
readonly paths: readonly string[];
readonly units?: readonly { readonly id: string; readonly path: string; readonly content?: Readonly<Record<string, unknown>> }[];
readonly evidence: string;
readonly sourceIdentity?: ProgressPartSourceIdentity;
}
interface ProgressDiffIdentity {
readonly baseSha: string;
readonly headSha: string;
readonly evidence: string;
}
export type ProgressDiffEvidence = ProgressDiffIdentity & (
| { readonly kind: 'single' }
| { readonly kind: 'partitioned'; readonly partitions: readonly ProgressDiffPartition[]; readonly protocol?: ProgressEvidenceProtocol }
);
export interface BoundProgressDiffQueryPort {
getDiff(baseSha: string, headSha: string): Promise<ProgressDiffEvidence>;
}
interface ProgressDiffChangeContent {
readonly path: string;
readonly status: string;
readonly patch?: string;
readonly evidence?: 'generated-metadata-only';
readonly unitId?: string;
readonly recoveredContent?: Readonly<Record<string, unknown>>;
}
/** Tree evidence has complete contents but no invented provider line statistics. */
export type ProgressDiffChange = ProgressDiffChangeContent & (
| { readonly additions: number; readonly deletions: number; readonly statistics?: never }
| { readonly statistics: 'immutable-content-only'; readonly additions?: never; readonly deletions?: never }
);