Skip to content

Add conservative inline script cache clearing (preview) - #3

Closed
StellaHuang95 wants to merge 2 commits into
mainfrom
pep723-pr13-clear-cache
Closed

Add conservative inline script cache clearing (preview)#3
StellaHuang95 wants to merge 2 commits into
mainfrom
pep723-pr13-clear-cache

Conversation

@StellaHuang95

@StellaHuang95 StellaHuang95 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Fork-review PR for a deliberately conservative, default-off feedback rollout.

This replaces the earlier comprehensive lifecycle implementation with a small preview-specific cache clear. It intentionally omits project migration, PID probing, and general lock recovery.

What this preview does

Adds Python: Clear Script Environment Cache (python-envs.clearInlineScriptCache) without changing the existing broad python-envs.clearCache command.

The preview command:

  1. is hidden/disabled unless python-envs.inlineScripts.enabled is on;
  2. waits for the inline manager's bounded registration readiness;
  3. requires modal confirmation;
  4. targets only the physically verified <globalStorage>/script-envs-v1 directory;
  5. rejects symlink/junction or redirected roots;
  6. coordinates create and clear across windows with a short root-maintenance-lock to entry-lock handoff;
  7. refuses active, orphaned, malformed, or unverifiable entry locks;
  8. permits explicit deletion of locks carrying the exact retained marker created after package-install cancellation;
  9. clears PR7 Memento associations and in-memory association/validation state;
  10. prevents pending rehydration from repopulating cleared state and emits removal events for known affected scripts.

Root-lock and owner-lock errors include the exact path and conservative manual-recovery guidance. New root-lock release failures are fatal; existing per-entry release behavior is unchanged.

Intentional limitations

  • no pythonProjects[] cleanup or migration;
  • no TTL eviction;
  • no PID/liveness probing or stale-owner recovery;
  • no generalized lockfile API changes;
  • no routing, setup UI, telemetry, or status behavior;
  • a crash-abandoned root/owner lock may require carefully removing the reported lock path after restart.

Size

  • production: 417 additions, 23 deletions across six production files
  • tests/wiring: focused command, locking, state, event, and registration coverage

Validation

  • TypeScript test compilation and extension compilation
  • ESLint
  • focused cache/command suite: 37+ passing across final iterations
  • smoke registration checks
  • eight manual review passes; no significant findings remain

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3cb82ae9-7424-40a4-9156-8c54ac6e0895
@StellaHuang95
StellaHuang95 marked this pull request as ready for review August 17, 2026 17:10
@StellaHuang95 StellaHuang95 added review-auto:changes-requested Automated review: posted blocking findings to address. review-auto:approved Automated review: no blocking findings (approval posted). and removed review-auto:changes-requested Automated review: posted blocking findings to address. review-auto:approved Automated review: no blocking findings (approval posted). labels Aug 17, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3cb82ae9-7424-40a4-9156-8c54ac6e0895
@StellaHuang95 StellaHuang95 changed the title Add clear script environment cache command (PEP 723 PR 13/16) Add conservative inline script cache clearing (preview) Aug 17, 2026
@StellaHuang95

Copy link
Copy Markdown
Owner Author

Closing this PR in favor of a clean-history replacement with the same current reviewed file changes.

@StellaHuang95

Copy link
Copy Markdown
Owner Author

Superseded by clean-history replacement #8.

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