Skip to content

implement create env#1646

Draft
StellaHuang95 wants to merge 3 commits into
microsoft:mainfrom
StellaHuang95:pep723-pr5-create-happy-path
Draft

implement create env#1646
StellaHuang95 wants to merge 3 commits into
microsoft:mainfrom
StellaHuang95:pep723-pr5-create-happy-path

Conversation

@StellaHuang95

Copy link
Copy Markdown
Contributor

No description provided.

@StellaHuang95

Copy link
Copy Markdown
Contributor Author

🔒 Automated review in progress — @StellaHuang95 is auto-reviewing this PR.

Comment thread src/common/lockfile.apis.ts Outdated
Comment thread src/managers/builtin/inlineScriptEnvManager.ts Outdated
Comment thread src/managers/builtin/inlineScriptEnvManager.ts
Comment thread src/managers/builtin/inlineScriptEnvManager.ts
Comment thread src/managers/builtin/inlineScriptEnvManager.ts
Comment thread src/managers/builtin/inlineScriptEnvManager.ts
Comment thread src/managers/builtin/inlineScriptEnvManager.ts
Comment thread src/common/lockfile.apis.ts Outdated
Comment thread src/common/lockfile.apis.ts
Comment thread src/common/lockfile.apis.ts Outdated
Comment thread src/common/inlineScriptCacheKey.ts
Comment thread src/managers/builtin/helpers.ts Outdated
StellaHuang95 and others added 2 commits July 22, 2026 17:00
Remove verbose narrative comments from the PEP 723 inline-script changes, keeping only must-have documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 39dcc6a3-0fbd-4f36-9d0f-68677de49c27
Apply the reasonable automated review fixes while preserving the PR5 happy-path scope.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 88b2e063-b52a-4743-bf2b-9ee639ec7a40
);
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot generated:
📍 src/managers/builtin/inlineScriptEnvManager.ts:createOrReuseEnvironment (retainLock branch)
The Skeptic found a new (Low) bug in the retain path: lock is set to undefined before retainedLock.retain() is awaited, so if retain() rejects (e.g. fs.rename fails with EACCES/EPERM/EBUSY) the error is only logged and finally sees lock === undefined → no release. On disk the owner-* marker persists but retained was never written, so the intended fast-fail ELOCKRETAINED degrades to a 5-min ELOCKED, and a future retained-keyed cleanup won't detect the orphan. Fix: keep lock non-null until retain() resolves (release in finally on failure), or write the retained sentinel before unlinking the owner marker so a failed transition still leaves a detectable marker.

[verified]

}
}
return build.environment;
} catch (error) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot generated:
📍 src/managers/builtin/inlineScriptEnvManager.ts:inspectExpectedCacheEnvironment
Architect (High, pre-PR13): the containment primitive was correctly extracted to shared resolveCacheEntryPath/isDescendantPath, but the ownership policyinspectExpectedCacheEnvironment plus the INLINE_SCRIPT_MANAGER_ID check and delete-gating — still lives private on the manager. PR13's delete path will re-derive "is this entry safely mine" with data-loss stakes; extract this into a shared assertOwnedCacheEntry(environment, cacheRoot, envDir) before then so create-safety and delete-safety cannot diverge.

[verified]

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