feat(cli): resolve persistent Runtime Host installation facts - #3816
feat(cli): resolve persistent Runtime Host installation facts#3816me2seeks wants to merge 1 commit into
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
Update on b3fec58ba5:
CODE GO — no P0-P2 (2×P3 non-blocking: canonicalCliPath depth check accepts non-CLI files; runNpmGlobalRoot ignores injected env). New resolver validates npm global npx vs direct probes with deterministic fixtures.
Checks on b3fec58ba56b16f386e6a1108031a9a37f8fe24a are test: IN_PROGRESS — awaits green.
简体中文
该头无阻断。
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed this head and found no blocking issues.
Resolver validates with green checks; non-blocking P3s noted.
Posted by an automated review agent operated by @Astro-Han. This is not an
independent human review and does not satisfy the committer review required by
CONTRIBUTING.md. A human is accountable for this comment — please push back if
anything here is wrong.
简体中文
本条评论由 @Astro-Han 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。
Summary
npxcache packages, and packages outside the active npm global prefixnpxprovenance check into the same helperWhy
The next #3243 adapter needs to distinguish a persistent installed CLI owner from a transient invocation before it can consume the local deployment handoff transaction.
A real isolated
npm install --globalcheck showed that npm does not persist a package lock ordist.integritybeside the installed global package. Registry metadata can identify the artifact published for a version, but it cannot prove that mutable local files are still that artifact. This PR therefore keeps two facts separate:Exact deployment identity remains the responsibility of later registry resolution, archive verification, and immutable staging. This resolver performs no network request, owner mutation, Host retirement, or user-policy decision.
This PR is merge-order independent from #3813. A later composition slice will consume both the stable installation facts here and the unified handoff transaction there.
Simplification and first-principles audit
GO. The final diff adds no durable state, lock, journal, deployment identity, or startup policy. It removes the duplicate
npxcache-path implementation from the managed service manager. The owner ID depends only on the canonical npm global slot, so package upgrades in one prefix retain ownership while distinct Node/npm prefixes remain distinct owners.Verification
origin/main19b47632be61b9116ae25d67e286f6a7878d6645npm --workspace maka-agent run buildnpm --workspace maka-agent run typecheckgit diff --checkThe broader Runtime workspace build still reports the unchanged local dependency-closure failures for missing
@slack/*/minisearchand the existinghttps-proxy-agenttype mismatch; the affected CLI and Runtime Host dependency builds used by this diff pass.Refs #3243
Refs #3231
Refs #3709
简体中文摘要
本 PR 为 #3243 提供 installed CLI 的 source facts:从 active npm global package slot 推导稳定的 CLI installation owner,并读取当前 package 的 version、package root 与 CLI entry point。
真实隔离的
npm install --global取证表明,全局安装旁不会保存 package-lock 或dist.integrity。因此 registry 对某个 version 的声明不能证明本机可变文件仍是那份 artifact。本 PR 明确区分:exact deployment identity 留给后续 registry 解析、archive integrity 校验与 immutable staging。本 resolver 不联网、不修改 owner record、不让 Host 退场,也不替用户选择 Restart / Wait / Cancel。
同时抽取并复用 service manager 既有的
npxcache 判断,删除一份重复实现。最终 diff 不增加 durable state、lock、journal、deployment identity 或 startup policy。该 PR 与 #3813 merge 顺序独立;后续 composition slice 再同时消费两者。验证:基于精确 current main;CLI build/typecheck 通过;installation facts 与完整 service-manager 测试 26/26;scoped Biome 与 diff-check 通过。
Generated-by: Codex