Skip to content

Bound Playground custom archive cache growth#1929

Merged
chubes4 merged 1 commit into
mainfrom
fix/playground-cache-retention-1924
Jul 21, 2026
Merged

Bound Playground custom archive cache growth#1929
chubes4 merged 1 commit into
mainfrom
fix/playground-cache-retention-1924

Conversation

@chubes4

@chubes4 chubes4 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • bound content-addressed custom-*.zip Playground archives by configurable age, size, and count while leaving stable WordPress release archives untouched
  • protect archives with process-scoped runtime references and owner-aware locks, including shared use and crashed-process recovery
  • expose deterministic diagnose/dry-run/apply maintenance evidence and attach automatic apply evidence to runtime startup cache validation
  • run maintenance on startup and teardown using WP_CODEBOX_PLAYGROUND_WORDPRESS_CACHE_DIR

Defaults

  • maximum age: 7 days
  • maximum custom cache size: 1 GiB
  • maximum custom archive count: 20
  • stale legacy lock age: 10 minutes

All bounds are configurable through the documented WP_CODEBOX_PLAYGROUND_CUSTOM_ARCHIVE_* environment variables.

Testing

  • npm run build
  • npm run test:playground-custom-archive-cache
  • npx tsx tests/playground-wordpress-release-cache.test.ts
  • npx tsx tests/playground-readonly-mounts.test.ts
  • npx tsx tests/playground-cli-runner-bootstrap-ini.test.ts
  • npx tsx tests/preview-lease-provider.test.ts
  • npm run test:production-boundary-enforcement
  • git diff --check

npm run check progressed through build and the initial smoke groups, then stopped at the unchanged command-registry-smoke failure tracked in #1745: wordpress.collect-workload-result outputShape should mention outputSchema id.

Dry-run evidence

The live configured cache dry-run reported 1 custom archive (31,435,175 bytes), 0 candidates, 0 active protections, and 0 removals under the new defaults.

Fixes #1924

@chubes4
chubes4 merged commit d006b25 into main Jul 21, 2026
4 checks passed
@chubes4

chubes4 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Independent review fixes pushed in 7e09da83:

  • replaced PID liveness with token-owned renewable leases carrying host, boot, PID, and process-start identity; foreign owners remain active until bounded expiry
  • switched retention inspection/removal to lstat, protect symlinks and multiply-linked files, and report allocated blocks as verified reclaimed bytes
  • clean orphan lock/reference sidecars without deleting active leases
  • surface automatic maintenance policy/permission failures in startup evidence and bounded teardown warnings
  • wired the complete unit, separate-process, and startup/teardown suite into the exact-head contracts workflow

Validation passed: build/typecheck, complete cache suite, agent-task contracts, all exact workflow contract commands, production-boundary enforcement, and existing Playground lifecycle regressions. npm run check still stops only at the unchanged failure tracked in #1745. Local actionlint was unavailable; the pushed workflow-lint check is authoritative.

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.

Bound WordPress Playground custom archive cache growth

1 participant