Skip to content

fix(design-gate): let a prepared pair render a screen file - #11215

Merged
iscekic merged 2 commits into
mainfrom
drain/design-gate-route-diagnostic
Nov 16, 2026
Merged

iscekic merged 2 commits into
mainfrom
drain/design-gate-route-diagnostic

Conversation

@iscekic

@iscekic iscekic commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Evidence

Evidence: demonstrated — a prepared design-gate pair at this head rendered the repository picker and the branch picker from screen-file diagnostics on both revisions, each target in all four matrix cells, and compare returned comparable with an empty introduced list; the focused unit run passes 48 tests, including the new acceptance and rejection cases.

What changed

  • dev/local/design-gate/baseline.ts: a target's diagnostic.component may now name a screen below apps/mobile/src/app as well as a component below apps/mobile/src/components. Route group and parameter segments are accepted there. The router's own files stay refused: _layout.tsx is not a screen, and a +-prefixed file is reserved for the not-found, HTML and native-intent hooks. A . or .. segment stays refused in both trees, so a manifest cannot name a file outside the app.
  • dev/local/design-gate/baseline.test.ts: the rejection list gains the layout, +-file and .ts cases, and two acceptance cases cover a plain and a parameterised route.

No screen, style or interaction of the app changes. The two files are the gate's own tooling; the app tree is untouched by this branch.

Why

A prepared pair could only render a shared component. When a change only alters the props a route passes to unchanged shared UI, that UI renders identically on both revisions, so no cell can show the difference and the comparison reports itself comparable while proving nothing. A screen file is the honest target for that shape of change, and several mobile picker changes take that shape.

Every existing guarantee holds: the source must be tracked in both revisions, the prepared source is hashed and validated, and a diagnostic still renders under (auth) so a signed-out device can capture it.

Verification

Focused unit run on this VM:

pnpm exec tsx --test dev/local/design-gate/baseline.test.ts
ℹ tests 48
ℹ pass 48
ℹ fail 0

Prepared pair at head b5c636eaf, two diagnostic targets that name a screen file (repo-picker.tsx, branch-picker.tsx), base 99ef995e (merge base) and the head, each revision served by its own Metro on its own port:

pnpm -s dev:mobile:design-gate prepare --base 99ef995e… --head b5c636ea… \
  --targets /tmp/pr-proof/targets-screen.json --out /tmp/pr-proof/prepared
pnpm -s dev:mobile:design-gate compare --preparation …/preparation.json \
  --base-run …/base --head-run … --out /tmp/pr-proof/comparison
{"status":"comparable","introduced":[],"reasons":[]}
  • prepare accepted both screen sources and generated the fixtures in both worktrees. Head fixture for repo-picker:
import Component from "@/app/(app)/agent-chat/repo-picker";
export default function DesignProofFixture() {
  if (!__DEV__) return React.createElement(Redirect, { href: '/(auth)/login' });
  return React.createElement(Component, JSON.parse("{}"));
}
  • Both targets were captured in all four matrix cells on both revisions, 8/8 bracketed, with no unsettled, blank-frame, capture-alignment, env-mismatch or link-unopened finding.
  • Each revision's device session reported its own product bundle: head b5c636ea…, base 99ef995e…, from proof-source.json and the loaded bundle marker.
  • The per-node rect, text, role and testID lists are identical between the two revisions in every cell.
  • Each run reports 16 findings, all safe-area on the sheet header: a diagnostic renders the sheet as a bare route, so the header sits under the status-bar inset. Both revisions report the same findings, so nothing is introduced by this change.
  • The picker renders its expired arm on the diagnostic route because the route has no data bridge; the screen's own header text is what the cell shows.
  • An earlier run of the same pair at 1292e01 covered five picker screens and compared comparable with the same outcome.

Design gate: 4 cells, 16 errors, 0 warnings

The base revision reports the same 16 findings, so no finding is introduced. One screen in the same flow cannot be a diagnostic target at all: it calls a hook that only the signed-in shell provides, and a diagnostic route renders signed out. Screen-level coverage for such a screen stays with its mounted test.

Unprepared run on the picker route

The same matrix ran in the plain run --link mode at both revisions. The signed-in route /agent-chat/repo-picker cannot be opened here (no backend on this VM: the bootstrap guard redirects to /login, and neither the grouped nor the ungrouped link form changed that), so the run used the prepared pair's own (auth) fixture route, which renders each revision's repo-picker.tsx.

  • Head: exit 1, 4 cells, 8 safe-area errors, 0 warnings, no unsettled, blank-frame, capture-alignment or env-mismatch.
  • Base: exit 1, 4 cells, the same 8 safe-area errors.
  • Nothing appears only at head and nothing only at base; per-cell node lists and hit slop are identical, and capture means match within a pixel.
  • Those errors are the sheet header at 24.8 dp against a 51.8 dp top inset (10.3 dp against 36.2 dp in the compact cell), which is what rendering a form sheet as a bare route produces. They are base-identical and are not introduced here.

This is a prerequisite for a mobile picker change that can only be proved by rendering its screens; that change follows once this lands.

Production prerequisites

None.

Proxy answers

The proxy answered no questions.

A prepared pair could only render a shared component, so a change that
only alters the props a route passes to an unchanged component had no
comparable cell: the component renders the same on both revisions.

