@skill-harness/adapters 0.12.0 → 0.13.0

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.
Files changed (103) hide show
  1. package/dist/archive-access.d.ts +58 -0
  2. package/dist/archive-access.js +61 -0
  3. package/dist/archive-checkpoint.d.ts +47 -0
  4. package/dist/archive-checkpoint.js +116 -0
  5. package/dist/archive-facts.d.ts +19 -0
  6. package/dist/archive-facts.js +20 -0
  7. package/dist/archive-observer.d.ts +21 -0
  8. package/dist/archive-observer.js +79 -0
  9. package/dist/archive-policy.d.ts +107 -0
  10. package/dist/archive-policy.js +135 -0
  11. package/dist/archive-read-capability.d.ts +49 -0
  12. package/dist/archive-read-capability.js +45 -0
  13. package/dist/archive-retention-policy.d.ts +52 -0
  14. package/dist/archive-retention-policy.js +49 -0
  15. package/dist/archived-work.d.ts +44 -0
  16. package/dist/archived-work.js +59 -0
  17. package/dist/blind-intervention.d.ts +29 -0
  18. package/dist/blind-intervention.js +211 -0
  19. package/dist/codex-diagnostic-model.d.ts +14 -0
  20. package/dist/codex-diagnostic-model.js +39 -0
  21. package/dist/codex-host-observer.d.ts +111 -0
  22. package/dist/codex-host-observer.js +309 -0
  23. package/dist/codex-https.d.ts +7 -0
  24. package/dist/codex-https.js +221 -0
  25. package/dist/codex-model-profile.d.ts +38 -0
  26. package/dist/codex-model-profile.js +54 -0
  27. package/dist/codex-producer-ipc.d.ts +55 -0
  28. package/dist/codex-producer-ipc.js +67 -0
  29. package/dist/codex-sdk-transport.d.ts +50 -0
  30. package/dist/codex-sdk-transport.js +294 -0
  31. package/dist/codex-subscription.d.ts +114 -0
  32. package/dist/codex-subscription.js +268 -0
  33. package/dist/evidence-archive.d.ts +57 -0
  34. package/dist/evidence-archive.js +221 -0
  35. package/dist/execution-projection-schema.d.ts +10 -0
  36. package/dist/execution-projection-schema.js +30 -0
  37. package/dist/execution-retention-archive.d.ts +69 -0
  38. package/dist/execution-retention-archive.js +154 -0
  39. package/dist/generated/retention-v2-contract.d.ts +72 -0
  40. package/dist/generated/retention-v2-contract.js +105 -0
  41. package/dist/generated/retention-v2-json.d.ts +24 -0
  42. package/dist/generated/retention-v2-json.js +268 -0
  43. package/dist/generated/retention-v2-native-json.d.ts +2 -0
  44. package/dist/generated/retention-v2-native-json.js +33 -0
  45. package/dist/generated/retention-v2-native.d.ts +58 -0
  46. package/dist/generated/retention-v2-native.js +155 -0
  47. package/dist/generated/retention-v2-pin.d.ts +2 -0
  48. package/dist/generated/retention-v2-pin.js +4 -0
  49. package/dist/generated/retention-v2-types.d.ts +49 -0
  50. package/dist/generated/retention-v2-types.js +2 -0
  51. package/dist/generated/retention-v2-work-types.d.ts +260 -0
  52. package/dist/generated/retention-v2-work-types.js +13 -0
  53. package/dist/generated/work-v4/execution-id.d.ts +5 -0
  54. package/dist/generated/work-v4/execution-id.js +14 -0
  55. package/dist/generated/work-v4/json.d.ts +24 -0
  56. package/dist/generated/work-v4/json.js +268 -0
  57. package/dist/generated/work-v4/occurrences.d.ts +226 -0
  58. package/dist/generated/work-v4/occurrences.js +116 -0
  59. package/dist/generated/work-v4/pin.d.ts +1 -0
  60. package/dist/generated/work-v4/pin.js +3 -0
  61. package/dist/generated/work-v4/projection.d.ts +294 -0
  62. package/dist/generated/work-v4/projection.js +238 -0
  63. package/dist/generated/work-v4/reader.d.ts +24 -0
  64. package/dist/generated/work-v4/reader.js +109 -0
  65. package/dist/generated/work-v4/snapshot.d.ts +28 -0
  66. package/dist/generated/work-v4/snapshot.js +268 -0
  67. package/dist/generated/work-v4/types.d.ts +260 -0
  68. package/dist/generated/work-v4/types.js +13 -0
  69. package/dist/generated/work-v4/validation.d.ts +13 -0
  70. package/dist/generated/work-v4/validation.js +227 -0
  71. package/dist/index.d.ts +22 -0
  72. package/dist/index.js +22 -0
  73. package/dist/installed-review-session.d.ts +28 -0
  74. package/dist/installed-review-session.js +166 -0
  75. package/dist/intervention-run.d.ts +403 -0
  76. package/dist/intervention-run.js +169 -0
  77. package/dist/learning-case.d.ts +12 -0
  78. package/dist/learning-case.js +15 -0
  79. package/dist/learning-journal.d.ts +18 -0
  80. package/dist/learning-journal.js +256 -0
  81. package/dist/principal-payload-port.d.ts +25 -0
  82. package/dist/principal-payload-port.js +40 -0
  83. package/dist/producer-product.d.ts +70 -0
  84. package/dist/producer-product.js +186 -0
  85. package/dist/producer-review.d.ts +53 -0
  86. package/dist/producer-review.js +207 -0
  87. package/dist/reviewed-archive-export.d.ts +42 -0
  88. package/dist/reviewed-archive-export.js +78 -0
  89. package/dist/trust-lifecycle.d.ts +128 -0
  90. package/dist/trust-lifecycle.js +200 -0
  91. package/dist/weekly-investigation.d.ts +237 -0
  92. package/dist/weekly-investigation.js +330 -0
  93. package/dist/work-candidates.d.ts +29 -0
  94. package/dist/work-candidates.js +78 -0
  95. package/dist/work-case-archive.d.ts +25 -0
  96. package/dist/work-case-archive.js +63 -0
  97. package/dist/work-case-review.d.ts +45 -0
  98. package/dist/work-case-review.js +220 -0
  99. package/dist/work-signal-cases.d.ts +15 -0
  100. package/dist/work-signal-cases.js +54 -0
  101. package/dist/work-signal-observation.d.ts +23 -0
  102. package/dist/work-signal-observation.js +89 -0
  103. package/package.json +3 -2
@@ -0,0 +1,200 @@
1
+ import { calibratePredictions, recommendExposure } from '@skill-harness/core';
2
+ import { isAbsolute } from 'node:path';
3
+ import { readArchiveSource } from './evidence-archive.js';
4
+ import { learningCopy, learningHash, learningJournal, registerLearningStore, verifyLearningStore } from './learning-journal.js';
5
+ import { readLearningCase } from './learning-case.js';
6
+ export const trustPolicyDigest = (input) => learningHash({ version: 'trust-lifecycle-v1', input });
7
+ export const trustOutcomeDigest = (outcome) => learningHash({ version: 'trust-reference-v1', outcome });
8
+ function evidence(root, id) { const result = readArchiveSource(root, id); if (result.status !== 'available' || !['exact', 'redacted'].includes(result.reference.retention))
9
+ throw Error('independent retained evidence unavailable'); return result; }
10
+ const text = (v) => typeof v === 'string' && v.length > 0 && v.length <= 512 && !/[\u0000-\u001f\u007f]/.test(v);
11
+ function validate(input) {
12
+ if (!isAbsolute(input.archiveRoot) || Object.keys(input).sort().join() !== 'archiveRoot,cohort,component,exposure,maxUnflagged,seed' || !/^([a-f0-9]{64})$/.test(input.seed) || !Number.isSafeInteger(input.maxUnflagged) || input.maxUnflagged < 0 || input.maxUnflagged > 32 || !Array.isArray(input.cohort) || !input.cohort.length || input.cohort.length > 1024 || new Set(input.cohort.map(c => c.incidentId)).size !== input.cohort.length)
13
+ throw Error('invalid frozen trust cohort');
14
+ for (const c of input.cohort) {
15
+ if (Object.keys(c).sort().join() !== 'flagged,incidentId,manifestId,split' || !text(c.incidentId) || typeof c.flagged !== 'boolean' || !['calibration', 'heldout', 'tuning'].includes(c.split))
16
+ throw Error('invalid cohort row');
17
+ evidence(input.archiveRoot, c.manifestId);
18
+ }
19
+ const dummy = { id: 'validation', incidentId: 'validation', component: input.component, kind: input.component.kind === 'detector' ? 'positive' : 'approval', split: 'calibration' };
20
+ calibratePredictions([dummy]);
21
+ if (input.exposure) {
22
+ if (learningHash(input.exposure.component) !== learningHash(input.component))
23
+ throw Error('policy component scope mismatch');
24
+ const report = calibratePredictions([{ ...dummy, kind: input.exposure.kind, split: input.exposure.split }]).reports[0];
25
+ recommendExposure(report, input.exposure, 0);
26
+ }
27
+ }
28
+ export function createTrustLifecycle(directory, input, authorizedPolicyDigests) {
29
+ const safe = learningCopy(input);
30
+ validate(safe);
31
+ const policyId = trustPolicyDigest(safe);
32
+ if (!authorizedPolicyDigests.includes(policyId))
33
+ throw Error('independent predeclared policy authority required');
34
+ const sampledIncidentIds = safe.cohort.filter(c => !c.flagged && c.split !== 'tuning').sort((a, b) => learningHash([safe.seed, a.incidentId]).localeCompare(learningHash([safe.seed, b.incidentId]))).slice(0, safe.maxUnflagged).map(c => c.incidentId);
35
+ const initial = { type: 'initial', kind: 'trust-lifecycle-v1', input: safe, policyId, sampledIncidentIds };
36
+ registerLearningStore(safe.archiveRoot, 'trust', policyId, directory, learningHash(initial));
37
+ try {
38
+ learningJournal(directory, initial);
39
+ }
40
+ catch (e) {
41
+ if (e.code !== 'EEXIST')
42
+ throw e;
43
+ const old = learningJournal(directory).read()[0].value;
44
+ if (learningHash(old) !== learningHash(initial))
45
+ throw Error('trust policy already predeclared');
46
+ }
47
+ return openTrustLifecycle(directory);
48
+ }
49
+ /** Existing calibration is recomputed from durable scoped predictions and independently permitted
50
+ * retained labels. Applied exposure is an attention reservation, not proof a human saw a question. */
51
+ export function openTrustLifecycle(directory) {
52
+ const journal = learningJournal(directory), initial = journal.read()[0].value;
53
+ if (initial.kind !== 'trust-lifecycle-v1' || initial.type !== 'initial')
54
+ throw Error('wrong trust journal');
55
+ const input = initial.input, sampledIncidentIds = initial.sampledIncidentIds;
56
+ validate(input);
57
+ const replay = () => {
58
+ verifyLearningStore(input.archiveRoot, 'trust', String(initial.policyId), directory, learningHash(initial));
59
+ const history = journal.read(), predictions = new Map(), allIds = new Set(), outcomes = new Map(), caseLinks = new Map(), exposures = new Map();
60
+ let retired = false, lastExposureAt = 0;
61
+ for (const { value: v } of history.slice(1)) {
62
+ if (v.type === 'prediction' || v.type === 'correction') {
63
+ const p = v.prediction;
64
+ calibratePredictions([p]);
65
+ if (allIds.has(p.id))
66
+ throw Error('duplicate prediction identity');
67
+ const c = input.cohort.find(c => c.incidentId === p.incidentId);
68
+ if (!c?.flagged || c.split !== p.split || learningHash(p.component) !== learningHash(input.component))
69
+ throw Error('prediction scope mismatch');
70
+ if (v.type === 'correction') {
71
+ const old = predictions.get(String(v.prior));
72
+ if (!old || old.incidentId !== p.incidentId)
73
+ throw Error('stale prediction correction');
74
+ predictions.delete(String(v.prior));
75
+ }
76
+ predictions.set(p.id, p);
77
+ allIds.add(p.id);
78
+ }
79
+ else if (v.type === 'outcome') {
80
+ const r = v.outcome;
81
+ if (outcomes.has(r.referenceId))
82
+ throw Error('duplicate reference identity');
83
+ outcomes.set(r.referenceId, r);
84
+ if (v.caseReference)
85
+ caseLinks.set(r.referenceId, v.caseReference);
86
+ }
87
+ else if (v.type === 'exposure') {
88
+ const id = String(v.id), result = v.result;
89
+ if (typeof v.now !== 'number' || !Number.isFinite(v.now) || v.now < lastExposureAt || exposures.has(id) || !['ask', 'silent', 'retire'].includes(result.mode))
90
+ throw Error('invalid exposure history');
91
+ lastExposureAt = v.now;
92
+ exposures.set(id, result);
93
+ retired ||= result.mode === 'retire';
94
+ }
95
+ else
96
+ throw Error('unknown trust history event');
97
+ }
98
+ return { history, predictions, allIds, outcomes, caseLinks, exposures, retired, lastExposureAt, tip: history.at(-1).id };
99
+ };
100
+ replay();
101
+ const inspect = (now) => {
102
+ if (!Number.isFinite(now) || now < 0)
103
+ throw Error('valid policy clock required');
104
+ const s = replay(), labels = [];
105
+ for (const r of s.outcomes.values()) {
106
+ evidence(input.archiveRoot, r.evidenceManifestId);
107
+ const p = s.predictions.get(r.targetId), link = s.caseLinks.get(r.referenceId);
108
+ if (link && !readLearningCase(input.archiveRoot, link).matched)
109
+ continue;
110
+ if (r.kind === 'prediction' && p)
111
+ labels.push({ ...p, id: r.referenceId, correct: r.value });
112
+ }
113
+ for (const p of s.predictions.values())
114
+ evidence(input.archiveRoot, input.cohort.find(c => c.incidentId === p.incidentId).manifestId);
115
+ const calibration = calibratePredictions([...s.predictions.values()], { outcomes: labels });
116
+ let misses = 0, resolved = 0, conflicted = 0;
117
+ for (const id of sampledIncidentIds) {
118
+ evidence(input.archiveRoot, input.cohort.find(c => c.incidentId === id).manifestId);
119
+ const values = new Set([...s.outcomes.values()].filter(r => r.kind === 'unflagged' && r.targetId === id).map(r => r.value));
120
+ if (values.size === 1) {
121
+ resolved++;
122
+ if (values.has(true))
123
+ misses++;
124
+ }
125
+ else if (values.size > 1)
126
+ conflicted++;
127
+ }
128
+ return { policyId: String(initial.policyId), component: learningCopy(input.component), calibration, sampledIncidentIds: [...sampledIncidentIds], unflagged: { sampled: sampledIncidentIds.length, resolved, misses, unresolved: sampledIncidentIds.length - resolved, conflicted }, attentionUsed: [...s.exposures.values()].filter(e => e.mode === 'ask').length, retired: s.retired, exposures: [...s.exposures].map(([id, result]) => ({ id, ...result })), tip: s.tip, grantExpansion: false };
129
+ };
130
+ const prediction = (p) => { const copy = learningCopy(p); calibratePredictions([copy]); const row = input.cohort.find(c => c.incidentId === copy.incidentId); if (!row?.flagged || row.split !== copy.split || learningHash(copy.component) !== learningHash(input.component))
131
+ throw Error('prediction scope mismatch'); evidence(input.archiveRoot, row.manifestId); return copy; };
132
+ const previewCaseOutcome = (predictionId, reference) => {
133
+ const ref = learningCopy(reference), s = replay(), p = s.predictions.get(predictionId), row = p && input.cohort.find(c => c.incidentId === p.incidentId), resolved = readLearningCase(input.archiveRoot, ref);
134
+ if (!p || p.kind !== 'positive' || row?.manifestId !== ref.manifestId || !resolved.matched || !['confirmed_defect', 'expected_behavior'].includes(resolved.current.disposition) || learningHash(resolved.candidate.detector) !== learningHash({ id: p.component.id, version: p.component.version, population: p.component.population }))
135
+ throw Error('current independent case outcome scope required');
136
+ const outcome = { kind: 'prediction', targetId: p.id, value: resolved.current.disposition === 'confirmed_defect', evidenceManifestId: ref.manifestId, referenceId: ref.decisionId };
137
+ return { outcome, caseReference: ref, digest: learningHash({ outcome, caseReference: ref }), tip: s.tip };
138
+ };
139
+ return { inspect, history: () => journal.read(), previewCaseOutcome,
140
+ linkCaseOutcome(predictionId, reference, authorizedDigests) {
141
+ const preview = previewCaseOutcome(predictionId, reference);
142
+ if (!authorizedDigests.includes(preview.digest))
143
+ throw Error('independent exact reference authority required');
144
+ const s = replay();
145
+ if (s.tip !== preview.tip)
146
+ throw Error('stale case outcome snapshot');
147
+ const old = s.outcomes.get(preview.outcome.referenceId);
148
+ if (old) {
149
+ if (trustOutcomeDigest(old) !== trustOutcomeDigest(preview.outcome) || learningHash(s.caseLinks.get(old.referenceId) ?? null) !== learningHash(reference))
150
+ throw Error('reference identity conflict');
151
+ return;
152
+ }
153
+ journal.append(s.tip, { type: 'outcome', outcome: preview.outcome, caseReference: preview.caseReference, authorityDigest: preview.digest });
154
+ },
155
+ predict(p) { const safe = prediction(p), s = replay(); if (s.allIds.has(safe.id)) {
156
+ if (learningHash(s.predictions.get(safe.id) ?? null) !== learningHash(safe))
157
+ throw Error('prediction identity conflict');
158
+ return;
159
+ } journal.append(s.tip, { type: 'prediction', prediction: safe }); },
160
+ correct(prior, p, reason) { const safe = prediction(p), s = replay(), old = s.predictions.get(prior); if (!old || old.incidentId !== safe.incidentId || s.allIds.has(safe.id) || !text(reason))
161
+ throw Error('stale or invalid prediction correction'); journal.append(s.tip, { type: 'correction', prior, prediction: safe, reason }); },
162
+ outcome(value, authorizedReferenceDigests) {
163
+ const r = learningCopy(value);
164
+ if (Object.keys(r).sort().join() !== 'evidenceManifestId,kind,referenceId,targetId,value' || !['prediction', 'unflagged'].includes(r.kind) || !text(r.targetId) || !text(r.referenceId) || typeof r.value !== 'boolean')
165
+ throw Error('invalid reference outcome');
166
+ const digest = trustOutcomeDigest(r);
167
+ if (!authorizedReferenceDigests.includes(digest))
168
+ throw Error('independent exact reference authority required');
169
+ evidence(input.archiveRoot, r.evidenceManifestId);
170
+ const s = replay();
171
+ if (r.kind === 'prediction' ? !s.predictions.has(r.targetId) : !sampledIncidentIds.includes(r.targetId))
172
+ throw Error('outcome outside current prediction or frozen sample');
173
+ const old = s.outcomes.get(r.referenceId);
174
+ if (old) {
175
+ if (trustOutcomeDigest(old) !== digest)
176
+ throw Error('reference identity conflict');
177
+ return;
178
+ }
179
+ journal.append(s.tip, { type: 'outcome', outcome: r, authorityDigest: digest });
180
+ },
181
+ expose(id, now) {
182
+ if (!text(id))
183
+ throw Error('exposure identity required');
184
+ const s = replay(), existing = s.exposures.get(id);
185
+ if (existing)
186
+ return { ...learningCopy(existing), replayed: true };
187
+ if (now < s.lastExposureAt)
188
+ throw Error('policy clock moved backwards');
189
+ const view = inspect(now);
190
+ if (view.tip !== s.tip)
191
+ throw Error('stale exposure snapshot');
192
+ const policy = input.exposure ? { ...input.exposure, attentionRemaining: Math.max(0, input.exposure.attentionRemaining - view.attentionUsed) } : null;
193
+ const report = view.calibration.reports.find(r => policy && r.kind === policy.kind && r.split === policy.split);
194
+ const result = s.retired ? { mode: 'retire', reason: 'previously-retired' } : report ? recommendExposure(report, policy, now) : { mode: 'silent', reason: policy ? 'insufficient-independent-evidence' : 'policy-unavailable' };
195
+ journal.append(s.tip, { type: 'exposure', id, now, result, policyId: initial.policyId, evidenceTip: s.tip });
196
+ return { ...learningCopy(result), replayed: false };
197
+ }
198
+ };
199
+ }
200
+ //# sourceMappingURL=trust-lifecycle.js.map
@@ -0,0 +1,237 @@
1
+ import { type Hypothesis, type InvestigationAuthority, type InvestigationScenarioPreview, type FrozenInvestigationInputs } from '@skill-harness/core';
2
+ import { type ArchiveReadCapabilityOptions } from './archive-read-capability.js';
3
+ export interface WeeklySupervisorInput {
4
+ archiveRoot: string;
5
+ week: string;
6
+ population: string;
7
+ policyDigest: string;
8
+ maxCases: number;
9
+ cases: {
10
+ version: 2 | 3;
11
+ batchId: string;
12
+ manifestId: string;
13
+ decisionId: string;
14
+ }[];
15
+ reader: Omit<ArchiveReadCapabilityOptions, 'root'>;
16
+ }
17
+ export interface ModelArchiveRequest {
18
+ kind: 'producer-archive-model-v1';
19
+ manifestIds: string[];
20
+ maxInputBytes: number;
21
+ proposalLimits: {
22
+ subjectCalls: number;
23
+ judgeCalls: number;
24
+ wallMs: number;
25
+ };
26
+ }
27
+ export interface InvestigationScreenRequest {
28
+ manifestIds: string[];
29
+ population: string;
30
+ }
31
+ export interface InvestigationFiles {
32
+ spec: string;
33
+ rubric: string;
34
+ judgePolicy: string;
35
+ heldout: string;
36
+ configuration: string;
37
+ skill: string;
38
+ }
39
+ export declare function createWeeklyInvestigation(directory: string, input: WeeklySupervisorInput): {
40
+ inspect: () => {
41
+ state: string;
42
+ hypothesis: Hypothesis | null;
43
+ approved: boolean;
44
+ preview: InvestigationScenarioPreview | null;
45
+ frozen: {
46
+ digest: string;
47
+ version: string;
48
+ hypothesisId: string;
49
+ authorityId: string;
50
+ inputs: FrozenInvestigationInputs;
51
+ executionReady: false;
52
+ } | null;
53
+ files: InvestigationFiles | null;
54
+ skillHash: string | null;
55
+ selection: import("@skill-harness/core").WeeklyInvestigationSelection;
56
+ tip: string;
57
+ };
58
+ evaluation: () => {
59
+ frozen: {
60
+ digest: string;
61
+ version: string;
62
+ hypothesisId: string;
63
+ authorityId: string;
64
+ inputs: FrozenInvestigationInputs;
65
+ executionReady: false;
66
+ };
67
+ caseIds: string[];
68
+ skillSha256: string;
69
+ executionReady: false;
70
+ };
71
+ previewScreen: (request: InvestigationScreenRequest) => {
72
+ digest: string;
73
+ input: InvestigationScreenRequest;
74
+ freeze: string;
75
+ skillSha256: string;
76
+ scenarioId: string;
77
+ };
78
+ prepareModel(raw: ModelArchiveRequest): {
79
+ digest: string;
80
+ input: string;
81
+ };
82
+ runModel(preparedDigest: string, planSha256: string, invoke: (input: string) => Promise<{
83
+ hostPath: string;
84
+ id: string;
85
+ }>): Promise<Hypothesis>;
86
+ screen(request: InvestigationScreenRequest, authorizedLinks: readonly string[]): {
87
+ report: {
88
+ scenarios: import("@skill-harness/core").ScreenScenario[];
89
+ criteria: import("@skill-harness/core").ScreenCriterion[];
90
+ };
91
+ exploratory: true;
92
+ populationMatches: boolean;
93
+ comparisonQualified: false;
94
+ digest: string;
95
+ input: InvestigationScreenRequest;
96
+ freeze: string;
97
+ skillSha256: string;
98
+ scenarioId: string;
99
+ };
100
+ run(program: unknown): Hypothesis;
101
+ approve(authority: InvestigationAuthority): {
102
+ version: string;
103
+ hypothesisId: string;
104
+ authorityId: string;
105
+ scope: "investigation-only";
106
+ };
107
+ preview(specPath: string, scenario: Record<string, unknown>): InvestigationScenarioPreview;
108
+ promote(preview: InvestigationScenarioPreview, authority: InvestigationAuthority): {
109
+ scenarioId: string;
110
+ replayed: boolean;
111
+ sha256: string;
112
+ scope: "scenario-only";
113
+ };
114
+ freeze(files: InvestigationFiles, authority: InvestigationAuthority): {
115
+ digest: string;
116
+ version: string;
117
+ hypothesisId: string;
118
+ authorityId: string;
119
+ inputs: FrozenInvestigationInputs;
120
+ executionReady: false;
121
+ };
122
+ previewEdit(text: string): string;
123
+ edit(text: string, authorizedDigests: readonly string[]): {
124
+ frozen: {
125
+ digest: string;
126
+ version: string;
127
+ hypothesisId: string;
128
+ authorityId: string;
129
+ inputs: FrozenInvestigationInputs;
130
+ executionReady: false;
131
+ };
132
+ caseIds: string[];
133
+ skillSha256: string;
134
+ executionReady: false;
135
+ };
136
+ };
137
+ /** Existing run is a finite inert data-only interpreter. The separate prepareModel/runModel
138
+ * composition forwards only capability-selected frozen bytes to an original producer model seam;
139
+ * it does not expose shell/filesystem tools or turn proposal evidence into execution authority. */
140
+ export declare function openWeeklyInvestigation(directory: string): {
141
+ inspect: () => {
142
+ state: string;
143
+ hypothesis: Hypothesis | null;
144
+ approved: boolean;
145
+ preview: InvestigationScenarioPreview | null;
146
+ frozen: {
147
+ digest: string;
148
+ version: string;
149
+ hypothesisId: string;
150
+ authorityId: string;
151
+ inputs: FrozenInvestigationInputs;
152
+ executionReady: false;
153
+ } | null;
154
+ files: InvestigationFiles | null;
155
+ skillHash: string | null;
156
+ selection: import("@skill-harness/core").WeeklyInvestigationSelection;
157
+ tip: string;
158
+ };
159
+ evaluation: () => {
160
+ frozen: {
161
+ digest: string;
162
+ version: string;
163
+ hypothesisId: string;
164
+ authorityId: string;
165
+ inputs: FrozenInvestigationInputs;
166
+ executionReady: false;
167
+ };
168
+ caseIds: string[];
169
+ skillSha256: string;
170
+ executionReady: false;
171
+ };
172
+ previewScreen: (request: InvestigationScreenRequest) => {
173
+ digest: string;
174
+ input: InvestigationScreenRequest;
175
+ freeze: string;
176
+ skillSha256: string;
177
+ scenarioId: string;
178
+ };
179
+ prepareModel(raw: ModelArchiveRequest): {
180
+ digest: string;
181
+ input: string;
182
+ };
183
+ runModel(preparedDigest: string, planSha256: string, invoke: (input: string) => Promise<{
184
+ hostPath: string;
185
+ id: string;
186
+ }>): Promise<Hypothesis>;
187
+ screen(request: InvestigationScreenRequest, authorizedLinks: readonly string[]): {
188
+ report: {
189
+ scenarios: import("@skill-harness/core").ScreenScenario[];
190
+ criteria: import("@skill-harness/core").ScreenCriterion[];
191
+ };
192
+ exploratory: true;
193
+ populationMatches: boolean;
194
+ comparisonQualified: false;
195
+ digest: string;
196
+ input: InvestigationScreenRequest;
197
+ freeze: string;
198
+ skillSha256: string;
199
+ scenarioId: string;
200
+ };
201
+ run(program: unknown): Hypothesis;
202
+ approve(authority: InvestigationAuthority): {
203
+ version: string;
204
+ hypothesisId: string;
205
+ authorityId: string;
206
+ scope: "investigation-only";
207
+ };
208
+ preview(specPath: string, scenario: Record<string, unknown>): InvestigationScenarioPreview;
209
+ promote(preview: InvestigationScenarioPreview, authority: InvestigationAuthority): {
210
+ scenarioId: string;
211
+ replayed: boolean;
212
+ sha256: string;
213
+ scope: "scenario-only";
214
+ };
215
+ freeze(files: InvestigationFiles, authority: InvestigationAuthority): {
216
+ digest: string;
217
+ version: string;
218
+ hypothesisId: string;
219
+ authorityId: string;
220
+ inputs: FrozenInvestigationInputs;
221
+ executionReady: false;
222
+ };
223
+ previewEdit(text: string): string;
224
+ edit(text: string, authorizedDigests: readonly string[]): {
225
+ frozen: {
226
+ digest: string;
227
+ version: string;
228
+ hypothesisId: string;
229
+ authorityId: string;
230
+ inputs: FrozenInvestigationInputs;
231
+ executionReady: false;
232
+ };
233
+ caseIds: string[];
234
+ skillSha256: string;
235
+ executionReady: false;
236
+ };
237
+ };