Skip to content

feat: drive generation state via verified PromptState contracts - #37

Closed
google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/drive-generation-via-prompt-state-contracts-jm1-2b6cdf0b-1d3d-447f-9d13-263f884dfde6
Closed

google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/drive-generation-via-prompt-state-contracts-jm1-2b6cdf0b-1d3d-447f-9d13-263f884dfde6

Conversation

@google-labs-stitch

Copy link
Copy Markdown
Contributor

Summary

This pull request drives manual composer state through verified PromptState (_.fP) contracts on supported Google Flow front-end builds and adds pre-submit validation for generation inputs and prompt items.

Changes

  • Normalize and validate generation parameters (src/generation.rs, src/service.rs, docs/*/tools-reference.md):
    • Normalize omitted video_type in "video" mode to "ingredients" (VIDEO_INGREDIENTS / "VIDEO_REFERENCES").
    • Default video model to "veo_3_1_lite" and map "veo-3.1-fast" to "veo_3_1_lite".
    • Reject "1:1" ("square") aspect ratio in "video" mode before browser actions start.
    • Reject characters and more than two frame references when video_type is "frames".
  • Add verified PromptComposerFormat and runtime probe (ts/frontend_builds.ts, ts/frontend_compatibility.ts, xtask/src/contracts.rs):
    • Add optional promptComposer?: PromptComposerFormat to FrontendBuildFields and populate NOVEMBER_20_PROMPT_COMPOSER on boq_labs-ai-sandbox-frontend_20261120.00_p0 (promptState: "fP", setMode: "AQ", setModel: "BQ", setCount: "scc", aspectLabels: "NE", videoAspects: "$O", families: "Wqa", activeFamily: "ala", catalogFamilies: "jx", modelId: "hg", items: "oc", disableReason: "Rp", clearOutput: "lF").
    • Keep 20261118.14_p0 and 20261117.10_p0 compatible without promptComposer.
    • Add "prompt_composer" verification to probeStore when the active build defines promptComposer, and validate PromptComposerFormat in xtask/src/contracts.rs.
  • Mutate PromptState directly and retain anchored DOM fallback (ts/composer_state.ts, ts/composer.ts, ts/setup_generation.ts, ts/types.ts):
    • Resolve Qa in resolveComposerControllers and set mode ("IMAGE", "VIDEO_FRAMES", "VIDEO_REFERENCES"), aspect ratio (Qa.setAspectRatio), exact model family (_.BQ matched against Qa.model.Wqa() and Qa.model.jx()), and output count (_.scc) without opening settings or model menus.
    • Retain the anchored Select model family DOM fallback when a build omits promptComposer.
  • Clear all seven ingredient chip types and block Rp disable codes (ts/attach_ingredients.ts, ts/submit_generation.ts):
    • Call Qa.clear() and emit lF ("all") on every non-edit run, with Clear prompt and all seven <flow-*-ingredient-chip> DOM fallbacks.
    • Inspect Qa.oc.all() in both attachIngredients and submitGeneration and abort before clicking "Start generation" when any of the 11 live Rp disable codes is present.

Verification

  • Ran cargo xtask ci (cargo fmt --check, check_license_headers, check_line_limits, check_doc_examples, check_forbidden_code + tsc --noEmit, check_flow_contracts, cargo clippy --workspace --all-targets -- -D warnings, cargo doc --no-deps, cargo build) and cargo deny --locked --workspace check.
  • Verified end-to-end behavior in headless Chrome and over MCP stdio (flow_status with probe: true, direct PromptState mutations, omitted video_type multi-ingredient + character Oc attachment, 7-chip cleanup, all 11 Rp disable codes, and 20261118.14_p0 anchored DOM fallback).

Verified PromptState Contracts E2E Verification


Automated PR initiated by user @byteland-app via Stitch Loop.

- Normalize video_type to ingredients and reject square video aspect
- Block characters and extra frame references in video frames mode
- Add PromptComposerFormat for build 20261120.00_p0 and probeStore
- Set mode, model family, aspect, and count directly on PromptState
- Clear all seven ingredient chip types and block Rp disable codes

Copy link
Copy Markdown
Contributor

src/generation.rs silently maps a caller's explicit veo-3.1-fast selection to veo_3_1_lite, including on supported builds that offer Fast. Preserve explicit model selection and return an availability error on builds that lack the requested model. Closing this overlapping implementation so control validation can continue in #39. A direct PromptState binding can be reviewed separately with the existing controls and defaults preserved.

@byteland-app
byteland-app deleted the stitch/drive-generation-via-prompt-state-contracts-jm1-2b6cdf0b-1d3d-447f-9d13-263f884dfde6 branch November 25, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant