archctx-contracts 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fixtures/boundary/agent-job-expired.json +33 -0
- package/fixtures/boundary/architecture-event-extension.json +41 -0
- package/fixtures/boundary/architecture-node-extension.json +13 -0
- package/fixtures/boundary/attestation-v2-error.json +43 -0
- package/fixtures/boundary/check-delivery-dead-letter.json +14 -0
- package/fixtures/boundary/evidence-binding-context-only.json +20 -0
- package/fixtures/boundary/practice-disabled-overlay.json +59 -0
- package/fixtures/boundary/recommendation-deferred.json +19 -0
- package/fixtures/boundary/review-challenge-v2-organization.json +15 -0
- package/fixtures/boundary/runner-identity-organization-scope.json +16 -0
- package/fixtures/invalid/adapter-fidelity-reverse-sync.json +9 -0
- package/fixtures/invalid/agent-job-direct-mutation.json +32 -0
- package/fixtures/invalid/architecture-event-source-body-field.json +39 -0
- package/fixtures/invalid/architecture-snapshot-unknown-mode.json +29 -0
- package/fixtures/invalid/attestation-v2-finding-field.json +39 -0
- package/fixtures/invalid/check-delivery-legacy-check-name.json +14 -0
- package/fixtures/invalid/cloud-egress-envelope-private-field.json +12 -0
- package/fixtures/invalid/compatibility-illegal-reason.json +17 -0
- package/fixtures/invalid/evidence-binding-summary-substring-authority.json +17 -0
- package/fixtures/invalid/evidence-item-source-body-field.json +27 -0
- package/fixtures/invalid/explorer-projection-write-field.json +21 -0
- package/fixtures/invalid/investigation-report-direct-mutation.json +38 -0
- package/fixtures/invalid/investigation-report-missing-proposed-delta.json +19 -0
- package/fixtures/invalid/node-unknown-field.json +10 -0
- package/fixtures/invalid/notification-event-code-field.json +11 -0
- package/fixtures/invalid/practice-policy-empty-test-evidence.json +15 -0
- package/fixtures/invalid/practice-policy-negative-recommendation-budget.json +10 -0
- package/fixtures/invalid/practice-unknown-field.json +56 -0
- package/fixtures/invalid/projection-target-invalid-ownership.json +18 -0
- package/fixtures/invalid/recommendation-feedback-implicit-acceptance.json +29 -0
- package/fixtures/invalid/recommendation-run-raw-input-field.json +33 -0
- package/fixtures/invalid/recommendation-source-body-field.json +17 -0
- package/fixtures/invalid/review-challenge-v2-private-field.json +16 -0
- package/fixtures/valid/adapter-fidelity.json +9 -0
- package/fixtures/valid/agent-job.json +33 -0
- package/fixtures/valid/architecture-candidate-delta-policy.json +45 -0
- package/fixtures/valid/architecture-candidate-delta.json +188 -0
- package/fixtures/valid/architecture-event.json +39 -0
- package/fixtures/valid/architecture-intervention.json +36 -0
- package/fixtures/valid/architecture-node.json +25 -0
- package/fixtures/valid/architecture-relation.json +14 -0
- package/fixtures/valid/architecture-snapshot.json +31 -0
- package/fixtures/valid/architecture-subject-selector.json +9 -0
- package/fixtures/valid/attestation-v2.json +38 -0
- package/fixtures/valid/attestation.json +25 -0
- package/fixtures/valid/changeset.json +30 -0
- package/fixtures/valid/chatgpt-ga-tool.json +9 -0
- package/fixtures/valid/check-delivery.json +14 -0
- package/fixtures/valid/cloud-egress-envelope.json +11 -0
- package/fixtures/valid/compatibility-contract.json +19 -0
- package/fixtures/valid/constraint.json +22 -0
- package/fixtures/valid/cross-repo-relation.json +23 -0
- package/fixtures/valid/device-identity.json +10 -0
- package/fixtures/valid/entitlement.json +12 -0
- package/fixtures/valid/evidence-binding.json +17 -0
- package/fixtures/valid/evidence-item.json +29 -0
- package/fixtures/valid/explorer-projection.json +53 -0
- package/fixtures/valid/explorer-service.json +11 -0
- package/fixtures/valid/external-document-resource.json +29 -0
- package/fixtures/valid/governance-key-status.json +11 -0
- package/fixtures/valid/investigation-report.json +38 -0
- package/fixtures/valid/landscape.json +36 -0
- package/fixtures/valid/likec4-mapping.json +14 -0
- package/fixtures/valid/notification-event.json +10 -0
- package/fixtures/valid/notification-provider.json +12 -0
- package/fixtures/valid/org-runner-identity.json +10 -0
- package/fixtures/valid/practice-catalog-manifest.json +16 -0
- package/fixtures/valid/practice-check-result.json +17 -0
- package/fixtures/valid/practice-checkpoint.json +94 -0
- package/fixtures/valid/practice-guidance.json +42 -0
- package/fixtures/valid/practice-match.json +23 -0
- package/fixtures/valid/practice-policy.json +33 -0
- package/fixtures/valid/practice-profile.json +22 -0
- package/fixtures/valid/practice-source.json +19 -0
- package/fixtures/valid/practice-waiver.json +14 -0
- package/fixtures/valid/practice.json +93 -0
- package/fixtures/valid/product-version-manifest.json +51 -0
- package/fixtures/valid/projection-target.json +18 -0
- package/fixtures/valid/recommendation-feedback.json +29 -0
- package/fixtures/valid/recommendation-run.json +33 -0
- package/fixtures/valid/recommendation.json +17 -0
- package/fixtures/valid/retrieval-config.json +20 -0
- package/fixtures/valid/retrieval-decision.json +26 -0
- package/fixtures/valid/retrieval-eval.json +14 -0
- package/fixtures/valid/review-challenge-v2.json +15 -0
- package/fixtures/valid/review-result.json +32 -0
- package/fixtures/valid/runner-identity.json +13 -0
- package/fixtures/valid/structurizr-mapping.json +15 -0
- package/fixtures/valid/task-context.json +23 -0
- package/package.json +17 -0
- package/src/control-plane-routes.ts +35 -0
- package/src/external-docs.ts +137 -0
- package/src/github-governance.ts +850 -0
- package/src/index.ts +9 -0
- package/src/ledger.ts +649 -0
- package/src/ports.ts +385 -0
- package/src/practices.ts +433 -0
- package/src/product-version.ts +108 -0
- package/src/schema.ts +145 -0
- package/src/validator.ts +95 -0
package/src/ports.ts
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import type { Json } from "./schema";
|
|
2
|
+
import type {
|
|
3
|
+
AgentJobV1,
|
|
4
|
+
ArchitectureEventSource,
|
|
5
|
+
ArchitectureRepositoryIdentityV1,
|
|
6
|
+
ArchitectureWorktreeIdentityV1,
|
|
7
|
+
InvestigationReportV1
|
|
8
|
+
} from "./ledger";
|
|
9
|
+
|
|
10
|
+
export interface WorkspaceRef {
|
|
11
|
+
root: string;
|
|
12
|
+
repositoryId: string;
|
|
13
|
+
headSha: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface RepositorySnapshot {
|
|
17
|
+
repositoryId: string;
|
|
18
|
+
headSha: string;
|
|
19
|
+
worktreeDigest: string;
|
|
20
|
+
modelDigest?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface CodeFactsSnapshot {
|
|
24
|
+
provider: "codegraph";
|
|
25
|
+
version: string;
|
|
26
|
+
schemaDigest: string;
|
|
27
|
+
indexedAt: string;
|
|
28
|
+
workspaceDigest: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface NormalizedSymbol {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
kind: string;
|
|
35
|
+
path: string;
|
|
36
|
+
range?: { startLine: number; endLine: number };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface NormalizedEdge {
|
|
40
|
+
source: string;
|
|
41
|
+
target: string;
|
|
42
|
+
kind: "calls" | "imports" | "reads" | "writes" | "implements";
|
|
43
|
+
confidence: "low" | "medium" | "high";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ObservedEvidencePolarity = "positive" | "absence" | "declaration";
|
|
47
|
+
export type ObservedEvidenceSupport = "recommendation" | "checkpoint" | "complete";
|
|
48
|
+
|
|
49
|
+
export interface ObservedEvidenceCoverage {
|
|
50
|
+
level: PracticeEvidenceBindingCoverageLevel;
|
|
51
|
+
scope: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ObservedEvidence {
|
|
55
|
+
id: string;
|
|
56
|
+
selector: SourceSelector;
|
|
57
|
+
summary: string;
|
|
58
|
+
confidence: "heuristic" | "observed" | "verified";
|
|
59
|
+
polarity?: ObservedEvidencePolarity;
|
|
60
|
+
coverage?: ObservedEvidenceCoverage;
|
|
61
|
+
supports?: ObservedEvidenceSupport[];
|
|
62
|
+
snapshot: RepositorySnapshot;
|
|
63
|
+
practiceBindings?: PracticeEvidenceBinding[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type PracticeEvidenceBindingProvenance =
|
|
67
|
+
| "codegraph"
|
|
68
|
+
| "model-store-yaml"
|
|
69
|
+
| "checkpoint"
|
|
70
|
+
| "runtime-daemon"
|
|
71
|
+
| "user"
|
|
72
|
+
| "subagent"
|
|
73
|
+
| "external-doc";
|
|
74
|
+
|
|
75
|
+
export type PracticeEvidenceBindingCoverageLevel = "complete" | "partial" | "unknown";
|
|
76
|
+
|
|
77
|
+
export interface PracticeEvidenceBindingCoverage {
|
|
78
|
+
level: PracticeEvidenceBindingCoverageLevel;
|
|
79
|
+
scope: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface PracticeEvidenceBinding {
|
|
83
|
+
practiceId: string;
|
|
84
|
+
triggerId?: string;
|
|
85
|
+
subject?: string;
|
|
86
|
+
provenance: PracticeEvidenceBindingProvenance;
|
|
87
|
+
coverage: PracticeEvidenceBindingCoverage;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface NormalizedCodeContext {
|
|
91
|
+
task: string;
|
|
92
|
+
symbols: NormalizedSymbol[];
|
|
93
|
+
edges: NormalizedEdge[];
|
|
94
|
+
evidence: ObservedEvidence[];
|
|
95
|
+
digest: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface NormalizedImpact {
|
|
99
|
+
symbolId: string;
|
|
100
|
+
callers: NormalizedEdge[];
|
|
101
|
+
callees: NormalizedEdge[];
|
|
102
|
+
affectedPaths: string[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface SymbolQuery {
|
|
106
|
+
query: string;
|
|
107
|
+
kinds?: string[];
|
|
108
|
+
limit?: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ImpactQuery {
|
|
112
|
+
symbolId: string;
|
|
113
|
+
depth: number;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface SourceSelector {
|
|
117
|
+
path: string;
|
|
118
|
+
symbolId?: string;
|
|
119
|
+
startLine?: number;
|
|
120
|
+
endLine?: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface CodeFactsPort {
|
|
124
|
+
ensureReady(workspace: WorkspaceRef): Promise<CodeFactsSnapshot>;
|
|
125
|
+
sync(input: { workspace: WorkspaceRef; changedPaths?: string[] }): Promise<CodeFactsSnapshot>;
|
|
126
|
+
buildTaskContext(input: { task: string; maxSymbols: number; includeSource: boolean; changedPaths?: string[] }): Promise<NormalizedCodeContext>;
|
|
127
|
+
findSymbols(query: SymbolQuery): Promise<NormalizedSymbol[]>;
|
|
128
|
+
getImpact(input: ImpactQuery): Promise<NormalizedImpact>;
|
|
129
|
+
getCallers(symbolId: string): Promise<NormalizedEdge[]>;
|
|
130
|
+
getCallees(symbolId: string): Promise<NormalizedEdge[]>;
|
|
131
|
+
resolveEvidence(selectors: SourceSelector[]): Promise<ObservedEvidence[]>;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface LocalStorePort {
|
|
135
|
+
migrate(): Promise<void>;
|
|
136
|
+
beginSnapshot(snapshot: RepositorySnapshot): Promise<string>;
|
|
137
|
+
commitSnapshot(snapshotId: string): Promise<void>;
|
|
138
|
+
saveTaskState(taskSessionId: string, state: unknown): Promise<void>;
|
|
139
|
+
readTaskState(taskSessionId: string): Promise<unknown | undefined>;
|
|
140
|
+
saveReviewResult(reviewId: string, result: unknown): Promise<void>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface ModelStorePort {
|
|
144
|
+
loadManifest(workspace: WorkspaceRef): Promise<unknown>;
|
|
145
|
+
loadModel(workspace: WorkspaceRef): Promise<unknown[]>;
|
|
146
|
+
validateModel(workspace: WorkspaceRef): Promise<{ valid: boolean; errors: string[]; modelDigest: string }>;
|
|
147
|
+
writeChangeSetPreview(changeSet: unknown): Promise<{ digest: string; summary: string }>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface PolicyPort {
|
|
151
|
+
evaluateChangeSet(changeSet: unknown): Promise<{ allowed: boolean; violations: string[] }>;
|
|
152
|
+
evaluateReview(input: unknown): Promise<{ result: "pass" | "fail"; findings: unknown[] }>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export type InvestigationContextRisk = "low" | "medium" | "high";
|
|
156
|
+
export type InvestigationContextUncertainty = "low" | "medium" | "high";
|
|
157
|
+
|
|
158
|
+
export interface InvestigationContextBundle {
|
|
159
|
+
schemaVersion: "archcontext.investigation-context-bundle/v1";
|
|
160
|
+
repository: ArchitectureRepositoryIdentityV1;
|
|
161
|
+
worktree: ArchitectureWorktreeIdentityV1;
|
|
162
|
+
taskSessionId: string;
|
|
163
|
+
fingerprint: string;
|
|
164
|
+
trigger: {
|
|
165
|
+
source: ArchitectureEventSource;
|
|
166
|
+
reason: string;
|
|
167
|
+
};
|
|
168
|
+
risk: InvestigationContextRisk;
|
|
169
|
+
uncertainty: InvestigationContextUncertainty;
|
|
170
|
+
summary: string;
|
|
171
|
+
evidenceBindingIds: string[];
|
|
172
|
+
candidateChangeIds: string[];
|
|
173
|
+
inputDigest: string;
|
|
174
|
+
extensions?: Record<string, Json>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface InvestigationRunnerInput {
|
|
178
|
+
job: AgentJobV1;
|
|
179
|
+
context: InvestigationContextBundle;
|
|
180
|
+
maxOutputBytes?: number;
|
|
181
|
+
signal?: AbortSignal;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface InvestigationRunnerPort {
|
|
185
|
+
readonly runnerId: string;
|
|
186
|
+
readonly capabilities: {
|
|
187
|
+
provider: string;
|
|
188
|
+
supportsCancellation: boolean;
|
|
189
|
+
canReadRepositoryText: boolean;
|
|
190
|
+
canMutateRepository: false;
|
|
191
|
+
};
|
|
192
|
+
runInvestigation(input: InvestigationRunnerInput): Promise<InvestigationReportV1>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface RendererPort {
|
|
196
|
+
renderProjection(input: { modelDigest: string; model: unknown[] }): Promise<{ path: string; content: string }[]>;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface CloudMetadataPort {
|
|
200
|
+
verifyEntitlement(input: { repositoryVisibility: "public" | "private"; accountId?: string }): Promise<{ allowed: boolean; reason?: string }>;
|
|
201
|
+
submitAttestation(input: unknown): Promise<{ accepted: boolean; checkRunId?: string; reason?: string }>;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export type NotificationResult = "pass" | "pass_with_warnings" | "fail_action_required";
|
|
205
|
+
export type NotificationRiskLevel = "low" | "medium" | "high" | "critical";
|
|
206
|
+
export type NotificationProviderKind = "github-check" | "slack" | "webhook" | "email";
|
|
207
|
+
|
|
208
|
+
export interface NotificationEvent {
|
|
209
|
+
schemaVersion: "archcontext.notification-event/v1";
|
|
210
|
+
eventId: string;
|
|
211
|
+
prUrl: string;
|
|
212
|
+
result: NotificationResult;
|
|
213
|
+
riskLevel: NotificationRiskLevel;
|
|
214
|
+
commitSha: string;
|
|
215
|
+
runtimeVersion: string;
|
|
216
|
+
occurredAt: string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface NotificationProviderConfig {
|
|
220
|
+
schemaVersion: "archcontext.notification-provider/v1";
|
|
221
|
+
id: string;
|
|
222
|
+
provider: NotificationProviderKind;
|
|
223
|
+
enabled: boolean;
|
|
224
|
+
target: string;
|
|
225
|
+
secretRef?: string;
|
|
226
|
+
unsubscribeUrl?: string;
|
|
227
|
+
retry: {
|
|
228
|
+
maxAttempts: number;
|
|
229
|
+
backoffSeconds: number;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export interface NotificationDeliveryResult {
|
|
234
|
+
providerId: string;
|
|
235
|
+
delivered: boolean;
|
|
236
|
+
idempotencyKey: string;
|
|
237
|
+
attempt: number;
|
|
238
|
+
statusCode?: number;
|
|
239
|
+
deadLettered?: boolean;
|
|
240
|
+
reason?: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface NotificationPublisher {
|
|
244
|
+
publish(event: NotificationEvent): Promise<NotificationDeliveryResult[]>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface ModelProjectionFile {
|
|
248
|
+
path: string;
|
|
249
|
+
content: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface ModelExportResult {
|
|
253
|
+
format: "likec4" | "structurizr" | "mermaid";
|
|
254
|
+
digest: string;
|
|
255
|
+
files: ModelProjectionFile[];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface ModelInteropExporter {
|
|
259
|
+
exportModel(input: { nodes: Json[]; relations: Json[] }): Promise<ModelExportResult>;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface ModelInteropImporter {
|
|
263
|
+
importInitialModel(input: { content: string; source: "likec4" | "structurizr" }): Promise<{ nodes: Json[]; relations: Json[]; warnings: string[] }>;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export type ExplorerVerificationStatus = "MATCHED" | "DRIFT" | "UNKNOWN" | "VERIFIED";
|
|
267
|
+
export type ExplorerPressureLevel = "low" | "medium" | "high";
|
|
268
|
+
|
|
269
|
+
export interface ExplorerNodeView {
|
|
270
|
+
id: string;
|
|
271
|
+
name: string;
|
|
272
|
+
kind: string;
|
|
273
|
+
repositoryId?: string;
|
|
274
|
+
verificationStatus: ExplorerVerificationStatus;
|
|
275
|
+
pressure: {
|
|
276
|
+
level: ExplorerPressureLevel;
|
|
277
|
+
score: number;
|
|
278
|
+
signals: string[];
|
|
279
|
+
};
|
|
280
|
+
sourceSelectors: SourceSelector[];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface ExplorerRelationView {
|
|
284
|
+
id: string;
|
|
285
|
+
source: string;
|
|
286
|
+
target: string;
|
|
287
|
+
kind: string;
|
|
288
|
+
verificationStatus: ExplorerVerificationStatus;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface ExplorerProjection {
|
|
292
|
+
schemaVersion: "archcontext.explorer-projection/v1";
|
|
293
|
+
generatedAt: string;
|
|
294
|
+
repository: RepositorySnapshot;
|
|
295
|
+
nodes: ExplorerNodeView[];
|
|
296
|
+
relations: ExplorerRelationView[];
|
|
297
|
+
landscape?: Json;
|
|
298
|
+
verification: Json[];
|
|
299
|
+
pressure: Json[];
|
|
300
|
+
interventions: Json[];
|
|
301
|
+
capabilities: {
|
|
302
|
+
readOnly: true;
|
|
303
|
+
mutationMode: "forbidden";
|
|
304
|
+
egress: "none";
|
|
305
|
+
tokenRequired: boolean;
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface ExplorerServiceContract {
|
|
310
|
+
schemaVersion: "archcontext.explorer-service/v1";
|
|
311
|
+
bindHost: "127.0.0.1";
|
|
312
|
+
protocol: "http-loopback";
|
|
313
|
+
optIn: true;
|
|
314
|
+
defaultEnabled: false;
|
|
315
|
+
tokenTtlSeconds: number;
|
|
316
|
+
readOnly: true;
|
|
317
|
+
allowedMethods: ["GET"];
|
|
318
|
+
egress: "none";
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export interface RetrievalConfig {
|
|
322
|
+
schemaVersion: "archcontext.retrieval-config/v1";
|
|
323
|
+
defaultMode: "lexical";
|
|
324
|
+
lexical: {
|
|
325
|
+
enabled: true;
|
|
326
|
+
tokenizer: "english-normalized+jieba-search";
|
|
327
|
+
};
|
|
328
|
+
embedding: {
|
|
329
|
+
enabled: boolean;
|
|
330
|
+
provider: "local-deterministic" | "local-provider";
|
|
331
|
+
dimensions: number;
|
|
332
|
+
indexPath?: string;
|
|
333
|
+
egress: "forbidden";
|
|
334
|
+
};
|
|
335
|
+
decisionGate: RetrievalDecisionThresholds;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface RetrievalEvalQuery {
|
|
339
|
+
id: string;
|
|
340
|
+
text: string;
|
|
341
|
+
expectedContextIds: string[];
|
|
342
|
+
expectedConstraintIds: string[];
|
|
343
|
+
prohibitedContextIds: string[];
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface RetrievalEvalSet {
|
|
347
|
+
schemaVersion: "archcontext.retrieval-eval/v1";
|
|
348
|
+
id: string;
|
|
349
|
+
seed: number;
|
|
350
|
+
queries: RetrievalEvalQuery[];
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export interface RetrievalScore {
|
|
354
|
+
contextRecall: number;
|
|
355
|
+
constraintRecall: number;
|
|
356
|
+
irrelevantRatio: number;
|
|
357
|
+
toolCalls: number;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface RetrievalDecisionThresholds {
|
|
361
|
+
minContextRecallLift: number;
|
|
362
|
+
minConstraintRecallLift: number;
|
|
363
|
+
maxIrrelevantRatio: number;
|
|
364
|
+
maxToolCallIncrease: number;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface RetrievalDecisionRecord {
|
|
368
|
+
schemaVersion: "archcontext.retrieval-decision/v1";
|
|
369
|
+
decidedAt: string;
|
|
370
|
+
baseline: RetrievalScore & { mode: "lexical" };
|
|
371
|
+
candidate: RetrievalScore & { mode: "embedding" };
|
|
372
|
+
thresholds: RetrievalDecisionThresholds;
|
|
373
|
+
decision: "enable-embedding" | "keep-lexical";
|
|
374
|
+
evidenceDigest: string;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export interface ChatGptGaToolContract {
|
|
378
|
+
schemaVersion: "archcontext.chatgpt-ga-tool/v1";
|
|
379
|
+
toolName: string;
|
|
380
|
+
surface: "cloud-metadata" | "local-runtime";
|
|
381
|
+
readOnlyByDefault: boolean;
|
|
382
|
+
dataClassification: "cloud-metadata" | "local-metadata" | "local-architecture";
|
|
383
|
+
requiresLocalConfirmationForWrite: boolean;
|
|
384
|
+
disclosure: string;
|
|
385
|
+
}
|