frontend-harness 0.6.0 → 0.6.2
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 +14 -0
- package/README.md +1 -1
- package/dist/cli/index.js +45 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/runtime/builtin-skills.js +2 -2
- package/dist/runtime/clean.js +1 -3
- package/dist/runtime/clean.js.map +1 -1
- package/dist/runtime/graph.js +13 -0
- package/dist/runtime/graph.js.map +1 -1
- package/dist/runtime/knowledge.js +29 -3
- package/dist/runtime/knowledge.js.map +1 -1
- package/dist/runtime/plan/guidance.js +1 -0
- package/dist/runtime/plan/guidance.js.map +1 -1
- package/dist/runtime/policy-provenance.d.ts +1 -1
- package/dist/runtime/policy-provenance.js +3 -51
- package/dist/runtime/policy-provenance.js.map +1 -1
- package/dist/runtime/project-discovery.js +3 -2
- package/dist/runtime/project-discovery.js.map +1 -1
- package/dist/runtime/protocol-init.d.ts +9 -1
- package/dist/runtime/protocol-init.js +117 -10
- package/dist/runtime/protocol-init.js.map +1 -1
- package/dist/runtime/repair-decision.js +14 -3
- package/dist/runtime/repair-decision.js.map +1 -1
- package/dist/runtime/repair-packet.js +48 -2
- package/dist/runtime/repair-packet.js.map +1 -1
- package/dist/runtime/skills.js +20 -7
- package/dist/runtime/skills.js.map +1 -1
- package/dist/runtime/ui-restoration.d.ts +3 -3
- package/dist/runtime/ui-restoration.js +15 -9
- package/dist/runtime/ui-restoration.js.map +1 -1
- package/dist/runtime/units.js +11 -0
- package/dist/runtime/units.js.map +1 -1
- package/dist/runtime/verification-commands.d.ts +5 -0
- package/dist/runtime/verification-commands.js +36 -8
- package/dist/runtime/verification-commands.js.map +1 -1
- package/dist/runtime/verify.js +74 -12
- package/dist/runtime/verify.js.map +1 -1
- package/dist/schemas/types.d.ts +1 -1
- package/dist/schemas/validation.js +84 -5
- package/dist/schemas/validation.js.map +1 -1
- package/dist/storage/json.js +1 -6
- package/dist/storage/json.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const UI_RESTORATION_CONSTRAINTS: ("Treat provider-specific design output such as MCP/Pixso/Figma/MasterGo/Stitch/design_to_code/HTML as source material
|
|
2
|
-
export declare const UI_RESTORATION_CORE_GUIDANCE: readonly ["For ordinary UI implementation, use the planned execution boundary, local component conventions, and user-visible state coverage without adding design-restoration evidence.", "When a real design source is provided, capture visual reference, structure/style facts, source metadata, and any generated baseline before coding.", "Use source evidence by purpose: DST/DSL or structured design data
|
|
1
|
+
export declare const UI_RESTORATION_CONSTRAINTS: ("Treat provider-specific design output such as MCP/Pixso/Figma/MasterGo/Stitch/design_to_code/HTML as source material that must be analyzed before it is used as project code." | "For design-backed UI restoration, visual equivalence to the design source is the highest priority for the first project implementation; source material does not mean the agent may redesign the screen." | "When both design structure data and visual references exist, use design structure data for hierarchy, text, dimensions, tokens, and component boundaries; use visual references for final visual verification." | "Normalize provider-specific design evidence into a design artifact with visual reference, structure tree, style facts, optional generated code, and source metadata before implementation." | "When design_to_code or generated design markup is available, preserve it and classify its usability as usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable before deciding whether it can drive implementation or repair." | "Use design_to_code as repair-loop evidence and a candidate implementation source: it may be copied into project source only after usability analysis proves it fits the project boundary and conventions." | "Classify design images before implementation as required content, functional UI element, brand/product asset, decorative sample, or replaceable placeholder, and preserve only required images as durable assets." | "Normalize generated UI into project components, naming, state, routing, and styling conventions." | "Allow project-native rewrites to change file placement, framework integration, semantic markup, asset localization, naming, state wiring, and component boundaries only when the rendered result preserves the design's primary layout, spacing, typography, color, density, hierarchy, and visible states." | "Split substantial restored screens into page orchestration, typed data fixtures, view configuration, calculations, and focused presentational components." | "Split components by semantic responsibility and reuse boundaries rather than mirroring every design layer as a component." | "Represent mock/domain data with named object fields instead of long positional factory arguments." | "Derive progress, summary values, badges, disabled states, and totals from source data or explicit workflow state instead of duplicating static literals." | "Preserve PRD terminology in visible labels and record stable domain wording in source-linked project knowledge when PRD input is provided." | "Implement expected interactions for the affected workflow, or mark unsupported interactions as explicit assumptions in the handoff evidence." | "Use reusable design tokens for colors, spacing, layout metrics, and status semantics instead of one-off page-only constants." | "Keep design source evidence, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification findings as durable project artifacts only when they are grounded in real source material or inspection." | "Document how design nodes or generated markup map to semantic frontend components, including nodes that were merged, ignored, or converted into data-driven configuration." | "Replace visible placeholder labels for icons or visual primitives with real project icons, components, or CSS shapes." | "Preserve accessibility semantics for controls, forms, dialogs, tables, keyboard navigation, focus order, and icon-only actions." | "Keep visible copy, dates, numbers, directionality, and terminology compatible with the project's i18n and localization conventions." | "Use project theme tokens for light/dark mode, status colors, typography, density, and responsive breakpoints instead of one-off visual constants." | "Cross-check visible state consistency across selected steps, progress labels, percentages, bars, badges, disabled states, and summary counts." | "Preserve source and comparison evidence for each substantial projectization step so the loop can repair project code; evidence is not a post-hoc supplement for making verification pass." | "Use the final restoration verdict to decide whether to repair project code; record score, threshold, comparison tool and command, compared viewports, key visual differences, accepted gaps, and design/actual/diff artifacts only after real comparison." | "For complex design-backed screens, preserve viewport-specific screenshots, diff artifacts, and compared-region evidence that prove the main layout regions, controls, data displays, density, colors, typography, and visible states were compared." | "For any design source with multiple functional regions, compare the design screenshot against the actual app at region level: navigation state, content groups, controls, primary actions, data presentation, status indicators, color semantics, and pagination or continuation affordances when present." | "Keep generated build output such as dist/ out of lint and typecheck scopes.")[];
|
|
2
|
+
export declare const UI_RESTORATION_CORE_GUIDANCE: readonly ["For ordinary UI implementation, use the planned execution boundary, local component conventions, and user-visible state coverage without adding design-restoration evidence.", "When a real design source is provided, capture visual reference, structure/style facts, source metadata, and any generated baseline before coding.", "Use source evidence by purpose: DST/DSL or structured design data provides hierarchy, text, tokens, and component-boundary facts; screenshots are the visual acceptance source for rendered appearance and missing visual states; design_to_code is repair-loop evidence and a candidate implementation source that must be classified before use.", "Classify design_to_code as usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. If it is design-layer HTML/CSS, mine it for visual facts during repair; if it fits project conventions and boundaries, it may seed implementation.", "For design-backed restoration, optimize the first implementation for visual equivalence; do not redesign the screen or replace required visual content.", "Use structured design data for hierarchy, text, dimensions, tokens, and component boundaries; use screenshots or images for final visual comparison when design evidence exists.", "Rewrite into project-native components, routing, state, styling, accessibility, and i18n conventions while preserving the planned UI behavior and, when applicable, the design.", "Document semantic component mapping, merged or ignored design nodes, required assets, accepted gaps, and unsupported interactions as durable evidence only when grounded in real design source or inspection.", "Use visual-restoration evidence to find and repair UI drift, backed by comparison provenance, viewport coverage, compared regions, design screenshots, actual screenshots, diff artifacts, and artifact hashes that match the actual files; do not treat evidence documents as a substitute for fixing project code.", "Finish ordinary UI work after configured verification and relevant behavior checks; require final visual-restoration checks only when the harness plan asks for it."];
|
|
3
3
|
export declare const UI_RESTORATION_VERIFICATION_FOCUS: readonly ["typecheck", "design source evidence", "semantic component mapping", "visual baseline", "component behavior", "affected interaction smoke", "responsive rendering", "visual restoration when design source is provided"];
|
|
4
|
-
export declare const UI_RESTORATION_GUIDANCE: ("Treat provider-specific design output such as MCP, Pixso, Figma, MasterGo, Stitch, design_to_code, or exported HTML as
|
|
4
|
+
export declare const UI_RESTORATION_GUIDANCE: ("Treat provider-specific design output such as MCP, Pixso, Figma, MasterGo, Stitch, design_to_code, or exported HTML as source material; analyze its usability before copying any of it into project source." | "For design-backed UI restoration, make visual equivalence the highest priority for the first project implementation; source material does not mean you may redesign the screen." | "Prefer DST, DSL, or structured design data for hierarchy, text, dimensions, tokens, and component boundaries; use screenshots or exported images to verify final rendered appearance, alignment, overflow, and visual state." | "Normalize Pixso, Figma, MasterGo, Stitch, screenshot, or HTML evidence into a provider-neutral design artifact before implementation." | "When design_to_code or generated design markup is available, preserve it and classify whether it is usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. Base the classification on visual fidelity, project fit, resource completeness, responsive behavior, semantic structure, and whether it is design-layer HTML/CSS rather than maintainable project code." | "Use design_to_code as repair-loop evidence and a candidate implementation source. If it is visually faithful but design-layer or absolute-positioned code, mine it for layout, spacing, color, typography, assets, and hierarchy during repair instead of pasting it wholesale. If it is project-compatible code, it may seed implementation within the planned boundary." | "Classify every design image as required content, functional UI element, brand/product asset, decorative sample, or replaceable placeholder; keep required images as durable assets and document replaced samples in the design evidence." | "Preserve the target project's component API, naming, routing, state, style, UI-library, icon, and layout conventions." | "Project-native rewrites may change file placement, framework integration, semantic markup, asset localization, naming, state wiring, and component boundaries only when the rendered result preserves the design's primary layout, spacing, typography, color, density, hierarchy, and visible states." | "Keep page files thin; move types, data fixtures, view configuration, calculations, and repeated sections into feature modules or focused components." | "Split components by semantic responsibility, reuse, and interaction boundary; do not create one component per design layer when a layer is decorative, static, or better represented as data or CSS." | "Use named object fixtures for domain rows; avoid long positional factory arguments in generated examples." | "Derive summary values, progress text, percentages, bars, badges, and disabled states from the same source state." | "Preserve PRD terminology in visible labels and capture stable domain wording in project knowledge with source_paths and coverage when PRD input is available." | "Implement or explicitly defer expected interactions for the affected workflow, such as filtering, selection, editing, navigation, dialogs, or bulk actions when applicable." | "Use reusable design tokens for colors, spacing, status colors, and layout metrics instead of page-only literals." | "Keep design source evidence, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification screenshots or notes as project artifacts when a design source exists and the findings come from real source material or inspection." | "Document how design nodes or generated markup map to semantic frontend components, including merged, ignored, or data-driven regions." | "Replace visible placeholder labels for icons or visual primitives with real project icons, components, or CSS shapes." | "Use semantic HTML and project UI-library accessibility behavior for controls, forms, dialogs, tables, keyboard navigation, focus order, and icon-only actions." | "Follow project i18n conventions for visible copy, dates, numbers, directionality, and terminology instead of hard-coding locale-specific formatting." | "Use project theme tokens for light/dark mode, status colors, typography, density, and responsive breakpoints instead of page-only constants." | "Verify visible state consistency across selected steps, progress labels, percentages, bars, badges, disabled states, and summary counts." | "Preserve source and comparison evidence for each substantial projectization step so the loop can repair project code; evidence is not a post-hoc supplement for making verification pass." | "Use final visual comparison to decide whether the project code needs repair; record score, threshold, comparison tool and command, compared viewports, key visual differences, accepted gaps, and design/actual/diff artifacts only after real comparison." | "For complex design-backed screens, preserve viewport-specific screenshots, diff artifacts, and compared-region evidence that prove the main layout regions, controls, data displays, density, colors, typography, and visible states were compared." | "For any design source with multiple functional regions, compare the design screenshot against the actual app at region level: navigation state, content groups, controls, primary actions, data presentation, status indicators, color semantics, and pagination or continuation affordances when present." | "Keep generated build output such as dist/ out of lint and typecheck scopes.")[];
|
|
5
5
|
export declare function renderUiImplementationSkillBullets(): string;
|
|
6
6
|
export declare function renderUiRestorationChecklist(): string;
|
|
@@ -2,8 +2,8 @@ import { lines } from "./common/text.js";
|
|
|
2
2
|
const UI_RESTORATION_RULES = [
|
|
3
3
|
{
|
|
4
4
|
section: "Source Material",
|
|
5
|
-
constraint: "Treat provider-specific design output such as MCP/Pixso/Figma/MasterGo/Stitch/design_to_code/HTML as source material
|
|
6
|
-
guidance: "Treat provider-specific design output such as MCP, Pixso, Figma, MasterGo, Stitch, design_to_code, or exported HTML as
|
|
5
|
+
constraint: "Treat provider-specific design output such as MCP/Pixso/Figma/MasterGo/Stitch/design_to_code/HTML as source material that must be analyzed before it is used as project code.",
|
|
6
|
+
guidance: "Treat provider-specific design output such as MCP, Pixso, Figma, MasterGo, Stitch, design_to_code, or exported HTML as source material; analyze its usability before copying any of it into project source."
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
section: "Source Material",
|
|
@@ -22,8 +22,13 @@ const UI_RESTORATION_RULES = [
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
section: "Source Material",
|
|
25
|
-
constraint: "When design_to_code or generated design markup is available, preserve it
|
|
26
|
-
guidance: "When design_to_code or generated design markup is available,
|
|
25
|
+
constraint: "When design_to_code or generated design markup is available, preserve it and classify its usability as usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable before deciding whether it can drive implementation or repair.",
|
|
26
|
+
guidance: "When design_to_code or generated design markup is available, preserve it and classify whether it is usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. Base the classification on visual fidelity, project fit, resource completeness, responsive behavior, semantic structure, and whether it is design-layer HTML/CSS rather than maintainable project code."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
section: "Source Material",
|
|
30
|
+
constraint: "Use design_to_code as repair-loop evidence and a candidate implementation source: it may be copied into project source only after usability analysis proves it fits the project boundary and conventions.",
|
|
31
|
+
guidance: "Use design_to_code as repair-loop evidence and a candidate implementation source. If it is visually faithful but design-layer or absolute-positioned code, mine it for layout, spacing, color, typography, assets, and hierarchy during repair instead of pasting it wholesale. If it is project-compatible code, it may seed implementation within the planned boundary."
|
|
27
32
|
},
|
|
28
33
|
{
|
|
29
34
|
section: "Source Material",
|
|
@@ -77,8 +82,8 @@ const UI_RESTORATION_RULES = [
|
|
|
77
82
|
},
|
|
78
83
|
{
|
|
79
84
|
section: "Required Artifacts",
|
|
80
|
-
constraint: "Keep design source evidence, semantic component mapping, PRD summary, component boundary notes, and visual verification findings as durable project artifacts only when they are grounded in real source material or inspection.",
|
|
81
|
-
guidance: "Keep design source evidence, semantic component mapping, PRD summary, component boundary notes, and visual verification screenshots or notes as project artifacts when a design source exists and the findings come from real source material or inspection."
|
|
85
|
+
constraint: "Keep design source evidence, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification findings as durable project artifacts only when they are grounded in real source material or inspection.",
|
|
86
|
+
guidance: "Keep design source evidence, design_to_code usability classification, semantic component mapping, PRD summary, component boundary notes, and visual verification screenshots or notes as project artifacts when a design source exists and the findings come from real source material or inspection."
|
|
82
87
|
},
|
|
83
88
|
{
|
|
84
89
|
section: "Required Artifacts",
|
|
@@ -112,8 +117,8 @@ const UI_RESTORATION_RULES = [
|
|
|
112
117
|
},
|
|
113
118
|
{
|
|
114
119
|
section: "Verification",
|
|
115
|
-
constraint: "Preserve
|
|
116
|
-
guidance: "Preserve
|
|
120
|
+
constraint: "Preserve source and comparison evidence for each substantial projectization step so the loop can repair project code; evidence is not a post-hoc supplement for making verification pass.",
|
|
121
|
+
guidance: "Preserve source and comparison evidence for each substantial projectization step so the loop can repair project code; evidence is not a post-hoc supplement for making verification pass."
|
|
117
122
|
},
|
|
118
123
|
{
|
|
119
124
|
section: "Verification",
|
|
@@ -140,7 +145,8 @@ export const UI_RESTORATION_CONSTRAINTS = UI_RESTORATION_RULES.map((rule) => rul
|
|
|
140
145
|
export const UI_RESTORATION_CORE_GUIDANCE = [
|
|
141
146
|
"For ordinary UI implementation, use the planned execution boundary, local component conventions, and user-visible state coverage without adding design-restoration evidence.",
|
|
142
147
|
"When a real design source is provided, capture visual reference, structure/style facts, source metadata, and any generated baseline before coding.",
|
|
143
|
-
"Use source evidence by purpose: DST/DSL or structured design data
|
|
148
|
+
"Use source evidence by purpose: DST/DSL or structured design data provides hierarchy, text, tokens, and component-boundary facts; screenshots are the visual acceptance source for rendered appearance and missing visual states; design_to_code is repair-loop evidence and a candidate implementation source that must be classified before use.",
|
|
149
|
+
"Classify design_to_code as usable_as_source, usable_as_visual_baseline, usable_for_patch_reference, or unusable. If it is design-layer HTML/CSS, mine it for visual facts during repair; if it fits project conventions and boundaries, it may seed implementation.",
|
|
144
150
|
"For design-backed restoration, optimize the first implementation for visual equivalence; do not redesign the screen or replace required visual content.",
|
|
145
151
|
"Use structured design data for hierarchy, text, dimensions, tokens, and component boundaries; use screenshots or images for final visual comparison when design evidence exists.",
|
|
146
152
|
"Rewrite into project-native components, routing, state, styling, accessibility, and i18n conventions while preserving the planned UI behavior and, when applicable, the design.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-restoration.js","sourceRoot":"","sources":["../../src/runtime/ui-restoration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,oBAAoB,GAAG;IAC3B;QACE,OAAO,EAAE,iBAAiB;QAC1B,UAAU,EAAE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BAAuB;IAC9B,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,EAAE,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,MAAM,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACzH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,CAAC,GAAG,EAAE,CAAC;IACb,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC"}
|
package/dist/runtime/units.js
CHANGED
|
@@ -4,6 +4,8 @@ import { relativeHarnessPath } from "../storage/paths.js";
|
|
|
4
4
|
import { projectScriptCommand } from "./command-taxonomy.js";
|
|
5
5
|
import { UI_RESTORATION_VERIFICATION_FOCUS } from "./ui-restoration.js";
|
|
6
6
|
import { discoverVerificationCommands, defaultVerificationCommandNames } from "./verification-commands.js";
|
|
7
|
+
const artifactKeys = new Set(["units"]);
|
|
8
|
+
const unitKeys = new Set(["id", "file", "task", "verification", "verificationEvidence", "dependsOn", "parallelGroup"]);
|
|
7
9
|
const policyVerificationNames = [
|
|
8
10
|
"targeted test",
|
|
9
11
|
"regression test",
|
|
@@ -61,6 +63,7 @@ export function checkExecutionUnits(projectRoot) {
|
|
|
61
63
|
if (!isRecord(unit)) {
|
|
62
64
|
continue;
|
|
63
65
|
}
|
|
66
|
+
validateAllowedKeys(unit, unitKeys, `units[${index}]`, errors);
|
|
64
67
|
validateUnit(unit, index, ids, knownVerificationNames, knownEvidenceNames, errors);
|
|
65
68
|
}
|
|
66
69
|
validateDependencyCycles(units, errors);
|
|
@@ -121,6 +124,7 @@ function getUnits(artifact, errors) {
|
|
|
121
124
|
errors.push("Execution unit artifact root must be an object.");
|
|
122
125
|
return [];
|
|
123
126
|
}
|
|
127
|
+
validateAllowedKeys(artifact, artifactKeys, "Execution unit artifact", errors);
|
|
124
128
|
if (!Array.isArray(artifact["units"])) {
|
|
125
129
|
errors.push("Execution unit artifact must contain a units array.");
|
|
126
130
|
return [];
|
|
@@ -236,4 +240,11 @@ function isProjectRelativeSourcePath(file) {
|
|
|
236
240
|
function isRecord(value) {
|
|
237
241
|
return typeof value === "object" && value !== null;
|
|
238
242
|
}
|
|
243
|
+
function validateAllowedKeys(value, allowedKeys, label, errors) {
|
|
244
|
+
for (const key of Object.keys(value)) {
|
|
245
|
+
if (!allowedKeys.has(key)) {
|
|
246
|
+
errors.push(`${label} contains unsupported field: ${key}.`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
239
250
|
//# sourceMappingURL=units.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"units.js","sourceRoot":"","sources":["../../src/runtime/units.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAuB3G,MAAM,uBAAuB,GAAG;IAC9B,eAAe;IACf,iBAAiB;IACjB,8B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,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,SAAS,mBAAmB,CAAC,KAA8B,EAAE,WAAwB,EAAE,KAAa,EAAE,MAAgB;IACpH,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,gCAAgC,GAAG,GAAG,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -8,4 +8,9 @@ export interface VerificationCommandDiscovery {
|
|
|
8
8
|
source: VerificationCommandSource;
|
|
9
9
|
command: string | null;
|
|
10
10
|
}
|
|
11
|
+
export interface VerificationCommandDiscoveryResult {
|
|
12
|
+
commands: VerificationCommandDiscovery[];
|
|
13
|
+
errors: string[];
|
|
14
|
+
}
|
|
11
15
|
export declare function discoverVerificationCommands(projectRoot: string, overrides?: VerificationCommandOverrides): VerificationCommandDiscovery[];
|
|
16
|
+
export declare function inspectVerificationCommands(projectRoot: string, overrides?: VerificationCommandOverrides): VerificationCommandDiscoveryResult;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { harnessPath } from "../storage/paths.js";
|
|
4
|
-
import { readJson } from "../storage/json.js";
|
|
5
4
|
import { isRecord } from "./common/parsing.js";
|
|
6
5
|
export const defaultVerificationCommandNames = ["typecheck", "test", "build"];
|
|
7
6
|
export function discoverVerificationCommands(projectRoot, overrides = {}) {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
return inspectVerificationCommands(projectRoot, overrides).commands;
|
|
8
|
+
}
|
|
9
|
+
export function inspectVerificationCommands(projectRoot, overrides = {}) {
|
|
10
|
+
const harnessConfig = readHarnessConfig(projectRoot);
|
|
11
|
+
const packageScripts = readPackageScripts(projectRoot);
|
|
12
|
+
const config = harnessConfig.config;
|
|
13
|
+
const scripts = packageScripts.scripts;
|
|
14
|
+
const errors = [...harnessConfig.errors, ...packageScripts.errors];
|
|
10
15
|
const commands = defaultVerificationCommandNames.map((name) => {
|
|
11
16
|
const overrideCommand = overrides[name];
|
|
12
17
|
if (overrideCommand) {
|
|
@@ -47,7 +52,7 @@ export function discoverVerificationCommands(projectRoot, overrides = {}) {
|
|
|
47
52
|
commands.push(customCommand);
|
|
48
53
|
configuredNames.add(customCommand.name);
|
|
49
54
|
}
|
|
50
|
-
return commands;
|
|
55
|
+
return { commands, errors };
|
|
51
56
|
}
|
|
52
57
|
function readCustomConfigCommands(config) {
|
|
53
58
|
if (!Array.isArray(config.verification?.commands)) {
|
|
@@ -73,19 +78,42 @@ function readCustomConfigCommands(config) {
|
|
|
73
78
|
}
|
|
74
79
|
return commands;
|
|
75
80
|
}
|
|
81
|
+
function readHarnessConfig(projectRoot) {
|
|
82
|
+
const configPath = harnessPath(projectRoot, "config.json");
|
|
83
|
+
if (!fs.existsSync(configPath)) {
|
|
84
|
+
return { config: {}, errors: [] };
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
return {
|
|
88
|
+
config: JSON.parse(fs.readFileSync(configPath, "utf8")),
|
|
89
|
+
errors: []
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
94
|
+
return {
|
|
95
|
+
config: {},
|
|
96
|
+
errors: [`.frontend-harness/config.json is not valid JSON: ${message}`]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
76
100
|
function readPackageScripts(projectRoot) {
|
|
77
101
|
const packageJsonPath = path.join(projectRoot, "package.json");
|
|
78
102
|
if (!fs.existsSync(packageJsonPath)) {
|
|
79
|
-
return {};
|
|
103
|
+
return { scripts: {}, errors: [] };
|
|
80
104
|
}
|
|
81
105
|
let packageJson;
|
|
82
106
|
try {
|
|
83
107
|
packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
84
108
|
}
|
|
85
|
-
catch {
|
|
86
|
-
|
|
109
|
+
catch (error) {
|
|
110
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
111
|
+
return {
|
|
112
|
+
scripts: {},
|
|
113
|
+
errors: [`package.json is not valid JSON: ${message}`]
|
|
114
|
+
};
|
|
87
115
|
}
|
|
88
|
-
return packageJson.scripts ?? {};
|
|
116
|
+
return { scripts: packageJson.scripts ?? {}, errors: [] };
|
|
89
117
|
}
|
|
90
118
|
function isValidCommandName(value) {
|
|
91
119
|
return /^[a-zA-Z0-9][a-zA-Z0-9:_-]{0,79}$/.test(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification-commands.js","sourceRoot":"","sources":["../../src/runtime/verification-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"verification-commands.js","sourceRoot":"","sources":["../../src/runtime/verification-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AA4BvF,MAAM,UAAU,4BAA4B,CAC1C,WAAmB,EACnB,YAA0C,EAAE;IAE5C,OAAO,2BAA2B,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,WAAm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ED,IAAI,WAAwB,CAAC;IAC7B,IAAI,CAAC;QACH,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAgB,CAAC;IACpF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO;YACL,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,CAAC,mCAAmC,OAAO,EAAE,CAAC;SACvD,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC5D,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,mCAAmC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC"}
|
package/dist/runtime/verify.js
CHANGED
|
@@ -7,12 +7,11 @@ import { harnessPath } from "../storage/paths.js";
|
|
|
7
7
|
import { ensureDir, readJson, writeJson, writeText } from "../storage/json.js";
|
|
8
8
|
import { checkStateContract, loadState, updateVerificationState } from "./state.js";
|
|
9
9
|
import { checkKnowledgeCoverage } from "./knowledge.js";
|
|
10
|
-
import {
|
|
10
|
+
import { inspectVerificationCommands } from "./verification-commands.js";
|
|
11
11
|
import { createRepairPacket } from "./repair-packet.js";
|
|
12
12
|
import { projectScriptCommand } from "./command-taxonomy.js";
|
|
13
13
|
const MAX_NODE_E_SCRIPT_LENGTH = 200;
|
|
14
14
|
export function runVerification(projectRoot, options) {
|
|
15
|
-
const commands = resolveCommands(projectRoot, options);
|
|
16
15
|
const startedFromFailed = readPreviousStatus(projectRoot) === "failed";
|
|
17
16
|
const stateContract = checkStateContract(projectRoot);
|
|
18
17
|
if (stateContract.status === "failed") {
|
|
@@ -154,6 +153,45 @@ export function runVerification(projectRoot, options) {
|
|
|
154
153
|
createRepairPacket(projectRoot, { verification: result });
|
|
155
154
|
return result;
|
|
156
155
|
}
|
|
156
|
+
const commandInspection = inspectVerificationCommands(projectRoot, options);
|
|
157
|
+
if (commandInspection.errors.length > 0) {
|
|
158
|
+
const relativeLogPath = `.frontend-harness/logs/verification-config-${new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z")}.log`;
|
|
159
|
+
writeText(path.join(projectRoot, relativeLogPath), [
|
|
160
|
+
"Verification command discovery failed before project verification.",
|
|
161
|
+
"",
|
|
162
|
+
"## Errors",
|
|
163
|
+
...commandInspection.errors.map((error) => `- ${error}`)
|
|
164
|
+
].join("\n"));
|
|
165
|
+
const result = {
|
|
166
|
+
status: "failed",
|
|
167
|
+
results: [
|
|
168
|
+
{
|
|
169
|
+
name: "verification-config",
|
|
170
|
+
command: "frontend-harness verify --json",
|
|
171
|
+
source: "none",
|
|
172
|
+
status: "failed",
|
|
173
|
+
exitCode: 1,
|
|
174
|
+
durationMs: 0,
|
|
175
|
+
logPath: relativeLogPath
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
retryGuidance: {
|
|
179
|
+
summary: "verification command configuration is invalid",
|
|
180
|
+
failedCommands: ["frontend-harness verify --json"],
|
|
181
|
+
logs: [relativeLogPath],
|
|
182
|
+
nextAgentInstruction: [
|
|
183
|
+
"Read the verification-config log.",
|
|
184
|
+
"Fix malformed .frontend-harness/config.json or package.json before rerunning project verification.",
|
|
185
|
+
`Then rerun ${projectScriptCommand("frontend-harness verify --json")}.`
|
|
186
|
+
].join(" ")
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
writeResult(projectRoot, result);
|
|
190
|
+
updateVerificationState(projectRoot, "failed", startedFromFailed);
|
|
191
|
+
createRepairPacket(projectRoot, { verification: result });
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
const commands = resolveCommands(commandInspection.commands);
|
|
157
195
|
if (commands.length === 0) {
|
|
158
196
|
const result = {
|
|
159
197
|
status: "not_configured",
|
|
@@ -274,15 +312,23 @@ function readEvidenceManifest(projectRoot, relativePath) {
|
|
|
274
312
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
275
313
|
return { ok: false, error: "Evidence manifest root must be an object." };
|
|
276
314
|
}
|
|
277
|
-
const
|
|
278
|
-
if (!Array.isArray(
|
|
315
|
+
const entryValues = parsed["entries"];
|
|
316
|
+
if (!Array.isArray(entryValues)) {
|
|
279
317
|
return { ok: false, error: "Evidence manifest must contain an entries array." };
|
|
280
318
|
}
|
|
281
|
-
|
|
319
|
+
const entries = [];
|
|
320
|
+
for (const [index, entryValue] of entryValues.entries()) {
|
|
321
|
+
const entry = parseEvidenceEntry(entryValue, index);
|
|
322
|
+
if (!entry.ok) {
|
|
323
|
+
return { ok: false, error: entry.error };
|
|
324
|
+
}
|
|
325
|
+
entries.push(entry.entry);
|
|
326
|
+
}
|
|
327
|
+
return { ok: true, entries };
|
|
282
328
|
}
|
|
283
|
-
function parseEvidenceEntry(value) {
|
|
329
|
+
function parseEvidenceEntry(value, index) {
|
|
284
330
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
285
|
-
return [];
|
|
331
|
+
return { ok: false, error: `Evidence manifest entries[${index}] must be an object.` };
|
|
286
332
|
}
|
|
287
333
|
const entry = value;
|
|
288
334
|
const unitId = entry["unitId"];
|
|
@@ -294,15 +340,18 @@ function parseEvidenceEntry(value) {
|
|
|
294
340
|
|| !Array.isArray(artifactPaths)
|
|
295
341
|
|| artifactPaths.some((artifactPath) => typeof artifactPath !== "string")
|
|
296
342
|
|| typeof createdAt !== "string") {
|
|
297
|
-
return [];
|
|
343
|
+
return { ok: false, error: `Evidence manifest entries[${index}] must include string unitId, string kind, string[] artifactPaths, and string createdAt.` };
|
|
298
344
|
}
|
|
299
|
-
return
|
|
345
|
+
return {
|
|
346
|
+
ok: true,
|
|
347
|
+
entry: {
|
|
300
348
|
unitId,
|
|
301
349
|
kind,
|
|
302
350
|
artifactPaths: artifactPaths,
|
|
303
351
|
createdAt,
|
|
304
352
|
...(isPlainRecord(entry["metadata"]) ? { metadata: entry["metadata"] } : {})
|
|
305
|
-
}
|
|
353
|
+
}
|
|
354
|
+
};
|
|
306
355
|
}
|
|
307
356
|
function validateEvidenceEntries(projectRoot, requiredEvidence, entries) {
|
|
308
357
|
const errors = [];
|
|
@@ -367,6 +416,7 @@ function validateEvidenceMetadata(projectRoot, entry, label, errors) {
|
|
|
367
416
|
requireMetadataStringArray(metadata, "baselineArtifactPaths", label, errors);
|
|
368
417
|
requireMetadataStringArray(metadata, "viewports", label, errors);
|
|
369
418
|
requireMetadataString(metadata, "preservedAt", label, errors);
|
|
419
|
+
requireDesignToCodeUsability(metadata, label, errors);
|
|
370
420
|
break;
|
|
371
421
|
case "responsive-rendering":
|
|
372
422
|
requireMetadataObject(metadata, label, errors);
|
|
@@ -397,6 +447,18 @@ function requireMetadataString(metadata, key, label, errors) {
|
|
|
397
447
|
errors.push(`Evidence metadata for ${label} must include non-empty ${key}.`);
|
|
398
448
|
}
|
|
399
449
|
}
|
|
450
|
+
function requireDesignToCodeUsability(metadata, label, errors) {
|
|
451
|
+
if (!metadata || metadata["sourceType"] !== "design_to_code") {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
const usability = metadata["usability"];
|
|
455
|
+
const allowed = ["usable_as_source", "usable_as_visual_baseline", "usable_for_patch_reference", "unusable"];
|
|
456
|
+
if (typeof usability !== "string" || !allowed.includes(usability)) {
|
|
457
|
+
errors.push(`Evidence metadata for ${label} with sourceType design_to_code must include usability of ${allowed.join(", ")}.`);
|
|
458
|
+
}
|
|
459
|
+
requireMetadataStringArray(metadata, "usabilityReasons", label, errors);
|
|
460
|
+
requireMetadataBoolean(metadata, "temporaryAssetsLocalized", label, errors);
|
|
461
|
+
}
|
|
400
462
|
function requireMetadataTrue(metadata, key, label, errors) {
|
|
401
463
|
if (!metadata) {
|
|
402
464
|
return;
|
|
@@ -577,8 +639,8 @@ function requireMetadataStringArray(metadata, key, label, errors, options = {})
|
|
|
577
639
|
function isPlainRecord(value) {
|
|
578
640
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
579
641
|
}
|
|
580
|
-
function resolveCommands(
|
|
581
|
-
return
|
|
642
|
+
function resolveCommands(commands) {
|
|
643
|
+
return commands
|
|
582
644
|
.flatMap((entry) => entry.command ? [{ name: entry.name, source: entry.source, command: entry.command }] : []);
|
|
583
645
|
}
|
|
584
646
|
function runCommand(projectRoot, name, source, command) {
|