Skip to content

Harden Playground cache retention safety#1930

Merged
chubes4 merged 6 commits into
mainfrom
fix/playground-cache-retention-followup-1929
Jul 21, 2026
Merged

Harden Playground cache retention safety#1930
chubes4 merged 6 commits into
mainfrom
fix/playground-cache-retention-followup-1929

Conversation

@chubes4

@chubes4 chubes4 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace PID-based ownership with token-owned renewable leases carrying host, boot, PID, and process-start identity
  • bind heartbeat renewal and removal to open file/directory generations so expired owners cannot overwrite or remove replacement leases
  • reject and safely unlink non-directory .refs sidecars without following symlinks outside the cache
  • protect symlinked and multiply-linked archives with lstat, separate logical/estimated removal metrics, and verify reclaimed bytes from filesystem free-space delta
  • clean orphan lock/reference sidecars while preserving active foreign leases
  • run bounded maintenance before archive resolution/download and retain post-failure/teardown cleanup diagnostics
  • wire unit, process, concurrency, attack, and lifecycle integration coverage into exact-head CI

Regression coverage

  • expiry/reacquire/old-heartbeat and old-release generation race
  • separate-process shared leases, crash expiry, PID reuse, and foreign host/namespace ownership
  • .refs symlink acquisition, archive cleanup, and orphan-sidecar attacks
  • hard links, archive symlinks, and open-unlinked allocation accounting
  • concurrent lock/reference acquisition versus maintenance
  • stale sidecars from the previously merged implementation
  • cache cleanup ordering before the next archive request
  • startup/teardown evidence, environment policy, invalid policy, bounds, and idempotence

Validation

  • npm run build
  • npm run test:playground-custom-archive-cache
  • npm run test:production-boundary-enforcement
  • npm run test:agent-task-contracts
  • exact workflow integration commands: runtime sources, readonly PHPUnit cache, native Playground E2E/interruption, trusted apply, redaction, and runtime tool policy
  • existing Playground release cache, readonly mount, bootstrap INI, and preview lease regressions
  • git diff --check

The full npm run check still reaches only the unchanged command-registry smoke failure tracked in #1745. This is a follow-up to merged #1929 and contains only commits absent from current main.

@chubes4
chubes4 merged commit 6bbfc83 into main Jul 21, 2026
4 checks passed
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