Skip to content

Latest commit

 

History

History
31 lines (18 loc) · 4.24 KB

concept-fidelity.md

File metadata and controls

31 lines (18 loc) · 4.24 KB

Build the UI that was approved

English · 简体中文 · 한국어 · 日本語 · Español

An approved preview is the visual target for the generated app. The build uses it throughout implementation. Functional tests and visual fidelity have separate gates; both must pass before delivery when a concept is approved.

The build does the following:

  1. Pin the target. Verify the approved PNG and SHA-256. Extract a small visual contract: layout regions, visible controls, illustration crops, colors and typography. Cache this analysis by image hash and pin it with the build's design hash.
  2. Reuse the artwork. Package the unchanged approved PNG as an asset. Native code region-decodes the declared decorative illustration. Text, values, buttons, selectors and navigation remain real native UI. A complete screenshot with invisible hit targets is prohibited.
  3. Build and capture. Compile, run JVM tests and lint, then capture the actual APK in the pictured state. The capture binds to the installed APK hash. Capture the target state at a matching aspect ratio.
  4. Check fidelity separately. A vision comparison sees the target first and the actual capture second. It checks layout, artwork, palette, typography and controls. Every rubric must score at least 85, artwork at least 90, every required control must be visible, and no critical mismatch may remain. The report records these visual rubric scores.
  5. Repair and verify behavior. A rejected capture and its hash-bound feedback return to code generation. The visual gate must pass before delivery. Once the design gate passes, the configured device workflow and implementation review still run. The final APK must retain the hash used for verification.

The contract, concept-fidelity-report.json and an offline target/capture comparison ship with the build. The APK’s embedded artwork bytes are checked against the approved PNG hash. A later approved preview is read from the current project when building, even if the functional specification is unchanged. Earlier APKs stay downloadable but are labelled previous until a build is verified against the new image hash. conceptVerified refers to the approved generated design; visualVerified continues to refer to the separate original-app runtime comparison. Each report records its target scenes.

These stages run during coding/building, leaving initial clarification and preview generation unchanged. Reusing the approved illustration avoids another image-generation request.

Capture configuration

A build with an approved concept requires an Android emulator and real screenshots. Without a configured scenario, the builder captures the isolated candidate's cold-start home using MELD_CONCEPT_SERIAL (or the configured native device, default emulator-5580). A cold start must visibly correspond to the target; otherwise delivery stops for missing evidence. Never substitute a screenshot from an older APK.

For a specific business state, configure the server-owned AndroidEnvironment.conceptCapture script. It drives the supplied candidate APK, then writes home.png and capture.json with apkSha256, packageId, sceneId and image: "home.png". forest-concept-capture.py demonstrates a real selected-task state. Its scene ID must match the pinned contract. Capture/device failures remain distinct from an actual visual rejection.

The builder matches the emulator to the target aspect ratio and restores its display override after capture. Large targets scale proportionally to a 2048-pixel maximum edge. Focus Grove uses 940 × 1672, 320 dpi and gesture navigation. Device workflows also check compact and landscape behavior.

Reuse without accepting stale approval

A trusted sourceSeed can supply hash-pinned Kotlin sources, design hash and parent review. Every repair computes changed, unchanged and removed paths. Reused source proceeds through compilation, tests, device checks and the concept gate.

Automated tests cover asset integrity, contract caching, control visibility, visual thresholds, viewport alignment and APK/capture hash binding. Live captures record the example app alongside its approved target.