diff --git a/skill/scripts/build-phase.mjs b/skill/scripts/build-phase.mjs index 11ea22394..bf55f5a1e 100644 --- a/skill/scripts/build-phase.mjs +++ b/skill/scripts/build-phase.mjs @@ -581,7 +581,13 @@ export function gateHero(state, { buildPath = HERO_REPRO, specPath = SPEC_PATH, if (otherContradicted.length > Math.max(1, Math.floor(report.regions.length / 3))) reasons.push(`${otherContradicted.length} of ${report.regions.length} regions contradicted: ${otherContradicted.map((r) => r.id).join(', ')}`); // A CSS-drawn organic contour sitting on a raster region's box is the plate // replaced by code, whatever the pixels score. - const artifactFile = artifact || state.artifact || null; + // A start with --direction records no artifact; the page is still there. + // Read index.html (or the one .html at the root) so the code scans run. + let artifactFile = artifact || state.artifact || null; + if (!artifactFile || !fs.existsSync(artifactFile)) { + if (fs.existsSync('index.html')) artifactFile = 'index.html'; + else { try { const htmls = fs.readdirSync('.').filter((f) => /\.html?$/i.test(f)); if (htmls.length === 1) artifactFile = htmls[0]; } catch { /* leave */ } } + } if (artifactFile && fs.existsSync(artifactFile) && specForRefs) { const organic = organicClipRegions(artifactFile, specForRefs); for (const r of organic) reasons.push(`artifact draws an organic clip-path (${r.snippet}) inside raster region ${r.id}'s box; that region ships as its plate, never as a polygon`); diff --git a/skill/scripts/comp-spec.mjs b/skill/scripts/comp-spec.mjs index 516e37d6b..a2f822ead 100644 --- a/skill/scripts/comp-spec.mjs +++ b/skill/scripts/comp-spec.mjs @@ -88,7 +88,7 @@ function paletteOf(img) { } /** Words in a region note that name painted material rather than code-drawn UI. */ -export const PAINTED_NOTE = /\b(diagram|drawing|drawn|illustration|illustrations|illustrated|figure|schematic|exploded|photo|photos|photograph\w*|picture|painting|painted|render|rendered|rendering|artwork|engraving|etching|linework|line art|texture|textured|textures|grain|fabric|halftone|watercolou?r|sketch|sketched|blueprint|technical geometry|carburetor geometry|product shot|hero image|3d)\b/i; +export const PAINTED_NOTE = /\b(diagram|drawing|drawn|illustration|illustrations|illustrated|figure|schematic|exploded|photo|photos|photograph\w*|picture|painting|painted|render|rendered|rendering|artwork|engraving|etching|linework|line art|texture|textured|textures|grain|fabric|halftone|watercolou?r|sketch|sketched|blueprint|geometry|leader lines?|callout lines?|thumbnail|silhouette|product shot|hero image|3d)\b/i; /** A text/control/chrome region larger than this fraction of the comp is a column, not an element. */ export const MAX_CODE_REGION_AREA = 0.25;