Add inline script environment lifecycle telemetry (PEP 723 PR 15/16) - #1723
Open
Stella Huang (StellaHuang95) wants to merge 4 commits into
Open
Add inline script environment lifecycle telemetry (PEP 723 PR 15/16)#1723Stella Huang (StellaHuang95) wants to merge 4 commits into
Stella Huang (StellaHuang95) wants to merge 4 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3cb82ae9-7424-40a4-9156-8c54ac6e0895
Cover detailed uv outcomes and normalized dependency counts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6b12d843-8011-4bfc-9ba9-f75761eadee2
Keep telemetry-only helpers scoped to their consuming test suite. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6b12d843-8011-4bfc-9ba9-f75761eadee2
Contributor
|
🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR. |
Report reuse dependency counts and preserve accurate final failure outcomes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6b12d843-8011-4bfc-9ba9-f75761eadee2
Rich Chiodo (rchiodo)
approved these changes
Aug 18, 2026
Rich Chiodo (rchiodo)
left a comment
Contributor
There was a problem hiding this comment.
Approved via Review Center.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Roadmap context
This is PR 15 of 16 in the PEP 723 inline-script roadmap. It adds the remaining lifecycle telemetry for the internal manager without changing routing, creation, or cache policy.
Why this PR
The manager can create, reuse, and persist inline-script environments, including consent-gated uv/Python fallback, but those lifecycle outcomes are not observable as a coherent feature funnel.
This PR adds low-cardinality telemetry that answers:
The instrumentation is deliberately attached to the underlying coalesced operation rather than every caller, and it excludes script/package/interpreter content.
What this PR does
Adds three typed lifecycle events
inlineScript.envCreatedinlineScript.envReuseHitinlineScript.envErrorThe telemetry constants and GDPR declarations use typed event/property mappings so call sites cannot send undeclared fields.
Reports verified creation only
envCreatedonly after environment creation succeeds, ownership/version validation passes, and.meta.jsonis persisted.Reports validated cache reuse only
envReuseHitonly after sidecar, interpreter, ownership, and compatibility checks complete successfully.lastUsedAtbehavior.Classifies lifecycle failures without leaking details
envErroruses stable low-cardinality categories for outcomes such as:Errors remain logged through the existing paths; telemetry sends no exception text.
Preserves uv consent and compatibility behavior
available,declined,failed, andinstalledoutcomes.Keeps event emission coalesced and deterministic
create()calls and pre-validation exits do not emit success-shaped lifecycle events.Event payloads and privacy
inlineScript.envCreatedinlineScript.envReuseHitinlineScript.envErrorThe events send no:
Script-controlled metadata therefore cannot create unbounded telemetry dimensions.
Lifecycle examples
Tests
Coverage includes:
Validation on the rebased branch:
npm run compile-testsnpm run compilenpm run lintThe full Windows unit run reaches 1612 passing and 5 pending; the existing concurrent
writeMetaJsonrename test can still intermittently fail withEPERMon Windows. That writer is unchanged by this PR and the same failure is reproducible onmain.Performance
User impact
No default-path user impact. The inline manager remains behind the undeclared, default-off
python-envs.inlineScripts.enabledflag.When the internal flag is manually enabled, prompts, environment creation/reuse, cancellation, error propagation, and cache behavior remain unchanged. This PR only records privacy-safe lifecycle outcomes.
Scope and follow-up
This PR intentionally does not implement:
The telemetry is ready for those later entry points to consume once the feature is intentionally exposed.