Skip to content

Remove the pre-rename compatibility layer: no released version ever used the old name #52

Closed

Description

@smb

Summary

The code still carries a fallback to the product's pre-rename cache and
workspace directories. It can go: no published release ever used the old
name.

2026-08-28  first commit
2026-08-31  d51be90 renames the product to MatteLoop
2026-09-02  v0.1.0, the first tag and the first release

The rename landed three days before anything shipped. Every artifact any user
has ever installed writes and reads the current names. The compatibility layer
serves exactly one machine — the maintainer's development box, which predates
the rename — and it costs a branch in every cache path resolution plus a
dedicated test file to keep proving it works.

Precondition: migrate the one machine that has this data first

Removing the fallback makes pre-rename data invisible, not corrupt. On the
maintainer's machine that currently means model weights and a compiled provider
cache under the old cache directory, and at least one output directory holding
promoted cuts under the old workspace name.

Moving those to the current names is enough, and needs no code: the resolver
already prefers the new location whenever it exists. Do that before this change
lands, or the weights get re-downloaded and the promoted cuts stop being found.

What to remove

  • src/matteloop/paths.py:12 — LEGACY_CACHE_NAME
  • src/matteloop/paths.py:14 — LEGACY_WORKSPACE_NAME
  • src/matteloop/paths.py:17-29 — the fallback inside cache_subdirectory(),
    which then collapses to a single user_cache_dir(...).joinpath(*parts)
  • src/matteloop/jobs/workspace/_platform.py:120-127 —
    _workspace_root_for_output(), the same pattern per output directory
  • tests/test_legacy_data_locations.py — the whole file
  • The prose in README.md, docs/engineering-guardrails.md,
    docs/v1-scope.md and docs/building.md describing the fallback

What must NOT be removed in this change

Two schema tokens still spell the old name, and they are not paths:

  • src/matteloop/core/fingerprints.py:27 — "rembggui-fingerprint"
  • src/matteloop/jobs/workspace/_common.py:65 — "rembggui-cut-manifest"

These are format identifiers written into stored files. Manifests carrying the
second token exist on disk today. Renaming them does not tidy a name — it
invalidates every promoted cut and every stored fingerprint, and
docs/engineering-guardrails.md:78 already says they stay. They are opaque
identifiers; the fact that the string reads like the old name costs nothing.

If they should be renamed anyway, that is a data-format migration and belongs in
its own issue with its own decision about what happens to existing cuts.

Related finding

coreml-cache is a third pre-rename directory. It is not reachable from any
code path — the string does not appear anywhere in src/, and never has in the
repository's history — yet compiled provider artifacts accumulate under it, in
one case several gigabytes, with nothing in the interface able to show or delete
them. That is a separate defect and not fixed by this issue, but whoever removes
the fallback will meet it.

Acceptance criteria

  1. No path resolution consults a pre-rename directory.
  2. grep -rn "rembggui" src/ returns only the two schema tokens named above.
  3. The docs no longer describe a fallback that does not exist.
  4. uv run ruff check . && uv run mypy src && QT_QPA_PLATFORM=offscreen uv run pytest -q still green, and the guardrail check passes.

Ordering

#51 rewrites README.md, including the paragraph describing this fallback. Land
this after #51 to avoid a conflict, or rebase.

Activity

  1. smb commented on Sep 5, 2026

    @smb
    CollaboratorAuthor

    The cache half of the precondition is done. On the one machine that had
    pre-rename data:

    • the model directory was moved to the current cache name, with the rembg
      version namespace beneath it untouched — all seven weights verified intact
      afterwards;
    • the superseded thumbnail copy under the old name was deleted, the current one
      having already won the resolution;
    • the orphaned compiled provider cache described above was deleted, reclaiming
      3.3 GiB that no code path could reach;
    • the old cache directory is now gone entirely.

    All three subdirectories now resolve under the current product name, and
    matteloop --smoke-test passes against the moved cache.

    Still outstanding before this issue can land: an output directory on that
    machine holds promoted cuts under the pre-rename workspace name. Removing
    _workspace_root_for_output() would make those cuts undiscoverable. Renaming
    that directory to the current workspace name is enough, and needs no code — the
    resolver already prefers the current name when it exists.

    Note that the manifests inside those cuts carry the rembggui-cut-manifest
    schema token. Renaming the directory does not touch them, and it must not:
    that token stays, for the reasons in the issue body.

  2. self-assigned this
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions