Skip to content

Native resolver serves a stale cached 'latest' binary forever #331

Open

Description

@neuromechanist

Found during epic #324 Phase 6 while running validate_implementations.py against the native reference binary.

Symptom

pamica.native.resolver.resolve() with the default version="latest" returns whatever binary was cached the first time "latest" was resolved on this machine, forever. On the development host, ~/.cache/pamica/bin/latest/ holds a binary downloaded on 2026-08-15 whose SHA-256 differs from the current v0.3.3 release asset. It happens to produce the same log-likelihood on the bundled sample, but nothing guarantees that for the next release, and the user has no signal that the "latest" binary is stale.

Root cause

pamica/native/resolver.py:119-121: the cache path is <cache>/<version>/<asset>, and a hit returns immediately without any check. For a pinned tag this is correct (a release asset never changes). For "latest", the directory name is a moving alias, so the first download is served indefinitely, and the SHA-256 is only verified at download time.

Options (decision needed)

  • Resolve "latest" to a concrete tag (GitHub releases/latest API or the redirect target) and cache under that tag, so a new release is fetched once and the old one stays addressable; fall back to the newest cached tag when offline, with a warning.
  • Or: key pamica.native to the installed pamica version by default (the binary built for this release), and make "latest" explicit opt-in.
  • Either way, log which tag/SHA-256 is being used, so parity reports can name the reference exactly (the validation guide already pins the v0.3.3 binary for its per-backend table).
  • Test: a cached "latest" from an older tag is not served once a newer tag is known (network-gated test, or an offline test on the tag-resolution function).

Activity

  1. added
    bug
    on Sep 23, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions