feat(runtime-host): bind dependency snapshots to managed commands - #88
Draft
zhiiw wants to merge 2 commits into
Draft
feat(runtime-host): bind dependency snapshots to managed commands#88zhiiw wants to merge 2 commits into
zhiiw wants to merge 2 commits into
Conversation
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.
Outcome
ManagedNodeRuncan now import packages from the same owner-issued immutable dependency snapshot already used byManagedNodeTest. The dependency identity is frozen in T1 before the command starts, and the sandbox consumes the opaque lease without exposing its path to Runtime callers.This does not bundle or download npm, install dependencies, run package scripts, grant
PATH, enable network access, or allow child processes. If the source has no admissiblenode_modules, T1 recordsdependency.kind = none.Primary invariant
Ownership and atomic boundary
ManagedDependencySnapshotAuthoritypublishes, verifies, leases, and releases dependency artifacts.ManagedNodeDependencyOwnerInternalderives a snapshot only from acceptedpackage.json/package-lock.jsonplus the source's existingnode_modules.ManagedNodeCommandAdmissionOwnerInternalfreezes accepted head, entrypoint, argv, toolchain, and dependency identity before T1.ManagedCommandSandboxOwnerInternalis the only consumer that can resolve the opaque lease to a read-only sandbox input.Failure states and rollback
Verification
git diff --checkpass.Stack
Base:
codex/m5-managed-shell-product-v1.中文说明
结果
ManagedNodeRun现在可以读取与ManagedNodeTest相同的、由 owner 签发的不可变依赖快照。依赖身份会在命令执行前写入 T1;sandbox 只消费 opaque lease,不把真实依赖路径暴露给 Runtime caller。本 PR 不会捆绑或下载 npm,不会安装依赖、运行 package scripts、授予
PATH、开放网络或允许子进程。若 source 没有可接受的node_modules,T1 会明确记录dependency.kind = none。主要不变量
Owner 与原子边界
ManagedDependencySnapshotAuthority发布、验证、租用和释放 dependency artifact。ManagedNodeDependencyOwnerInternal只根据 acceptedpackage.json/package-lock.json与 source 中已经存在的node_modules生成快照。ManagedNodeCommandAdmissionOwnerInternal在 T1 前冻结 accepted head、entrypoint、argv、toolchain 与 dependency identity。ManagedCommandSandboxOwnerInternal是唯一能把 opaque lease 解析成只读 sandbox input 的 consumer。失败与回滚
验证
git diff --check通过。