Skip to content

Detect and regenerate shims produced by older generators #147

Description

@junior-ricon

Problem

Generated shims can outlive the shiv version and template that produced them.

A concrete example on this machine is mise-managed shiv:codebase@0.3.0. Its active shim still exports generic:

export CALLER_PWD="$PWD"

Current shiv has generated package-scoped variables such as CODEBASE_CALLER_PWD since #113, and the installed codebase source already prefers that variable. Updating shiv or vfox-shiv did not regenerate the existing concrete codebase installation, so the old generated contract persists.

This is adjacent to, but distinct from:

Those source fixes do not repair already-generated shims by themselves.

Desired direction

Make stale generated artifacts visible and give each installation model a bounded repair path:

  • A traditional global shiv upgrade may regenerate shims owned by its global registry.
  • A mise/vfox-managed package rebuild may regenerate only that isolated package installation's shim.
  • Neither path should rewrite shims owned by the other model.
  • Existing concrete mise package versions need an explicit invalidation/rebuild story when vfox-shiv's bundled shiv generator changes; updating the plugin/bootstrap alone does not currently reinstall them.

Potential mechanisms include generator/format metadata in shim headers, shiv doctor detection, atomic owned-shim regeneration, and a vfox-shiv rebuild contract. The implementation should choose the smallest mechanism that makes ownership and upgrade behavior reliable.

Acceptance criteria

  • Generated shims expose enough provenance or format information to detect stale templates.
  • Global shiv can atomically regenerate only globally registered shims.
  • Mise/vfox-managed installs can rebuild only their version-local shims.
  • Upgrading one installation model cannot overwrite the other's shims.
  • A regression proves that a package installed with an older shim template is detected and repaired after the relevant generator upgrade.
  • Release guidance explains how fixes such as Rename CALLER_PWD to SHIV_CALLER_PWD across shiv-managed tools #104 and Isolate generated shim task maps per mise-managed install #146 propagate to already-installed tools.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions