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: one content-addressed cache for prepared dependencies, import graphs and flake resolutions · Issue #1908 · developing-today/code

mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908

New issue
Copy link
New issue
Copy link
Closed
Closed
mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions#1908
Copy link
Assignees
dezren39
Labels
enhancementNew feature or requestsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Relocated from dezren39/darwin-nix#187 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).

Parent: #175

Summary

Three runtime issues each introduce a content-addressed cache, and each designs it alone: #103 a prepared dependency
directory, #104 a resolved import graph, #107 a resolved flake reference. The one cache mcpx has today is sized and
evicted for something far smaller. Built three times, they get three layouts, three eviction rules and three
concurrency bugs -- and #78 (daemon state and cache correctness) gets three more members. This issue owns one cache
mechanism; the three issues own what they put in it.

This is #181 collision 12.

Original notes

  • non-ai auto-import dynamic if a script imports something that isnt avaialble
  • if i import a file in another dir that has its own package.json/lock can it auto-import, prepare dependencies to be available whereever needed
  • accept a flake url as an alternative exec env (devshell/shell.nix in default pwd or tempdir or ad-hoc flake that isfully isolated, path executed before script, script executed inside

Current state (05c78b2)

  • Exec workdirs are content-addressed and evicted by count: pruneWorkDirs (internal/runner/runner.go:808) keeps
    defaults.ExecWorkDirs directories (internal/defaults/defaults.go:413). Each holds a generated client -- kilobytes.
  • It is already one of three count-based pruners, each written separately: prunePrograms (runner.go:768, generated
    programs per workdir), pruneWorkDirs (:808) and pruneEntries (:847, entry points beside a user's script).
    Their bounds (exec.programs: 64, exec.workDirs: 8, exec.entries: 8, internal/defaults/defaults.json:96-100)
    are built-in defaults, not settings.
  • Nothing is evicted by size or age, nothing pins an entry a running exec is using, and there is no listing or prune
    command for cached state. Each pruner spares only the caller's own entry (if p == keep) and orders the rest by
    mtime, so a concurrent run's directory is protected only by being recent.

The three proposals differ by orders of magnitude, which is the point this issue exists to make:

Cache Proposed in Key (as proposed) Size of an entry
prepared dependencies (node_modules, deno/bun cache) #103 dependency set tens to hundreds of MB
import graph #104 entry file hash + transitive mtimes kilobytes
flake resolution #107 reference + lock bytes -- but the store path it names lives in /nix/store and is collected by nix-collect-garbage unless mcpx holds a GC root

Two more candidate tenants are proposed in sibling issues, and they should not become a fourth and fifth design:
#100's compiled JS (script.compile, "its own cache keyed by script hash + runtime" is an open question there) and
#105's uv environments per dependency set.

So "one cache" should mean one mechanism (layout, keys, index, eviction, pinning), not one blob store.

Approaches

A -- each issue keeps its own directory and pruning. What happens by default. Count-based eviction applied to
node_modules trees is unbounded in bytes, and three prune loops race each other and any running exec.

B -- generalise pruneWorkDirs to every kind: one root, evicted by count. One mechanism, little code. Count is the
wrong unit when entries differ by five orders of magnitude, and it still has no pinning, so a prune can delete the
dependencies of an exec that is running.

C -- recommended: one cache package with per-kind namespaces. <state>/cache/<kind>/<key>; keys are the SHA-256 of
canonical inputs (for #104, content hashes rather than mtimes, which are not stable across checkouts); entries are
created in a temp directory and renamed into place; a lease (lock file or refcount) pins an entry while an exec uses it;
eviction by total bytes and age, never touching a leased entry; #107's entries register and drop nix GC roots; limits
are settings (cache.maxBytes, cache.maxAge; names open), and mcpx cache lists and prunes (or the existing
status gains a section -- prefer that over a new command if it fits). Recommended because it is the only option that
gives the large kind a byte bound and every kind a guarantee that a running script's inputs are not deleted under it.

Open questions

  • Should Bump build/buck/preludes/buck2-prelude from d956689 to 062245a #103 cache at all, or lean on the runtimes' own content-addressed caches (DENO_DIR, bun's global cache with
    hardlinks, npm's cache) and have mcpx cache only the resolved manifest? That would shrink the large kind to bytes.
  • Who evicts -- the daemon, or any process that writes? Eviction racing between a daemon and a standalone CLI run is
    the fix(deps): update rust crate leptos_router to v0.8.17 #78 bug class.
  • Do the existing exec workdirs (and the program and entry pruners) move onto this, or stay as they are? If they move,
    their three built-in bounds become settings of the mechanism rather than three more constants.
  • Timing: this has to be settled before the first of Bump build/buck/preludes/buck2-prelude from d956689 to 062245a #103/Bump tracing from 0.1.38 to 0.1.40 in /sources/pavex/examples/skeleton #104/Bump checkmarx/ast-github-action from 2.0.19 to 2.0.22 #107 ships a cache. After that, it is a migration.
  • The daemon's schema cache is a fourth existing cache with its own invalidation, a hand-bumped cacheVersion (internal/daemon/registry.go:102-106; fix(deps): update rust crate leptos_router to v0.8.17 #78 item 3). Whether it joins the mechanism (keyed by content instead of a version constant) is the same question as the pruners.

Ease · Impact · Related

Ease M · Impact med-high -- cheap now, expensive after the first of #103/#104/#107 ships its own.
Related: #103, #104, #107 (users), #100 and #105 (candidate users: compiled JS, uv environments), #78 (cache
correctness), #181 (collision 12).

Security/auth deferred; see tracker.

Activity

Next
  1. developing-today commented on Oct 28, 2026

    @developing-today
    developing-todayBot
    on Oct 28, 2026 – with developing.today
    Contributor
    More actions

    CODE-834

  2. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    History carried over from dezren39/darwin-nix#187 (verbatim, oldest first):


    @dezren39 · 2026-09-30T12:07:49Z

    Issues pass (2026-09-30, at 05c78b2).

    • Current state: pruneWorkDirs is one of three count-based pruners already written separately: prunePrograms (internal/runner/runner.go:768), pruneWorkDirs (:808) and pruneEntries (:847). Their bounds (exec.programs: 64, exec.workDirs: 8, exec.entries: 8, internal/defaults/defaults.json:96-100) are built-in defaults, not settings. Each spares only the caller's own entry, so a concurrent run is protected only by being recent.
    • Named two more candidate tenants so they do not become designs of their own: Bump build/buck/preludes/buck2-prelude from d956689 to 9afedba #100's compiled JS (script.compile) and Bump h2 from 0.3.18 to 0.3.24 in /sources/pavex/examples/skeleton #105's uv environments.
    • Added a timing question: this must be settled before the first of Bump build/buck/preludes/buck2-prelude from d956689 to 062245a #103/Bump tracing from 0.1.38 to 0.1.40 in /sources/pavex/examples/skeleton #104/Bump checkmarx/ast-github-action from 2.0.19 to 2.0.22 #107 ships a cache. The existing-workdirs question now covers all three pruners, and their bounds would become settings of the mechanism.
    • Bump build/buck/preludes/buck2-prelude from d956689 to 062245a #103, Bump tracing from 0.1.38 to 0.1.40 in /sources/pavex/examples/skeleton #104 and Bump checkmarx/ast-github-action from 2.0.19 to 2.0.22 #107 now carry a "Cache: deferred to Phase 4: joiner with missing pre-join control messages stalls silently #187" line and keep their cache text as input to this issue. fix(id): make Nix E2E check reproducible #175 lists this issue in its task list, order and table (M / med-high).

    @dezren39 · 2026-09-30T12:16:52Z

    Issues pass (2026-09-30, architect follow-up). Open question added: the daemon's schema cache (hand-bumped cacheVersion, internal/daemon/registry.go:102-106, #78 item 3) is a fourth existing cache; whether it joins the mechanism is the same question as the three pruners.

  3. dezren39
    added
    enhancementNew feature or request
    queue/queuedHas a queued queue task
    status/needs-triageNot yet triaged; needs a first look
    on Oct 28, 2026
  4. github-actions
    assigned
    dezren39
    on Oct 28, 2026
  5. 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 Oct 29, 2026
  6. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), Lane A shift
    • Session / ID: queue task 2802
    • Found via: queue claim
    • Task: Triage relocated mcpx cache issue mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908: dedupe against existing code issues, confirm scope against current pkgs/mcpx on main, enqueue implementation follow-up. No implementation in this task.
    • Expectation: s — done = triage verdict posted, follow-up packet enqueued (or duplicate closed with pointer), labels truthful.
    • Links: task 2802 · tracker mcpx: re-home the open mcpx backlog from dezren39/nix, with this repo as the single source #309
  7. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), Lane A shift
    • Session / ID: queue task 2802 (triage) → follow-up task 3148
    • Found via: queue claim
    • Task: Triage relocated mcpx cache issue mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908 (was mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions dezren39/darwin-nix#187): dedupe, scope confirmation vs current main, enqueue implementation follow-up.
    • Expectation: done = verdict below + follow-up packet enqueued.
    • Links: follow-up queue task 3148 · tracker mcpx: re-home the open mcpx backlog from dezren39/nix, with this repo as the single source #309

    Triage verdict

    Dedupe: no duplicate — #1908 is the unique owner of the cache mechanism.

    • mcpx: where a script's packages come from -- npm/deno/bun dependency configuration chain #1913 (prepared dependencies, was nix#103), mcpx: resolve a script's import graph statically and prepare missing dependencies #1915 (import graph, was nix#104) and mcpx: accept a flake ref as a program and as an execution environment #1921 (flake refs, was nix#107) each carry a "Cache: deferred to Phase 4: joiner with missing pre-join control messages stalls silently #187" header: they own what they put in the cache and explicitly defer the mechanism (layout, keys, eviction, leases) to this issue.
    • mcpx: small correctness problems in daemon state and caches #1866 (was nix#78, daemon state and cache correctness) is related — its item 3 is the schema-cache question listed in this issue's open questions — but it does not own a unified cache mechanism.
    • mcpx: Python as a first-class script language, 1:1 with TypeScript #1917 (Python/uv environments) names itself a tenant of this mechanism; mcpx: how the JavaScript runtime is chosen, what each does with TypeScript, and an automatic validate/compile step #1911's bundle step is a candidate tenant. Neither duplicates this issue.
    • Searches for the mechanism itself (pruneWorkDirs, "cache mechanism", "content-addressed cache") return only mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908 and its tenants above.

    Scope confirmed against current pkgs/mcpx on main (8124cc0):

    • The three separate count-based pruners still exist: prunePrograms (internal/runner/runner.go:721), pruneWorkDirs (:761), pruneEntries (:800) — same functions the issue cited at 768/808/847 on the old nix-tree commit; line numbers shifted, nothing has been unified.
    • Their bounds are still built-in defaults, not settings: internal/defaults/defaults.json has exec.workDirs: 8, exec.programs: 64, exec.entries: 8.
    • The daemon schema cache still uses a hand-bumped constant: const cacheVersion = 6 (internal/daemon/registry.go:136).
    • There is no pkgs/mcpx/internal/cache package on main. Approach C remains unimplemented and the timing warning stands: this should land before mcpx: where a script's packages come from -- npm/deno/bun dependency configuration chain #1913/mcpx: resolve a script's import graph statically and prepare missing dependencies #1915/mcpx: accept a flake ref as a program and as an execution environment #1921 ship their own caches.

    Follow-up: implementation packet enqueued as queue task 3148 (kind small_fix, dedupe key repo-health:v1:fix:developing-today/code:issue:1908) carrying Approach C and the acceptance criteria intact, including answering the open questions on the PR rather than dropping them. Tenant integrations stay under their own issues.

    Labels updated to mirror the queued follow-up.

  8. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Oct 29, 2026
  9. 45 remaining items

  10. dezren39
    added
    queue/queuedHas a queued queue task
    status/needs-triageNot yet triaged; needs a first look
    on Nov 3, 2026
  11. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 30 (priority/none). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  12. 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 4, 2026
  13. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-e
    • Session / ID: task 8724
    • Found via: queue claim
    • Task: task 8724 for issue mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908 (triage) — execution lane assigned opencode
    • Expectation: the laptop claimant launches the bound opencode session, which drives task 8724 to its terminal state
    • Links: issue mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908
  14. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane 1a180ae5-384f-4e71-8d77-08f7b1652c75 (OpenChamber scheduled lane)
    • Session / ID: task 8724 (queue repo-health-code-pilot)
    • Found via: OpenChamber scheduled lane claim
    • Task: Revalidate the content-addressed mcpx cache proposal on issue mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908 against current main and route it.
    • Prior progress: The queue row says the task was handed off to the OpenCode execution lane at 06:32Z. I am verifying current issue, PR, and queue ownership before treating that handoff as live.
    • Expectation: Confirm whether mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908 remains live; do not implement inside this triage task.
  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 4, 2026
  16. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — resolved on current main

    • Agent: queue worker (repo-worker-code), lane 1a180ae5-384f-4e71-8d77-08f7b1652c75 (OpenChamber scheduled lane)
    • Session / ID: task 8724 (queue repo-health-code-pilot)
    • Found via: OpenChamber scheduled lane claim
    • Task: Triage mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908, the shared content-addressed cache mechanism.

    Resolution evidence (verified against current main b6f36bf355d1bdd9e59cad083312868b71e92e8a)

    • pkgs/mcpx/internal/cache/cache.go implements the shared per-kind cache, canonical SHA-256 keys, atomic puts, leases, listing, byte/age/count eviction and shared pruning (Limits/Key lines 39-72; Put 150-187; leases 199-216; List 253-258; Evict/Prune/victim selection 352-418).
    • pkgs/mcpx/internal/runner/runner.go acquires leases for running workdirs/programs and routes the three historical pruners through cache.Prune (425-471, 1341-1389). pkgs/mcpx/internal/cli/cache.go provides list/prune/remove; cache limits are configurable in defaults.
    • The implementation PR mcpx: one content-addressed cache mechanism (internal/cache) — #1908 Approach C #2555 is MERGED (674c4c6); hardening PR fix(mcpx): cache — traversal rejection, Put self-eviction, eviction lease re-check (#2566) #2838 (42435d6) and lease-scan fix fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) #3728 (70a595a) are also MERGED. No open PR for mcpx: one content-addressed cache for prepared dependencies, import graphs and flake resolutions #1908.
    • PR mcpx: one content-addressed cache mechanism (internal/cache) — #1908 Approach C #2555 explicitly records the daemon schema cache as a deliberate non-join assigned to mcpx: small correctness problems in daemon state and caches #1866 item 3, and says cache tenants remain owned by their separate issues. Neither is an untracked gap in this mechanism issue.

    This tracker is resolved and closed. No follow-up task was enqueued because the shared mechanism is delivered; remaining tenant work is intentionally separate.

  17. dezren39
    closed this as completedon Nov 4, 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

enhancementNew feature or requestsource/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.