Skip to content

fix(flow): bind verified scene signals and emit clip assets - #46

Closed
google-labs-stitch[bot] wants to merge 2 commits into
mainfrom
stitch/bind-verified-scene-signals-and-clip-assets-jm0-709feeed-1fac-4fb8-9349-aa037fea0bbf
Closed

google-labs-stitch[bot] wants to merge 2 commits into
mainfrom
stitch/bind-verified-scene-signals-and-clip-assets-jm0-709feeed-1fac-4fb8-9349-aa037fea0bbf

Conversation

@google-labs-stitch

@google-labs-stitch google-labs-stitch Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request binds verified Google Flow scene builder signals, derives scene orientation and collection placement from clip metadata, emits distinct <sceneId>:<wfId> scene clip assets with full consumer support, and confirms scene clip mutations through PROJECT_TILES refetches.

Scene Clip ID Rule and Behavior Notes

Changes

  • Scene descriptors and probeStore() (ts/scene_tiles.ts, ts/frontend_builds.ts, ts/frontend_compatibility.ts, ts/angular.ts):
    • Add sceneBuilder descriptors (controller: "su", timeline: "B6", player: "Gc", playerReady: "Dx", selectedClip: "la", clips: "Uc", extendDisabledReason: "Yo", activeExtendClip: "TL", exitExtend: "rE", modelsQuery: "Od"), sceneCreated: "y6a", and scene clip mutation fields (clipTrimStart: "Ji", clipTrimEnd: "Ci", clipIndex: "ik") on NOVEMBER_20_STORE.
    • Check su, B6, Gc, Uc, Yo, TL, rE, and Od in probeStore() both on _.su when <flow-scene-builder> is unmounted and on the live controller when mounted, and match exact identifier boundaries in hasDeferredSceneRoute.
    • Derive aspectRatio in createScene (0.5625 for 9:16 clips from verified Kb.aspectRatio or Bc dimensions, 16 / 9 for 16:9 clips or empty scenes) and pass clip 0's verified Dc collection ID via Fc.
  • Verified su.Gc clip selection (ts/video_ops.ts, ts/scene_tiles.ts):
    • Parse <sceneId>:<wfId> asset IDs via splitSceneClipId, resolve the live su controller on <flow-scene-builder> with resolveLView, wait until su.Gc.Dx() returns true, never click <video>, use sbFormat descriptors for TL, rE, and Od (returning scene_builder_signals_missing if any required function is absent), select via su.Gc.la.set(selectedWfId), confirm .clip.selected, surface su.Yo() disabled reasons, and open Add clip then Extend.
  • Distinct <sceneId>:<wfId> clip assets, consumers, and extend polling (ts/read_store_snapshot.ts, ts/asset_ops.ts, ts/asset_trash.ts, ts/video_ops.ts, ts/open_edit_asset.ts, src/assets.rs, src/scenes.rs):
    • Preserve standalone VIDEO entries when sceneTile.Uc diverges, skip Cg-only history entries, emit <sceneId>:<wfId> per active Uc clip without inheriting st.displayName, support <sceneId>:<wfId> across rename/trim/trash/edit/match consumers, and restrict collect_extended_videos to watched_ids and <opened_scene_id>:* scene clips so unrelated stand-alone video updates are never accepted.
  • Workflow validation, refetch confirmation, error reporting, and docs (ts/scene_ops.ts, ts/project_store.ts, src/scenes.rs, docs/*/tools-reference.md):
    • Validate that scene_id names a non-trashed SCENE tile and all asset_ids in create and add_clips resolve to non-trashed VIDEO workflow IDs, forward submitProjectMutation errors through mutateAndVerify (onSubmitError) so add_clips reports submit failures instead of only add_clips_not_confirmed, and document <sceneId>:<wfId> and prepare_extend behavior in en, zh-CN, and ja tool references.

Verification

  • Ran cargo xtask ci (cargo fmt --check, cargo xtask check, tsc, clippy -D warnings, cargo doc --document-private-items -D warnings, cargo build, and cargo deny).
  • Verified _.su (Gc, Uc, Yo, TL, Od, rE) and B6 (Yo) against Google Flow boq_labs-ai-sandbox-frontend_20261120.00_p0.
  • Ran headless Chrome CDP and Rust behavioral checks covering hasDeferredSceneRoute .sum/.sub rejection, probeStore() checks for TL/rE/Od, <sceneId>:<wfId> across readStoreSnapshot/assetOps/videoOp (trim & prepare_extend)/trashAssetOp/openEditAsset/match_asset, mutateAndVerify submit error propagation, and collect_extended_videos filtering of unrelated stand-alone videos.

Scene signal clip selection and extend composer verification


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

- Add verified su and B6 scene builder descriptors and probe checks
- Derive scene aspectRatio and Dc collection ID in createScene
- Select clips via su.Gc signals after Dx readiness without video click
- Emit <sceneId>:<wfId> video clip assets and watch extend updates
- Validate VIDEO workflows and confirm add_clips via store refetch

@byteland-app byteland-app left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts/read_store_snapshot.ts uses ${sceneId}:${wfId} for each clip. If the same workflow appears twice, the later occurrence overwrites the first. A local fixture with two occurrences and different trim points returned only one. The exported ID also fails as an asset_ids input for a scene-only clip. Use a stable identity for each occurrence and resolve that identity consistently in the scene consumers. Verify both repeated clips and a scene-only clip passed back to a tool.

@byteland-app

Copy link
Copy Markdown
Contributor

Changes requested.

  1. ts/read_store_snapshot.ts: scene clips now have only the ID <sceneId>:<wfId>. Nothing in src/ or ts/ parses an ID with : except the new code. ts/asset_ops.ts:34 and the trim code in ts/video_ops.ts use tileMap.get(id) directly, so an ID from list_assets is not found there. The PR text does not mention this change.
  2. ts/video_ops.ts (prepare_extend): it uses minified names (TL, rE, Od) that probeStore() does not check (it checks only su, B6, Yo). If one name changes, the function is silently skipped, and doctor gives no warning.
  3. prepare_extend now looks for the clip in the scene that is open, and returns scene_clip_not_found when it is not there. The old code reused the current scene for a stand-alone video. This is a behavior change. Document it.
  4. ts/scene_tiles.ts (hasDeferredSceneRoute): toString().includes(".su") also matches .sum and .sub.
  5. ts/scene_ops.ts (mutateAndVerify): .catch(() => {}) hides the submit error, so a timeout reports only add_clips_not_confirmed.
  6. src/scenes.rs (collect_extended_videos): a stand-alone video without : is accepted when its media changes. An unrelated update of another video can be taken as the extend result.

The clip ID rule conflicts with the multi-clip export in #44. This PR also overlaps with #28, #38, #43 and #51. Decide the order and rebase.

- Parse <sceneId>:<wfId> IDs in rename, trim, trash, and edit paths
- Keep scene names off clip items so scene queries match scene tiles
- Add TL, rE, and Od to SceneBuilderFormat and check them in probeStore
- Match exact identifier boundaries in hasDeferredSceneRoute
- Surface submit errors from mutateAndVerify in sceneOp add_clips
- Ignore unrelated stand-alone video updates in collect_extended_videos
- Document scene clip IDs and open-scene prepare_extend behavior
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Addressed in b4a7b31:

  1. <sceneId>:<wfId> consumer support & documentation:
    • Added splitSceneClipId (ts/scene_tiles.ts) and pub(crate) fn split_scene_clip_id (src/scenes.rs) and wired <sceneId>:<wfId> handling across all consumers:
      • ts/video_ops.ts (trim) & src/scenes.rs (confirm_trimmed_video): trims <sceneId>:<wfId> clips on the parent SCENE tile via set_scene_clip_primary_media (Ji / Ci) and confirms the settled clip bounds in sceneTile.Uc.
      • ts/asset_ops.ts (rename): validates <sceneId>:<wfId> against sceneTile.Uc and renames the underlying top-level VIDEO tile when present (returning scene_clip_has_no_tile_to_rename for scene-only clips, since Uc entries do not store an independent displayName).
      • ts/asset_trash.ts (trashAssetOp): removes <sceneId>:<wfId> from <sceneId> via scene_delete_clip_mutation (ik) without trashing any stand-alone VIDEO tile.
      • ts/open_edit_asset.ts: navigates to /project/<pid>/scene/<sceneId> instead of /edit/<sceneId>:<wfId>.
    • Documented <sceneId>:<wfId> in docs/{en,zh-CN,ja}/tools-reference.md and the PR description.
  2. TL, rE, and Od checked in probeStore() (doctor):
    • Added activeExtendClip: "TL", exitExtend: "rE", and modelsQuery: "Od" to SceneBuilderFormat / NOVEMBER_20_STORE.sceneBuilder.
    • sceneBuilderChecks (probeStore()) now checks su.prototype.rE and Gc, Uc, Yo, TL, Od on su when the class is loaded, plus live TL, rE, and Od.isPending functions when <flow-scene-builder> is mounted. prepare_extend reads these descriptors via sbFormat and returns scene_builder_signals_missing if any required function is absent instead of silently skipping.
  3. prepare_extend open-scene behavior documented:
    • Documented in docs/{en,zh-CN,ja}/tools-reference.md, ts/video_ops.ts, and the PR description that when a scene is open (or scene_id is provided), prepare_extend looks for the target clip in that scene and returns scene_clip_not_found:<wfId> instead of reusing the open scene for an unrelated stand-alone video.
  4. hasDeferredSceneRoute exact export match (ts/scene_tiles.ts):
    • Replaced .includes(\.${controllerName}`) with an identifier-boundary regex (referencesExport) so .suno longer matches.sum, .sub, or .subscribe`.
  5. mutateAndVerify submit error propagation (ts/project_store.ts, ts/scene_ops.ts):
    • Added onSubmitError to mutateAndVerify instead of swallowing submitProjectMutation errors with .catch(() => {}) (and stopped polling early once a fresh PROJECT_TILES read confirms a rejected mutation did not apply), so sceneOp (add_clips) surfaces the submit error instead of reporting only add_clips_not_confirmed.
  6. collect_extended_videos stand-alone video filter (src/scenes.rs):
    • Removed !asset.id.contains(':') || from the secondary scan so only watched_ids (target.id and <opened_scene_id>:<wfId>) and <opened_scene_id>:* scene clips are accepted; concurrent updates to unrelated stand-alone videos are ignored.

Clip ID rule (#44) & PR merge order:

  • Clip ID rule: Top-level SCENE tiles keep id: <sceneId> (kind: "scene", name: st.displayName), stand-alone VIDEO tiles keep id: <id>, and active scene clips use <sceneId>:<wfId> (kind: "video"). Stopped copying st.displayName onto <sceneId>:<wfId> clip items in ts/read_store_snapshot.ts and updated match_asset (src/assets.rs) to prefer top-level tiles on non-colon name and ID-substring lookups so scene queries in multi-clip scene export (#44) always resolve to kind: "scene".
  • Rebase & merge order: #46 is cleanly based on main (34de8f5) and should merge first to establish the <sceneId>:<wfId> contract and verified scene signals, followed by rebasing #28, the split PRs from #44, #38 / #43, and #51 onto main.

@byteland-app

Copy link
Copy Markdown
Contributor

Closing this pull request. It conflicts with main, and main now supports Google Flow build 20261129.06_p0 with new field names in the code that this change edits. Please open a new pull request on current main if the change is still needed.

@byteland-app
byteland-app deleted the stitch/bind-verified-scene-signals-and-clip-assets-jm0-709feeed-1fac-4fb8-9349-aa037fea0bbf branch December 1, 2026 03:30
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Opened #61 on current main (96eacfb, v2.4.0) with the conflicts resolved and verified field bindings for Google Flow build 20261129.06_p0 (alongside 20261120.00_p0):

  • Bound SceneBuilderFormat for 20261129.06_p0 (controller: "Iv", timeline: "s6", player: "Lc", playerReady: "Ny", selectedClip: "la", clips: "Pc", extendDisabledReason: "Rp", activeExtendClip: "YN", exitExtend: "VF", modelsQuery: "ub") and updated probeStore() to inspect Ivy definitions across Ka / Ma / ɵcmp, deferred route loaders (eh / mh / loadComponent), and prototype descriptors without invoking getters.
  • Mapped scene and clip mutations through ProjectMutationFormat for 20261129.06_p0 (ud, hg, Fg, xc, LQ, Yb, Be, Kbb, yc, vg, tg, cj, Si, oj) and 20261120.00_p0 (Xc, mf, ng, Dc, De, y6a, yc, dh, ug, Ji, Ci, ik).
  • Merged main's snapshot trim/date descriptors and bounded add_clips confirmation (f10b1d7, 96eacfb) with <sceneId>:<wfId> clip asset emission (readSceneClipBounds via snapshotFormat()?.trim), clip consumer routing (rename, trim, trash, edit, extend), and mutateAndVerify submit error propagation.

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