GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry · Issue #3112 · developing-today/code

mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry #3112

New issue
Copy link
New issue
Copy link
Closed
#3728
Closed
mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry#3112
#3728
Copy link
Assignees
dezren39
Labels
app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 31, 2026
Issue body actions

Problem

pkgs/mcpx/internal/cache's Scan treats a file entry's lease file as a cache entry in its own right. A lease for a directory entry lives inside the entry (invisible to a scan of the parent), but a lease for a single-file entry lives beside it, named <entry>.lease-<random> (leaseLocation, cache.go:222-231). Scan (cache.go:265-310) only skips names starting with the bare lease prefix .lease- (cache.go:276) or .tmp- — a beside-file lease name starts with the entry's name, so it passes the skip, passes a nil match, and is returned as an Entry with Leased: false.

Consequences, all in the mechanism whose core promise is "eviction never removes a leased entry … the lease is what makes that safe" (cache.go:14-17):

  • List / mcpx cache and every eviction accounting count phantom entries: a leased file entry reports as two entries, and its size/count budget is charged for the lease file too.
  • Worse, Prune/Evict can select the lease file itself as a victim (it is not keep, and Leased() on the lease file's own path finds no <leasefile>.lease-*, so the mcpx cache: three Codex findings on merged PR #2555 — path traversal in cache remove, Put self-eviction, eviction/lease TOCTOU #2566-finding-3 recheck in removeAll, cache.go:349-361, also passes) and delete it — silently stripping the pin from a live, in-use entry, which the next eviction pass can then delete mid-run.

Evidence (verified this run, main 69b23978)

Verbatim-copy probe on the laptop (cache.go sha256 2782f988… identical in both clones; probe dir ~/git/fleet/probe-2026-10-31-laneB-cachelease/ on the laptop):

  • Scan(dir, "kind", 0, nil) over a directory holding one leased file entry returned 2 entries: key="entry.bin" size=7 leased=true and key="entry.bin.lease-3358895815" size=0 leased=false.
  • With the lease file aged oldest and the entry newest, Prune(dir, Limits{MaxEntries: 1}, "", nil) removed exactly one entry: entry.bin.lease-566081972 — the live lease file itself — leaving the in-use entry unpinned.

The nil-match form is not hypothetical: Cache.List (cache.go:254) and the runner's pruneWorkDirs (internal/runner/runner.go:839-846) both scan with no pattern, and the package documents entries as "either a directory or a single file" (cache.go:8-9) with Acquire explicitly supporting file entries (cache.go:195-198). The runner's patterned pruners escape only because their suffix patterns (.ts, .mcpx-entry.ts) happen not to match a lease suffix.

Why it matters

The lease is the cache mechanism's only protection against concurrent eviction (#1908, #2566). A scan that cannot tell a lease from an entry both corrupts eviction accounting and can destroy the pin itself, re-opening the exact failure #2566 finding 3 closed (an in-use entry deleted from under a running exec) through the lease file rather than the entry.

Acceptance criteria

  • Scan never returns a lease file as an entry: beside-file leases (<name>.lease-*) are skipped (or otherwise recognised) regardless of the match pattern, including the nil-pattern form.
  • Prune/Evict/removeAll can never delete a lease file; a victim list containing one is impossible, not just rechecked.
  • Regression tests in internal/cache: a leased file entry scans as exactly one entry with Leased: true, and a prune sized to force a victim leaves the lease file and the entry in place.
  • Existing internal/cache and runner tests still pass (laptop or CI).

Dedup

Distinct from closed #2566 (path traversal in Remove, Put self-eviction, scan→remove lease TOCTOU recheck): this is lease files being enumerated as entries by Scan, which neither the traversal validation nor the removeAll recheck addresses. Searched open + closed issues for cache/Scan/lease/Prune terms; no existing issue covers it. Parent mechanism: #1908.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/lowNice to have; do when convenient
    queue/queuedHas a queued queue task
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-b)
    • Session / ID: new-issue-creator-code-b cron run 2026-10-31T15:20Z (America/Chicago)
    • Found via: filed this run
    • Task: Filed this issue: mcpx cache Scan enumerates a file entry's beside-lease file as an entry, and Prune can delete the live lease, stripping the pin from an in-use entry (verified with a laptop verbatim-copy probe of internal/cache/cache.go at main 69b2397)
    • Expectation: effort/s — triage confirms the phantom-entry scan and routes the fix (skip beside-file leases in Scan; regression tests)
    • Links: queue packet packet-3112-triage.json (repo-health-code-pilot)
  3. github-actions
    assigned
    dezren39
    on Oct 31, 2026
  4. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  5. 81 remaining items

  6. dezren39
    added
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 1, 2026
  7. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: ses_e5e674d64eeffeDebWj03vsWrt; queue task 5637
    • State: PARKED for 30 minutes; no PR or worktree changes made.
    • Fresh evidence: mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry #3112 remains OPEN; canonical exact-scope PR fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728 is OPEN at 07c1801 and authored by Drew. No competing fix PR exists.
    • Resume when: fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728 merges (verify main and complete already_done) or closes unmerged (fresh revalidation).
    • Links: fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728
  8. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 1, 2026
  9. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane C
    • Session / ID: task 5637
    • Found via: queue claim (resume from pr_opened)
    • Task: verify Codex re-review state on PR fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728 head 07c1801 for issue mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry #3112; if clean, merge PR fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728 and close issue mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry #3112
    • Expectation: effort s; done = PR fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728 merged with all Codex findings dispositioned, issue mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry #3112 closed
    • Links: PR fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728; branch queue/5637-3112-cache-lease-scan
  10. dezren39
    added a commit that references this issue on Nov 1, 2026

    Merge pull request #3728 from developing-today/queue/5637-3112-cache-…

    70a595a
  11. dezren39
    closed this as completedin #3728on Nov 1, 2026
  12. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane C
    • Session / ID: task 5637
    • Found via: queue claim (resume from pr_opened)
    • Task: merged PR fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728 and closed issue mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry #3112
    • Expectation: met — PR fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728 merged as 70a595a; issue mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry #3112 closed by the merge (Fixes mcpx(cache): Scan counts a file entry's lease file as an entry — Prune can delete the live lease and strip the pin from an in-use entry #3112)
    • Links: PR fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728. Verification: Codex re-review of head 07c1801 clean ("Didn't find any major issues", 2026-11-01T15:35Z), the sole Codex P1 thread is resolved; targeted tests (go test ./internal/cache ./internal/runner) passed pre/post main merge per task 5637 checkpoints. basic:lint and stress remain red only on the pre-existing internal/conformance compile break (features_test.go:308 failingReads/Complete), verified in both job logs and tracked separately as issue mcpx: internal/conformance test backends do not compile against current mcpserver.Backend Complete signature #3519 / issue mcpx: conformance test package does not compile — test backend Complete returns []string, mcpserver.Backend wants Completion #3710 — unrelated to this change.
  13. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.