yam-flow 2.5.1 → 2.6.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.
- package/CHANGELOG.md +25 -0
- package/COMMANDS.md +27 -1
- package/README.md +19 -1
- package/ROADMAP.md +38 -6
- package/dist/bin/yam.js +389 -6
- package/dist/lib/benchmark-promotion.d.ts +53 -0
- package/dist/lib/benchmark-promotion.js +204 -0
- package/dist/lib/design-production.d.ts +306 -0
- package/dist/lib/design-production.js +1341 -0
- package/dist/lib/external-updates.d.ts +23 -0
- package/dist/lib/external-updates.js +286 -30
- package/dist/lib/gate-result.d.ts +44 -0
- package/dist/lib/gate-result.js +219 -0
- package/dist/lib/trust-kernel.js +17 -1
- package/package.json +4 -2
- package/references/ueye.md +14 -0
- package/skills/ueye/SKILL.md +11 -0
- package/src/bin/yam.ts +394 -6
- package/src/lib/benchmark-promotion.ts +249 -0
- package/src/lib/design-production.ts +1441 -0
- package/src/lib/external-updates.ts +331 -28
- package/src/lib/gate-result.ts +223 -0
- package/src/lib/trust-kernel.ts +20 -1
- package/yam.manifest.json +2 -2
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
const DIGEST_PATTERN = /^(?:sha256:)?[a-f0-9]{64}$/i;
|
|
3
|
+
const SEED_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
|
|
4
|
+
const MAX_SAMPLES = 256;
|
|
5
|
+
export function parsePromotionSample(value) {
|
|
6
|
+
const parts = String(value || '').split(':');
|
|
7
|
+
if (parts.length !== 3)
|
|
8
|
+
throw new Error('sample must use seed:candidate:baseline');
|
|
9
|
+
const [seed, candidateText, baselineText] = parts;
|
|
10
|
+
const candidate = Number(candidateText);
|
|
11
|
+
const baseline = Number(baselineText);
|
|
12
|
+
if (!SEED_PATTERN.test(seed))
|
|
13
|
+
throw new Error('sample seed must use 1-64 letters, numbers, dot, underscore, or dash');
|
|
14
|
+
if (!Number.isFinite(candidate) || !Number.isFinite(baseline))
|
|
15
|
+
throw new Error(`sample ${seed} must contain finite candidate and baseline numbers`);
|
|
16
|
+
return { seed, candidate, baseline };
|
|
17
|
+
}
|
|
18
|
+
export function buildBoundedPromotionReport(input = {}) {
|
|
19
|
+
const requestedTarget = String(input.target || 'higher');
|
|
20
|
+
const target = requestedTarget === 'lower' ? 'lower' : 'higher';
|
|
21
|
+
const minSamples = integerInRange(input.min_samples, 2, MAX_SAMPLES, 2, 'min_samples');
|
|
22
|
+
const minMeanDelta = finiteAtLeast(input.min_mean_delta, 0, 0, 'min_mean_delta');
|
|
23
|
+
const minWinRate = finiteRange(input.min_win_rate, 0, 1, 0.5, 'min_win_rate');
|
|
24
|
+
const candidateDigest = normalizeDigest(input.candidate_digest);
|
|
25
|
+
const baselineDigest = normalizeDigest(input.baseline_digest);
|
|
26
|
+
const unit = boundedText(input.unit || '', 64);
|
|
27
|
+
const evidenceSource = boundedText(input.evidence_source || '', 512);
|
|
28
|
+
const rawSamples = Array.isArray(input.samples) ? input.samples : [];
|
|
29
|
+
const validationFailures = [];
|
|
30
|
+
if (!['higher', 'lower'].includes(requestedTarget))
|
|
31
|
+
validationFailures.push('target_invalid: target must be higher or lower');
|
|
32
|
+
if (!candidateDigest)
|
|
33
|
+
validationFailures.push('candidate_digest_invalid: record a SHA-256 candidate digest');
|
|
34
|
+
if (!baselineDigest)
|
|
35
|
+
validationFailures.push('baseline_digest_invalid: record a SHA-256 baseline digest');
|
|
36
|
+
if (candidateDigest && baselineDigest && candidateDigest === baselineDigest) {
|
|
37
|
+
validationFailures.push('candidate_matches_baseline: compare two distinct configuration digests');
|
|
38
|
+
}
|
|
39
|
+
if (!unit)
|
|
40
|
+
validationFailures.push('unit_missing: record what each paired score measures');
|
|
41
|
+
if (!evidenceSource)
|
|
42
|
+
validationFailures.push('evidence_source_missing: record where the paired measurements came from');
|
|
43
|
+
if (rawSamples.length > MAX_SAMPLES)
|
|
44
|
+
validationFailures.push(`sample_limit_exceeded: at most ${MAX_SAMPLES} paired samples are accepted`);
|
|
45
|
+
const seenSeeds = new Set();
|
|
46
|
+
const samples = [];
|
|
47
|
+
for (const row of rawSamples.slice(0, MAX_SAMPLES)) {
|
|
48
|
+
const seed = String(row?.seed || '');
|
|
49
|
+
const candidate = Number(row?.candidate);
|
|
50
|
+
const baseline = Number(row?.baseline);
|
|
51
|
+
if (!SEED_PATTERN.test(seed)) {
|
|
52
|
+
validationFailures.push('sample_seed_invalid: every seed must use 1-64 letters, numbers, dot, underscore, or dash');
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (seenSeeds.has(seed)) {
|
|
56
|
+
validationFailures.push(`duplicate_seed: ${seed}`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
seenSeeds.add(seed);
|
|
60
|
+
if (!Number.isFinite(candidate) || !Number.isFinite(baseline)) {
|
|
61
|
+
validationFailures.push(`sample_not_finite: ${seed}`);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const directionalDelta = target === 'higher' ? candidate - baseline : baseline - candidate;
|
|
65
|
+
if (!Number.isFinite(directionalDelta)) {
|
|
66
|
+
validationFailures.push(`sample_delta_not_finite: ${seed}`);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
samples.push({
|
|
70
|
+
seed,
|
|
71
|
+
candidate,
|
|
72
|
+
baseline,
|
|
73
|
+
directional_delta: directionalDelta,
|
|
74
|
+
winner: directionalDelta > 0 ? 'candidate' : directionalDelta < 0 ? 'baseline' : 'tie'
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
samples.sort((left, right) => left.seed < right.seed ? -1 : left.seed > right.seed ? 1 : 0);
|
|
78
|
+
const candidateMean = samples.length ? mean(samples.map((sample) => sample.candidate)) : null;
|
|
79
|
+
const baselineMean = samples.length ? mean(samples.map((sample) => sample.baseline)) : null;
|
|
80
|
+
const directionalMeanDelta = samples.length ? mean(samples.map((sample) => sample.directional_delta)) : null;
|
|
81
|
+
const winRate = samples.length ? samples.filter((sample) => sample.winner === 'candidate').length / samples.length : null;
|
|
82
|
+
const failures = [...validationFailures];
|
|
83
|
+
if (!validationFailures.length) {
|
|
84
|
+
if (samples.length < minSamples)
|
|
85
|
+
failures.push(`minimum_samples_not_met: observed ${samples.length}, required ${minSamples}`);
|
|
86
|
+
if (directionalMeanDelta !== null && directionalMeanDelta < minMeanDelta) {
|
|
87
|
+
failures.push(`minimum_mean_delta_not_met: observed ${directionalMeanDelta}, required ${minMeanDelta}`);
|
|
88
|
+
}
|
|
89
|
+
if (winRate !== null && winRate < minWinRate)
|
|
90
|
+
failures.push(`minimum_win_rate_not_met: observed ${winRate}, required ${minWinRate}`);
|
|
91
|
+
}
|
|
92
|
+
const decision = validationFailures.length
|
|
93
|
+
? 'blocked'
|
|
94
|
+
: samples.length < minSamples
|
|
95
|
+
? 'insufficient-evidence'
|
|
96
|
+
: failures.length
|
|
97
|
+
? 'revert'
|
|
98
|
+
: 'keep';
|
|
99
|
+
const canonicalEvidence = {
|
|
100
|
+
candidate_digest: candidateDigest,
|
|
101
|
+
baseline_digest: baselineDigest,
|
|
102
|
+
target,
|
|
103
|
+
unit,
|
|
104
|
+
evidence_source: evidenceSource,
|
|
105
|
+
policy: { min_samples: minSamples, min_mean_delta: minMeanDelta, min_win_rate: minWinRate },
|
|
106
|
+
samples: samples.map(({ seed, candidate, baseline }) => ({ seed, candidate, baseline }))
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
schema: 'yam.bounded-promotion-receipt.v1',
|
|
110
|
+
generated_at: new Date().toISOString(),
|
|
111
|
+
label: boundedText(input.label || 'unnamed', 160),
|
|
112
|
+
candidate_digest: candidateDigest,
|
|
113
|
+
baseline_digest: baselineDigest,
|
|
114
|
+
target,
|
|
115
|
+
unit,
|
|
116
|
+
policy: {
|
|
117
|
+
min_samples: minSamples,
|
|
118
|
+
min_mean_delta: minMeanDelta,
|
|
119
|
+
min_win_rate: minWinRate
|
|
120
|
+
},
|
|
121
|
+
samples,
|
|
122
|
+
sample_count: samples.length,
|
|
123
|
+
candidate_mean: candidateMean,
|
|
124
|
+
baseline_mean: baselineMean,
|
|
125
|
+
directional_mean_delta: directionalMeanDelta,
|
|
126
|
+
win_rate: winRate,
|
|
127
|
+
decision,
|
|
128
|
+
failures,
|
|
129
|
+
blockers: decision === 'keep' ? [] : failures,
|
|
130
|
+
evidence_source: evidenceSource,
|
|
131
|
+
evidence_digest: `sha256:${createHash('sha256').update(stableJson(canonicalEvidence)).digest('hex')}`,
|
|
132
|
+
measurement_truth: 'operator_asserted',
|
|
133
|
+
arithmetic_truth_status: validationFailures.length ? 'blocked' : 'verified',
|
|
134
|
+
truth_status: validationFailures.length ? 'blocked' : 'partial',
|
|
135
|
+
next_action: promotionNextAction(decision)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function normalizeDigest(value) {
|
|
139
|
+
const text = String(value || '').trim().toLowerCase();
|
|
140
|
+
if (!DIGEST_PATTERN.test(text))
|
|
141
|
+
return '';
|
|
142
|
+
return text.startsWith('sha256:') ? text : `sha256:${text}`;
|
|
143
|
+
}
|
|
144
|
+
function integerInRange(value, min, max, fallback, label) {
|
|
145
|
+
if (value === undefined || value === null || value === '')
|
|
146
|
+
return fallback;
|
|
147
|
+
const number = Number(value);
|
|
148
|
+
if (!Number.isInteger(number) || number < min || number > max)
|
|
149
|
+
throw new Error(`${label} must be an integer from ${min} to ${max}`);
|
|
150
|
+
return number;
|
|
151
|
+
}
|
|
152
|
+
function finiteAtLeast(value, min, fallback, label) {
|
|
153
|
+
if (value === undefined || value === null || value === '')
|
|
154
|
+
return fallback;
|
|
155
|
+
const number = Number(value);
|
|
156
|
+
if (!Number.isFinite(number) || number < min)
|
|
157
|
+
throw new Error(`${label} must be a finite number at least ${min}`);
|
|
158
|
+
return number;
|
|
159
|
+
}
|
|
160
|
+
function finiteRange(value, min, max, fallback, label) {
|
|
161
|
+
if (value === undefined || value === null || value === '')
|
|
162
|
+
return fallback;
|
|
163
|
+
const number = Number(value);
|
|
164
|
+
if (!Number.isFinite(number) || number < min || number > max)
|
|
165
|
+
throw new Error(`${label} must be between ${min} and ${max}`);
|
|
166
|
+
return number;
|
|
167
|
+
}
|
|
168
|
+
function mean(values) {
|
|
169
|
+
const scale = Math.max(...values.map((value) => Math.abs(value)));
|
|
170
|
+
if (scale === 0)
|
|
171
|
+
return 0;
|
|
172
|
+
let sum = 0;
|
|
173
|
+
let compensation = 0;
|
|
174
|
+
for (const value of values) {
|
|
175
|
+
const normalized = value / scale;
|
|
176
|
+
const next = sum + normalized;
|
|
177
|
+
compensation += Math.abs(sum) >= Math.abs(normalized)
|
|
178
|
+
? (sum - next) + normalized
|
|
179
|
+
: (normalized - next) + sum;
|
|
180
|
+
sum = next;
|
|
181
|
+
}
|
|
182
|
+
return ((sum + compensation) / values.length) * scale;
|
|
183
|
+
}
|
|
184
|
+
function boundedText(value, max) {
|
|
185
|
+
return String(value || '').replace(/[\r\n\u0000-\u001f\u007f]+/g, ' ').trim().slice(0, max);
|
|
186
|
+
}
|
|
187
|
+
function stableJson(value) {
|
|
188
|
+
if (Array.isArray(value))
|
|
189
|
+
return `[${value.map((item) => stableJson(item)).join(',')}]`;
|
|
190
|
+
if (value && typeof value === 'object') {
|
|
191
|
+
const record = value;
|
|
192
|
+
return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`).join(',')}}`;
|
|
193
|
+
}
|
|
194
|
+
return JSON.stringify(value);
|
|
195
|
+
}
|
|
196
|
+
function promotionNextAction(decision) {
|
|
197
|
+
if (decision === 'keep')
|
|
198
|
+
return 'keep the candidate only with the recorded evidence source and smallest relevant regression check';
|
|
199
|
+
if (decision === 'revert')
|
|
200
|
+
return 'revert or revise the candidate because one or more promotion thresholds failed';
|
|
201
|
+
if (decision === 'insufficient-evidence')
|
|
202
|
+
return 'record more paired samples with the same explicit policy before deciding';
|
|
203
|
+
return 'repair the malformed or ambiguous promotion evidence before making a keep/revert decision';
|
|
204
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
type JsonObject = Record<string, unknown>;
|
|
2
|
+
export type PlanReviewVerdict = 'approve' | 'request_changes';
|
|
3
|
+
export type DesignRevisionStatus = 'active' | 'accepted' | 'two_round_limit' | 'integrity_blocked';
|
|
4
|
+
export type GalleryCompletionState = 'draft' | 'ready_for_inspection' | 'packaged';
|
|
5
|
+
export interface PlanReviewArtifact {
|
|
6
|
+
id: string;
|
|
7
|
+
role: 'plan' | 'reference' | 'deliverable';
|
|
8
|
+
file_path: string;
|
|
9
|
+
sha256: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PlanReviewComment {
|
|
12
|
+
id: string;
|
|
13
|
+
anchor: {
|
|
14
|
+
artifact_id: string;
|
|
15
|
+
kind: 'line' | 'region' | 'text';
|
|
16
|
+
locator: string;
|
|
17
|
+
};
|
|
18
|
+
finding: string;
|
|
19
|
+
requested_change: string;
|
|
20
|
+
anchor_context: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PlanReviewSession {
|
|
23
|
+
schema: 'yam.plan-review-canvas.v1';
|
|
24
|
+
session_id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
created_at: string;
|
|
27
|
+
updated_at: string;
|
|
28
|
+
status: 'open' | 'closed';
|
|
29
|
+
verdict: PlanReviewVerdict | null;
|
|
30
|
+
closed_at: string | null;
|
|
31
|
+
demand_trigger: DesignProductionDemandTrigger & {
|
|
32
|
+
evidence_truth: 'operator_asserted';
|
|
33
|
+
recorded_at: string;
|
|
34
|
+
};
|
|
35
|
+
execution_boundary: {
|
|
36
|
+
storage: 'local_only';
|
|
37
|
+
rendering: 'static_html';
|
|
38
|
+
sandbox: 'csp_no_script_no_network';
|
|
39
|
+
remote_sharing: false;
|
|
40
|
+
server: false;
|
|
41
|
+
background_service: false;
|
|
42
|
+
};
|
|
43
|
+
artifacts: PlanReviewArtifact[];
|
|
44
|
+
comments: PlanReviewComment[];
|
|
45
|
+
}
|
|
46
|
+
export interface UeyeRevisionReference {
|
|
47
|
+
artifact_id: string;
|
|
48
|
+
manifest_path: string;
|
|
49
|
+
round: number;
|
|
50
|
+
sha256: string;
|
|
51
|
+
archived_at: string;
|
|
52
|
+
intent: 'preserve' | 'edit_copy';
|
|
53
|
+
asset_manifest_path: string | null;
|
|
54
|
+
asset_id: string | null;
|
|
55
|
+
}
|
|
56
|
+
export interface DesignRevisionRound {
|
|
57
|
+
round: number;
|
|
58
|
+
reviewer_finding: {
|
|
59
|
+
id: string;
|
|
60
|
+
source_comment_id: string;
|
|
61
|
+
summary: string;
|
|
62
|
+
evidence: string;
|
|
63
|
+
};
|
|
64
|
+
planned_change: string;
|
|
65
|
+
outcome: 'accepted' | 'changes_requested';
|
|
66
|
+
revision_refs: UeyeRevisionReference[];
|
|
67
|
+
recorded_at: string;
|
|
68
|
+
}
|
|
69
|
+
export interface DesignRevisionState {
|
|
70
|
+
schema: 'yam.design-revision-state.v1';
|
|
71
|
+
session_id: string;
|
|
72
|
+
canvas_session_path: string;
|
|
73
|
+
canvas_session_sha256: string;
|
|
74
|
+
updated_at: string;
|
|
75
|
+
max_rounds: 2;
|
|
76
|
+
status: DesignRevisionStatus;
|
|
77
|
+
stop_reason: string;
|
|
78
|
+
rounds: DesignRevisionRound[];
|
|
79
|
+
}
|
|
80
|
+
export interface GalleryArtifact {
|
|
81
|
+
id: string;
|
|
82
|
+
role: 'primary' | 'supporting' | 'reference';
|
|
83
|
+
provenance: {
|
|
84
|
+
kind: 'operator' | 'generated' | 'downloaded';
|
|
85
|
+
source_ref: string;
|
|
86
|
+
license_note: string;
|
|
87
|
+
};
|
|
88
|
+
revision_ref: UeyeRevisionReference;
|
|
89
|
+
dimensions: string;
|
|
90
|
+
sha256: string;
|
|
91
|
+
completion_state: GalleryCompletionState;
|
|
92
|
+
final_path: string;
|
|
93
|
+
}
|
|
94
|
+
export interface FinalGalleryManifest {
|
|
95
|
+
schema: 'yam.final-gallery-manifest.v1';
|
|
96
|
+
session_id: string;
|
|
97
|
+
created_at: string;
|
|
98
|
+
completion_state: GalleryCompletionState;
|
|
99
|
+
purpose: 'inspection_and_packaging_evidence_only';
|
|
100
|
+
claims: {
|
|
101
|
+
visual_correctness: 'not_verified';
|
|
102
|
+
license_correctness: 'not_verified';
|
|
103
|
+
implementation_correctness: 'not_verified';
|
|
104
|
+
};
|
|
105
|
+
artifacts: GalleryArtifact[];
|
|
106
|
+
}
|
|
107
|
+
export interface DesignProductionDemandTrigger {
|
|
108
|
+
kind: 'repeated_plan_review' | 'multi_asset_production';
|
|
109
|
+
evidence: string;
|
|
110
|
+
}
|
|
111
|
+
export declare function createPlanReviewCanvas(input: {
|
|
112
|
+
root: string;
|
|
113
|
+
session_id: string;
|
|
114
|
+
title: string;
|
|
115
|
+
demand_trigger: DesignProductionDemandTrigger;
|
|
116
|
+
artifacts: Array<Omit<PlanReviewArtifact, 'sha256'> & {
|
|
117
|
+
sha256?: string;
|
|
118
|
+
}>;
|
|
119
|
+
session_path?: string;
|
|
120
|
+
render_path?: string;
|
|
121
|
+
}): Promise<{
|
|
122
|
+
schema: string;
|
|
123
|
+
session_path: string;
|
|
124
|
+
render_path: string;
|
|
125
|
+
session: PlanReviewSession;
|
|
126
|
+
next_action: string;
|
|
127
|
+
claims: {
|
|
128
|
+
session_artifact_integrity: string;
|
|
129
|
+
visual_correctness: string;
|
|
130
|
+
implementation_correctness: string;
|
|
131
|
+
};
|
|
132
|
+
truth_status: "verified" | "partial";
|
|
133
|
+
}>;
|
|
134
|
+
export declare function addPlanReviewComment(input: {
|
|
135
|
+
root: string;
|
|
136
|
+
session_path: string;
|
|
137
|
+
render_path: string;
|
|
138
|
+
comment: Omit<PlanReviewComment, 'anchor_context'>;
|
|
139
|
+
}): Promise<{
|
|
140
|
+
schema: string;
|
|
141
|
+
session_path: string;
|
|
142
|
+
render_path: string;
|
|
143
|
+
session: PlanReviewSession;
|
|
144
|
+
next_action: string;
|
|
145
|
+
claims: {
|
|
146
|
+
session_artifact_integrity: string;
|
|
147
|
+
visual_correctness: string;
|
|
148
|
+
implementation_correctness: string;
|
|
149
|
+
};
|
|
150
|
+
truth_status: "verified" | "partial";
|
|
151
|
+
}>;
|
|
152
|
+
export declare function closePlanReviewCanvas(input: {
|
|
153
|
+
root: string;
|
|
154
|
+
session_path: string;
|
|
155
|
+
render_path: string;
|
|
156
|
+
verdict: PlanReviewVerdict;
|
|
157
|
+
}): Promise<{
|
|
158
|
+
schema: string;
|
|
159
|
+
session_path: string;
|
|
160
|
+
render_path: string;
|
|
161
|
+
session: PlanReviewSession;
|
|
162
|
+
next_action: string;
|
|
163
|
+
claims: {
|
|
164
|
+
session_artifact_integrity: string;
|
|
165
|
+
visual_correctness: string;
|
|
166
|
+
implementation_correctness: string;
|
|
167
|
+
};
|
|
168
|
+
truth_status: "verified" | "partial";
|
|
169
|
+
}>;
|
|
170
|
+
export declare function readPlanReviewSession(file: string): Promise<PlanReviewSession>;
|
|
171
|
+
export declare function createDesignRevisionState(input: {
|
|
172
|
+
root: string;
|
|
173
|
+
session_id: string;
|
|
174
|
+
state_path?: string;
|
|
175
|
+
}): Promise<{
|
|
176
|
+
schema: string;
|
|
177
|
+
state_path: string;
|
|
178
|
+
state: DesignRevisionState;
|
|
179
|
+
truth_status: "verified";
|
|
180
|
+
}>;
|
|
181
|
+
export declare function recordDesignRevisionRound(input: {
|
|
182
|
+
root: string;
|
|
183
|
+
state_path: string;
|
|
184
|
+
reviewer_finding: DesignRevisionRound['reviewer_finding'];
|
|
185
|
+
planned_change: string;
|
|
186
|
+
outcome: DesignRevisionRound['outcome'];
|
|
187
|
+
revision_refs: UeyeRevisionReference[];
|
|
188
|
+
}): Promise<{
|
|
189
|
+
schema: string;
|
|
190
|
+
state_path: string;
|
|
191
|
+
round: DesignRevisionRound;
|
|
192
|
+
state: DesignRevisionState;
|
|
193
|
+
next_action: string;
|
|
194
|
+
truth_status: "verified";
|
|
195
|
+
}>;
|
|
196
|
+
export declare function readDesignRevisionState(file: string): Promise<DesignRevisionState>;
|
|
197
|
+
export declare function readCanonicalDesignRevisionState(input: {
|
|
198
|
+
root: string;
|
|
199
|
+
state_path: string;
|
|
200
|
+
}): Promise<DesignRevisionState>;
|
|
201
|
+
export declare function writeFinalGalleryManifest(input: {
|
|
202
|
+
root: string;
|
|
203
|
+
manifest_path: string;
|
|
204
|
+
session_id: string;
|
|
205
|
+
completion_state: GalleryCompletionState;
|
|
206
|
+
artifacts: GalleryArtifact[];
|
|
207
|
+
}): Promise<{
|
|
208
|
+
schema: string;
|
|
209
|
+
manifest_path: string;
|
|
210
|
+
manifest: FinalGalleryManifest;
|
|
211
|
+
ready: boolean;
|
|
212
|
+
warnings: string[];
|
|
213
|
+
next_action: string;
|
|
214
|
+
truth_status: "partial";
|
|
215
|
+
}>;
|
|
216
|
+
export declare function verifyFinalGalleryManifest(input: {
|
|
217
|
+
root: string;
|
|
218
|
+
manifest_path: string;
|
|
219
|
+
}): Promise<{
|
|
220
|
+
schema: string;
|
|
221
|
+
manifest_path: string;
|
|
222
|
+
artifact_count: number;
|
|
223
|
+
errors: string[];
|
|
224
|
+
ready: boolean;
|
|
225
|
+
claims: {
|
|
226
|
+
visual_correctness: string;
|
|
227
|
+
license_correctness: string;
|
|
228
|
+
implementation_correctness: string;
|
|
229
|
+
};
|
|
230
|
+
next_action: string;
|
|
231
|
+
truth_status: "blocked" | "partial";
|
|
232
|
+
}>;
|
|
233
|
+
export declare function finalizeDesignProductionPhase(input: {
|
|
234
|
+
root: string;
|
|
235
|
+
demand_trigger: DesignProductionDemandTrigger;
|
|
236
|
+
canvas_session_path: string;
|
|
237
|
+
revision_state_path: string | null;
|
|
238
|
+
gallery_manifest_path: string;
|
|
239
|
+
receipt_path: string;
|
|
240
|
+
}): Promise<{
|
|
241
|
+
receipt_path: string;
|
|
242
|
+
receipt_digest: string;
|
|
243
|
+
schema: string;
|
|
244
|
+
session_id: string;
|
|
245
|
+
recorded_at: string;
|
|
246
|
+
demand_trigger: {
|
|
247
|
+
evidence_truth: "operator_asserted";
|
|
248
|
+
kind: "repeated_plan_review" | "multi_asset_production";
|
|
249
|
+
evidence: string;
|
|
250
|
+
};
|
|
251
|
+
canvas: {
|
|
252
|
+
path: string;
|
|
253
|
+
status: "closed";
|
|
254
|
+
verdict: PlanReviewVerdict;
|
|
255
|
+
artifact_integrity: string;
|
|
256
|
+
};
|
|
257
|
+
revision: {
|
|
258
|
+
path: string;
|
|
259
|
+
status: DesignRevisionStatus;
|
|
260
|
+
rounds: number;
|
|
261
|
+
reference_integrity: string;
|
|
262
|
+
};
|
|
263
|
+
gallery: {
|
|
264
|
+
path: string;
|
|
265
|
+
completion_state: "draft" | "ready_for_inspection" | "packaged";
|
|
266
|
+
integrity: string;
|
|
267
|
+
claims: {
|
|
268
|
+
visual_correctness: string;
|
|
269
|
+
license_correctness: string;
|
|
270
|
+
implementation_correctness: string;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
upstream_digests: {
|
|
274
|
+
canvas_session: string;
|
|
275
|
+
revision_state: string;
|
|
276
|
+
gallery_manifest: string;
|
|
277
|
+
};
|
|
278
|
+
execution_boundary: {
|
|
279
|
+
storage: "local_only";
|
|
280
|
+
rendering: "static_html";
|
|
281
|
+
sandbox: "csp_no_script_no_network";
|
|
282
|
+
remote_sharing: false;
|
|
283
|
+
server: false;
|
|
284
|
+
background_service: false;
|
|
285
|
+
};
|
|
286
|
+
phase_evidence_status: "complete" | "bounded_stop" | "incomplete";
|
|
287
|
+
ready: boolean;
|
|
288
|
+
ready_to_claim_correctness: boolean;
|
|
289
|
+
next_action: string;
|
|
290
|
+
truth_status: "partial";
|
|
291
|
+
}>;
|
|
292
|
+
export declare function verifyDesignProductionPhaseReceipt(input: {
|
|
293
|
+
root: string;
|
|
294
|
+
receipt_path: string;
|
|
295
|
+
}): Promise<{
|
|
296
|
+
schema: string;
|
|
297
|
+
receipt_path: string;
|
|
298
|
+
ready: boolean;
|
|
299
|
+
errors: string[];
|
|
300
|
+
upstream_digests: JsonObject;
|
|
301
|
+
receipt_digest: string;
|
|
302
|
+
ready_to_claim_correctness: boolean;
|
|
303
|
+
next_action: string;
|
|
304
|
+
truth_status: "blocked" | "partial";
|
|
305
|
+
}>;
|
|
306
|
+
export {};
|