The diagnostic source may now name a screen below apps/mobile/src/app,
with its group and parameter segments. The router's own files stay
refused: a layout is not a screen, and a + file is reserved for the
not-found, HTML and native-intent hooks. Dotted segments are allowed in
the route tree only, so no . or .. segment can leave the app.
@iscekic iscekic added drain Work item from the findings drain explorer:android Finding surfaced by the Android explorer labels Nov 16, 2026
@kilo-code-bot

kilo-code-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The only change since the previous review is a formatting re-wrap of the COMPONENT_SOURCE and ROUTE_SOURCE regex constants in dev/local/design-gate/baseline.ts with no semantic difference, so the previously verified screen-file validation behavior is unchanged and no new issue was found.

Assumptions: [INFERENCE] The CLI usage text in dev/local/design-gate/cli.ts:117 still describes only apps/mobile/src/components diagnostic sources; it is unchanged by this PR, so it is noted here rather than as a finding.

Files Reviewed (2 files)
  • dev/local/design-gate/baseline.ts
  • dev/local/design-gate/baseline.test.ts
Previous Review Summary (commit 1292e01)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 1292e01)

Status: No Issues Found | Recommendation: Merge

Executive Summary

The design-gate schema now admits screen files below apps/mobile/src/app while still refusing ./.. traversal segments, layouts, and +-prefixed router files; the added acceptance and rejection cases in baseline.test.ts match the regex behavior, and no correctness, security, or performance issue was found in the changed lines.

Assumptions: [INFERENCE] The CLI usage text in dev/local/design-gate/cli.ts:117-118 still describes only apps/mobile/src/components sources; it is unchanged by this PR, so it is noted here rather than as a finding.

Files Reviewed (2 files)
  • dev/local/design-gate/baseline.ts
  • dev/local/design-gate/baseline.test.ts

Reviewed by deepseek-flash-latest · Input: 38K · Output: 3.8K · Cached: 164.9K

Review guidance: REVIEW.md from base branch main

@iscekic iscekic added merge:blocked:kilobot-not-ready Review bot has not recommended merge at this head merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. and removed merge:blocked:kilobot-not-ready Review bot has not recommended merge at this head labels Nov 16, 2026
@iscekic

iscekic commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Prepared pair at head b5c636e, two diagnostic targets that name a screen file (apps/mobile/src/app/(app)/agent-chat/repo-picker.tsx and branch-picker.tsx).

  • prepare accepted both screen sources and wrote the fixtures into both prepared worktrees; the head fixture imports @/app/(app)/agent-chat/repo-picker.
  • Head run from the head worktree: 2 targets in all four standard cells, 8/8 bracketed, 16 findings (safe-area on the sheet header), 0 warnings.
  • Base run from the base worktree: identical, 16 findings.
  • compare: {"status":"comparable","introduced":[],"reasons":[]}.
  • Node lists (testID, role, text, rect) are identical between the two revisions in every cell, so nothing is introduced.
  • Each revision's device session reported its own product bundle: head b5c636ea…, base 99ef995e….
  • The picker renders its expired arm because a diagnostic route has no data bridge; the readable header text is the screen's own.

Contact sheet, head run: two screen-file targets in four cells

Head revision rendering the repository picker from a screen-file diagnostic

Base revision rendering the same screen from the manifest the head accepts

@iscekic

iscekic commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Unprepared run --link matrix on the repository-picker shell, both revisions, at head b5c636e (base 99ef995e).

  • --link 'kiloapp:///(app)/agent-chat/repo-picker' and the ungrouped form both stay on /login: this VM has no backend, so the signed-in composer route cannot be opened. The run used the prepared pair's own (auth) fixture route instead, which renders each revision's repo-picker.tsx.
  • Head run: exit 1, 4 cells, 8 safe-area errors, 0 warnings, no unsettled, blank-frame, capture-alignment or env-mismatch.
  • Base run: exit 1, 4 cells, the same 8 safe-area errors, 0 warnings.
  • Finding sets are equal in both directions: none appears only at head and none only at base. Per-cell node lists and hit slop are identical across revisions in all four cells, and the capture means match within a pixel.
  • The errors are the sheet header sitting at 24.8 dp against a 51.8 dp top inset (10.3 dp against 36.2 dp in the compact cell). They come from rendering a form sheet as a bare route, so they are the same at base and are not introduced here. Nothing on this branch changes a screen: it widens the target schema of the gate itself.

Both runs are uploaded beside the prepared pair under this head in the factory design-gate bucket, in the run-link and run-link-base folders.

Head revision picker shell across the four standard cells

Base revision picker shell across the four standard cells

@iscekic

iscekic commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

bot: On the review note about the CLI usage text (dev/local/design-gate/cli.ts:117): no change is needed, for two reasons.

  • That line is an example value inside the Optional target diagnostic: entry, not a statement of what the field accepts. Its only constraint sentence, two lines below, reads "component must exist in BOTH revisions", and that stays true.
  • The constraint itself is enforced by the manifest schema, whose rejection message now names both trees: "must name a component below apps/mobile/src/components or a screen below apps/mobile/src/app, not a layout and not a + file" (dev/local/design-gate/baseline.ts:44). A rejected manifest therefore shows the widened rule, and the acceptance and rejection cases are covered in baseline.test.ts.

The remark was recorded as an assumption rather than a finding, so it needs no code change; the run at this head stays as it is.

@iscekic
iscekic added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit cb91de0 Nov 16, 2026
44 checks passed
@iscekic
iscekic deleted the drain/design-gate-route-diagnostic branch November 16, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

drain Work item from the findings drain explorer:android Finding surfaced by the Android explorer merge:bot Bot-owned review; merge when ready once readiness passes and a review approves.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants