Skip to content

fix(sandbox): report the no-install path so the cache denominator is knowable - #5398

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/sandbox-deps-metric-no-install-arm
Jul 29, 2026
Merged

fix(sandbox): report the no-install path so the cache denominator is knowable#5398
pedrofrxncx merged 1 commit into
mainfrom
fix/sandbox-deps-metric-no-install-arm

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #5346/#5351. Found while checking whether the L2 cache is live in prod — it isn't, but the metric that will judge it has a blind spot big enough to change the buy decision.

The gap

sandbox.deps.restore emits on a restore hit and on a completed install. It emits nothing on the installPromise === null early return — and that's the path every Deno project takes: deno fetches at runtime, there is no node_modules, so no golden tier (L1 or the L2 EFS archive) can ever help it.

Measured in prod just now, 12 live sandbox pods on image 1.26.1:

count
[dev] $ deno task dev 4
bun / npm / pnpm / yarn 1
unclaimed or idle, no dev script 7
emitted any sandbox.deps* line 1

So today the log reads as "barely any dependency traffic" when the truth is "most of these boots are a runtime the cache cannot serve."

Why it blocks the decision, not just the dashboard

The Deno share is the ceiling on what any golden tier can win. Without a line on that path it is invisible, and we'd be sizing an EFS filesystem against a denominator we can't see — buying a shared filesystem to serve a fraction of boots we never measured.

no-install makes the denominator knowable:

stats by (source) count()
  l1 | l2 | miss   → tiers, hit rate, and the saving
  no-install       → boots no cache can ever serve

The one real datapoint the metric did produce

{"msg":"sandbox.deps.restore","source":"miss","repo_hash":"f73290d25d81db55","duration_ms":26652}

deco-sites/decocms-tanstack, 312 deps, 26.6s cold install. That's the per-boot cost L2 would shave — worth having on the record since it's the first prod figure for it.

Testing

New orchestrator test drives a Deno project (task-bearing deno.json, no package manifest) so spawnInstall has nothing to run, and asserts the label. Guarded: deleting the emit fails it (verified 13 pass / 1 fail).

bun test packages/sandbox/daemon/setup/ → 98 pass. knip clean, lint 0 errors.

Scope

Deliberately not instrumented: the fingerprint-skip resume path. A resume isn't a cold boot and studio.sandbox.ensure.outcome already splits fresh vs resume — adding an arm here would double-count.


Summary by cubic

Emit no-install events in sandbox.deps.restore so cache metrics include boots with no install step. This makes Deno and manifest-less repos visible and lets us size L2 correctly.

  • Bug Fixes
    • Added no-install to RestoreSource and emit when installPromise is null (e.g., Deno, no manifest).
    • Wrote an orchestrator test that runs a Deno project and asserts source: "no-install".
    • Left resume/fingerprint-skip path untouched to avoid double counting.

Written for commit 50295de. Summary will update on new commits.

Review in cubic

…knowable

`sandbox.deps.restore` emitted only on a restore hit or a completed install.
The `installPromise === null` early return emitted nothing — and that is the
path EVERY Deno project takes, since deno fetches at runtime and there is no
node_modules for any golden tier to cache.

Measured in prod (12 live sandbox pods, image 1.26.1): 4 Deno, 1 bun, 7
unclaimed. Only the bun pod emitted anything. So the log currently reads as
"barely any dependency traffic" when the truth is "most of these boots are a
runtime the cache cannot serve".

That conflation is load-bearing for a buy decision. The Deno share is the
ceiling on what L1 or the L2 EFS archive can ever win, and right now it is
invisible — we would be sizing an EFS filesystem against a denominator we
cannot see.

Add `no-install` to the source union and emit it there. Guarded: deleting the
emit fails the new test.

For reference, the one real prod datapoint the metric did produce:
source=miss, 312 deps, duration_ms=26652 (deco-sites/decocms-tanstack).
@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) July 29, 2026 21:20
@pedrofrxncx
pedrofrxncx merged commit 8d08e8c into main Jul 29, 2026
18 of 19 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/sandbox-deps-metric-no-install-arm branch July 29, 2026 21:28
decocms Bot pushed a commit that referenced this pull request Jul 29, 2026
PR: #5398 fix(sandbox): report the no-install path so the cache denominator is knowable
Bump type: patch

- @decocms/sandbox (packages/sandbox/package.json): 1.27.0 -> 1.27.1
- deploy/helm/sandbox-env (chart 0.9.46) (deploy/helm/sandbox-env/values.yaml deploy/helm/sandbox-env/Chart.yaml): image.tag/appVersion -> 1.27.1

Deploy-Scope: both
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant