Skip to content

Bug: Invalidate cached results whose output assets are missing #111

Description

@BerryUIKI

Summary

After generating a disposable asset and deleting its file, the identical request returned success=true, is_cached=true, and the old asset URL; the runner was called only once. creative_runner.py:211 trusts cache.py:120 without checking output availability.

Environment and evidence

  • Review finding: F11 (2026-10-05 product/technical review).
  • Baseline: Windows, dev at c1c5dbe. The remote dev matched this commit when filing.
  • Evidence: Reproduced.
  • Priority recommendation: P1 - proposed first-release blocker. This is review triage, not a production-incident severity declaration.
  • No real credentials, paid inference, engine installation, or unrelated process termination were used for review probes. Mocked observations establish the stated code behavior, not live-provider/GPU acceptance.

Reproduction or validation

  1. In a disposable asset/cache database, execute a seed=42 request with the engine mocked to return a managed fixture asset.
  2. Delete only that fixture's output file.
  3. Submit the identical request.
    Observed: success=True, is_cached=True, old asset URL, and only one engine call although the file is absent.

User impact

Users see a successful result that cannot be displayed or exported; R09 and R16 require valid output reuse.

Proposed approach

Validate cache output references and files, invalidate broken entries, and recompute or report an actionable missing-output state. Add startup reconciliation and tests for deleted/corrupt assets.

Acceptance criteria

  • A cache hit requires all referenced outputs to remain available and valid.
  • Broken entries are invalidated and recomputed or returned as an actionable missing-output state.
  • Startup reconciliation detects orphaned references.
  • Tests cover deleted/corrupt outputs and valid reuse across restarts.

Verification scope

Real GPU inference, paid-provider compatibility, and a clean-machine packaged desktop journey remain unverified. Any follow-up implementation should target dev under the repository's contribution/branching rules.

Activity

  1. added
    bugSomething isn't working
    criticalCritical priority issues that block core functionality or cause vulnerabilities
    backendBackend Python / FastAPI / Engine issues
    on Oct 4, 2026
  2. added a commit that references this issue on Oct 4, 2026
    4fdea8d
  3. BerryUIKI commented on Oct 4, 2026

    @BerryUIKI
    OwnerAuthor

    Resolved in PR #153.

    • Output assets referenced in cache entries are validated on read (\get_async, \has_async).
    • If an asset is missing or corrupted on disk, the entry is automatically invalidated from both in-memory store and SQLite, prompting the runner to recompute outputs cleanly.
    • Startup reconciliation (
      econcile_orphan_references_async) prunes stale cache references on application launch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend Python / FastAPI / Engine issuesbugSomething isn't workingcriticalCritical priority issues that block core functionality or cause vulnerabilities

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions