Repository navigation
feat: 强制清单规则,补齐 prepack 与生命周期幂等 - #22
Conversation
- 每个非载体包必须声明 hosihikari 依赖,读取器与打包器都拒绝(ADR-0006) - extraInfo.packageKind:plugin/loader/carrier,其它值报错;carrier 只给 hosihikari,自持态扫描跳过 - extraInfo.prepack 在打包期于包目录执行,字符串或数组都收,失败或超时拒包(ADR-0031) - 共享层清单改读契约;载体注册加载器时把程序集并进清单 - 卸载验证只收有限超时(ADR-0042) - Disable 幂等,与 Enable 对称;待回收也算依赖者(ADR-0013 / 0004) - 打包期拒绝缺框架依赖、未知 packageKind、错名载体包;新增 R21–R23 断言并把夹具清单补全 - 版本:核心 1.3.0,Plugin.Build 与 Testing 1.1.0
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e15877f34e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (options.UnloadVerificationTimeout <= TimeSpan.Zero | ||
| || options.UnloadVerificationTimeout > MaxUnloadVerificationTimeout) |
There was a problem hiding this comment.
Preserve the documented timeout option in the 1.x API
Existing carriers that pass Timeout.InfiniteTimeSpan through PluginManagerOptions now fail during manager construction with ArgumentOutOfRangeException, although this was explicitly supported by the previous public API. Removing that accepted value in the 1.3.0 release violates the repository's additive-only requirement for 1.x changes. Preserve compatibility in this release or defer the breaking change to a major version.
AGENTS.md reference: AGENTS.md:L31-L32
Useful? React with 👍 / 👎.
| if (kind != "carrier" | ||
| && !manifest.Dependencies.Any(dependency => | ||
| string.Equals(dependency?.Name, PluginContractInfo.ParentName, StringComparison.Ordinal))) | ||
| { | ||
| problems.Add(PackText.Get("MissingFrameworkDependency")); |
There was a problem hiding this comment.
Update the Build smoke fixture for the required dependency
The manifest generated in tools/Build/smoke.sh still omits dependencies, so packaging that fixture with the updated packer now returns MissingFrameworkDependency instead of producing the package. This breaks the MSBuild packaging smoke step in .github/workflows/verify.yml. Add the required hosihikari dependency to that fixture alongside enforcing the new rule.
AGENTS.md reference: AGENTS.md:L20-L20
Useful? React with 👍 / 👎.
| // 进程外插件的 prepack 也在打包期跑,装 node_modules / venv 之类(ADR-0031)。 | ||
| Prepack(manifest, sourceDirectory, problems); |
There was a problem hiding this comment.
Validate shared-layer files after running prepack
If a successful prepack command creates or copies a shared-layer DLL into the source directory, it bypasses the shared-layer scan, which has already finished before this call. The subsequent recursive copy includes the new DLL without another check, allowing Pack to report success for a package it would otherwise reject for duplicate shared assemblies. Run prepack before the file validations, or repeat those validations against the resulting files before copying them into the package.
Useful? React with 👍 / 👎.
- InfiniteTimeSpan 仍是 1.3.0 的合法取值(1.x 加法承诺),只有有限值走范围校验 - prepack 挪到共享层扫描与入口检查之前,装出来的文件也受同一套校验 - tools/Build/smoke.sh 的夹具清单补上 hosihikari 依赖
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa86b1ca00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| if (process.ExitCode != 0) | ||
| { | ||
| var detail = (stderr.GetAwaiter().GetResult() + stdout.GetAwaiter().GetResult()).Trim(); |
There was a problem hiding this comment.
Apply the prepack timeout to redirected output reads
If a failing prepack command starts a background child that inherits stdout or stderr, the main process can exit while those pipes remain open. WaitForExit then returns immediately, but these unbounded GetResult() calls wait for the child to close the pipes, bypassing the five-minute timeout and potentially hanging packaging indefinitely. Apply the same overall deadline to process completion and output draining so this failure path also returns within the configured limit.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
孙进程继承管道时主进程可能先退出,读 stdout/stderr 会一直等下去;现在整段 prepack 共用一个截止时间,超时连树一起杀。
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 386bc7c7fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .Where(item => item.ValueKind == JsonValueKind.String) | ||
| .Select(item => item.GetString()!) | ||
| .Where(item => item.Length > 0)); | ||
| } |
There was a problem hiding this comment.
Preserve empty arguments in prepack command arrays
When a prepack command intentionally includes an empty argument, .Where(item => item.Length > 0) removes it and shifts subsequent arguments. For example, a script invoked with ["python", "prepare.py", "", "release"] receives different positional arguments than the manifest specifies, potentially failing packaging or generating the wrong artifacts. Preserve empty strings after the executable position and validate the executable separately.
Useful? React with 👍 / 👎.
| <TargetFramework>net10.0</TargetFramework> | ||
| <PackageId>Hosihikari.Plugin.Build</PackageId> | ||
| <Version>1.0.0</Version> | ||
| <Version>1.1.0</Version> |
There was a problem hiding this comment.
Update the smoke fixture to request the new Build version
With Hosihikari.Plugin.Build 1.0.0 already in the global NuGet cache, tools/Build/smoke.sh can still restore that version because its generated project continues to request Version="1.0.0". Although the script builds 1.1.0 into its temporary feed, the smoke step in .github/workflows/verify.yml can therefore exercise the old packaged targets and packer instead of this change. Update the fixture's package reference alongside this version bump so the required smoke check reliably tests the newly built package.
AGENTS.md reference: AGENTS.md:L20-L20
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a16837bd27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // prepack 先跑(ADR-0031):它会往包目录里装 node_modules / venv, | ||
| // 之后共享层扫描与递归复制看到的就是最终产物。 | ||
| Prepack(manifest, sourceDirectory, problems); |
There was a problem hiding this comment.
Bump the standalone packer version to distribute these changes
If Hosihikari.Plugin.Pack 1.0.0 has already been published, these new packaging rules and prepack support will not reach standalone hosihikari-pack users: tools/Pack/Hosihikari.Plugin.Pack.csproj still declares version 1.0.0. The inspected release workflow packs that project and pushes it with --skip-duplicate (.github/workflows/release.yml:175–195), which the CLI documentation says “treats any 409 Conflict response as a warning.” Consequently, the release can succeed while retaining the old standalone tool, even though Build 1.1.0 bundles the new implementation. Increment the packer's independently managed version and update the tool-install smoke check accordingly.
AGENTS.md reference: AGENTS.md:L38-L41
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
概要
按 ADR-0006 / 0013 / 0031 / 0042 把清单与生命周期的规则落到读取器与打包器上。
hosihikari依赖,两处都拒绝。extraInfo.packageKind:plugin/loader/carrier,其它值报错;carrier只给hosihikari,自持态扫描跳过载体包。extraInfo.prepack在打包期于包目录执行(字符串或数组),失败或 5 分钟超时拒包。Disable幂等;待回收也算依赖者。验证
dotnet run --project host/... -c Release:79 项全过bash tools/Build/smoke.sh:通过dotnet run --project testing/...Testing.Smoke:通过bash ./pack.sh 0.0.0-check:出包成功