@ggui-ai/ui-gen 0.24.0 → 0.26.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/README.md +2 -2
- package/dist/{adapter-Du7P_5Fx.d.ts → adapter-BJwn74rx.d.ts} +49 -1
- package/dist/adapters/generation-dispatch.d.ts +32 -7
- package/dist/adapters/generation-dispatch.js +1997 -216
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +29 -6
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +15 -12
- package/dist/advanced/index.js +2013 -270
- package/dist/advanced/index.js.map +1 -1
- package/dist/{axes-CzLEMDeB.d.ts → axes-CKVCzR_x.d.ts} +1 -1
- package/dist/bank-Ctdp3FUA.d.ts +118 -0
- package/dist/blueprint-validator.js +416 -92
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.d.ts +2 -2
- package/dist/boilerplate.js +34 -15
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +13 -5
- package/dist/check/index.js +56 -3
- package/dist/check/index.js.map +1 -1
- package/dist/classifier/index.d.ts +2 -2
- package/dist/compose.d.ts +2 -2
- package/dist/{create-ui-generator-GIhzx08x.d.ts → create-ui-generator-N4gRXpcL.d.ts} +11 -4
- package/dist/{design-mode-DLufhrNp.d.ts → design-mode-DGWN_Gkm.d.ts} +1 -1
- package/dist/{dispatch-BnAH56p4.d.ts → dispatch-BUoXRj_r.d.ts} +6 -4
- package/dist/evaluation/axis-checks/index.d.ts +7 -6
- package/dist/evaluation/axis-checks/index.js +90 -2
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +6 -5
- package/dist/evaluation/axis-checks/registry.js +88 -1
- package/dist/evaluation/axis-checks/registry.js.map +1 -1
- package/dist/evaluation/index.d.ts +189 -344
- package/dist/evaluation/index.js +1272 -59
- package/dist/evaluation/index.js.map +1 -1
- package/dist/evaluation/types.d.ts +26 -1
- package/dist/evaluation/types.js.map +1 -1
- package/dist/fragments/index.d.ts +3 -3
- package/dist/{generate-9IeNT4ZY.d.ts → generate-tSO_shQ0.d.ts} +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +7 -7
- package/dist/harness/check/runtime-render/index.js +416 -92
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/check/runtime-render/render-check-worker.js +393 -88
- package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
- package/dist/harness/index.d.ts +5 -6
- package/dist/harness/index.js +69 -20
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/prompts.d.ts +2 -2
- package/dist/harness/prompts.js +10 -1
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +19 -5
- package/dist/harness/result-types.js.map +1 -1
- package/dist/harness/runtime.d.ts +21 -7
- package/dist/harness/runtime.js +36 -17
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +6 -4
- package/dist/harness/types-public.js +43 -18
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +6 -5
- package/dist/hash.d.ts +1 -1
- package/dist/index.d.ts +64 -13
- package/dist/index.js +2023 -270
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +5 -5
- package/dist/policy.d.ts +1 -1
- package/dist/{prompts-YU9piOgs.d.ts → prompts-BhNUuRoZ.d.ts} +1 -1
- package/dist/tools/get-primitives-ts.d.ts +1 -1
- package/dist/tools/get-primitives-ts.js +1 -1
- package/dist/tools/get-primitives-ts.js.map +1 -1
- package/dist/tools/render-check-worker.js +8 -1
- package/dist/tools/render-check-worker.js.map +1 -1
- package/dist/{types-BOvHNG7K.d.ts → types-Dh1s4K9j.d.ts} +1 -1
- package/dist/types-public-B7wn4ce5.d.ts +959 -0
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/visual-evaluator-C9L-o6ap.d.ts +639 -0
- package/dist/workflows.d.ts +5 -5
- package/package.json +12 -12
- package/src/adapters/generation-dispatch.ts +38 -2
- package/src/adapters/tools.ts +2 -1
- package/src/boilerplate/free-design-prompt.ts +4 -4
- package/src/boilerplate/generate.ts +26 -1
- package/src/boilerplate/hard-sections.ts +14 -14
- package/src/boilerplate/system-prompt.ts +1 -1
- package/src/boilerplate/templates/layouts/chat-mobile.tsx.tmpl +3 -1
- package/src/boilerplate/templates/layouts/chat-universal.tsx.tmpl +3 -1
- package/src/boilerplate/templates/layouts/fullscreen-desktop.tsx.tmpl +3 -1
- package/src/boilerplate/templates/layouts/fullscreen-universal.tsx.tmpl +3 -1
- package/src/check/index.ts +1 -0
- package/src/check/run-tier0.ts +6 -3
- package/src/check/sample-props.ts +63 -0
- package/src/coding-agent/tools.ts +4 -1
- package/src/contract-context.ts +1 -1
- package/src/create-harness.ts +3 -3
- package/src/create-ui-generator.ts +20 -1
- package/src/evaluation/__fixtures__/png.ts +100 -0
- package/src/evaluation/axis-checks/checks/state-merge.ts +1 -1
- package/src/evaluation/axis-checks/checks/universal.ts +111 -0
- package/src/evaluation/axis-checks/dispatch.ts +4 -1
- package/src/evaluation/cost-tracker.ts +54 -6
- package/src/evaluation/criteria/bank.ts +85 -0
- package/src/evaluation/criteria/context.ts +52 -0
- package/src/evaluation/criteria/edge-probe.ts +286 -0
- package/src/evaluation/criteria/edge.ts +202 -0
- package/src/evaluation/criteria/resolve.ts +207 -0
- package/src/evaluation/criteria/select.ts +79 -0
- package/src/evaluation/index.ts +27 -0
- package/src/evaluation/ink-extent.ts +200 -0
- package/src/evaluation/judge-spend.ts +48 -0
- package/src/evaluation/theme-css.ts +12 -5
- package/src/evaluation/types-public.ts +221 -3
- package/src/evaluation/types.ts +19 -0
- package/src/evaluation/visual-evaluator.ts +853 -51
- package/src/harness/check/runtime-render/adapter.ts +18 -0
- package/src/harness/check/runtime-render/probe-pending.ts +111 -0
- package/src/harness/check/runtime-render/render-check-host.ts +10 -6
- package/src/harness/check/runtime-render/render-check-worker.ts +6 -3
- package/src/harness/check/runtime-render/render-check.ts +417 -133
- package/src/harness/check/runtime-render/walk.ts +200 -0
- package/src/harness/coding/assemble-result.ts +2 -0
- package/src/harness/coding/generate-task-runner.ts +30 -0
- package/src/harness/coding/init-session.ts +5 -3
- package/src/harness/coding/run-coding-turn.ts +12 -4
- package/src/harness/coding/run-eval-round.ts +82 -3
- package/src/harness/in-loop-evaluation.ts +39 -0
- package/src/harness/llm-router.ts +58 -1
- package/src/harness/result-types.ts +9 -0
- package/src/harness/runtime.ts +14 -0
- package/src/harness/types-public.ts +10 -1
- package/src/harness-tool-names.ts +38 -0
- package/src/index.ts +17 -0
- package/src/internal/verdict-line.ts +33 -0
- package/src/run-check.ts +2 -0
- package/src/taught-tokens.ts +32 -0
- package/src/tools/get-primitives-ts.ts +1 -1
- package/src/tools/get-wire.ts +1 -1
- package/src/tools/render-check-worker.ts +2 -1
- package/src/tools/render-check.ts +8 -67
- package/src/tools.ts +11 -1
- package/src/validation/primitives.ts +1 -1
- package/dist/llm-router-DwwUK1bz.d.ts +0 -265
- package/dist/types-public-Bk6d1WLN.d.ts +0 -451
|
@@ -1,451 +0,0 @@
|
|
|
1
|
-
import { GenerationRuntimeProbeStatus, GenerationRuntimeProbeOutcome } from '@ggui-ai/mcp-server-core';
|
|
2
|
-
import { C as CanvasClass, D as DesignMode } from './design-mode-DLufhrNp.js';
|
|
3
|
-
import { DataContract } from '@ggui-ai/protocol';
|
|
4
|
-
import { C as Classification, A as AxisVector } from './axes-CzLEMDeB.js';
|
|
5
|
-
import { A as AxisKey } from './types-BOvHNG7K.js';
|
|
6
|
-
|
|
7
|
-
type Priority = "P0" | "P1" | "P2";
|
|
8
|
-
|
|
9
|
-
type EvalTier = 0 | 1 | 2;
|
|
10
|
-
type EvalOutcome = "fail" | "warn" | "pass";
|
|
11
|
-
type EvalCategory = "compile" | "security" | "contract" | "types" | "imports" | "tokens" | "mode" | "functionality" | "crash" | "interactivity" | "accessibility" | "layout" | "loading" | "visual";
|
|
12
|
-
interface EvalIssue {
|
|
13
|
-
tier: EvalTier;
|
|
14
|
-
result: EvalOutcome;
|
|
15
|
-
category: EvalCategory;
|
|
16
|
-
/**
|
|
17
|
-
* Priority tier — threaded through to the retry formatter so the LLM can
|
|
18
|
-
* rank its next patch against the prompt's P0/P1/P2 priority schema.
|
|
19
|
-
* Derived from (category, result) via {@link priorityForIssue} when not
|
|
20
|
-
* explicitly set. Optional on construction; check-runners typically
|
|
21
|
-
* populate it before returning.
|
|
22
|
-
*/
|
|
23
|
-
priority?: Priority;
|
|
24
|
-
subcategory?: string;
|
|
25
|
-
severity?: "critical" | "major";
|
|
26
|
-
description: string;
|
|
27
|
-
fix: string;
|
|
28
|
-
line?: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Runtime-render probe execution status — four-valued so "the probe
|
|
32
|
-
* never ran" is never conflated with "the probe ran clean". ONE union: the
|
|
33
|
-
* same values a generation's metadata reports (`GenerationRuntimeProbeStatus`
|
|
34
|
-
* in `@ggui-ai/mcp-server-core`), declared there and named here.
|
|
35
|
-
*
|
|
36
|
-
* - `ran` — probe executed; its findings (possibly none) are
|
|
37
|
-
* in the issue stream under `runtime:*` subcategories.
|
|
38
|
-
* - `infra-skipped` — probe could NOT execute (environment failure:
|
|
39
|
-
* happy-dom load, user-event document capture,
|
|
40
|
-
* ESM/CJS interop). Carries ZERO probe evidence;
|
|
41
|
-
* consumers MUST NOT count it as a pass.
|
|
42
|
-
* - `not-applicable`— nothing to probe (no compiled code, no contract
|
|
43
|
-
* surface, or no runtimeRender check configured).
|
|
44
|
-
* - `timed-out` — probe started but did not finish inside its
|
|
45
|
-
* wall-clock bound (ggui#1299). Carries ZERO
|
|
46
|
-
* evidence about the component: on a contended
|
|
47
|
-
* host an ordinary component crosses the bound.
|
|
48
|
-
* Consumers MUST NOT count it as a pass, and MUST
|
|
49
|
-
* NOT count it as a crash either. `elapsedMs` and
|
|
50
|
-
* `hostLoad` say how long it ran and how busy the
|
|
51
|
-
* host was, so a reader can tell the two cases apart.
|
|
52
|
-
*/
|
|
53
|
-
type RuntimeProbeStatus = GenerationRuntimeProbeStatus;
|
|
54
|
-
/**
|
|
55
|
-
* The host's 1-minute load average at a probe's start and end, beside the
|
|
56
|
-
* number of CPUs the process can use (ggui#1299). A load well above
|
|
57
|
-
* `cores` means the probe competed for CPU; a wall-clock bound crossed
|
|
58
|
-
* there says more about the host than about the component.
|
|
59
|
-
*/
|
|
60
|
-
interface ProbeHostLoad {
|
|
61
|
-
readonly start: number;
|
|
62
|
-
readonly end: number;
|
|
63
|
-
readonly cores: number;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* The engine's own fields on a probe's meta, beside the outcome a
|
|
67
|
-
* generation's metadata reports: why a probe did not finish, its render
|
|
68
|
-
* time, the host's load around it. Present on every arm of
|
|
69
|
-
* {@link RuntimeProbeMeta}; each is absent when the probe had nothing to
|
|
70
|
-
* say about it.
|
|
71
|
-
*/
|
|
72
|
-
interface RuntimeProbeMetaDetail {
|
|
73
|
-
/** Populated for `infra-skipped` / `not-applicable` / `timed-out` — why the probe didn't finish. */
|
|
74
|
-
readonly reason?: string;
|
|
75
|
-
/** `ran` only: the check's own render time, inside `elapsedMs`. */
|
|
76
|
-
readonly renderMs?: number;
|
|
77
|
-
/** Host load around the probe, when it ran isolated (absent for an in-process probe). */
|
|
78
|
-
readonly hostLoad?: ProbeHostLoad;
|
|
79
|
-
/** Time the check waited for a probe slot before it started, ms; present only when > 0 (ggui#1380 C2b). */
|
|
80
|
-
readonly queuedMs?: number;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Probe execution meta stamped onto an `EvalResult` at the exit-decision
|
|
84
|
-
* points that invoke the probe. Absence of this field means the eval
|
|
85
|
-
* path never reached a probe invocation at all — consumers treat that
|
|
86
|
-
* the same as not-run, never as a pass.
|
|
87
|
-
*
|
|
88
|
-
* ONE union with the generation metadata's probe outcome
|
|
89
|
-
* (`GenerationRuntimeProbeOutcome` in `@ggui-ai/mcp-server-core`, declared
|
|
90
|
-
* there and carried here with {@link RuntimeProbeMetaDetail} on every arm),
|
|
91
|
-
* so the round's stamp and the metadata's record cannot say different
|
|
92
|
-
* things (ggui#1380):
|
|
93
|
-
*
|
|
94
|
-
* - `ran` + `verdict: 'pass'` — the probe executed and no check failed;
|
|
95
|
-
* - `ran` + `verdict: 'fail'` — ANY check failed; `failChecks` lists the
|
|
96
|
-
* distinct check kinds that did (`RenderCheckKind`, the engine's name
|
|
97
|
-
* for the same union), never empty, in the order `RENDER_CHECK_KINDS`
|
|
98
|
-
* declares them, parsed from the probe's own
|
|
99
|
-
* `runtime:<check>[:<subject>]` issues;
|
|
100
|
-
* - `timed-out` / `infra-skipped` / `not-applicable` — no verdict, and the
|
|
101
|
-
* type carries none. `elapsedMs` (on every status that reached the
|
|
102
|
-
* check) and `hostLoad` say how long it ran and how busy the host was.
|
|
103
|
-
*
|
|
104
|
-
* The verdict and the repair trigger are two different questions. The
|
|
105
|
-
* verdict is `fail` on any failing check. The one repair turn a probe-only
|
|
106
|
-
* round buys fires on a `render-no-throw` fail the engine recognises
|
|
107
|
-
* (`isRecoverableRenderCrash`) and on nothing else: a `fail` verdict whose
|
|
108
|
-
* checks are `prop-sensitivity`, `action-wiring` or any other kind is
|
|
109
|
-
* recorded here and never fed back.
|
|
110
|
-
*/
|
|
111
|
-
type RuntimeProbeMeta = GenerationRuntimeProbeOutcome & RuntimeProbeMetaDetail;
|
|
112
|
-
/**
|
|
113
|
-
* The one repair turn a probe-only round buys (ggui#1380). A serving
|
|
114
|
-
* deployment that wires the runtime probe and configures no evaluator runs
|
|
115
|
-
* the probe once after the coding turns; a render crash the engine
|
|
116
|
-
* recognises buys exactly one repair turn, then one re-probe. This records
|
|
117
|
-
* what came of it:
|
|
118
|
-
* - `compiled: false` — the repair turn's code did not pass self-check, so
|
|
119
|
-
* no re-probe ran (there is no `after`) and the pre-repair card is the
|
|
120
|
-
* one served;
|
|
121
|
-
* - `compiled: true` — the re-probe ran and `after` is its whole meta:
|
|
122
|
-
* its status, its verdict when it ran, and the checks that still fail.
|
|
123
|
-
* Whether the crash class the turn was bought for is still there is
|
|
124
|
-
* `after.verdict === 'fail' && after.failChecks.includes('render-no-throw')`.
|
|
125
|
-
* The two arms are exclusive by type.
|
|
126
|
-
*/
|
|
127
|
-
type RuntimeProbeRepair = {
|
|
128
|
-
readonly attempted: true;
|
|
129
|
-
readonly compiled: false;
|
|
130
|
-
readonly trigger?: never;
|
|
131
|
-
} | {
|
|
132
|
-
readonly attempted: true;
|
|
133
|
-
readonly compiled: true;
|
|
134
|
-
readonly trigger: RuntimeProbeMeta;
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* Per-criterion execution status — three-valued so "the criterion
|
|
138
|
-
* silently produced no verdict" is never conflated with "the criterion
|
|
139
|
-
* ran clean", and neither is conflated with "not evaluated by design".
|
|
140
|
-
* Same doctrine and vocabulary family as `RuntimeProbeStatus` above.
|
|
141
|
-
*
|
|
142
|
-
* - `ran` — the LLM call completed and returned a verdict
|
|
143
|
-
* for this criterion; its findings (possibly
|
|
144
|
-
* none) are in `issues`.
|
|
145
|
-
* - `skipped` — the call errored or returned no tool call. The
|
|
146
|
-
* criterion carries ZERO evidence; the evaluator
|
|
147
|
-
* fail-opens it into `pass` to avoid blocking
|
|
148
|
-
* generation on flaky LLM calls, so consumers
|
|
149
|
-
* MUST consult this field before treating `pass`
|
|
150
|
-
* membership as a verdict. Counts AGAINST
|
|
151
|
-
* coverage.
|
|
152
|
-
* - `not-applicable` — the evaluator was bypassed by design for this
|
|
153
|
-
* cell (e.g. the same-image low-risk bypass:
|
|
154
|
-
* axis checks clean, tier-1/2 never invoked).
|
|
155
|
-
* `reason` names the bypass. Excluded from
|
|
156
|
-
* coverage denominators — it is neither evidence
|
|
157
|
-
* nor a silent absence.
|
|
158
|
-
*/
|
|
159
|
-
type CriterionRunStatus = "ran" | "skipped" | "not-applicable";
|
|
160
|
-
/** Coverage row for one evaluation criterion of one eval run. */
|
|
161
|
-
interface CriterionCoverage {
|
|
162
|
-
readonly criterion: string;
|
|
163
|
-
readonly tier: 1 | 2;
|
|
164
|
-
readonly status: CriterionRunStatus;
|
|
165
|
-
/** Populated for `skipped` / `not-applicable` — why no verdict. */
|
|
166
|
-
readonly reason?: string;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Coverage of the screenshot JUDGE leg for one eval round (ggui#1221) — a
|
|
170
|
-
* different surface from the `visual` CRITERION in `criteriaCoverage` (the
|
|
171
|
-
* LLM evaluator's read of the source). `ran` = a frame was captured and
|
|
172
|
-
* judged; `skipped` = the leg was configured but produced no verdict
|
|
173
|
-
* (no browser, a launch or in-page failure, an unbundlable component, an
|
|
174
|
-
* unparsable judge answer) with `reason` naming why; `not-applicable` =
|
|
175
|
-
* the round had no visual leg configured. Before this row a skipped leg
|
|
176
|
-
* left NO trace on the result — `{ issues: [] }` read exactly like a
|
|
177
|
-
* clean run, and every bootstrap mint on a browserless runtime "passed"
|
|
178
|
-
* its visual round that way.
|
|
179
|
-
*/
|
|
180
|
-
interface VisualCoverage {
|
|
181
|
-
readonly status: CriterionRunStatus;
|
|
182
|
-
/** Populated for `skipped` / `not-applicable` — why no verdict. */
|
|
183
|
-
readonly reason?: string;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* The static criteria `runLLMEvaluation` runs, in stamp order — the
|
|
187
|
-
* ONE list both the evaluator's coverage stamp and the harness's
|
|
188
|
-
* bypass stamp derive from, so the two can never disagree on the set.
|
|
189
|
-
* Tier 1 = binary pass/fail gates; tier 2 = fail/warn/pass quality.
|
|
190
|
-
*/
|
|
191
|
-
declare const LLM_EVAL_STATIC_CRITERIA: ReadonlyArray<{
|
|
192
|
-
readonly criterion: string;
|
|
193
|
-
readonly tier: 1 | 2;
|
|
194
|
-
}>;
|
|
195
|
-
/**
|
|
196
|
-
* Coverage rows for a cell where the evaluator was BYPASSED BY DESIGN
|
|
197
|
-
* (never invoked) — one `not-applicable` row per static criterion, all
|
|
198
|
-
* carrying `reason`. Harness exits that skip tier-1/2 evaluation stamp
|
|
199
|
-
* this so the cell is neither a silent absence (field missing) nor
|
|
200
|
-
* evidence. Same shape contract as `runLLMEvaluation`'s stamp: always
|
|
201
|
-
* every criterion. Lives here (not in llm-evaluator) because the bypass
|
|
202
|
-
* exit runs before the evaluator module is lazily loaded.
|
|
203
|
-
*/
|
|
204
|
-
declare function notApplicableCoverage(reason: string): CriterionCoverage[];
|
|
205
|
-
/** One contract-feedback round (ggui#1261): what bought it, and the source it was fed back on. */
|
|
206
|
-
interface ContractFeedbackRecord {
|
|
207
|
-
/** The exit-probe issue subcategories that bought the round, e.g. `runtime:prop-sensitivity:currentUser`. */
|
|
208
|
-
readonly firedOn: readonly string[];
|
|
209
|
-
/** The component source as it stood when the model was told — the round's BEFORE. */
|
|
210
|
-
readonly sourceBefore: string;
|
|
211
|
-
}
|
|
212
|
-
interface EvalResult {
|
|
213
|
-
issues: EvalIssue[];
|
|
214
|
-
pass: string[];
|
|
215
|
-
/**
|
|
216
|
-
* Per-criterion coverage for this eval run — one row per static
|
|
217
|
-
* criterion, ALWAYS all of them when present. Stamped by
|
|
218
|
-
* `runLLMEvaluation` (`ran` / `skipped`) and by the harness on
|
|
219
|
-
* evaluator-bypass exits (`not-applicable` + reason). The harness
|
|
220
|
-
* carries it unchanged through every later re-stamp of this result.
|
|
221
|
-
* Absent = coverage UNKNOWN (paths that predate the instrument, e.g.
|
|
222
|
-
* `parseEvalResponse` replays) — never assume `ran`, never assume
|
|
223
|
-
* bypass.
|
|
224
|
-
*/
|
|
225
|
-
criteriaCoverage?: CriterionCoverage[];
|
|
226
|
-
/**
|
|
227
|
-
* Runtime-render probe execution meta. Stamped by the exit-decision
|
|
228
|
-
* probe runner; absent on eval paths that never invoke the probe.
|
|
229
|
-
*/
|
|
230
|
-
runtimeProbe?: RuntimeProbeMeta;
|
|
231
|
-
/**
|
|
232
|
-
* The probe-only round's repair record (ggui#1380) — present only when a
|
|
233
|
-
* recoverable render crash bought the one repair turn. See
|
|
234
|
-
* {@link RuntimeProbeRepair}. `runtimeProbe` beside it is the re-probe's
|
|
235
|
-
* verdict when the repair compiled, else the pre-repair probe's.
|
|
236
|
-
*/
|
|
237
|
-
runtimeProbeRepair?: RuntimeProbeRepair;
|
|
238
|
-
/**
|
|
239
|
-
* The contract-feedback round, when one fired this generation (ggui#1261):
|
|
240
|
-
* which exit-probe findings bought it and the source as it stood when the
|
|
241
|
-
* model was told. `runtimeProbe` and the `runtime:*` issues on this result
|
|
242
|
-
* are the probe's verdict AFTER that round; `sourceBefore` beside the final
|
|
243
|
-
* source is the round's before/after. Absent when no such round fired.
|
|
244
|
-
*/
|
|
245
|
-
contractFeedback?: ContractFeedbackRecord;
|
|
246
|
-
/**
|
|
247
|
-
* Per-canvas visual verdicts. Stamped by the harness ONLY when the
|
|
248
|
-
* visual leg ran with `visualEvaluation.canvases` set (arm-neutral —
|
|
249
|
-
* the same judge in every design mode); absent on the single-shot
|
|
250
|
-
* visual path and whenever the visual leg did not run. PNGs stay on
|
|
251
|
-
* `runVisualEvaluation`'s own result (`VisualEvaluationResult.canvases[*].screenshotPng`),
|
|
252
|
-
* never here — this object is serialized into reports.
|
|
253
|
-
*/
|
|
254
|
-
visual?: VisualEvalSummary;
|
|
255
|
-
/**
|
|
256
|
-
* Whether the screenshot judge leg ran, was skipped (with the reason) or
|
|
257
|
-
* was not configured — ALWAYS stamped by the harness's eval round
|
|
258
|
-
* (ggui#1221), so a consumer can tell a clean visual run from a leg
|
|
259
|
-
* that silently could not run. See {@link VisualCoverage}.
|
|
260
|
-
*/
|
|
261
|
-
visualCoverage?: VisualCoverage;
|
|
262
|
-
}
|
|
263
|
-
/** One canvas's visual verdict, PNG-free — see `EvalResult.visual`. */
|
|
264
|
-
/**
|
|
265
|
-
* How one canvas's `score` was reached (ggui#1072): `k` vision calls on the
|
|
266
|
-
* SAME captured frame, aggregated by `rule`. Always present — `k: 1` ⇒
|
|
267
|
-
* `samples: [score]`, `sigma: 0`, `notes: [critique]` — so one shape serves
|
|
268
|
-
* a single judgement and a median of many. `samples`/`notes` carry only the
|
|
269
|
-
* calls the judge could parse (in call order); `k` stays the requested count,
|
|
270
|
-
* so a short `samples` is visible on the row rather than filled in.
|
|
271
|
-
*/
|
|
272
|
-
interface CanvasJudgeRecord {
|
|
273
|
-
readonly k: number;
|
|
274
|
-
readonly rule: 'median';
|
|
275
|
-
readonly samples: number[];
|
|
276
|
-
/** Population σ of `samples` (0 when one sample). */
|
|
277
|
-
readonly sigma: number;
|
|
278
|
-
/** The judge's per-canvas critique per sample — the words beside a swing. */
|
|
279
|
-
readonly notes: string[];
|
|
280
|
-
}
|
|
281
|
-
interface CanvasVisualSummary {
|
|
282
|
-
canvas: CanvasClass;
|
|
283
|
-
viewport: {
|
|
284
|
-
width: number;
|
|
285
|
-
height: number;
|
|
286
|
-
};
|
|
287
|
-
/** The judge's weighted score at this canvas (0-100). */
|
|
288
|
-
score: number;
|
|
289
|
-
/** `score >= passThreshold`, and on the inline card: no overflow (ggui#1027). */
|
|
290
|
-
passed: boolean;
|
|
291
|
-
/** The document's scroll height at this canvas, CSS px; `null` when unmeasurable (ggui#1027). */
|
|
292
|
-
contentHeight: number | null;
|
|
293
|
-
/** `contentHeight > viewport.height` — measured on every canvas, judged per `canvasFitPolicy`. */
|
|
294
|
-
overflow: boolean;
|
|
295
|
-
/** How `score` was reached — always present (ggui#1072). */
|
|
296
|
-
judge: CanvasJudgeRecord;
|
|
297
|
-
/**
|
|
298
|
-
* How the judge composed the mount (ggui#1100): `'fill'` on every
|
|
299
|
-
* fullscreen canvas — the served runtime's fit, the root stretched to
|
|
300
|
-
* the frame; absent on the inline card, which keeps its natural height.
|
|
301
|
-
*/
|
|
302
|
-
fit?: 'fill';
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* ggui#1195 — the fit reading on the canvas whose policy FAILS an overflow
|
|
306
|
-
* (the inline chat card): the box it was judged at (`ceiling` — the order's
|
|
307
|
-
* declared viewport when one was carried, else the class box), whether that
|
|
308
|
-
* box was declared, and how many px of content sit below it (0 = fits).
|
|
309
|
-
* Present only when such a canvas was judged with a measurable height, so
|
|
310
|
-
* the bar and the ledger read one number for "does the hello fit".
|
|
311
|
-
*/
|
|
312
|
-
interface VisualFitStamp {
|
|
313
|
-
readonly canvas: CanvasClass;
|
|
314
|
-
readonly ceiling: {
|
|
315
|
-
readonly width: number;
|
|
316
|
-
readonly height: number;
|
|
317
|
-
};
|
|
318
|
-
readonly declared: boolean;
|
|
319
|
-
readonly overflowPx: number;
|
|
320
|
-
}
|
|
321
|
-
/** The visual leg's per-canvas summary — see `EvalResult.visual`. */
|
|
322
|
-
interface VisualEvalSummary {
|
|
323
|
-
/** Mean of the canvas scores (rounded). */
|
|
324
|
-
score: number;
|
|
325
|
-
/** Every canvas passed. */
|
|
326
|
-
passed: boolean;
|
|
327
|
-
canvases: CanvasVisualSummary[];
|
|
328
|
-
/** ggui#1195 — see {@link VisualFitStamp}; absent when no fail-policy canvas was judged. */
|
|
329
|
-
fit?: VisualFitStamp;
|
|
330
|
-
/** The design tree the judge painted with (ggui#1042): `src` + `srcSha256` — `design@judge`. */
|
|
331
|
-
design?: {
|
|
332
|
-
readonly src: string;
|
|
333
|
-
readonly srcSha256: string;
|
|
334
|
-
};
|
|
335
|
-
/** The mode the judge's tokens were composed in, when the caller said (ggui#1076). */
|
|
336
|
-
themeMode?: 'light' | 'dark';
|
|
337
|
-
}
|
|
338
|
-
type QualityMode = "fast" | "auto-improve" | "high-quality";
|
|
339
|
-
interface QualityConfig {
|
|
340
|
-
quality: QualityMode;
|
|
341
|
-
visualEval: boolean;
|
|
342
|
-
maxCostPerGeneration: number;
|
|
343
|
-
model?: {
|
|
344
|
-
provider?: string;
|
|
345
|
-
model?: string;
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
declare const DEFAULT_QUALITY_CONFIG: QualityConfig;
|
|
349
|
-
|
|
350
|
-
interface AxisCheckInput {
|
|
351
|
-
sourceCode: string;
|
|
352
|
-
compiledCode: string | null;
|
|
353
|
-
contract?: DataContract;
|
|
354
|
-
originalPrompt: string;
|
|
355
|
-
/** Full classification — checks may read sibling axes. */
|
|
356
|
-
classification: Classification;
|
|
357
|
-
/**
|
|
358
|
-
* Which triad produced the source. Checks that assert a design-package
|
|
359
|
-
* component (e.g. `layout.multi_step.stepper_adopted`) read it and
|
|
360
|
-
* stand down in `free` mode, where the primitive is optional. Absent
|
|
361
|
-
* means `constrained`.
|
|
362
|
-
*/
|
|
363
|
-
designMode?: DesignMode;
|
|
364
|
-
/**
|
|
365
|
-
* The rendering canvas the source is judged FOR (ggui#1117). A width cap on
|
|
366
|
-
* the outermost element is a defect on a fullscreen canvas and a no-op in a
|
|
367
|
-
* chat bubble, so a check that reads width must know the surface. Populated
|
|
368
|
-
* where the harness is built (`Harness.canvas`); ABSENT for callers with no
|
|
369
|
-
* rendering context — a check handles `undefined`, it never assumes a
|
|
370
|
-
* default (a silent `lg` would be the same guess with a nicer face).
|
|
371
|
-
*/
|
|
372
|
-
canvas?: CanvasClass;
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* A gated check. Runs only when the classification's axis value matches
|
|
376
|
-
* one of the gate's accepted values. Multiple gates (implicit AND) support
|
|
377
|
-
* cross-axis combinations.
|
|
378
|
-
*/
|
|
379
|
-
interface AxisCheck {
|
|
380
|
-
/** Stable id used in issue subcategories. */
|
|
381
|
-
id: string;
|
|
382
|
-
/** Primary axis this check gates on. */
|
|
383
|
-
axis: AxisKey;
|
|
384
|
-
/** Which values of that axis activate the check. */
|
|
385
|
-
values: readonly string[];
|
|
386
|
-
/** Optional extra gate on a sibling axis (e.g., only when state=merge AND writes=per-item). */
|
|
387
|
-
and?: {
|
|
388
|
-
axis: AxisKey;
|
|
389
|
-
values: readonly string[];
|
|
390
|
-
};
|
|
391
|
-
/** Execute the check and emit zero or more issues. */
|
|
392
|
-
run(input: AxisCheckInput): EvalIssue[];
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Whether a check's gate(s) match the given axis vector. Pure function,
|
|
396
|
-
* no issue emission.
|
|
397
|
-
*/
|
|
398
|
-
declare function matches(vector: AxisVector, check: AxisCheck): boolean;
|
|
399
|
-
/**
|
|
400
|
-
* Map a tier-0 issue category to the canonical P0/P1/P2 priority.
|
|
401
|
-
*
|
|
402
|
-
* Sourced from the criteria priority assignments:
|
|
403
|
-
* - P0 (must): compile, security, imports, contract, types, mode
|
|
404
|
-
* - P1 (safety): tokens, crash, functionality
|
|
405
|
-
* - P2 (quality): interactivity, accessibility, layout, loading, visual
|
|
406
|
-
*/
|
|
407
|
-
declare function priorityForIssue(category: EvalCategory): Priority;
|
|
408
|
-
/** Whether any issue blocks shipping (has result = 'fail'). */
|
|
409
|
-
declare function isBlocked(result: EvalResult): boolean;
|
|
410
|
-
/**
|
|
411
|
-
* Return the issues the agent should act on, depending on quality mode.
|
|
412
|
-
* - fast: only fails (blocking issues)
|
|
413
|
-
* - auto-improve / high-quality: fails + warns
|
|
414
|
-
*/
|
|
415
|
-
declare function getActionableIssues(result: EvalResult, mode: QualityMode): EvalIssue[];
|
|
416
|
-
interface EvalCriterion {
|
|
417
|
-
/** Unique identifier matching the eval tool name (e.g., 'functionality') */
|
|
418
|
-
id: string;
|
|
419
|
-
/** Human-readable name shown to both agents */
|
|
420
|
-
name: string;
|
|
421
|
-
/** Priority tier — P0 must, P1 should, P2 nice */
|
|
422
|
-
priority: Priority;
|
|
423
|
-
/** What the coding agent should DO to satisfy this criterion */
|
|
424
|
-
codingGuidance: string;
|
|
425
|
-
/** What the eval agent should CHECK — the evaluation prompt */
|
|
426
|
-
evalInstruction: string;
|
|
427
|
-
/** Tier 0 = programmatic, Tier 1 = LLM critical, Tier 2 = LLM quality */
|
|
428
|
-
tier: 0 | 1 | 2;
|
|
429
|
-
/** Eval outcome when this criterion fails */
|
|
430
|
-
failOutcome: "fail" | "warn";
|
|
431
|
-
}
|
|
432
|
-
declare const CRITERIA: readonly EvalCriterion[];
|
|
433
|
-
/**
|
|
434
|
-
* The criteria registry for a design mode. `constrained` IS `CRITERIA`
|
|
435
|
-
* (same array, byte-identical summary); `free` swaps in the two
|
|
436
|
-
* overrides above by id, preserving order.
|
|
437
|
-
*/
|
|
438
|
-
declare function criteriaFor(designMode?: DesignMode): readonly EvalCriterion[];
|
|
439
|
-
/** Get all criteria for a specific priority level */
|
|
440
|
-
declare function getCriteriaByPriority(priority: Priority, designMode?: DesignMode): EvalCriterion[];
|
|
441
|
-
/** Get a specific criterion by ID */
|
|
442
|
-
declare function getCriterionById(id: string, designMode?: DesignMode): EvalCriterion | undefined;
|
|
443
|
-
/** Get all LLM-evaluated criteria (tier 1 + 2) */
|
|
444
|
-
declare function getLLMCriteria(designMode?: DesignMode): EvalCriterion[];
|
|
445
|
-
/**
|
|
446
|
-
* Build the coding agent's criteria summary from the single source of truth.
|
|
447
|
-
* Grouped by priority for the P0→P1→P2 hierarchy.
|
|
448
|
-
*/
|
|
449
|
-
declare function buildCodingCriteriaSummary(designMode?: DesignMode): string;
|
|
450
|
-
|
|
451
|
-
export { type AxisCheck as A, type CanvasJudgeRecord as C, DEFAULT_QUALITY_CONFIG as D, type EvalIssue as E, LLM_EVAL_STATIC_CRITERIA as L, type ProbeHostLoad as P, type QualityConfig as Q, type RuntimeProbeStatus as R, type VisualEvalSummary as V, type AxisCheckInput as a, type EvalResult as b, type EvalTier as c, type VisualCoverage as d, CRITERIA as e, type CanvasVisualSummary as f, type ContractFeedbackRecord as g, type CriterionCoverage as h, type CriterionRunStatus as i, type EvalCategory as j, type EvalCriterion as k, type EvalOutcome as l, matches as m, type Priority as n, type QualityMode as o, buildCodingCriteriaSummary as p, criteriaFor as q, getActionableIssues as r, getCriteriaByPriority as s, getCriterionById as t, getLLMCriteria as u, isBlocked as v, notApplicableCoverage as w, priorityForIssue as x };
|