Skip to content

Both Menus Judge a Cached Hub Fresh Against main Whatever --ref Names #2541

Closed

Description

@ptr727

Found during the local strict review for #1093 (pre-existing, unchanged by that fix).

Both menus confirm a cached hub tree is fresh by comparing its HEAD with origin/<default ref> alone, whatever --ref / -Ref the session was started with: ensure_hub_root in host-setup/menu.sh and Confirm-HubRoot in host-setup/menu.ps1.

A fetch for a non-default ref sets HUB_ROOT to $DIR/hub with that ref checked out, so two things follow:

  1. A session started with a non-default ref re-clones on every task. Its own tree's HEAD is the ref's commit, which differs from origin/main, so each later task reads its own fetch as stale and fetches again.
  2. It can run tools from the wrong ref. Where another session sharing the same cache directory has since fetched the default ref, that tree's HEAD equals origin/main, so the first session accepts it as fresh and runs its next task from main rather than the ref it asked for, with no message saying so.

Constructed reproduction: session A runs menu.sh --ref develop and completes one task. Session B, sharing the same --dir, runs a task on the default ref, which replaces $DIR/hub with a main clone. A's next task passes the freshness check and runs from main.

Done means the freshness check compares against the commit the session's own ref resolves to (or a non-default ref always re-fetches deliberately and says so), with a test per menu covering the mixed-ref interleaving above.

Activity

  1. added
    bug
    pre-existing
    script
    on Oct 8, 2026
  2. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Fixed by #2571, which reached main through promotion #2568. That promotion carried no closing keyword for this issue, so it is closed by hand.

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

    bugpre-existingscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions