Skip to content

test(recall): fail when a recorded metadata key has no recall contract - #10220

Open
Pfannkuchensack wants to merge 5 commits into
invoke-ai:mainfrom
Pfannkuchensack:test/recall-contract
Open

Pfannkuchensack wants to merge 5 commits into
invoke-ai:mainfrom
Pfannkuchensack:test/recall-contract

Conversation

@Pfannkuchensack

@Pfannkuchensack Pfannkuchensack commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Nothing checked that metadata recall reads what the graph builders record, so recall gaps were found by hand (#10169, #10140). Every key an image or video graph records now needs an entry in a recall contract, and a key without one fails the frontend tests.

  • imageRecallContract.test.ts and videoRecallContract.test.ts compile every Generate base and shape, Canvas modes, Upscale, hosted providers, and every video base, variant and mode. Each recallable setting is tuned off its default. The tests then check:
    • every recorded key has an entry;
    • recall restores what each entry claims, and the check fails if the value matches the panel or the model default anyway;
    • a key marked ignored changes nothing when removed;
    • each recall kind (Recall All, Remix, prompts, seed, size, CLIP skip) applies exactly its own settings;
    • every recall field label is reported by some record;
    • a generation record lacking a key restores that key's default.
  • The image contract also has to name every field CoreMetadataInvocation declares. A backend field added without an entry fails tsc. frontend-checks now also runs when invokeai/frontend/api/schema.ts changes, so this check runs on the backend PR that adds the field.
  • Gaps the contracts found, fixed here:
    • Image recall now restores PiD mode and steps. A record of the same family without PiD turns it off, so recalling a refiner image onto a panel with PiD on no longer leaves a combination validation refuses.
    • Video recall restores the target resolution of canvases sized by media (first/last frame, source video, picture clip), for Recall All, Remix and Use size. Before, a remix could run at the panel's resolution and come out at another size.
    • The missing videoTitles.size notice title.
  • The shared graph fixtures for Canvas, Upscale and video coverage moved into *.testing.ts files, unchanged. The remix and video round-trip tests the contracts replace are removed.

Related Issues / Discussions

QA Instructions

From invokeai/frontend/webv2:

pnpm lint
pnpm test src/workbench/image-actions src/features/generation/core/graphCoverage.test.ts src/features/generation/core/canvas src/features/video/core src/features/upscale/core src/architecture/architectureWorkflow.test.ts src/platform/i18n
  • pnpm lint passes. The focused run passes: 49 files, 2639 tests. The two contract files take under 1 s.
  • Each gate was checked by mutation and fails as intended:
    • an extra key in a builder's metadata;
    • a removed entry;
    • a disabled reader;
    • a read key marked ignored;
    • a new recall field label;
    • a removed declared key;
    • reverting the PiD and video size fixes.
  • Locally, five tests in the full unit run fail on a de-DE Windows machine with and without this change: number formatting in clusterStats, indexProgress and modelCacheStore, plus the AltGr test in keys.test.ts.
  • Not done: a browser check. The mock backend has no video record sized by media.

Review

No blocking findings. Remaining limits:

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Meaningful regression coverage added / updated where needed; obsolete tests/code removed
  • Persisted-state and API changes include required migrations / compatibility validation
  • Relevant performance/efficiency opportunities considered; material claims have evidence
  • Material review findings resolved and relevant checks rerun
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Image and video recall contracts classify every key the graph builders record and prove each round trip.
Recall now restores PiD mode and steps, and the target resolution of media-sized video canvases.
The checks workflow also runs when the generated API types change.
@github-actions github-actions Bot added CI-CD Continuous integration / Continuous delivery frontend PRs that change frontend files docs PRs that change docs labels Nov 9, 2026
The recorded canvas is snapped, so its ratio cannot stand in for the media; the executor now resolves the target resolution once the media are hydrated.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-CD Continuous integration / Continuous delivery docs PRs that change docs frontend PRs that change frontend files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants