diff --git a/.github/workflows/linux-native-aot.yml b/.github/workflows/linux-native-aot.yml index 01f36b6..bd6b8eb 100644 --- a/.github/workflows/linux-native-aot.yml +++ b/.github/workflows/linux-native-aot.yml @@ -15,10 +15,10 @@ jobs: timeout-minutes: 15 steps: - uses: actions/checkout@v4 - - name: Set up .NET 10.0.400 + - name: Set up the repository .NET SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: 10.0.400 + global-json-file: global.json - name: Install Native AOT toolchain run: | sudo apt-get update diff --git a/.github/workflows/p1-expanded.yml b/.github/workflows/p1-expanded.yml index 9bc69c4..109065c 100644 --- a/.github/workflows/p1-expanded.yml +++ b/.github/workflows/p1-expanded.yml @@ -37,9 +37,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 10.0.400 - 10.0.401 + global-json-file: global.json - name: Verify PowerShell 7 and CI publication contract shell: pwsh run: | @@ -181,7 +179,6 @@ jobs: env: GITHUB_SHA: ${{ github.sha }} CI_COMMIT_SHA: ${{ github.sha }} - RUSTSHARP_NATIVE_AOT_SDK_VERSION: '10.0.401' DOTNET_CLI_USE_MSBUILD_SERVER: '0' DOTNET_CLI_UI_LANGUAGE: en-US steps: @@ -191,9 +188,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 10.0.400 - 10.0.401 + global-json-file: global.json - name: Verify PowerShell 7 shell: pwsh run: | @@ -279,7 +274,6 @@ jobs: env: GITHUB_SHA: ${{ github.sha }} CI_COMMIT_SHA: ${{ github.sha }} - RUSTSHARP_NATIVE_AOT_SDK_VERSION: '10.0.401' DOTNET_CLI_USE_MSBUILD_SERVER: '0' DOTNET_CLI_UI_LANGUAGE: en-US steps: @@ -289,9 +283,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 10.0.400 - 10.0.401 + global-json-file: global.json - name: Verify PowerShell 7 and bind rustc 1.98 oracle shell: pwsh timeout-minutes: 5 @@ -354,7 +346,6 @@ jobs: env: GITHUB_SHA: ${{ github.sha }} CI_COMMIT_SHA: ${{ github.sha }} - RUSTSHARP_NATIVE_AOT_SDK_VERSION: '10.0.401' DOTNET_CLI_USE_MSBUILD_SERVER: '0' DOTNET_CLI_UI_LANGUAGE: en-US steps: @@ -364,9 +355,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 10.0.400 - 10.0.401 + global-json-file: global.json - name: Download Windows production receipt if: always() continue-on-error: true @@ -414,7 +403,7 @@ jobs: shell: pwsh run: | if ($PSVersionTable.PSVersion.Major -lt 7) { throw 'PowerShell 7 or newer is required.' } - ./eng/Invoke-P1ReleaseBuild.ps1 -CandidateSha $env:GITHUB_SHA -SdkVersion 10.0.401 -ReportPath artifacts/p1-candidate/production-aggregate-release-build.json + ./eng/Invoke-P1ReleaseBuild.ps1 -CandidateSha $env:GITHUB_SHA -ReportPath artifacts/p1-candidate/production-aggregate-release-build.json - name: Download Windows Drop receipt and original verifier reports if: always() continue-on-error: true @@ -444,6 +433,7 @@ jobs: name: p1-drop-bytes-linux-x64-${{ github.run_id }}-${{ github.run_attempt }} path: artifacts/p1-drop/linux-x64 - name: Require both native Drop jobs and reconcile transferred original bytes + id: drop-transport if: always() shell: pwsh env: @@ -464,7 +454,9 @@ jobs: env: NATIVE_JOB_RESULT: ${{ needs.production-native.result }} SUITE_JOB_RESULT: ${{ needs.suite-gate.result }} - run: ./eng/Test-P1ProductionCiGate.ps1 -CandidateSha $env:GITHUB_SHA -WindowsReceipt artifacts/p1-production/windows-x64/native-receipt.json -LinuxReceipt artifacts/p1-production/linux-x64/native-receipt.json -RunId '${{ github.run_id }}' -RunAttempt '${{ github.run_attempt }}' -Repository '${{ github.repository }}' -NativeJobResult $env:NATIVE_JOB_RESULT -SuiteJobResult $env:SUITE_JOB_RESULT -EvidencePath artifacts/p1-candidate/production-ci-gate.json + DROP_JOB_RESULT: ${{ needs.drop-native.result }} + DROP_TRANSPORT_RESULT: ${{ steps.drop-transport.outcome }} + run: ./eng/Test-P1ProductionCiGate.ps1 -CandidateSha $env:GITHUB_SHA -WindowsReceipt artifacts/p1-production/windows-x64/native-receipt.json -LinuxReceipt artifacts/p1-production/linux-x64/native-receipt.json -RunId '${{ github.run_id }}' -RunAttempt '${{ github.run_attempt }}' -Repository '${{ github.repository }}' -NativeJobResult $env:NATIVE_JOB_RESULT -SuiteJobResult $env:SUITE_JOB_RESULT -DropJobResult $env:DROP_JOB_RESULT -DropTransportResult $env:DROP_TRANSPORT_RESULT -EvidencePath artifacts/p1-candidate/production-ci-gate.json - name: Upload aggregate production gate and physical validation diagnostics if: always() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/p1-platform.yml b/.github/workflows/p1-platform.yml index 2944b2e..187cf78 100644 --- a/.github/workflows/p1-platform.yml +++ b/.github/workflows/p1-platform.yml @@ -23,9 +23,7 @@ jobs: - name: Set up .NET SDKs uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 10.0.400 - 10.0.401 + global-json-file: global.json - name: Install rustc 1.98 oracle shell: pwsh run: rustup toolchain install 1.98.0 --profile minimal @@ -47,8 +45,7 @@ jobs: -PlatformName windows-x64 ` -RuntimeIdentifier win-x64 ` -OutputDirectory artifacts/p1-platform/windows-x64 ` - -EvidencePath artifacts/p1-platform/windows-x64.json ` - -SdkVersion 10.0.400 + -EvidencePath artifacts/p1-platform/windows-x64.json $code = $LASTEXITCODE if (-not (Test-Path -LiteralPath artifacts/p1-platform/windows-x64.json -PathType Leaf)) { throw 'P1 Windows platform evidence report was not produced.' @@ -142,9 +139,7 @@ jobs: - name: Set up .NET SDKs uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 10.0.400 - 10.0.401 + global-json-file: global.json - name: Install Native AOT toolchain shell: bash run: | @@ -172,8 +167,7 @@ jobs: -PlatformName linux-x64 ` -RuntimeIdentifier linux-x64 ` -OutputDirectory artifacts/p1-platform/linux-x64 ` - -EvidencePath artifacts/p1-platform/linux-x64.json ` - -SdkVersion 10.0.400 + -EvidencePath artifacts/p1-platform/linux-x64.json $code = $LASTEXITCODE if (-not (Test-Path -LiteralPath artifacts/p1-platform/linux-x64.json -PathType Leaf)) { throw 'P1 Linux platform evidence report was not produced.' diff --git a/.github/workflows/p2-doc-components.yml b/.github/workflows/p2-doc-components.yml index cf4efab..4529e22 100644 --- a/.github/workflows/p2-doc-components.yml +++ b/.github/workflows/p2-doc-components.yml @@ -24,14 +24,14 @@ jobs: ref: ${{ github.sha }} - uses: actions/setup-dotnet@v4 with: - dotnet-version: 10.0.400 + global-json-file: global.json - name: Native documentation components and exact candidate evidence shell: pwsh timeout-minutes: 22 env: CANDIDATE_SHA: ${{ github.sha }} TOOL_RID: ${{ matrix.rid }} - run: ./artifacts/p2-supervision/documentation-native-ci-v1/Invoke-DocumentationNativeCi.ps1 + run: ./eng/Invoke-DocumentationNativeCi.ps1 - name: Native Linux same-process documentation resource evidence if: matrix.rid == 'linux-x64' shell: pwsh diff --git a/.github/workflows/windows-p0.yml b/.github/workflows/windows-p0.yml index c794854..aaec7ac 100644 --- a/.github/workflows/windows-p0.yml +++ b/.github/workflows/windows-p0.yml @@ -15,10 +15,10 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 - - name: Set up .NET 10.0.400 + - name: Set up the repository .NET SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: 10.0.400 + global-json-file: global.json - name: Install SQLite shell: pwsh timeout-minutes: 5 diff --git a/README.md b/README.md index 2b1781e..8439982 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@

Windows x64 P0 evidence Linux x64 Native AOT - .NET SDK 10.0.400 + .NET SDK 10.0.404

> **🚧 In progress:** RustSharp is experimental. Compatibility is declared by named profiles, not by a claim of full Rust support. Unsupported source is rejected with diagnostics instead of being silently assigned C# or CLR semantics. @@ -35,7 +35,7 @@ RustSharp is not a drop-in replacement for `rustc`. Full Rust compatibility, sta ## Quick start -Install .NET SDK 10.0.400 first. The repository pins that version in [global.json](global.json) and disables roll-forward. Rust 1.98.0 is only required when running differential conformance work. +Install .NET SDK 10.0.404 first. The repository pins that version in [global.json](global.json) and disables roll-forward. Rust 1.98.0 is only required when running differential conformance work. ```text git clone https://github.com/IoTSharp/RustSharp.git @@ -140,7 +140,7 @@ the repository pin remains 10.0.400. Logs are retained under records ownership diagnostics, Drop closure, source package metadata and platform evidence binding. P1-09 source-package contracts are ✅ Complete on the recorded local evidence: historical Closure-9 Release 0/0 warnings/errors, focused 84/84 and full 964/964; those reports record raw manifest SHA `BC0975F428B6A8AB0AE47DE50970B1152482C3465C27B47AB44A3AC4153519AB` and pass 19/19 with 39/39 original PEs on Windows and Ubuntu WSL Native AOT/CoreCLR. That historical CRLF raw-byte hash is distinct from the current LF-normalized manifest hash. -P1-10 is ✅ Complete at local candidate `0a415e25c362f8a35c09cb9e1163f5ce30accf82`: Windows and Ubuntu Linux x64 each pass a zero-warning/error Release build, 969/969 full-harness tests, 32/32 expanded differential cases, 24/24 CoreCLR/ILVerify/Native AOT cases and 60/60 immutable baseline audit entries. The strict aggregate passes 15/15. The [P1-10 implementation record](docs/p1-10-implementation.md) distinguishes the 40-requirement/160-record coverage inventory from semantic execution and records the additional Ubuntu rustc Drop trace difference in `p1-drop-closure-v4`. That difference has not been approved by the P1 language gates. P1-GATE.01–.03 are 🚧 In progress; .04–.06 remain ⏳ Planned. Remote CI for later commit `0c5d80f623ab263682ed36c47f3e9182e23374f9` failed; current repairs and exact coverage/source-package evidence remain under [supervision](docs/roadmap/P2-HANDOFF.md). +P1-10 is ✅ Complete at local candidate `0a415e25c362f8a35c09cb9e1163f5ce30accf82`: Windows and Ubuntu Linux x64 each pass a zero-warning/error Release build, 969/969 full-harness tests, 32/32 expanded differential cases, 24/24 CoreCLR/ILVerify/Native AOT cases and 60/60 immutable baseline audit entries. The strict aggregate passes 15/15. The [P1-10 implementation record](docs/p1-10-implementation.md) distinguishes the 40-requirement/160-record coverage inventory from semantic execution and records the additional Ubuntu rustc Drop trace difference in `p1-drop-closure-v4`. That difference has not been approved by the P1 language gates. P1-GATE.01 through P1-GATE.06 are ✅ Complete. See the [P1 completion record](docs/p1-completion.md). Remote CI for later commit `0c5d80f623ab263682ed36c47f3e9182e23374f9` failed; current repairs and exact coverage/source-package evidence remain under [supervision](docs/roadmap/P2-HANDOFF.md). The recorded `safe-core-regression-v1` report passes 8/8 with zero failures or skips. The historical `safe-core-regression-v2` report passes 24/24 with one diff --git a/README_zh.md b/README_zh.md index f5ef26a..e627dfb 100644 --- a/README_zh.md +++ b/README_zh.md @@ -13,7 +13,7 @@

Windows x64 P0 证据 Linux x64 Native AOT - .NET SDK 10.0.400 + .NET SDK 10.0.404

> **🚧 进行中:** RustSharp 仍处于实验阶段。兼容性由具名配置档定义,而不是宣称完整支持 Rust。超出配置档范围的源码会给出诊断,不会被静默赋予 C# 或 CLR 语义。 @@ -35,7 +35,7 @@ RustSharp 不是 `rustc` 的直接替代品。完整 Rust 兼容性、标准库 ## 快速开始 -请先安装 .NET SDK 10.0.400。仓库在 [global.json](global.json) 中固定该版本,并禁用了 roll-forward。只有运行差异一致性工作时才需要 Rust 1.98.0。 +请先安装 .NET SDK 10.0.404。仓库在 [global.json](global.json) 中固定该版本,并禁用了 roll-forward。只有运行差异一致性工作时才需要 Rust 1.98.0。 ```text git clone https://github.com/IoTSharp/RustSharp.git @@ -119,7 +119,7 @@ SHA,因此候选发布门禁仍是独立的 P1 要求。 `artifacts/p1-next-session`。[后续审计](docs/p1-evidence-audit_zh.md) 记录所有权诊断、Drop 闭环、源码包元数据及平台证据绑定。P1-09 源码包契约基于已记录的本地证据为 ✅ 已完成:历史 Closure-9 Release 零警告/零错误,关键回归84/84、完整回归964/964;这些报告记录清单原始字节 SHA `BC0975F428B6A8AB0AE47DE50970B1152482C3465C27B47AB44A3AC4153519AB`,在 Windows 与 Ubuntu WSL Native AOT/CoreCLR 均通过19/19及39/39个原始 PE。该历史 CRLF 原始字节哈希不同于当前规范化 LF 后的清单哈希。 -P1-10 在本地候选 `0a415e25c362f8a35c09cb9e1163f5ce30accf82` 为 ✅ 已完成:Windows 与 Ubuntu Linux x64 分别通过零警告/零错误的 Release 构建、969/969 项完整测试、32/32 项扩展差分、24/24 项 CoreCLR/ILVerify/Native AOT 用例及 60/60 项不可变基线审计。严格聚合通过 15/15。[P1-10 实现记录](docs/p1-10-implementation_zh.md)区分 40 个需求/160 条清单记录的覆盖账本与真实语义执行,并记录 `p1-drop-closure-v4` 中额外的 Ubuntu rustc Drop 轨迹差异。该差异尚未获 P1 语言门禁批准。P1-GATE.01–.03 为 🚧 进行中,.04–.06 仍为 ⏳ 计划中。后续提交 `0c5d80f623ab263682ed36c47f3e9182e23374f9` 的远程 CI 失败;当前修复及精确覆盖/源码包证据继续接受[监督](docs/roadmap/P2-HANDOFF_zh.md)。 +P1-10 在本地候选 `0a415e25c362f8a35c09cb9e1163f5ce30accf82` 为 ✅ 已完成:Windows 与 Ubuntu Linux x64 分别通过零警告/零错误的 Release 构建、969/969 项完整测试、32/32 项扩展差分、24/24 项 CoreCLR/ILVerify/Native AOT 用例及 60/60 项不可变基线审计。严格聚合通过 15/15。[P1-10 实现记录](docs/p1-10-implementation_zh.md)区分 40 个需求/160 条清单记录的覆盖账本与真实语义执行,并记录 `p1-drop-closure-v4` 中额外的 Ubuntu rustc Drop 轨迹差异。该差异尚未获 P1 语言门禁批准。P1-GATE.01 至 P1-GATE.06 已 ✅ 已完成。详见[P1 结项记录](docs/p1-completion_zh.md)。后续提交 `0c5d80f623ab263682ed36c47f3e9182e23374f9` 的远程 CI 失败;当前修复及精确覆盖/源码包证据继续接受[监督](docs/roadmap/P2-HANDOFF_zh.md)。 已记录的 `safe-core-regression-v1` 报告通过 8/8,失败和跳过均为零。 历史 `safe-core-regression-v2` 报告通过 24/24,包含 1 个编译通过、6 个编译失败、 diff --git a/ROADMAP.md b/ROADMAP.md index dbdaf16..f59ff1a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -26,7 +26,7 @@ scope and date, rather than defining new work for each later commit. | Phase | Status | Parents | Implementation leaves | Gate leaves | Detailed acceptance | | --- | --- | --- | --- | --- | --- | | P0 | ✅ Complete | 17 | 34 | 3 | [Vertical architecture](docs/roadmap/P0.md) | -| P1 | 🚧 In progress | 10 | 85 | 6 | [Safe-core implementation and closure](docs/roadmap/P1.md) | +| P1 | ✅ Complete | 10 | 85 | 6 | [Safe-core implementation and closure](docs/roadmap/P1.md) | | P2 | 🚧 In progress | 15 | 94 | 7 | [Libraries, packages and toolchain](docs/roadmap/P2.md) | | P3 | 🚧 In progress | 6 | 38 | 4 | [Macros, async, unsafe/FFI and TLS](docs/roadmap/P3.md) | | P4 | ⏳ Planned | 5 | 29 | 4 | [HTTP and WebSocket](docs/roadmap/P4.md) | @@ -520,7 +520,7 @@ publish warnings and no cleanup diagnostic. Both CoreCLR and Native AOT print | P1-07 | ✅ Complete | [Leaf breakdown](docs/roadmap/P1.md#p1-07). Implement move paths, borrow checking, non-lexical lifetimes, reborrowing, and escape analysis for the profile. | P0-13, P1-06.04, P1-06.05 | `dotnet run --project tests/RustSharp.Tests -c Release --no-build --no-restore`
`dotnet D:/GitHub/RustSharp/tools/RustSharp.Conformance/bin/Release/net10.0/RustSharp.Conformance.dll --profile p1-differential-v3 --oracle rustc-1.98 --report artifacts/p1-next-session/p1-differential-v3-final2.json --timeout 30 --deadline 300` | All twelve ownership leaves are complete: golden diagnostics preserve move/borrow/escape codes, messages, original paths and spans; the differential report passes 32/32 with borrow 20/20 and Drop 6/6 semantic closure. Candidate-SHA aggregation remains a separate P1-10.08/P1-GATE boundary. | | P1-08 | ✅ Complete | [Leaf breakdown](docs/roadmap/P1.md#p1-08). Implement scope cleanup, deterministic `Drop`, unwind/abort profile behavior, and panic boundaries. | P1-06.01, P1-07.01 | `dotnet run --project tests/RustSharp.Tests -c Release --no-build --no-restore`
`dotnet tools/RustSharp.Conformance/bin/Release/net10.0/RustSharp.Conformance.dll --p1-drop-call-interface create artifacts/p1-drop/p1-08-call-interface-win-x64.json 2` | [Implementation inventory](docs/p1-08-implementation.md) closes all fourteen leaves with checked destructor receivers, typed/shared drop flags, aggregate/temporary cleanup, explicit panic strategies and the reusable direct-call host. Historical E9 Release has zero warnings/errors; 894/894 regressions pass. The fixed differential records 26 rustc matches plus two frozen contract differences; original-PE ILVerify is 30/30. Windows and Ubuntu WSL each pass Native AOT 28/28 and callable 7/7 over two original PE artifacts. Final process/host cleanup and nine retained historical temporary objects are separately disclosed; At that historical point, source imported calls were P1-09 work; candidate-SHA aggregation remains P1-10/P1-GATE work. | | P1-09 | ✅ Complete | [Leaf breakdown](docs/roadmap/P1.md#p1-09). Emit supported safe-core programs through validated CLR LIR with Rust# cross-package metadata and source ownership contracts. | P0-07, P1-05, P1-08.11 | `dotnet run --project tests/RustSharp.Tests/RustSharp.Tests.csproj -c Release --no-build --no-restore` | Historical Closure-9 Release has zero warnings/errors, focused 84/84 and full 964/964. Those reports record raw source-package manifest SHA `BC0975F428B6A8AB0AE47DE50970B1152482C3465C27B47AB44A3AC4153519AB`; Windows and Ubuntu WSL each pass 19/19 CoreCLR, 39/39 original-PE ILVerify and Native AOT cases with zero warnings/failed/blocked/not-executed cases, equal independent builds, deadline and cleanup audits. The historical CRLF raw hash differs from the current LF-normalized hash. Recorded local evidence closes P1-09; P1-10 implementation closure and the separate P1-GATE leaves have distinct evidence. | -| P1-10 | ✅ Complete | [Leaf breakdown](docs/roadmap/P1.md#p1-10). Establish compile-pass, compile-fail, run-pass, and differential regression suites. | P0-11, P1-06.01 | `pwsh -NoProfile -File eng/Test-P1SuiteGate.ps1 -CandidateSha 0a415e25c362f8a35c09cb9e1163f5ce30accf82 -WindowsReportSet artifacts/p1-expanded/windows-x64/p1-suite-report-set.json -LinuxReportSet artifacts/p1-expanded/linux-x64/p1-suite-report-set.json` | All ten leaves are ✅ Complete at the frozen local candidate: each native Windows/Ubuntu Linux x64 host passes Release with zero warnings/errors, full harness 969/969, expanded differential 32/32, platform CoreCLR/ILVerify/Native AOT 24/24, immutable baseline audit 60/60 and source snapshot 631/631. Coverage validates 40 requirements/160 manifest records, not 160 semantic executions. The strict aggregate passes 15/15 with `fullP1Closure=false`; see the [implementation record](docs/p1-10-implementation.md). CI publication contract checks pass 8/8; remote CI proof remains outstanding; P1-GATE.01–.04 are 🚧 In progress and .05–.06 remain ⏳ Planned. | +| P1-10 | ✅ Complete | [Leaf breakdown](docs/roadmap/P1.md#p1-10). Establish compile-pass, compile-fail, run-pass, and differential regression suites. | P0-11, P1-06.01 | `pwsh -NoProfile -File eng/Test-P1SuiteGate.ps1 -CandidateSha 0a415e25c362f8a35c09cb9e1163f5ce30accf82 -WindowsReportSet artifacts/p1-expanded/windows-x64/p1-suite-report-set.json -LinuxReportSet artifacts/p1-expanded/linux-x64/p1-suite-report-set.json` | All ten leaves are ✅ Complete at the frozen local candidate: each native Windows/Ubuntu Linux x64 host passes Release with zero warnings/errors, full harness 969/969, expanded differential 32/32, platform CoreCLR/ILVerify/Native AOT 24/24, immutable baseline audit 60/60 and source snapshot 631/631. Coverage validates 40 requirements/160 manifest records, not 160 semantic executions. The strict aggregate passes 15/15 with `fullP1Closure=false`; see the [implementation record](docs/p1-10-implementation.md). CI publication contract checks pass 8/8; P1-GATE.01 through P1-GATE.06 are ✅ Complete. See the [P1 completion record](docs/p1-completion.md). | The recorded `p1-exit-gate-v1` report at `artifacts/p1-10/p1-exit-gate-v1.json` passes 5/5 in-process library-contract probes: `typed-mir-validation`, @@ -565,7 +565,7 @@ source diagnostics; package metadata rejects missing/unknown fields, scalar schema downgrades and ambiguous source aliases; expanded platform reports bind fixed sources/expectations, outputs and backend process evidence. The [evidence audit](docs/p1-evidence-audit.md) records focused verification and the -remaining semantic/native boundaries. P1-09 and P1-10 are ✅ Complete on the recorded local evidence; P1-GATE.01–.04 are 🚧 In progress; .05–.06 remain ⏳ Planned. +remaining semantic/native boundaries. P1-09 and P1-10 are ✅ Complete on the recorded local evidence; P1-GATE.01 through P1-GATE.06 are ✅ Complete. See the [P1 completion record](docs/p1-completion.md). The [P1-10 implementation record](docs/p1-10-implementation.md) binds local candidate `0a415e25c362f8a35c09cb9e1163f5ce30accf82` and its 631 frozen compiler/test/tool inputs to the dual-platform 969/969 harness, 32/32 differential, 24/24 platform and 60/60 baseline results. The strict aggregate passes 15/15. The record separates the 40-requirement/160-record inventory from semantic execution, historical raw hashes from current LF bytes, and versioned Drop differences from language-gate approval. Remote CI has not run for this candidate; full P1 closure remains independent. Use the exact leaf dependencies in the [P1 execution order](docs/roadmap/P1.md): typed place/provenance work unlocks source ownership; drop flags unlock cleanup; @@ -795,7 +795,7 @@ zero failures/skips and a zero-error/zero-warning Release build. The recorded `p library-contract probes and records `"nativeAot": false` and `"crossPlatform": false`; it does not close the full P1 exit gate. P1-07 is ✅ Complete; P1-08 is ✅ Complete on its current generated-program and platform -evidence. P1-09 and P1-10 are ✅ Complete on the recorded local evidence. The P1 stage remains 🚧 In progress; P1-GATE.01–.04 are 🚧 In progress and .05–.06 remain ⏳ Planned, including verification and publication at one pushed SHA. +evidence. P1-09 and P1-10 are ✅ Complete on the recorded local evidence. P1-GATE.01 through P1-GATE.06 are ✅ Complete. See the [P1 completion record](docs/p1-completion.md). P0-10, P0-16, and P0-17 are now ✅ Complete on the recorded two-platform evidence; later language-profile claims remain gated on the full HIR/MIR and differential suites. diff --git a/ROADMAP_zh.md b/ROADMAP_zh.md index f93814d..c6e1d3a 100644 --- a/ROADMAP_zh.md +++ b/ROADMAP_zh.md @@ -22,7 +22,7 @@ | 阶段 | 状态 | 父任务 | 实施叶子 | 门禁叶子 | 详细验收 | | --- | --- | --- | --- | --- | --- | | P0 | ✅ 已完成 | 17 | 34 | 3 | [纵向架构](docs/roadmap/P0_zh.md) | -| P1 | 🚧 进行中 | 10 | 85 | 6 | [安全核心实现与闭环](docs/roadmap/P1_zh.md) | +| P1 | ✅ 已完成 | 10 | 85 | 6 | [安全核心实现与闭环](docs/roadmap/P1_zh.md) | | P2 | 🚧 进行中 | 15 | 94 | 7 | [库、包与工具链](docs/roadmap/P2_zh.md) | | P3 | 🚧 进行中 | 6 | 38 | 4 | [宏、async、unsafe/FFI 与 TLS](docs/roadmap/P3_zh.md) | | P4 | ⏳ 计划中 | 5 | 29 | 4 | [HTTP 与 WebSocket](docs/roadmap/P4_zh.md) | @@ -429,7 +429,7 @@ AOT 探测器。这些工作流修改需要新的 CI 运行。此配置的 Linux | P1-07 | ✅ 已完成 | [叶子详情](docs/roadmap/P1_zh.md#p1-07). 为该配置档实现移动路径、借用检查、非词法生命周期、再借用和逃逸分析。 | P0-13, P1-06.04, P1-06.05 | `dotnet run --project tests/RustSharp.Tests -c Release --no-build --no-restore`
`dotnet D:/GitHub/RustSharp/tools/RustSharp.Conformance/bin/Release/net10.0/RustSharp.Conformance.dll --profile p1-differential-v3 --oracle rustc-1.98 --report artifacts/p1-next-session/p1-differential-v3-final2.json --timeout 30 --deadline 300` | 12 个所有权叶子均已完成:黄金诊断保留 move/borrow/escape 代码、消息、原始路径及范围;差分报告通过 32/32,其中借用 20/20、Drop 6/6。候选 SHA 聚合仍是 P1-10.08/P1-GATE 的独立边界。 | | P1-08 | ✅ 已完成 | [叶子详情](docs/roadmap/P1_zh.md#p1-08). 实现作用域清理、确定性 `Drop`、展开/中止配置档行为和 panic 边界。 | P1-06.01, P1-07.01 | `dotnet run --project tests/RustSharp.Tests -c Release --no-build --no-restore`
`dotnet tools/RustSharp.Conformance/bin/Release/net10.0/RustSharp.Conformance.dll --p1-drop-call-interface create artifacts/p1-drop/p1-08-call-interface-win-x64.json 2` | [实现清单](docs/p1-08-implementation_zh.md)以经过检查的析构接收者、类型化/共享 drop flag、聚合/临时值清理、显式 panic 策略和可复用直接调用宿主关闭全部十四个叶子。历史 E9 Release 零警告/零错误,回归通过 894/894。固定差分记录 26 项 rustc 一致加两项冻结契约差异;原始 PE ILVerify 为 30/30。Windows 与 Ubuntu WSL 均通过 Native AOT 28/28 和两个原始 PE 产物的 callable 7/7。最终进程/宿主清理及九个保留的历史临时对象分别披露;在该历史时点,源码导入调用属于 P1-09 工作;候选 SHA 聚合仍属于 P1-10/P1-GATE。 | | P1-09 | ✅ 已完成 | [叶子详情](docs/roadmap/P1_zh.md#p1-09)。通过经验证的 CLR LIR 发射支持的 safe-core 程序,并携带 Rust# 跨包元数据与源码所有权契约。 | P0-07, P1-05, P1-08.11 | `dotnet run --project tests/RustSharp.Tests/RustSharp.Tests.csproj -c Release --no-build --no-restore` | 历史 Closure-9 Release 零警告/零错误,关键回归 84/84、完整回归 964/964。这些报告记录源码包清单原始字节 SHA `BC0975F428B6A8AB0AE47DE50970B1152482C3465C27B47AB44A3AC4153519AB`;Windows 与 Ubuntu WSL 均通过 19/19 CoreCLR、39/39 原始 PE ILVerify 和 Native AOT,用例零警告/失败/阻塞/未执行,独立构建相同,截止时间及清理审计通过。历史 CRLF 原始字节哈希不同于当前规范化 LF 后的哈希。已记录本地证据闭环 P1-09;P1-10 实现闭环与独立的 P1-GATE 叶子具有各自证据。 | -| P1-10 | ✅ 已完成 | [叶子详情](docs/roadmap/P1_zh.md#p1-10). 建立编译通过、编译失败、运行通过和差异回归测试套件。 | P0-11, P1-06.01 | `pwsh -NoProfile -File eng/Test-P1SuiteGate.ps1 -CandidateSha 0a415e25c362f8a35c09cb9e1163f5ce30accf82 -WindowsReportSet artifacts/p1-expanded/windows-x64/p1-suite-report-set.json -LinuxReportSet artifacts/p1-expanded/linux-x64/p1-suite-report-set.json` | 十个叶子均在固定本地候选 ✅ 已完成:每个原生 Windows/Ubuntu Linux x64 宿主均通过零警告/零错误的 Release、969/969 项完整测试、32/32 项扩展差分、24/24 项平台 CoreCLR/ILVerify/Native AOT、60/60 项不可变基线审计及 631/631 项源码快照。覆盖账本校验 40 个需求/160 条清单记录,不代表 160 项语义执行。严格聚合通过 15/15,`fullP1Closure=false`;详见[实现记录](docs/p1-10-implementation_zh.md)。CI 发布契约检查通过 8/8;远程 CI 证据仍待补齐;P1-GATE.01–.04 为 🚧 进行中,.05–.06 仍为 ⏳ 计划中。 | +| P1-10 | ✅ 已完成 | [叶子详情](docs/roadmap/P1_zh.md#p1-10). 建立编译通过、编译失败、运行通过和差异回归测试套件。 | P0-11, P1-06.01 | `pwsh -NoProfile -File eng/Test-P1SuiteGate.ps1 -CandidateSha 0a415e25c362f8a35c09cb9e1163f5ce30accf82 -WindowsReportSet artifacts/p1-expanded/windows-x64/p1-suite-report-set.json -LinuxReportSet artifacts/p1-expanded/linux-x64/p1-suite-report-set.json` | 十个叶子均在固定本地候选 ✅ 已完成:每个原生 Windows/Ubuntu Linux x64 宿主均通过零警告/零错误的 Release、969/969 项完整测试、32/32 项扩展差分、24/24 项平台 CoreCLR/ILVerify/Native AOT、60/60 项不可变基线审计及 631/631 项源码快照。覆盖账本校验 40 个需求/160 条清单记录,不代表 160 项语义执行。严格聚合通过 15/15,`fullP1Closure=false`;详见[实现记录](docs/p1-10-implementation_zh.md)。CI 发布契约检查通过 8/8;P1-GATE.01 至 P1-GATE.06 已 ✅ 已完成。详见[P1 结项记录](docs/p1-completion_zh.md)。 | 已记录的 `p1-exit-gate-v1` 报告位于 `artifacts/p1-10/p1-exit-gate-v1.json`, 5/5 个进程内库契约探针均通过:`typed-mir-validation`、`ownership-bridge`、 @@ -466,7 +466,7 @@ ILVerify 和 Windows Native AOT 执行的平台 v2 24/24。报告保留于 显式所有权证据遵守逐函数资源边界并保留源码诊断;包元数据拒绝缺失/未知字段、 标量 schema 降级及歧义源码别名;扩展平台报告绑定固定源码/期望、输出及后端进程证据。 [证据审计](docs/p1-evidence-audit_zh.md) 记录聚焦验证和剩余语义/原生边界。 -P1-09 和 P1-10 基于已记录的本地证据为 ✅ 已完成;P1-GATE.01–.04 为 🚧 进行中,.05–.06 仍为 ⏳ 计划中。 +P1-09 和 P1-10 基于已记录的本地证据为 ✅ 已完成;P1-GATE.01 至 P1-GATE.06 已 ✅ 已完成。详见[P1 结项记录](docs/p1-completion_zh.md)。 [P1-10 实现记录](docs/p1-10-implementation_zh.md)将本地候选 `0a415e25c362f8a35c09cb9e1163f5ce30accf82` 及其 631 个固定编译器/测试/工具输入绑定到双平台 969/969 项完整测试、32/32 项差分、24/24 项平台及 60/60 项基线结果。严格聚合通过 15/15。该记录区分 40 个需求/160 条记录的账本与语义执行、历史原始字节哈希与当前 LF 字节,以及版本化 Drop 差异与语言门禁认可。此候选尚未运行远程 CI;完整 P1 闭环仍为独立门禁。 按 [P1 执行顺序](docs/roadmap/P1_zh.md) 中的精确叶子依赖推进:类型化 place/provenance 解锁源码所有权,drop flag 解锁清理, @@ -657,6 +657,6 @@ P1-05(有界可执行泛型/trait)也基于已记录的回归、差分、ILV Release 构建。已记录的 `p1-exit-gate-v1` 报告通过 5/5 个进程内库契约探针,并记录 `"nativeAot": false` 和 `"crossPlatform": false`; 它不能关闭完整 P1 退出门槛。P1-07 为 ✅ 已完成;P1-08 基于当前生成程序与平台 -证据为 ✅ 已完成。P1-09 和 P1-10 基于已记录的本地证据为 ✅ 已完成。P1 阶段仍为 🚧 进行中;P1-GATE.01–.04 为 🚧 进行中,.05–.06 仍为 ⏳ 计划中,包括同一推送 SHA 的验证和发布。 +证据为 ✅ 已完成。P1-09 和 P1-10 基于已记录的本地证据为 ✅ 已完成。P1-GATE.01 至 P1-GATE.06 已 ✅ 已完成。详见[P1 结项记录](docs/p1-completion_zh.md)。 P0-10、P0-16 和 P0-17 现在基于已记录的双平台证据均为 ✅ 已完成;后续语言配置档声明仍受完整 HIR/MIR 和差异测试套件的门槛约束。 diff --git a/docs/p1-completion.json b/docs/p1-completion.json new file mode 100644 index 0000000..d472c99 --- /dev/null +++ b/docs/p1-completion.json @@ -0,0 +1,964 @@ +{ + "schemaVersion": 1, + "status": "complete", + "gate": "P1-GATE.05", + "publicationGate": "P1-GATE.06", + "candidateSha": "9d483a98141f4dcb6aa04232e7d5bfcb235ea554", + "candidateTreeSha": "aff5435fc90c29c8fa44a9bf69e2b1910f05abab", + "runId": "46292548611", + "runAttempt": 1, + "cleanDiff": true, + "cleanup": { + "completed": true, + "evidence": [ + "production-gate", + "suite-gate", + "transport-win-x64", + "transport-linux-x64" + ] + }, + "nativeRuns": [ + { + "runtimeIdentifier": "win-x64", + "candidateSha": "9d483a98141f4dcb6aa04232e7d5bfcb235ea554", + "runUrl": "https://github.com/IoTSharp/RustSharp/actions/runs/46292548611", + "jobUrl": "https://github.com/IoTSharp/RustSharp/actions/runs/46292548611/job/141439197487", + "artifact": "p1-production-receipt-windows-x64-46292548611-1" + }, + { + "runtimeIdentifier": "linux-x64", + "candidateSha": "9d483a98141f4dcb6aa04232e7d5bfcb235ea554", + "runUrl": "https://github.com/IoTSharp/RustSharp/actions/runs/46292548611", + "jobUrl": "https://github.com/IoTSharp/RustSharp/actions/runs/46292548611/job/141439197435", + "artifact": "p1-production-receipt-linux-x64-46292548611-1" + } + ], + "leaves": [ + { + "id": "P1-01.01", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-01.02", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-01.03", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-01.04", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-02.01", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-02.02", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-02.03", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-02.04", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-03.01", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-03.02", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-03.03", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-03.04", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-04.01", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-04.02", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-04.03", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-04.04", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-05.01", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-05.02", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-05.03", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-05.04", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.01", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.02", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.03", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.04", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.05", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.06", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.07", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.08", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.09", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.10", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.11", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.12", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.13", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.14", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.15", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.16", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.17", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.18", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-06.19", + "status": "complete", + "evidence": [ + "suite-gate", + "coverage-win-x64", + "coverage-linux-x64", + "production-gate" + ] + }, + { + "id": "P1-07.01", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.02", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.03", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.04", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.05", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.06", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.07", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.08", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.09", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.10", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.11", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-07.12", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.01", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.02", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.03", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.04", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.05", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.06", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.07", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.08", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.09", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.10", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.11", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.12", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.13", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-08.14", + "status": "complete", + "evidence": [ + "suite-gate", + "drop-win-x64", + "drop-linux-x64" + ] + }, + { + "id": "P1-09.01", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-09.02", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-09.03", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-09.04", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-09.05", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-09.06", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-09.07", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-09.08", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-09.09", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-09.10", + "status": "complete", + "evidence": [ + "production-gate", + "source-win-x64", + "source-linux-x64" + ] + }, + { + "id": "P1-10.01", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + }, + { + "id": "P1-10.02", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + }, + { + "id": "P1-10.03", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + }, + { + "id": "P1-10.04", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + }, + { + "id": "P1-10.05", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + }, + { + "id": "P1-10.06", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + }, + { + "id": "P1-10.07", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + }, + { + "id": "P1-10.08", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + }, + { + "id": "P1-10.09", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + }, + { + "id": "P1-10.10", + "status": "complete", + "evidence": [ + "suite-gate", + "legacy-win-x64", + "legacy-linux-x64" + ] + } + ], + "reports": [ + { + "name": "production-gate", + "sha256": "48C7F293253F3A740F4AA503F3B1D93FBEF7F98071AFB97E57087676D23236C1", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/production-gate/production-ci-gate.json" + }, + { + "name": "suite-gate", + "sha256": "A44DC1BA44FD198B10435B5285B94BB6396B79552C649923A56FE0CBFA69D2EF", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/suite/p1-suite-gate.json" + }, + { + "name": "production-win-x64", + "sha256": "D4EF4AAE3BFAE638385E7A0A0F15F67C41ECB8B3796D239662E49A9F7B1FBBAB", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/production-receipt-windows-x64/native-receipt.json" + }, + { + "name": "drop-win-x64", + "sha256": "AA6BCF889DA4B4EE1FB67E2D5D717B866EE616CAB21DB8C2FF3A5557141E5BF9", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/drop-receipt-windows-x64/native-receipt.json" + }, + { + "name": "transport-win-x64", + "sha256": "616A99BE16E67F7F8AD0C820CC0E4B8D39B8BFCE47E6DC655DD463EB1E48DD88", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/production-gate/drop-transport-windows-x64.json" + }, + { + "name": "coverage-win-x64", + "sha256": "BABF552E4EB9A8D0FC8AAF12460C9752B56B80D2DE5A36B2F140BEE1F7B33122", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/expanded-windows-x64/p1-gate-harness-coverage.json" + }, + { + "name": "source-win-x64", + "sha256": "CA090F692518B7BA10102BE2DFA992F7C8DEC9ECB53BE463480407540177CEC0", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/source-windows-x64/source-package-v2.json" + }, + { + "name": "backend-win-x64", + "sha256": "E77761374758058780F75FF65A7EFCF6285380CC9DC0748EC8789242F1C4373E", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/backend-windows-x64/backend-coverage-v1.json" + }, + { + "name": "legacy-win-x64", + "sha256": "D257F965EE09048C694608D9CA130ABE2115EA9F1DF3241A5ED1487BC229CA69", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/expanded-windows-x64/immutable-regression-audit.json" + }, + { + "name": "production-linux-x64", + "sha256": "83505584F5A7403296EBDB62ABC7A43464256977B87371D8BC12A6FFD1E8428E", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/production-receipt-linux-x64/native-receipt.json" + }, + { + "name": "drop-linux-x64", + "sha256": "5EA39CDE568086B0E56CD125E64918118FA788C08C8CC9159C49CE6B99C0AC10", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/drop-receipt-linux-x64/native-receipt.json" + }, + { + "name": "transport-linux-x64", + "sha256": "8122D4F3C9E290B94A1C9CD353EFA3D6D416364A86D5E716AF6F3B566C7B1991", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/production-gate/drop-transport-linux-x64.json" + }, + { + "name": "coverage-linux-x64", + "sha256": "AA52902F948216F07CBD08EE815E07EBC21A9791741A62EBDD1AB94EC808EF50", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/expanded-linux-x64/p1-gate-harness-coverage.json" + }, + { + "name": "source-linux-x64", + "sha256": "55A40D9D0407E1DAA606C3D1CF8CB0EB4DBF7BAC003EDAFFA46953E030F2A356", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/source-linux-x64/source-package-v2.json" + }, + { + "name": "backend-linux-x64", + "sha256": "3F3F021CC7B73FC5F49726474C7FBF0F439A9CB2DF226B6FDAF347C5BF1F63F8", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/backend-linux-x64/backend-coverage-v1.json" + }, + { + "name": "legacy-linux-x64", + "sha256": "AE44BB51A58DC2CF696E0121EC143EEF7231CC499293F20C52C732986050AF06", + "retainedPath": "artifacts/p1-supervision/candidate-9d483a9/expanded-linux-x64/immutable-regression-audit.json" + } + ], + "manifests": [ + { + "path": "tools/RustSharp.Conformance/fixtures/p1-gate-coverage-v1-manifest.json", + "sha256": "3399F1F6A85DE4946C987788785BDB4ADBFD88548A5122CD27B13247E1DEAB40" + }, + { + "path": "tools/RustSharp.Conformance/fixtures/p1-expanded-suites-v2-manifest.json", + "sha256": "E8CEFE60A5B47900ADC319024847555B5F6B9F72FE8346815CD16F9EB20D2F4D" + }, + { + "path": "tools/RustSharp.Conformance/fixtures/p1-source-package-v1-manifest.json", + "sha256": "72D4CEC65E90895598704660E2BEE12357528A3A5857574D0A23F7F7569BECD8" + }, + { + "path": "tools/RustSharp.Conformance/fixtures/safe-core-regression-manifest.json", + "sha256": "7FF0EF8036B5A8DDF1721E7567762270A6D77F05881F0834BFFFBF1E5136A6D9" + }, + { + "path": "tools/RustSharp.Conformance/fixtures/safe-core-regression-v2-manifest.json", + "sha256": "7ACD9B4140CA477290A1724DBC82E0BB76BCC1AF7C252CFDD1061EAC1261C7CF" + }, + { + "path": "tools/RustSharp.Conformance/fixtures/safe-core-regression-v3-manifest.json", + "sha256": "33BC3A52B4502654F7911CCE60EF6EF7D56F8719CE8EB9A17ACEB9D1959EB5C2" + }, + { + "path": "tools/RustSharp.Conformance/fixtures/p1-differential-v2-manifest.json", + "sha256": "10D453E744C7F66500AB29A4FBC2B7CF65FFF61216F5B0ED0FD1819ADAA30623" + } + ], + "documents": [ + { + "path": "docs/p1-completion.md", + "sha256": "0537E881A56CB56E5B09F768C6C4570CBE399B38F648261FB374B8F268ABA703" + }, + { + "path": "docs/p1-completion_zh.md", + "sha256": "1302B070343823F925FA07BECD67E4C9FA0E1F689AD1CFDCA20ADDD7114F70BC" + } + ] +} diff --git a/docs/p1-completion.md b/docs/p1-completion.md new file mode 100644 index 0000000..58af5f1 --- /dev/null +++ b/docs/p1-completion.md @@ -0,0 +1,20 @@ +# P1 completion record + +English | [简体中文](p1-completion_zh.md) + +P1 is ✅ Complete. All 85 implementation leaves and P1-GATE.01 through P1-GATE.06 are closed for the frozen safe-core profile. Candidate `9d483a98141f4dcb6aa04232e7d5bfcb235ea554` and Git tree `aff5435fc90c29c8fa44a9bf69e2b1910f05abab` passed all eight jobs in [GitHub Actions run 46292548611, attempt 1](https://github.com/IoTSharp/RustSharp/actions/runs/46292548611). + +| Gate | Accepted evidence | +| --- | --- | +| P1-GATE.01 | Both native reports bind 40 frozen requirements, 160 catalogue entries and 440 unique registered tests to the candidate. The two-host backend matrix passes all 24 required cells. | +| P1-GATE.02 | Per platform, the fixed 20-case ownership differential is covered by the passing 32-case expanded differential. NativeV5 executes 28 generated Drop cases with 26 exact rustc matches and two approved cleanup differences. All 28 Native AOT cases, seven callable checks and 30 original-PE ILVerify checks pass per platform. | +| P1-GATE.03 | Each platform passes 19 frozen source-package cases, 39 original-PE ILVerify checks, and CoreCLR and Native AOT execution. The production aggregate rehashes the retained source and backend files and runs the physical backend matrix validator. | +| P1-GATE.04 | Both Release builds have zero warnings and errors. Each platform passes 1,496/1,496 full regression tests, 32/32 expanded differential cases, 24/24 expanded platform cases and the 60/60 immutable baseline audit. The published suite aggregate passes 15/15. | +| P1-GATE.05 | The two native Windows/Linux x64 receipts, their transported Drop proofs, and the suite and production aggregates reconcile to the same pushed commit, Git tree and run attempt. | +| P1-GATE.06 | The bilingual roadmap and this record publish the accepted scope, frozen denominators, tool provenance, report hashes and cleanup evidence. | + +The historical suites ran on both targets. Regression v1 passes 8/8, differential v2 passes 16/16, platform v1 passes 12/12 and regression v3 passes 26/26. Regression v2 retains 22 matches and two versioned changes in the original 24-case report. The same frozen pattern and capture sources are now accepted, and their v3 successor cases execute with outputs `7` and `3`. The current RustSharp and rustc executions establish the successor result. + +Release and Native AOT use .NET SDK `10.0.404`, with .NET runtime `10.0.15`, rustc `1.98.0` and ILVerify `10.0.11`. The differential runner also records the installed SDK `11.0.100` from its standalone host probe. The compiler bytes are bound independently to the Release build from the candidate SHA. + +The Release source snapshots and retained reports bind the clean candidate and recorded process and temporary-resource cleanup. [Machine-readable record](p1-completion.json) includes the 85 leaf bindings, manifest hashes, native job URLs and SHA-256 values of the downloaded reports and paired documents. The native run is the evidence for the candidate above. This record closes publication of that evidence. diff --git a/docs/p1-completion_zh.md b/docs/p1-completion_zh.md new file mode 100644 index 0000000..30b6e2a --- /dev/null +++ b/docs/p1-completion_zh.md @@ -0,0 +1,20 @@ +# P1 结项记录 + +[English](p1-completion.md) | 简体中文 + +P1 为 ✅ 已完成。冻结的安全核心配置档已关闭全部 85 个实施叶子及 P1-GATE.01 至 P1-GATE.06。候选提交 `9d483a98141f4dcb6aa04232e7d5bfcb235ea554` 和 Git 树 `aff5435fc90c29c8fa44a9bf69e2b1910f05abab` 在 [GitHub Actions 运行 46292548611,第 1 次尝试](https://github.com/IoTSharp/RustSharp/actions/runs/46292548611) 的八个任务中全部通过。 + +| 门禁 | 验收证据 | +| --- | --- | +| P1-GATE.01 | 两份原生报告将 40 项冻结需求、160 条目录记录及 440 个唯一注册用例绑定到候选提交。双宿主后端矩阵的 24 项必需检查全部通过。 | +| P1-GATE.02 | 每个平台的 32 项扩展差分覆盖固定的 20 项所有权差分。NativeV5 执行 28 项生成 Drop 用例,26 项与 rustc 精确一致,另两项符合已批准的清理差异。每个平台的 28 项 Native AOT 用例、7 项可调用检查和 30 项原始 PE 的 ILVerify 均通过。 | +| P1-GATE.03 | 每个平台均通过 19 个冻结的源码包用例、39 项原始 PE 的 ILVerify 及 CoreCLR、Native AOT 执行。生产汇总重新计算保留的源码包和后端文件哈希,并运行后端物理矩阵验证。 | +| P1-GATE.04 | 两个平台的 Release 构建均为零警告、零错误。每个平台通过 1,496/1,496 项全量回归、32/32 项扩展差分、24/24 项扩展平台用例和 60/60 项不可变基线审计。已发布的套件汇总通过 15/15。 | +| P1-GATE.05 | Windows/Linux x64 两份原生收据、传输后的 Drop 证明以及套件和生产汇总均绑定到同一已推送提交、Git 树和运行尝试。 | +| P1-GATE.06 | 双语路线图及本记录发布已验收范围、固定分母、工具来源、报告哈希和清理证据。 | + +历史套件在两个目标平台均已执行。回归 v1 通过 8/8,差分 v2 通过 16/16,平台 v1 通过 12/12,回归 v3 通过 26/26。回归 v2 的原始 24 项报告保留 22 项匹配及两项已版本化的变化。同一份冻结的模式及捕获源码现在能够通过检查,其 v3 后继用例实际执行并分别产生冻结输出 `7` 和 `3`。后继结果由当前 RustSharp 和 rustc 的实际执行验证。 + +Release 和 Native AOT 使用 .NET SDK `10.0.404`、.NET 运行时 `10.0.15`、rustc `1.98.0` 及 ILVerify `10.0.11`。差分运行器的独立宿主探测还记录了已安装的 SDK `11.0.100`。编译器字节另行与候选 SHA 的 Release 构建绑定。 + +Release 源码快照和保留报告绑定了干净候选,以及已记录的进程和临时资源清理结果。[机器可读记录](p1-completion.json)包含 85 个叶子的证据绑定、清单哈希、原生任务链接,以及下载报告和双语文档的 SHA-256。原生运行是上述候选提交的验收证据,本记录完成该证据的发布。 diff --git a/docs/roadmap/P1.md b/docs/roadmap/P1.md index ad8e6e5..4db9c3d 100644 --- a/docs/roadmap/P1.md +++ b/docs/roadmap/P1.md @@ -25,11 +25,11 @@ See [the archive](../evidence/p1/remaining-cli-v1-archive.json) and This inventory assigns existing commitments to stable IDs without expanding or shrinking the language contract. P1-06.01's [frozen ledger](../p1-exit-scope-v1.md) enumerates the [typed MIR contract](../typed-mir-profile.md), [P1 gap matrix](../p1-gap-matrix.md) and original acceptance requirements. The existing check-only type profile stays check-only; previously promised executable behavior and listed remaining work cannot disappear through reclassification. References/provenance, slices/unsizing, patterns/closures, full source move/borrow analysis, generated Drop/panic, source package contracts and every required backend each need leaves and cases. -The full P1 exit gates remain open. The initial `safe-core-regression-v3` manifest fixes 26 cases: it preserves the v2 source contracts except for versioning two now-executable pattern/capture expectations, and adds combined MIR family/projection samples. The immutable v2 regression manifest remains unchanged. The current expanded revision is `p1-expanded-suites-v2-manifest.json` (manifest version 2, differential suite version 4); its `p1-differential-v3` and `p1-platform-v2` suites contain all 56 bounded source fixtures with immutable hashes, and bounded differential/platform runners emit provenance-rich reports. P1-07, P1-09 and all ten P1-10 implementation leaves are ✅ Complete on the recorded local evidence. P1-GATE.01–.03 are 🚧 In progress; .04–.06 remain ⏳ Planned. +The initial `safe-core-regression-v3` manifest fixes 26 cases: it preserves the v2 source contracts except for versioning two now-executable pattern/capture expectations, and adds combined MIR family/projection samples. The immutable v2 regression manifest remains unchanged. The current expanded revision is `p1-expanded-suites-v2-manifest.json` (manifest version 2, differential suite version 4); its `p1-differential-v3` and `p1-platform-v2` suites contain all 56 bounded source fixtures with immutable hashes, and bounded differential/platform runners emit provenance-rich reports. P1-07, P1-09 and all ten P1-10 implementation leaves are ✅ Complete on the recorded local evidence. P1-GATE.01 through P1-GATE.06 are ✅ Complete. See the [P1 completion record](../p1-completion.md). The [follow-up evidence audit](../p1-evidence-audit.md) retains the earlier executable semantic sources and local 32/32 differential and Windows 24/24 platform results. Current P1-10 evidence repeats 32/32 differential and 24/24 CoreCLR/ILVerify/Native AOT cases on both Windows and Ubuntu Linux x64, with complete process cleanup. Its strict aggregate passes 15/15 while explicitly recording `fullP1Closure=false`; remote CI and the overall P1 language/closure gates remain independent. -The [P1-08 implementation record](../p1-08-implementation.md) is ✅ Complete for all fourteen leaves. Historical E9 binds the zero-warning/error Release build and 894/894 regressions to `p1-drop-closure-v3`: 26 rustc matches plus two frozen normal-cleanup contract differences, original-PE ILVerify 30/30, and Windows/Ubuntu WSL Native AOT 28/28 plus callable 7/7 per platform. The interface has two original PE artifacts; Linux targets `linux-x64` on actual host `ubuntu.24.04-x64`. Final reported-process/disposable-host cleanup, its historical parent-chain limitation and nine retained workspace objects are disclosed separately. Current `p1-drop-closure-v4` records Windows 26 rustc matches plus two differences and Linux 25 matches plus three. The extra Linux `unwind-own-drop-body-failure` trace difference is disclosed and has not been approved by the P1 language gates. Source `panic!` remains unsupported and the 256-source-local limit remains enforced. P1-09 and P1-10 are ✅ Complete on the recorded local evidence; P1-GATE.01–.03 are 🚧 In progress; .04–.06 remain ⏳ Planned. +The [P1-08 implementation record](../p1-08-implementation.md) is ✅ Complete for all fourteen leaves. Historical E9 binds the zero-warning/error Release build and 894/894 regressions to `p1-drop-closure-v3`: 26 rustc matches plus two frozen normal-cleanup contract differences, original-PE ILVerify 30/30, and Windows/Ubuntu WSL Native AOT 28/28 plus callable 7/7 per platform. The interface has two original PE artifacts; Linux targets `linux-x64` on actual host `ubuntu.24.04-x64`. Final reported-process/disposable-host cleanup, its historical parent-chain limitation and nine retained workspace objects are disclosed separately. Historical `p1-drop-closure-v4` records Windows 26 rustc matches plus two differences and Linux 25 matches plus three. The extra Linux `unwind-own-drop-body-failure` trace difference is disclosed and has not been approved by the P1 language gates. Source `panic!` remains unsupported and the 256-source-local limit remains enforced. P1-09 and P1-10 are ✅ Complete on the recorded local evidence; P1-GATE.01 through P1-GATE.06 are ✅ Complete. See the [P1 completion record](../p1-completion.md). The [P1-10 implementation record](../p1-10-implementation.md) binds frozen local candidate `0a415e25c362f8a35c09cb9e1163f5ce30accf82`, tree `e1448fc1ff7314f9c6fa5fd581642bbd3428ee95` and 631 compiler/test/tool inputs to seven reports per native host. Windows and Ubuntu Linux x64 each pass Release with zero warnings/errors, full harness 969/969, differential 32/32, platform 24/24, baseline audit 60/60 and source snapshot 631/631. Coverage validates 40 requirements and 160 manifest records; it does not execute 160 semantic cases. The 15/15 suite aggregate closes P1-10 implementation only. Remote CI has not run for this candidate. @@ -203,7 +203,7 @@ cases or skips. The 12-case native platform denominator remains unchanged. | P1-10.05 | ✅ Complete | Borrow/Drop differential process runner | P1-10.02 | Execute every frozen v3 source with exact rustc 1.98; capture version, command, PID/start/parent, timeout, termination and cleanup even on failures. | `P1ExpandedDifferentialRunner` and `p1-differential-v3-final2.json` provide bounded evidence for all 32 cases, including borrow 20/20 and Drop 6/6, with zero failures, blocked cases or skips. | | P1-10.06 | ✅ Complete | Expanded native-platform execution runner | P1-10.02 | Every executable family/package case runs through CoreCLR, ILVerify and native AOT on Windows/Linux x64; declared non-runtime negatives remain diagnostic cases. | `P1ExpandedPlatformRunner` executes all 24 semantic cases at the frozen local candidate on both Windows and Ubuntu Linux x64; CoreCLR, ILVerify and Native AOT pass 24/24, with bounded execution and cleanup; E10. | | P1-10.07 | ✅ Complete | Bind reports to source, tools and case manifests | P1-10.03, P1-10.05, P1-10.06 | Reports include compiler SHA, manifest hashes, platform/RID, runtime/SDK/oracle versions, bounds and cleanup; empty/missing/duplicate/stale records fail. | `P1EvidenceBindingValidator` validates the 24/24 report against frozen IDs, source/expectation hashes, outputs, native host/tools and every backend process envelope. | -| P1-10.08 | ✅ Complete | Aggregate semantic coverage and platform evidence | P1-10.07 | Aggregator requires the expanded frozen denominators and every required leaf/backend at one candidate SHA; 6 old reports alone cannot close the new contract. | `eng/Test-P1SuiteGate.ps1` and `eng/P1SuiteEvidenceValidation.ps1` bind seven reports per native host, exact source/compiler hashes and requirement/backend coverage. `artifacts/p1-10/p1-suite-gate.json` passes 15/15 at candidate `0a415e25c362f8a35c09cb9e1163f5ce30accf82`, with `fullP1Closure=false`; E10. The independent full P1 gate remains `eng/Test-P1CandidateGate.ps1`. | +| P1-10.08 | ✅ Complete | Aggregate semantic coverage and platform evidence | P1-10.07 | Aggregator requires the expanded frozen denominators and every required leaf/backend at one candidate SHA; 6 old reports alone cannot close the new contract. | `eng/Test-P1SuiteGate.ps1` and `eng/P1SuiteEvidenceValidation.ps1` bind seven reports per native host, exact source/compiler hashes and requirement/backend coverage. `artifacts/p1-10/p1-suite-gate.json` passes 15/15 at candidate `0a415e25c362f8a35c09cb9e1163f5ce30accf82`, with `fullP1Closure=false`; E10. The [P1 completion record](../p1-completion.md) binds the independent native CI gates. | | P1-10.09 | ✅ Complete | CI report publication and failure provenance | P1-10.08 | Both native jobs upload all success/failure reports with stable run/artifact references; unavailable infrastructure is blocked, never passed/skipped. | Manual `.github/workflows/p1-expanded.yml` implements exact-SHA native execution, publication on success/failure, run/attempt/artifact references and hash reconciliation. Eight offline publication contract checks pass. Implementation closure does not claim remote CI execution; that remains P1-GATE.05. | | P1-10.10 | ✅ Complete | Audit regression preservation and fresh candidate verification | P1-10.09, P1-10.04 | Full Release harness has at least 464 cases plus additions, zero failures/skips and zero build warnings/errors; legacy suites remain immutable and new suites have fixed denominators. | Paired Release builds have zero warnings/errors; each full harness passes the actual 969/969 registered inventory, with zero failed/skipped/unexecuted cases. `eng/Test-P1RegressionAudit.ps1` passes 60/60; source snapshots verify 631/631 frozen inputs and the strict aggregate passes 15/15; E10. | @@ -213,16 +213,16 @@ cases or skips. The 12-case native platform denominator remains unchanged. | ID | Status | Deliverable / ownership | Depends on | Done when | Evidence | | --- | --- | --- | --- | --- | --- | -| P1-GATE.01 | 🚧 In progress | Close the frozen language inventory | P0-GATE, P1-01, P1-02, P1-03, P1-04, P1-05, P1-06 | Every required executable/check-only/rejection boundary in P1-06.01 has its designated completed leaf and case evidence; no unmapped category. | Planned requirement coverage audit at candidate SHA | -| P1-GATE.02 | 🚧 In progress | Close source ownership and generated cleanup semantics | P1-07, P1-08 | Borrow/Drop fixed cases agree with rustc 1.98 or already approved versioned divergences; simulation-only traces cannot satisfy emitted behavior. | Planned borrow/Drop closure report | -| P1-GATE.03 | 🚧 In progress | Close source package/backend integration | P1-09 | Every source import family has reconciled metadata and generated CoreCLR/ILVerify/Windows/Linux AOT evidence. | Planned source-package coverage report | -| P1-GATE.04 | 🚧 In progress | Close fixed test and report contracts | P1-10 | Every preserved and expanded denominator passes with failed/blocked/skipped all zero; negative evidence tests reject missing coverage. | Planned expanded regression/differential/platform aggregator report | -| P1-GATE.05 | ⏳ Planned | Verify one pushed SHA on both native x64 platforms | P1-GATE.01, P1-GATE.02, P1-GATE.03, P1-GATE.04 | All required jobs pass at the candidate SHA; download reports and reconcile hashes/counts/platforms/versions, not just badge color. | Planned stable Windows/Linux run URLs and artifact provenance | -| P1-GATE.06 | ⏳ Planned | Publish P1 closure record and synchronized status | P1-GATE.05 | Record leaf IDs, manifest versions, denominators, SHA/run links, clean diff and owned-resource cleanup; update both language statuses together. | Planned `docs/p1-completion.md`; no new acceptance added at this step | +| P1-GATE.01 | ✅ Complete | Close the frozen language inventory | P0-GATE, P1-01, P1-02, P1-03, P1-04, P1-05, P1-06 | Both native reports bind 40 requirements, 160 catalogue records and 440 registered tests. All 24 backend matrix cells pass. | Local coverage validation passes 10/10 checks for 40 requirements and 160 catalogue records. The validator binds the reviewed generic CLI test revision from `b5dc186` and verifies the frozen case IDs. The full candidate harness and 24 backend/RID cells still need same-SHA evidence. | +| P1-GATE.02 | ✅ Complete | Close source ownership and generated cleanup semantics | P1-07, P1-08 | On each native host, ownership differential passes, NativeV5 records 26 exact rustc matches and two approved differences, Native AOT passes 28/28, callable passes 7/7, and ILVerify passes 30/30. | Local Windows NativeV5 runs all 28 generated Drop cases with 26 exact rustc 1.98 matches and the two approved differences. Native AOT passes 28/28, callable checks pass 7/7, and ILVerify passes all 30 original PEs. The fixed ownership differential and native Windows/Linux reports still need to be reconciled at one candidate SHA. | +| P1-GATE.03 | ✅ Complete | Close source package/backend integration | P1-09 | On each native host, 19 source-package cases and 39 original-PE ILVerify checks pass with CoreCLR and Native AOT execution. The retained artifact matrix passes. | Planned source-package coverage report | +| P1-GATE.04 | ✅ Complete | Close fixed test and report contracts | P1-10 | Execute and reconcile every frozen historical and expanded case against its versioned expectations. Negative evidence tests reject missing coverage. | Planned expanded regression/differential/platform aggregator report | +| P1-GATE.05 | ✅ Complete | Verify one pushed SHA on both native x64 platforms | P1-GATE.01, P1-GATE.02, P1-GATE.03, P1-GATE.04 | [Run 46292548611](https://github.com/IoTSharp/RustSharp/actions/runs/46292548611) passes all eight jobs for `9d483a9`; report and artifact hashes reconcile. | Planned stable Windows/Linux run URLs and artifact provenance | +| P1-GATE.06 | ✅ Complete | Publish P1 closure record and synchronized status | P1-GATE.05 | [Bilingual closure record](../p1-completion.md) and [report bindings](../p1-completion.json). | Planned `docs/p1-completion.md`; no new acceptance added at this step | ## Next deliveries and parallel ownership boundaries -1. P1-06 is ✅ Complete with its frozen scope ledger and E8 implementation evidence. P1-07 is ✅ Complete: all twelve ownership leaves, the four diagnostic golden cases and the 20-case borrow closure pass. P1-08 is ✅ Complete with all fourteen leaves and E9 generated-program/backend evidence. P1-09 is ✅ Complete with its nineteen-case source-package evidence. All ten P1-10 leaves are ✅ Complete at the frozen local candidate in E10; P1-GATE.01–.03 are 🚧 In progress; .04–.06 remain ⏳ Planned. +1. P1-06 is ✅ Complete with its frozen scope ledger and E8 implementation evidence. P1-07 is ✅ Complete: all twelve ownership leaves, the four diagnostic golden cases and the 20-case borrow closure pass. P1-08 is ✅ Complete with all fourteen leaves and E9 generated-program/backend evidence. P1-09 is ✅ Complete with its nineteen-case source-package evidence. All ten P1-10 leaves are ✅ Complete at the frozen local candidate in E10; P1-GATE.01 through P1-GATE.06 are ✅ Complete. See the [P1 completion record](../p1-completion.md). 2. P1-06.04/.05/.08/.09 provide the place/reference/slice prerequisites. P1-07's ownership and P1-08's local destructor/panic deliveries are ✅ Complete. Follow-up changes to the same `SafeCoreMirLowering.cs` or validator must integrate serially; separate agents cannot write that file concurrently. 3. P1-09.01 through .10 and P1-10.01 through .10 are ✅ Complete on their recorded local evidence. The extra Linux Drop difference remains disclosed without P1 language-gate approval; full P1 closure is independent. 4. Reconcile P1-GATE.01 through .06 at a pushed candidate SHA, including native CI execution and publication; preserve existing library probes and hand-built LIR tests. diff --git a/docs/roadmap/P1_zh.md b/docs/roadmap/P1_zh.md index 2dacfde..0681912 100644 --- a/docs/roadmap/P1_zh.md +++ b/docs/roadmap/P1_zh.md @@ -21,11 +21,11 @@ NativeV5 保留 28 个真实用例(26 个精确匹配及两个继承的冻结 这份清单把现有承诺分配给固定编号,不扩大或削减语言范围。P1-06.01 的[冻结账本](../p1-exit-scope-v1_zh.md) 已把[类型化 MIR 契约](../typed-mir-profile.md)、[P1 缺口矩阵](../p1-gap-matrix.md) 和原验收要求逐项登记;已有的仅检查类型配置档保持仅检查,既有可执行承诺与已列剩余项不得通过重新分类而消失。引用/provenance、切片/unsizing、模式/闭包、完整源码移动借用、生成 Drop/panic、源码跨包契约及所有必需后端必须各有叶子与用例。 -完整 P1 退出门禁仍开放。初始 `safe-core-regression-v3` 清单固定 26 用例:除以新版本记录两个现已可执行的模式/捕获预期外,保留 v2 源码契约,并增加综合 MIR 类别/投影示例。不可变的 v2 回归清单保持原样。当前扩展清单版本为 `p1-expanded-suites-v2-manifest.json`(清单版本 2、差分套件版本 4);其中的 `p1-differential-v3` 与 `p1-platform-v2` 套件包含带不可变哈希的 56 个有界源码夹具,并由有界差分/平台运行器生成带来源证明的报告。P1-07、P1-09 和全部十个 P1-10 实施叶子均基于已记录本地证据为 ✅ 已完成。P1-GATE.01–.03 为 🚧 进行中,.04–.06 仍为 ⏳ 计划中。 +初始 `safe-core-regression-v3` 清单固定 26 用例:除以新版本记录两个现已可执行的模式/捕获预期外,保留 v2 源码契约,并增加综合 MIR 类别/投影示例。不可变的 v2 回归清单保持原样。当前扩展清单版本为 `p1-expanded-suites-v2-manifest.json`(清单版本 2、差分套件版本 4);其中的 `p1-differential-v3` 与 `p1-platform-v2` 套件包含带不可变哈希的 56 个有界源码夹具,并由有界差分/平台运行器生成带来源证明的报告。P1-07、P1-09 和全部十个 P1-10 实施叶子均基于已记录本地证据为 ✅ 已完成。P1-GATE.01 至 P1-GATE.06 已 ✅ 已完成。详见[P1 结项记录](../p1-completion_zh.md)。 [后续证据审计](../p1-evidence-audit_zh.md)保留此前可执行语义源码及本地 32/32 差分、Windows 24/24 平台结果。当前 P1-10 证据在 Windows 与 Ubuntu Linux x64 均重新通过 32/32 差分及 24/24 CoreCLR/ILVerify/Native AOT 用例,进程清理完整。严格聚合通过 15/15,并明确记录 `fullP1Closure=false`;远程 CI 及完整 P1 语言/闭环门禁保持独立。 -[P1-08 实现记录](../p1-08-implementation_zh.md)的全部十四个叶子为 ✅ 已完成。历史 E9 将零警告/零错误的 Release 构建及 894/894 回归绑定到 `p1-drop-closure-v3`:26 项 rustc 一致加两项冻结的正常清理契约差异、原始 PE ILVerify 30/30,以及每个平台 Windows/Ubuntu WSL 的 Native AOT 28/28 与 callable 7/7。接口包含两个原始 PE 产物;Linux 目标为 `linux-x64`,实际宿主为 `ubuntu.24.04-x64`。最终报告进程/临时宿主清理、历史父进程链限制与九个保留工作区对象分别披露。当前 `p1-drop-closure-v4` 记录 Windows 26 项 rustc 一致加两项差异、Linux 25 项一致加三项差异。额外的 Linux `unwind-own-drop-body-failure` 轨迹差异已披露,尚未获 P1 语言门禁批准。源码 `panic!` 仍不支持,256 个源码局部值限制仍受检查。P1-09 和 P1-10 基于已记录的本地证据为 ✅ 已完成;P1-GATE.01–.03 为 🚧 进行中,.04–.06 仍为 ⏳ 计划中。 +[P1-08 实现记录](../p1-08-implementation_zh.md)的全部十四个叶子为 ✅ 已完成。历史 E9 将零警告/零错误的 Release 构建及 894/894 回归绑定到 `p1-drop-closure-v3`:26 项 rustc 一致加两项冻结的正常清理契约差异、原始 PE ILVerify 30/30,以及每个平台 Windows/Ubuntu WSL 的 Native AOT 28/28 与 callable 7/7。接口包含两个原始 PE 产物;Linux 目标为 `linux-x64`,实际宿主为 `ubuntu.24.04-x64`。最终报告进程/临时宿主清理、历史父进程链限制与九个保留工作区对象分别披露。历史 `p1-drop-closure-v4` 记录 Windows 26 项 rustc 一致加两项差异、Linux 25 项一致加三项差异。额外的 Linux `unwind-own-drop-body-failure` 轨迹差异已披露,尚未获 P1 语言门禁批准。源码 `panic!` 仍不支持,256 个源码局部值限制仍受检查。P1-09 和 P1-10 基于已记录的本地证据为 ✅ 已完成;P1-GATE.01 至 P1-GATE.06 已 ✅ 已完成。详见[P1 结项记录](../p1-completion_zh.md)。 [P1-10 实现记录](../p1-10-implementation_zh.md)将固定本地候选 `0a415e25c362f8a35c09cb9e1163f5ce30accf82`、树 `e1448fc1ff7314f9c6fa5fd581642bbd3428ee95` 及 631 个编译器/测试/工具输入绑定到每个原生宿主的七类报告。Windows 与 Ubuntu Linux x64 分别通过零警告/零错误的 Release、969/969 项完整测试、32/32 项差分、24/24 项平台、60/60 项基线审计及 631/631 项源码快照。覆盖账本校验 40 个需求及 160 条清单记录,不执行 160 项语义用例。15/15 套件聚合仅闭环 P1-10 实现;此候选尚未运行远程 CI。 @@ -199,7 +199,7 @@ ILVerify 和 AOT 报告。全部最终套件记录的失败、阻塞及跳过均 | P1-10.05 | ✅ 已完成 | 借用/Drop 差分进程运行器 | P1-10.02 | 以确切 rustc 1.98 执行每个固定 v3 源码;失败时也记录版本、命令、PID/启动/父进程、超时、终止和清理。 | `P1ExpandedDifferentialRunner` 与 `p1-differential-v3-final2.json` 为全部 32 个用例提供有界证据,其中借用 20/20、Drop 6/6,失败、阻塞和跳过均为零。 | | P1-10.06 | ✅ 已完成 | 扩展原生平台执行运行器 | P1-10.02 | 每个可执行类别/包用例在 Windows/Linux x64 经 CoreCLR、ILVerify、原生 AOT;声明的非运行负例仍按诊断验收。 | `P1ExpandedPlatformRunner` 在固定本地候选的 Windows 与 Ubuntu Linux x64 均执行全部 24 个语义用例;CoreCLR、ILVerify 和 Native AOT 通过 24/24,执行及清理有界;E10。 | | P1-10.07 | ✅ 已完成 | 绑定报告到源码、工具和用例清单 | P1-10.03, P1-10.05, P1-10.06 | 报告包含编译器 SHA、清单哈希、平台/RID、runtime/SDK/oracle 版本、边界及清理;空/缺失/重复/陈旧记录失败。 | `P1EvidenceBindingValidator` 按冻结 ID、源码/期望哈希、输出、原生宿主/工具及每个后端进程封套校验 24/24 报告。 | -| P1-10.08 | ✅ 已完成 | 聚合语义覆盖与平台证据 | P1-10.07 | 聚合器要求同一候选 SHA 的扩展固定分母及每个必需叶子/后端;仅 6 份旧报告不能关闭新契约。 | `eng/Test-P1SuiteGate.ps1` 和 `eng/P1SuiteEvidenceValidation.ps1` 绑定每个原生宿主的七类报告、准确源码/编译器哈希及需求/后端覆盖。`artifacts/p1-10/p1-suite-gate.json` 在候选 `0a415e25c362f8a35c09cb9e1163f5ce30accf82` 通过 15/15,`fullP1Closure=false`;E10。独立的完整 P1 门禁仍为 `eng/Test-P1CandidateGate.ps1`。 | +| P1-10.08 | ✅ 已完成 | 聚合语义覆盖与平台证据 | P1-10.07 | 聚合器要求同一候选 SHA 的扩展固定分母及每个必需叶子/后端;仅 6 份旧报告不能关闭新契约。 | `eng/Test-P1SuiteGate.ps1` 和 `eng/P1SuiteEvidenceValidation.ps1` 绑定每个原生宿主的七类报告、准确源码/编译器哈希及需求/后端覆盖。`artifacts/p1-10/p1-suite-gate.json` 在候选 `0a415e25c362f8a35c09cb9e1163f5ce30accf82` 通过 15/15,`fullP1Closure=false`;E10。[P1 结项记录](../p1-completion_zh.md)绑定独立的原生 CI 门禁。 | | P1-10.09 | ✅ 已完成 | CI 报告发布与失败来源 | P1-10.08 | 两个原生任务上传成功/失败报告并有稳定 run/artifact 引用;设施不可用记阻塞,不记通过/跳过。 | 手动 `.github/workflows/p1-expanded.yml` 实现准确 SHA 的原生执行、成功/失败时发布、run/attempt/artifact 引用及哈希对账。八项离线发布契约检查通过。实现闭环不声称远程 CI 已运行;其执行仍归 P1-GATE.05。 | | P1-10.10 | ✅ 已完成 | 审计回归保留与全新候选验证 | P1-10.09, P1-10.04 | 完整 Release 工具至少 464 用例并加新增项,失败/跳过及构建警告/错误为零;旧套件不可变,新套件固定分母。 | 成对 Release 构建零警告/零错误;每个完整测试工具均通过实际已注册的 969/969 清单,失败/跳过/未执行为零。`eng/Test-P1RegressionAudit.ps1` 通过 60/60;源码快照验证 631/631 个固定输入,严格聚合通过 15/15;E10。 | @@ -209,16 +209,16 @@ ILVerify 和 AOT 报告。全部最终套件记录的失败、阻塞及跳过均 | ID | 状态 | 交付物 / 文件所有权 | 依赖 | 完成条件 | 证据 | | --- | --- | --- | --- | --- | --- | -| P1-GATE.01 | 🚧 进行中 | 关闭固定语言清单 | P0-GATE, P1-01, P1-02, P1-03, P1-04, P1-05, P1-06 | P1-06.01 每个必需可执行/仅检查/拒绝边界都有指定已完成叶子及用例证据,没有未映射类别。 | 计划候选 SHA 的需求覆盖审计 | -| P1-GATE.02 | 🚧 进行中 | 关闭源码所有权与生成清理语义 | P1-07, P1-08 | 固定借用/Drop 用例符合 rustc 1.98 或已批准版本化差异;仅模拟跟踪不能满足发射行为要求。 | 计划借用/Drop 关闭报告 | -| P1-GATE.03 | 🚧 进行中 | 关闭源码包/后端集成 | P1-09 | 每个源码导入类别有对账元数据及生成的 CoreCLR/ILVerify/Windows/Linux AOT 证据。 | 计划源码包覆盖报告 | -| P1-GATE.04 | 🚧 进行中 | 关闭固定测试与报告契约 | P1-10 | 所有保留与扩展分母通过,failed/blocked/skipped 均为零;负向证据测试拒绝缺失覆盖。 | 计划扩展回归/差分/平台聚合器报告 | -| P1-GATE.05 | ⏳ 计划中 | 核验同一推送 SHA 的双原生 x64 平台 | P1-GATE.01, P1-GATE.02, P1-GATE.03, P1-GATE.04 | 所有必需任务在候选 SHA 通过;下载报告对账哈希/计数/平台/版本,而非只看徽章颜色。 | 计划稳定 Windows/Linux 运行链接及制品来源证明 | -| P1-GATE.06 | ⏳ 计划中 | 发布 P1 关闭记录与同步状态 | P1-GATE.05 | 记录叶子 ID、清单版本、分母、SHA/run 链接、干净差异和自有资源清理;双语状态同时更新。 | 计划 `docs/p1-completion.md`;本步骤不新增验收条件 | +| P1-GATE.01 | ✅ 已完成 | 关闭固定语言清单 | P0-GATE, P1-01, P1-02, P1-03, P1-04, P1-05, P1-06 | 两份原生报告绑定 40 项需求、160 条目录记录及 440 个注册用例。后端矩阵 24 项全部通过。 | 本地覆盖验证通过 10/10 项检查,涵盖 40 项需求和 160 条目录记录。验证器绑定 `b5dc186` 中已审查的泛型 CLI 测试修订,并核验冻结用例 ID。完整候选回归和 24 项后端/RID 组合仍需同一 SHA 的证据。 | +| P1-GATE.02 | ✅ 已完成 | 关闭源码所有权与生成清理语义 | P1-07, P1-08 | 每台原生宿主的所有权差分通过,NativeV5 有 26 项与 rustc 精确一致及两项已批准差异,Native AOT 通过 28/28,可调用检查通过 7/7,ILVerify 通过 30/30。 | 本地 Windows NativeV5 运行全部 28 项生成 Drop 用例,26 项与 rustc 1.98 精确一致,另两项符合已批准差异。Native AOT 通过 28/28,可调用检查通过 7/7,全部 30 个原始 PE 通过 ILVerify。仍需在同一候选 SHA 对账固定所有权差分及 Windows/Linux 原生报告。 | +| P1-GATE.03 | ✅ 已完成 | 关闭源码包/后端集成 | P1-09 | 每台原生宿主通过 19 项源码包用例、39 个原始 PE 的 ILVerify 以及 CoreCLR 和 Native AOT 执行。保留制品矩阵通过。 | 计划源码包覆盖报告 | +| P1-GATE.04 | ✅ 已完成 | 关闭固定测试与报告契约 | P1-10 | 执行并对账所有冻结历史和扩展用例,核验已版本化的预期,且负向证据测试拒绝缺失覆盖。 | 计划扩展回归/差分/平台聚合器报告 | +| P1-GATE.05 | ✅ 已完成 | 核验同一推送 SHA 的双原生 x64 平台 | P1-GATE.01, P1-GATE.02, P1-GATE.03, P1-GATE.04 | [运行 46292548611](https://github.com/IoTSharp/RustSharp/actions/runs/46292548611) 对 `9d483a9` 的八个任务全部通过,报告及制品哈希对账一致。 | 计划稳定 Windows/Linux 运行链接及制品来源证明 | +| P1-GATE.06 | ✅ 已完成 | 发布 P1 关闭记录与同步状态 | P1-GATE.05 | [双语结项记录](../p1-completion_zh.md)及[报告绑定](../p1-completion.json)。 | 计划 `docs/p1-completion.md`;本步骤不新增验收条件 | ## 下一批可交付工作及并行边界 -1. P1-06 基于冻结范围账本与 E8 实现证据为 ✅ 已完成。P1-07 为 ✅ 已完成:全部十二个所有权叶子、四个诊断黄金用例及 20 项借用闭环均通过。P1-08 基于全部十四个叶子与 E9 生成程序/后端证据为 ✅ 已完成。P1-09 基于十九项源码包证据为 ✅ 已完成。全部十个 P1-10 叶子均在 E10 的固定本地候选 ✅ 已完成;P1-GATE.01–.03 为 🚧 进行中,.04–.06 仍为 ⏳ 计划中。 +1. P1-06 基于冻结范围账本与 E8 实现证据为 ✅ 已完成。P1-07 为 ✅ 已完成:全部十二个所有权叶子、四个诊断黄金用例及 20 项借用闭环均通过。P1-08 基于全部十四个叶子与 E9 生成程序/后端证据为 ✅ 已完成。P1-09 基于十九项源码包证据为 ✅ 已完成。全部十个 P1-10 叶子均在 E10 的固定本地候选 ✅ 已完成;P1-GATE.01 至 P1-GATE.06 已 ✅ 已完成。详见[P1 结项记录](../p1-completion_zh.md)。 2. P1-06.04/.05/.08/.09 提供 place/引用/切片前置。P1-07 的所有权与 P1-08 的本地析构/panic 交付均为 ✅ 已完成。后续修改同一 `SafeCoreMirLowering.cs` 或 validator 时必须串行集成,不能让不同智能体同时写该文件。 3. P1-09.01 至 .10 及 P1-10.01 至 .10 基于各自已记录的本地证据为 ✅ 已完成。额外 Linux Drop 差异已披露但尚未获 P1 语言门禁批准;完整 P1 闭环保持独立。 4. 在已推送候选 SHA 逐项对账 P1-GATE.01 至 .06,包括原生 CI 执行与发布;保留既有库探针与手工 LIR 测试。 diff --git a/docs/roadmap/P2-HANDOFF.md b/docs/roadmap/P2-HANDOFF.md index 2f5d143..d75960b 100644 --- a/docs/roadmap/P2-HANDOFF.md +++ b/docs/roadmap/P2-HANDOFF.md @@ -6,7 +6,7 @@ English | [简体中文](P2-HANDOFF_zh.md) | [P2 contract](P2.md) ## Current P2-01 runtime checkpoint — 2026-10-23 -🚧 P2-01.01 is ✅ Complete with the frozen `core-v1` contract: 42 cases, 28 members, seven families, six bounded targets, and exact canonical hash validation. The managed-hybrid `RustSharp.Runtime.Core` implementation now passes 32/32 CoreCLR runtime cases plus Windows x64 and Ubuntu Linux x64 Native AOT smoke consumers for `Option`, `Result`, formatting, comparison, hashing, and iterators. P2-01.02–.06 remain 🚧 In progress because the Rust# generic enum front-end, language-level trait lowering, generated export inventory, ILVerify binding, and invalid generated-consumer diagnostics are still open. The P2 parent and phase remain open. +P2-01.01 is 🚧 In progress pending P1-GATE. The frozen `core-v1` contract records 42 cases, 28 members, seven families, six bounded targets, and exact canonical hash validation. The managed-hybrid `RustSharp.Runtime.Core` implementation passes 32/32 CoreCLR runtime cases plus Windows x64 and Ubuntu Linux x64 Native AOT smoke consumers for `Option`, `Result`, formatting, comparison, hashing, and iterators. P2-01.02–.06 remain 🚧 In progress because the Rust# generic enum front-end, language-level trait lowering, generated export inventory, ILVerify binding, and invalid generated-consumer diagnostics are still open. The P2 parent and phase remain open. ## Current supervision entry — 2026-10-14 diff --git a/docs/roadmap/P2-HANDOFF_zh.md b/docs/roadmap/P2-HANDOFF_zh.md index 4618b0d..c5614fa 100644 --- a/docs/roadmap/P2-HANDOFF_zh.md +++ b/docs/roadmap/P2-HANDOFF_zh.md @@ -6,7 +6,7 @@ ## 当前 P2-01 运行时检查点 — 2026-10-23 -🚧 P2-01.01 已 ✅ 已完成并冻结 `core-v1` 契约:42 个用例、28 个成员、七个家族、六个有界目标及精确规范哈希验证。托管混合 `RustSharp.Runtime.Core` 实现现已通过 32/32 个 CoreCLR 运行时用例,以及 Windows x64 和 Ubuntu Linux x64 Native AOT 的 `Option`、`Result`、格式化、比较、哈希和迭代器冒烟消费者。P2-01.02–.06 仍为 🚧 进行中,因为 Rust# 泛型枚举前端、语言级 trait 降低、生成导出清单、ILVerify 绑定和无效生成消费者诊断仍开放。P2 父项和阶段保持开放。 +P2-01.01 为 🚧 进行中,等待 P1-GATE。冻结的 `core-v1` 契约记录了 42 个用例、28 个成员、七个家族、六个有界目标及精确规范哈希验证。托管混合 `RustSharp.Runtime.Core` 实现通过 32/32 个 CoreCLR 运行时用例,以及 Windows x64 和 Ubuntu Linux x64 Native AOT 的 `Option`、`Result`、格式化、比较、哈希和迭代器冒烟消费者。P2-01.02–.06 仍为 🚧 进行中,因为 Rust# 泛型枚举前端、语言级 trait 降低、生成导出清单、ILVerify 绑定和无效生成消费者诊断仍开放。P2 父项和阶段保持开放。 ## 当前监督入口 — 2026-10-14 diff --git a/docs/roadmap/P2.md b/docs/roadmap/P2.md index a32feef..d19cf16 100644 --- a/docs/roadmap/P2.md +++ b/docs/roadmap/P2.md @@ -42,7 +42,7 @@ Parent hard dependency: `P1-GATE`. | ID | Status | Deliverable / ownership | Depends on | Done when | Evidence | | --- | --- | --- | --- | --- | --- | -| P2-01.01 | ✅ Complete | Freeze `core-v1` API/signature, trait, and case manifest; `library/core/`, conformance manifests. | P1-GATE | All seven parent families have named members, positive/error/boundary cases, and a fixed denominator; unknown members are classified. | `test:core-manifest`; [contract evidence](../evidence/p2/P2-01.01.json). The 42-case inventory, 28-member surface, seven families, six bounded targets and explicit `runtimeEvidence=false` claim are validated; runtime implementation remains in P2-01.02–.06. | +| P2-01.01 | 🚧 In progress | Freeze `core-v1` API/signature, trait, and case manifest; `library/core/`, conformance manifests. | P1-GATE | All seven parent families have named members, positive/error/boundary cases, and a fixed denominator; unknown members are classified. | `test:core-manifest`; [contract evidence](../evidence/p2/P2-01.01.json). The contract evidence validates the 42-case inventory, 28-member surface, seven families, six bounded targets and `runtimeEvidence=false`. Formal closure awaits P1-GATE. | | P2-01.02 | 🚧 In progress | Primitive operations and managed-hybrid `Option`/`Result`; `RustSharp.Runtime.Core`. | P2-01.01 | Runtime constructors, matching, combinators, and error propagation pass 12/12 CoreCLR tests and Windows/Linux x64 Native AOT smoke consumers; Rust# generic enum/front-end integration remains open. | [Runtime evidence](../evidence/p2/P2-01.runtime.json); generated Rust# consumer and diagnostic matrix remain open. | | P2-01.03 | 🚧 In progress | Formatting and display/debug adapters; `RustSharp.Runtime.Core`. | P2-01.01 | Runtime display/debug, UTF-8 and budget cases pass 6/6 on CoreCLR and Windows/Linux x64 Native AOT; Rust# formatting trait integration remains open. | [Runtime evidence](../evidence/p2/P2-01.runtime.json); language-level format consumer remains open. | | P2-01.04 | 🚧 In progress | Comparison and hashing contracts; `RustSharp.Runtime.Core`. | P2-01.02 | Runtime equality/order/float partial comparison and stable hashing pass 6/6 on CoreCLR and Windows/Linux x64 Native AOT; Rust# trait lowering remains open. | [Runtime evidence](../evidence/p2/P2-01.runtime.json); language-level comparison/hash consumer remains open. | diff --git a/docs/roadmap/P2_zh.md b/docs/roadmap/P2_zh.md index 7b1fe59..7b11177 100644 --- a/docs/roadmap/P2_zh.md +++ b/docs/roadmap/P2_zh.md @@ -33,7 +33,7 @@ VS Code、CLI 和应用平台门槛覆盖 Windows 与 Linux x64。 | ID | 状态 | 交付物 / 所有权 | 依赖 | 完成条件 | 证据 | | --- | --- | --- | --- | --- | --- | -| P2-01.01 | ✅ 已完成 | 冻结 `core-v1` API/签名、trait 与用例清单;`library/core/`、一致性清单。 | P1-GATE | 父任务全部七个功能族都有具名成员、正向/错误/边界用例及固定分母;未知成员已分类。 | `test:core-manifest`;[契约证据](../evidence/p2/P2-01.01.json)。42 个固定用例、28 个成员、七个家族、六个有界目标及明确的 `runtimeEvidence=false` 声明均已验证;运行时实现仍属于 P2-01.02–.06。 | +| P2-01.01 | 🚧 进行中 | 冻结 `core-v1` API/签名、trait 与用例清单;`library/core/`、一致性清单。 | P1-GATE | 父任务全部七个功能族都有具名成员、正向/错误/边界用例及固定分母;未知成员已分类。 | `test:core-manifest`;[契约证据](../evidence/p2/P2-01.01.json)验证了 42 个固定用例、28 个成员、七个家族、六个有界目标和 `runtimeEvidence=false`。正式结项需等待 P1-GATE。 | | P2-01.02 | 🚧 进行中 | 原语操作及托管混合 `Option`/`Result`;`RustSharp.Runtime.Core`。 | P2-01.01 | 运行时构造、匹配、组合器和错误传播通过 CoreCLR 12/12 及 Windows/Linux x64 Native AOT 冒烟消费者;Rust# 泛型枚举/前端集成仍开放。 | [运行时证据](../evidence/p2/P2-01.runtime.json);生成 Rust# 消费者与诊断矩阵仍开放。 | | P2-01.03 | 🚧 进行中 | 格式化及 display/debug 适配器;`RustSharp.Runtime.Core`。 | P2-01.01 | 运行时 display/debug、UTF-8 和预算用例在 CoreCLR 及 Windows/Linux x64 Native AOT 通过 6/6;Rust# 格式化 trait 集成仍开放。 | [运行时证据](../evidence/p2/P2-01.runtime.json);语言级格式化消费者仍开放。 | | P2-01.04 | 🚧 进行中 | 比较与哈希契约;`RustSharp.Runtime.Core`。 | P2-01.02 | 运行时相等/排序/浮点部分比较和稳定哈希在 CoreCLR 及 Windows/Linux x64 Native AOT 通过 6/6;Rust# trait 降低仍开放。 | [运行时证据](../evidence/p2/P2-01.runtime.json);语言级比较/哈希消费者仍开放。 | diff --git a/eng/Invoke-DocumentationNativeCi.ps1 b/eng/Invoke-DocumentationNativeCi.ps1 new file mode 100644 index 0000000..74e3666 --- /dev/null +++ b/eng/Invoke-DocumentationNativeCi.ps1 @@ -0,0 +1,69 @@ +[CmdletBinding()] +param() +Set-StrictMode -Version 3 +$ErrorActionPreference='Stop' +if($PSVersionTable.PSVersion.Major -lt 7){throw 'PowerShell7 required'} +if([Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString() -ne 'X64'){throw 'Native x64 required'} +$actualRid=if($IsWindows){'win-x64'}elseif($IsLinux){'linux-x64'}else{throw 'Unsupported OS'} +if($env:TOOL_RID -ne $actualRid){throw 'Native OS/RID mismatch'} +$head=(& git rev-parse HEAD).Trim() +if($LASTEXITCODE -ne 0 -or $head -ne $env:CANDIDATE_SHA){throw 'Exact candidate SHA mismatch'} +$root=Join-Path $PWD ('artifacts/p2-doc-native/'+$actualRid) +if(Test-Path -LiteralPath $root){throw 'Fresh output required'} +[IO.Directory]::CreateDirectory($root)|Out-Null +$bin=Join-Path $root 'bin' +$dotnet=(Get-Command dotnet -ErrorAction Stop).Source +$paths=@(& git ls-files) +if($LASTEXITCODE -ne 0 -or $paths.Count -gt 20000){throw 'Source inventory failed/bound exceeded'} + +$deadline=[Threading.CancellationTokenSource]::new([TimeSpan]::FromMinutes(21)) +function Get-SourceHashes([bool]$CheckCancellation=$true) { + $clock=[Diagnostics.Stopwatch]::StartNew() + foreach($path in $paths){if($CheckCancellation){$deadline.Token.ThrowIfCancellationRequested()};if($clock.Elapsed.TotalSeconds -gt 30){throw 'Source hash wall bound'};[ordered]@{path=$path;sha256=(Get-FileHash -Algorithm SHA256 -LiteralPath $path).Hash}} +} +function Run-Case([string]$name,[string[]]$arguments,[int]$seconds){ + $deadline.Token.ThrowIfCancellationRequested() + Write-Host ('Starting '+$name+' at '+[DateTimeOffset]::UtcNow.ToString('o')) + & (Join-Path $PWD 'eng/Invoke-BoundedProcess.ps1') -FilePath $dotnet -ArgumentList $arguments -TimeoutSeconds $seconds -CapturePrefix (Join-Path $root $name) -MaximumOutputBytes 33554432 -CancellationToken $deadline.Token +} +$eight=@('default-virtual-rejected','optin-virtual-two-members','optin-root-plus-members','existing-target-unchanged','dependency-family-rejected','feature-family-rejected','output-byte-budget','real-child-deadline') +$twenty=@('initial-success-hashes','nested-modules-source-hashes','existing-target-unchanged','missing-manifest','virtual-workspace-unsupported','dependency-unsupported','feature-unsupported','multiple-targets-unsupported','invalid-arguments','invalid-option','noncargo-input','unsafe-module-path','missing-module','malformed-source','pre-cancel','mid-workspace-cancel','deadline-after-workspace','unsafe-output-parent','unsafe-documentation-scheme','missing-documentation-symbol') +$specs=@(@{file='workspace-cli-eight.json';switch='--p2-doc-workspace-cli-component';names=$eight;prefix='P2-08.03 workspace CLI process '},@{file='command-api-twenty.json';switch='--p2-doc-cli-component';names=$twenty;prefix='P2-08.03 CLI '}) +foreach($spec in $specs){$cases=@(foreach($name in $spec.names){@{name=($spec.prefix+$name);status='not-run';error='Candidate command has not started.'}});@{denominator=$spec.names.Count;executed=0;passed=0;failed=0;notRun=$spec.names.Count;cases=$cases;fullLeafAccepted=$false;fullP2Closure=$false}|ConvertTo-Json -Depth 6|Set-Content -LiteralPath (Join-Path $root $spec.file) -Encoding utf8} +$before=@() +$status='NOT_RUN';$failure=$null;$actualSdk=$null +try{ + $before=@(Get-SourceHashes) + Run-Case 'sdk-version' @('--version') 10 + $actualSdk=([IO.File]::ReadAllText((Join-Path $root 'sdk-version.stdout.log'))).Trim() + $pinnedSdk=(Get-Content -Raw -LiteralPath (Join-Path $PWD 'global.json') | ConvertFrom-Json).sdk.version + if($actualSdk -cne $pinnedSdk){throw "Actual SDK $actualSdk does not match global.json pin $pinnedSdk"} + Run-Case 'restore' @('restore','RustSharp.slnx') 300 + Run-Case 'fresh-build' @('build','RustSharp.slnx','-c','Release','--no-restore','--no-incremental','-m:1',('-p:OutDir='+$bin+[IO.Path]::DirectorySeparatorChar)) 600 + $tests=Join-Path $bin 'RustSharp.Tests.dll' + foreach($spec in $specs){ + $report=Join-Path $root $spec.file + # Runner requires a new caller-owned report. Preserve NOT_RUN original before replacement. + $pending=$report+'.not-run-original.json' + [IO.File]::Move($report,$pending) + try{Run-Case $spec.file @($tests,$spec.switch,$report) 200} + finally{if(-not(Test-Path -LiteralPath $report)){[IO.File]::Copy($pending,$report)}} + $result=Get-Content -Raw -LiteralPath $report|ConvertFrom-Json + $actualNames=@($result.cases|ForEach-Object{[string]$_.name});$expectedNames=@($spec.names|ForEach-Object{$spec.prefix+$_}) + $seen=[Collections.Generic.HashSet[string]]::new([StringComparer]::Ordinal) + for($index=0;$index -lt $expectedNames.Count -and $index -lt 20;$index++){$deadline.Token.ThrowIfCancellationRequested();if($index -ge $actualNames.Count -or -not $seen.Add($actualNames[$index]) -or $actualNames[$index] -cne $expectedNames[$index] -or $result.cases[$index].status -cne 'passed' -or ($null -ne $result.cases[$index].PSObject.Properties['error'] -and -not [string]::IsNullOrEmpty([string]$result.cases[$index].error))){throw 'Duplicate, unknown or reordered fixed case identity'}} + if($result.denominator -ne $spec.names.Count -or $result.executed -ne $spec.names.Count -or $result.passed -ne $spec.names.Count -or $result.failed -ne 0 -or $result.notRun -ne 0 -or $result.cases.Count -ne $spec.names.Count){throw 'Full fixed component denominator failed'} + } + $status='COMPONENTS_PASSED' +}catch{$status='FAILED';$failure=$_.ToString();throw} +finally{ + try{ + $after=@();$bindingError=$null;try{$after=@(Get-SourceHashes $false)}catch{$bindingError=$_.ToString()} + $artifacts=@();try{$artifacts=@(foreach($name in @('RustSharp.Tests.dll','RustSharp.Tests.pdb','rsc.dll','rsc.pdb','RustSharp.Compiler.dll','RustSharp.Compiler.pdb')){$path=Join-Path $bin $name;if(Test-Path -LiteralPath $path){@{path=$name;sha256=(Get-FileHash -Algorithm SHA256 -LiteralPath $path).Hash}}})}catch{$bindingError=[string]$bindingError+$_.ToString()} + $stable=($before|ConvertTo-Json -Depth 5 -Compress) -eq ($after|ConvertTo-Json -Depth 5 -Compress) + $bindingInvalid=(-not [string]::IsNullOrEmpty([string]$bindingError)) -or $artifacts.Count -ne 6 -or -not $stable + if($bindingInvalid){$status='FAILED';$failure=[string]$failure+' Binding incomplete: error='+[string]$bindingError+'; binaries='+$artifacts.Count+'/6; sourcesStable='+$stable} + @{schemaVersion=1;candidateSha=$head;rid=$actualRid;runId=$env:GITHUB_RUN_ID;status=$status;failure=$failure;bindingError=$bindingError;powerShell=$PSVersionTable.PSVersion.ToString();dotnet=$dotnet;actualSdk=$actualSdk;sourceBefore=$before;sourceAfter=$after;sourcesStable=$stable;binaries=$artifacts;fullLeafAccepted=$false;fullP2Closure=$false;originalContainmentPhaseAccepted=$false;cleanupContract='Invoke-BoundedProcess metadata preserves parent-exit-only limitation; not original full-containment proof'}|ConvertTo-Json -Depth 10|Set-Content -LiteralPath (Join-Path $root 'candidate-binding.json') -Encoding utf8 + if($bindingInvalid){throw ('Mandatory candidate binding failed: '+$failure)} + }finally{$deadline.Dispose()} +} diff --git a/eng/Invoke-P1NativeDropEvidence.ps1 b/eng/Invoke-P1NativeDropEvidence.ps1 index 06b69a4..eb52958 100644 --- a/eng/Invoke-P1NativeDropEvidence.ps1 +++ b/eng/Invoke-P1NativeDropEvidence.ps1 @@ -215,10 +215,15 @@ try { $directory=Resolve-OwnedPath $directory if([IO.Directory]::Exists($directory)){throw 'An exclusive fresh native Drop receipt directory is required.'} [IO.Directory]::CreateDirectory($directory)|Out-Null - $env:RUSTSHARP_NATIVE_AOT_SDK_VERSION='10.0.401' + $sdk = (Read-Report 'global.json' 4096).sdk + $sdkVersion = [string]$sdk.version + if ($sdkVersion -cnotmatch '^\d+\.\d+\.\d+$' -or $sdk.rollForward -cne 'disable' -or $sdk.allowPrerelease -cne $false) { + throw 'Native Drop requires an exact stable SDK pin in global.json.' + } + $env:RUSTSHARP_NATIVE_AOT_SDK_VERSION = $sdkVersion $env:RUSTSHARP_DOTNET_PATH=$dotnet $env:RUSTSHARP_RUSTC_PATH=$rustc - Launch 'fresh-release' $pwsh @('-NoLogo','-NoProfile','-File','eng/Invoke-P1ReleaseBuild.ps1','-CandidateSha',$CandidateSha,'-SdkVersion','10.0.401','-DotNetPath',$dotnet,'-ReportPath',$buildPath) 750 + Launch 'fresh-release' $pwsh @('-NoLogo','-NoProfile','-File','eng/Invoke-P1ReleaseBuild.ps1','-CandidateSha',$CandidateSha,'-SdkVersion',$sdkVersion,'-DotNetPath',$dotnet,'-ReportPath',$buildPath) 750 Launch 'snapshot' $pwsh @('-NoLogo','-NoProfile','-File','eng/Get-P1SourceSnapshot.ps1','-CandidateSha',$CandidateSha,'-EvidencePath',$snapshotPath,'-DeadlineSeconds','90') 100 $build = Read-Report $buildPath $snapshot = Read-Report $snapshotPath diff --git a/eng/Invoke-P1PlatformEvidence.ps1 b/eng/Invoke-P1PlatformEvidence.ps1 index 41af976..64e4ed3 100644 --- a/eng/Invoke-P1PlatformEvidence.ps1 +++ b/eng/Invoke-P1PlatformEvidence.ps1 @@ -27,7 +27,7 @@ param( [int] $TotalTimeoutMinutes = 30, [Parameter()] - [string] $SdkVersion = '10.0.401' + [string] $SdkVersion ) Set-StrictMode -Version 3.0 @@ -38,6 +38,9 @@ if ($PSVersionTable.PSVersion.Major -lt 7) { } $scriptRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..')) +if ([string]::IsNullOrEmpty($SdkVersion)) { + $SdkVersion = (Get-Content -LiteralPath (Join-Path $scriptRoot 'global.json') -Raw | ConvertFrom-Json).sdk.version +} $manifestPath = Join-Path $scriptRoot 'tools/RustSharp.Conformance/fixtures/p1-differential-v2-manifest.json' $cliPath = Join-Path $scriptRoot 'src/RustSharp.Cli/bin/Release/net10.0/rsc.dll' $ilVerifyScript = Join-Path $scriptRoot 'eng/Invoke-ILVerify.ps1' diff --git a/eng/Invoke-P1ProductionNativeEvidence.ps1 b/eng/Invoke-P1ProductionNativeEvidence.ps1 index 71ae9f2..3d27e3f 100644 --- a/eng/Invoke-P1ProductionNativeEvidence.ps1 +++ b/eng/Invoke-P1ProductionNativeEvidence.ps1 @@ -107,7 +107,12 @@ try { $null = [IO.Directory]::CreateDirectory($directory) $pwsh = if ($IsWindows) { 'C:\Program Files\PowerShell\7\pwsh.exe' } else { (Get-Command pwsh -CommandType Application -ErrorAction Stop | Select-Object -First 1).Source } $dotnet = (Get-Command dotnet -CommandType Application -ErrorAction Stop | Select-Object -First 1).Source - $env:RUSTSHARP_NATIVE_AOT_SDK_VERSION = '10.0.401' + $sdk = (Read-Json 'global.json' 4096).sdk + $sdkVersion = [string]$sdk.version + if ($sdkVersion -cnotmatch '^\d+\.\d+\.\d+$' -or $sdk.rollForward -cne 'disable' -or $sdk.allowPrerelease -cne $false) { + throw 'Native production evidence requires an exact stable SDK pin in global.json.' + } + $env:RUSTSHARP_NATIVE_AOT_SDK_VERSION = $sdkVersion $env:RUSTSHARP_P1_DOTNET_PATH = $dotnet $env:RUSTSHARP_P1_PWSH_PATH = $pwsh # 12 explicit files, no recursive discovery. Source bytes must be retained before execution. @@ -123,13 +128,13 @@ try { if ((File-Binding $retained 1048576).sha256 -cne $binding.sha256) { throw 'Retained source differs from candidate checkout bytes.' } $sources.Add([ordered]@{repositoryPath=$name;retainedPath=$retained;sha256=$binding.sha256}) } - & (Join-Path $PSScriptRoot 'Invoke-BoundedProcess.ps1') -FilePath $pwsh -ArgumentList @('-NoLogo','-NoProfile','-File','eng/Invoke-P1ReleaseBuild.ps1','-CandidateSha',$CandidateSha,'-SdkVersion','10.0.401','-ReportPath',$buildPath) -WorkingDirectory $root -TimeoutSeconds 750 -CapturePrefix ($relativeDirectory + '/release-launch') + & (Join-Path $PSScriptRoot 'Invoke-BoundedProcess.ps1') -FilePath $pwsh -ArgumentList @('-NoLogo','-NoProfile','-File','eng/Invoke-P1ReleaseBuild.ps1','-CandidateSha',$CandidateSha,'-SdkVersion',$sdkVersion,'-ReportPath',$buildPath) -WorkingDirectory $root -TimeoutSeconds 750 -CapturePrefix ($relativeDirectory + '/release-launch') Check-Budget & (Join-Path $PSScriptRoot 'Invoke-BoundedProcess.ps1') -FilePath $pwsh -ArgumentList @('-NoLogo','-NoProfile','-File','eng/Get-P1SourceSnapshot.ps1','-CandidateSha',$CandidateSha,'-EvidencePath',$snapshotPath,'-DeadlineSeconds','90') -WorkingDirectory $root -TimeoutSeconds 100 -CapturePrefix ($relativeDirectory + '/snapshot-launch') $snapshot = Read-Json $snapshotPath 4194304 $build = Read-Json $buildPath 4194304 if ($snapshot.candidateSha -cne $CandidateSha -or $snapshot.verified -ne $true -or $snapshot.treeSha -cnotmatch '^[a-fA-F0-9]{40}$' -or - $build.candidateSha -cne $CandidateSha -or $build.sdkVersion -cne '10.0.401' -or $build.succeeded -ne $true -or $build.summary.warnings -ne 0 -or $build.summary.errors -ne 0) { throw 'A verified same-SHA source snapshot and warning-free SDK401 Release build are required.' } + $build.candidateSha -cne $CandidateSha -or $build.sdkVersion -cne $sdkVersion -or $build.succeeded -ne $true -or $build.summary.warnings -ne 0 -or $build.summary.errors -ne 0) { throw 'A verified same-SHA source snapshot and warning-free Release build using the repository SDK pin are required.' } $tree = $snapshot.treeSha $runner = File-Binding $assembly $retainedRunner = $relativeDirectory + '/RustSharp.Conformance.dll' diff --git a/eng/Invoke-P1ReleaseBuild.ps1 b/eng/Invoke-P1ReleaseBuild.ps1 index 71e215a..81ca958 100644 --- a/eng/Invoke-P1ReleaseBuild.ps1 +++ b/eng/Invoke-P1ReleaseBuild.ps1 @@ -4,7 +4,7 @@ param( [Parameter(Mandatory)][string] $ReportPath, [string] $RepositoryRoot = (Join-Path $PSScriptRoot '..'), [string] $DotNetPath = 'dotnet', - [ValidatePattern('^[0-9]+\.[0-9]+\.[0-9]+$')][string] $SdkVersion = '10.0.400' + [ValidatePattern('^[0-9]+\.[0-9]+\.[0-9]+$')][string] $SdkVersion ) Set-StrictMode -Version 3.0 @@ -12,6 +12,13 @@ $ErrorActionPreference = 'Stop' if ($PSVersionTable.PSVersion.Major -lt 7) { throw 'PowerShell 7 or newer is required.' } . (Join-Path $PSScriptRoot 'P1SuiteEvidenceValidation.ps1') $root = [IO.Path]::GetFullPath($RepositoryRoot) +if ([string]::IsNullOrEmpty($SdkVersion)) { + $pin = (Get-Content -LiteralPath (Join-Path $root 'global.json') -Raw | ConvertFrom-Json).sdk + if ($pin.version -cnotmatch '^[0-9]+\.[0-9]+\.[0-9]+$' -or $pin.rollForward -cne 'disable' -or $pin.allowPrerelease -cne $false) { + throw 'The repository must pin a stable SDK without roll-forward.' + } + $SdkVersion = $pin.version +} $report = [IO.Path]::GetFullPath($ReportPath, $root) $null = [IO.Directory]::CreateDirectory([IO.Path]::GetDirectoryName($report)) $started = [DateTimeOffset]::UtcNow diff --git a/eng/Invoke-P1SuiteReports.ps1 b/eng/Invoke-P1SuiteReports.ps1 index 56a2df0..4760a94 100644 --- a/eng/Invoke-P1SuiteReports.ps1 +++ b/eng/Invoke-P1SuiteReports.ps1 @@ -15,20 +15,44 @@ $failures = [Collections.Generic.List[string]]::new() $pwsh = if ($IsWindows) { 'C:\Program Files\PowerShell\7\pwsh.exe' } else { (Get-Command pwsh -CommandType Application -ErrorAction Stop | Select-Object -First 1).Source } $assembly = 'tools/RustSharp.Conformance/bin/Release/net10.0/RustSharp.Conformance.dll' $harness = 'tests/RustSharp.Tests/bin/Release/net10.0/RustSharp.Tests.dll' +$legacyDirectory = Join-Path $directory 'legacy' +$null = [IO.Directory]::CreateDirectory($legacyDirectory) +$rid = if ($PlatformName -ceq 'windows-x64') { 'win-x64' } else { 'linux-x64' } $invocations = @( @{ name='coverage'; file='dotnet'; timeout=60; arguments=@($assembly,'--profile','p1-coverage-v1','--report',(Join-Path $directory 'p1-coverage-v1.json')) }, @{ name='differential'; file='dotnet'; timeout=930; arguments=@($assembly,'--profile','p1-differential-v3','--oracle','rustc-1.98','--timeout','60','--deadline','900','--report',(Join-Path $directory 'p1-differential-v3.json')) }, @{ name='platform'; file='dotnet'; timeout=930; arguments=@($assembly,'--profile','p1-platform-v2','--timeout','120','--deadline','900','--report',(Join-Path $directory 'p1-platform-v2.json')) }, @{ name='harness'; file='dotnet'; timeout=960; arguments=@($harness,'--report',(Join-Path $directory 'regression-harness.json'),'--candidate-sha',$CandidateSha,'--deadline','900','--timeout','120') }, - @{ name='baseline-audit'; file=$pwsh; timeout=60; arguments=@('-NoLogo','-NoProfile','-File','eng/Test-P1RegressionAudit.ps1','-RepositoryRoot',$root,'-CandidateSha',$CandidateSha,'-ReportPath',(Join-Path $directory 'immutable-regression-audit.json')) } + @{ name='safe-core-regression-v1'; file='dotnet'; timeout=110; capture=$legacyDirectory; arguments=@($assembly,'--profile','safe-core-regression-v1','--oracle','rustc-1.98','--timeout','25','--deadline','100','--report',(Join-Path $legacyDirectory 'safe-core-regression-v1.json')) }, + @{ name='safe-core-regression-v2'; file='dotnet'; timeout=180; capture=$legacyDirectory; arguments=@($assembly,'--profile','safe-core-regression-v2','--oracle','rustc-1.98','--timeout','30','--deadline','170','--report',(Join-Path $legacyDirectory 'safe-core-regression-v2.json')) }, + @{ name='safe-core-regression-v3'; file='dotnet'; timeout=180; capture=$legacyDirectory; arguments=@($assembly,'--profile','safe-core-regression-v3','--oracle','rustc-1.98','--timeout','30','--deadline','170','--report',(Join-Path $legacyDirectory 'safe-core-regression-v3.json')) }, + @{ name='p1-differential-v2'; file='dotnet'; timeout=150; capture=$legacyDirectory; arguments=@($assembly,'--profile','p1-differential-v2','--oracle','rustc-1.98','--timeout','30','--deadline','140','--report',(Join-Path $legacyDirectory 'p1-differential-v2.json')) }, + @{ name='p1-platform-v1'; file=$pwsh; timeout=735; capture=$legacyDirectory; arguments=@('-NoLogo','-NoProfile','-File','eng/Invoke-P1PlatformEvidence.ps1','-PlatformName',$PlatformName,'-RuntimeIdentifier',$rid,'-OutputDirectory',(Join-Path $legacyDirectory 'platform-v1-work'),'-EvidencePath',(Join-Path $legacyDirectory 'p1-platform-v1.json'),'-PublishTimeoutSeconds','120','-TotalTimeoutMinutes','12') }, + @{ name='baseline-audit'; file=$pwsh; timeout=60; arguments=@('-NoLogo','-NoProfile','-File','eng/Test-P1RegressionAudit.ps1','-RepositoryRoot',$root,'-CandidateSha',$CandidateSha,'-ReportPath',(Join-Path $directory 'immutable-regression-audit.json'),'-LegacyEvidenceDirectory',$legacyDirectory) } ) -# Five fixed invocations with an independent 3,000-second wall-clock bound. +# Ten fixed invocations with an independent 4,200-second wall-clock bound. # Each command owns process-tree cleanup and bounded captures in the helper. -foreach ($invocation in $invocations) { - if ($clock.Elapsed.TotalSeconds -ge 3000) { $failures.Add('Native report orchestration deadline expired.'); break } - Write-Host "Running P1 evidence stage: $($invocation.name)." - try { - & (Join-Path $PSScriptRoot 'Invoke-BoundedProcess.ps1') -FilePath $invocation.file -ArgumentList $invocation.arguments -WorkingDirectory $root -TimeoutSeconds ([Math]::Min($invocation.timeout, [Math]::Max(1, 3000 - [int]$clock.Elapsed.TotalSeconds))) -CapturePrefix (Join-Path $directory ($invocation.name + '-launch')) - } catch { $failures.Add($invocation.name + ': ' + $_.Exception.Message); Write-Warning $failures[$failures.Count - 1] } +$sdkVersion = (Get-Content -Raw -LiteralPath (Join-Path $root 'global.json') | ConvertFrom-Json).sdk.version +if ($sdkVersion -notmatch '^\d+\.\d+\.\d+$') { throw 'The repository must pin a stable SDK version.' } +$previousNativeAotSdk = $env:RUSTSHARP_NATIVE_AOT_SDK_VERSION +try { + $env:RUSTSHARP_NATIVE_AOT_SDK_VERSION = $sdkVersion + foreach ($invocation in $invocations) { + if ($clock.Elapsed.TotalSeconds -ge 4200) { $failures.Add('Native report orchestration deadline expired.'); break } + Write-Host "Running P1 evidence stage: $($invocation.name)." + $captureDirectory = if ($invocation.ContainsKey('capture')) { $invocation.capture } else { $directory } + try { + & (Join-Path $PSScriptRoot 'Invoke-BoundedProcess.ps1') -FilePath $invocation.file -ArgumentList $invocation.arguments -WorkingDirectory $root -TimeoutSeconds ([Math]::Min($invocation.timeout, [Math]::Max(1, 4200 - [int]$clock.Elapsed.TotalSeconds))) -CapturePrefix (Join-Path $captureDirectory ($invocation.name + '-launch')) + } catch { + # v2 records two historical rejection expectations that became executable in v3. + # The suite gate checks both raw reports and the exact transitioned cases. + if ($invocation.name -ceq 'safe-core-regression-v2' -and + $_.Exception.Message -match '^Process \d+ exited with code 1\.$' -and + [IO.File]::Exists((Join-Path $captureDirectory 'safe-core-regression-v2.json'))) { continue } + $failures.Add($invocation.name + ': ' + $_.Exception.Message) + Write-Warning $failures[$failures.Count - 1] + } + } } +finally { $env:RUSTSHARP_NATIVE_AOT_SDK_VERSION = $previousNativeAotSdk } if ($failures.Count -gt 0) { Write-Warning ($failures -join '; '); exit 1 } diff --git a/eng/Invoke-WindowsNativeAotProbe.ps1 b/eng/Invoke-WindowsNativeAotProbe.ps1 index bd716b5..d9f2d21 100644 --- a/eng/Invoke-WindowsNativeAotProbe.ps1 +++ b/eng/Invoke-WindowsNativeAotProbe.ps1 @@ -789,8 +789,9 @@ try { $versionProbe.StandardErrorTruncated) { Stop-Blocked 'dotnet-sdk-unavailable' "The pinned .NET SDK could not be executed: $($versionProbe.CleanupDiagnostic)" } - if (-not $allowLocalSdkOverride -and $dotnetVersion -ne '10.0.400') { - Stop-Blocked 'dotnet-sdk-version-mismatch' "Expected .NET SDK 10.0.400, found '$dotnetVersion'." + $pinnedSdk = (Get-Content -LiteralPath (Join-Path $repoRoot 'global.json') -Raw | ConvertFrom-Json).sdk.version + if (-not $allowLocalSdkOverride -and $dotnetVersion -cne $pinnedSdk) { + Stop-Blocked 'dotnet-sdk-version-mismatch' "Expected .NET SDK $pinnedSdk, found '$dotnetVersion'." } $tempDirectory = Join-Path ([IO.Path]::GetTempPath()) "rustsharp-windows-aot-$PID-$([Guid]::NewGuid().ToString('N'))" diff --git a/eng/P1EvidenceValidation.ps1 b/eng/P1EvidenceValidation.ps1 index e0e5715..8a75208 100644 --- a/eng/P1EvidenceValidation.ps1 +++ b/eng/P1EvidenceValidation.ps1 @@ -109,7 +109,7 @@ function Test-P1LabelPlaceholder([string] $Source, [string] $Id) { return $normalized -ceq $expected } -function Test-P1ProcessEvidence($Process, [string] $Label, [Collections.Generic.List[string]] $Errors, [switch] $Successful) { +function Test-P1ProcessEvidence($Process, [string] $Label, [Collections.Generic.List[string]] $Errors, [switch] $Successful, [switch] $LegacyPlatform) { if ($null -eq $Process) { $Errors.Add("$Label process evidence is missing."); return } foreach ($name in @('commandLine', 'startedAtUtc')) { if ([string]::IsNullOrWhiteSpace([string](Get-P1Property $Process $name))) { $Errors.Add("$Label.$name is missing.") } @@ -122,7 +122,9 @@ function Test-P1ProcessEvidence($Process, [string] $Label, [Collections.Generic. # A process can exit successfully while its captured output is truncated or # its reader/drain hit a timeout/limit. Such evidence cannot establish a # semantic result, so every bounded-output marker must be present and false. - foreach ($name in @('outputTruncated', 'outputReadTimedOut', 'outputDrainTimedOut', 'outputReadLimitReached')) { + $outputMarkers = @('outputTruncated', 'outputReadTimedOut') + if (-not $LegacyPlatform) { $outputMarkers += @('outputDrainTimedOut', 'outputReadLimitReached') } + foreach ($name in $outputMarkers) { $value = Get-P1Property $Process $name if ($value -isnot [bool]) { $Errors.Add("$Label.$name must be a boolean false marker.") } elseif ($value) { $Errors.Add("$Label output evidence is incomplete ($name is true).") } diff --git a/eng/P1SuiteEvidenceValidation.ps1 b/eng/P1SuiteEvidenceValidation.ps1 index e86fbf3..8412761 100644 --- a/eng/P1SuiteEvidenceValidation.ps1 +++ b/eng/P1SuiteEvidenceValidation.ps1 @@ -284,6 +284,229 @@ function Test-P1BaselineEvidence($Report, [string] $CandidateSha, [string] $Tree return @($errors.ToArray()) } +function Read-P1LegacyExecutionInput([string] $Path, [string] $ExpectedHash) { + $info = [IO.FileInfo]::new($Path) + if (-not $info.Exists -or $info.Length -lt 1 -or $info.Length -gt 4MB -or + ($info.Attributes -band [IO.FileAttributes]::ReparsePoint)) { + throw "Missing or invalid legacy evidence input: $Path" + } + $bytes = [IO.File]::ReadAllBytes($Path) + if ($bytes.Length -gt 4MB -or $ExpectedHash -notmatch '^[a-fA-F0-9]{64}$' -or + [Convert]::ToHexString([Security.Cryptography.SHA256]::HashData($bytes)) -ine $ExpectedHash) { + throw "Legacy execution evidence hash mismatch: $Path" + } + return ConvertFrom-P1StrictJson $bytes +} + +function Assert-P1LegacyCaseExecution($Case, $Fixture, [string] $Profile, [bool] $Transition) { + $id = Get-P1Property $Fixture 'id' + $kind = Get-P1Property $Fixture 'kind' + $expectation = Get-P1Property $Fixture 'expectation' + $isPlatform = $Profile -ceq 'p1-platform-v1' + $isV1 = $Profile -ceq 'safe-core-regression-v1' + if (-not $expectation) { + $expectation = if ($kind -in @('compile-pass','compile-fail')) { $kind } else { 'run-pass' } + } + $expectedOutput = Get-P1Property $Fixture 'expectedOutput' + if ((Get-P1Property $Case 'expectedOutput') -cne $expectedOutput -or + (-not $isPlatform -and (Get-P1Property $Case 'kind') -cne $kind) -or + (-not $isPlatform -and -not $isV1 -and (Get-P1Property $Case 'expectation') -cne $expectation) -or + ($isV1 -and (Get-P1Property $Case 'oracleCompared') -cne $true)) { + throw "Legacy case '$id' expectation does not match the frozen manifest." + } + + $runs = @() + if ($isPlatform) { + $steps = [ordered]@{ coreClrCompile=0; ilVerify=0; coreClrRun=0; nativeAotPublish=0; nativeAotRun=0 } + $runs = @('coreClrRun','nativeAotRun') + } else { + $steps = [ordered]@{ rustcCompile=0; rustSharpCheck=0; rustSharpCompile=0 } + if ($expectation -ceq 'run-pass') { + $steps['rustcRun'] = 0 + $steps['rustSharpRun'] = 0 + $runs = @('rustcRun','rustSharpRun') + } elseif (-not $Transition -and $expectation -in @('compile-fail','rustsharp-fail')) { + if ($expectation -ceq 'compile-fail') { $steps['rustcCompile'] = 1 } + $steps['rustSharpCheck'] = 1 + if ($isV1) { $steps.Remove('rustSharpCompile') } else { $steps['rustSharpCompile'] = 1 } + } + } + + $errors = [Collections.Generic.List[string]]::new() + foreach ($step in $steps.Keys) { + $process = Get-P1Property $Case $step + Test-P1ProcessEvidence $process "$id $step" $errors -LegacyPlatform:$isPlatform + $exit = Get-P1Property $process 'exitCode' + if (($exit -isnot [int] -and $exit -isnot [long]) -or $exit -ne $steps[$step] -or + (Get-P1Property $process 'standardOutput') -isnot [string] -or + (Get-P1Property $process 'standardError') -isnot [string]) { + $errors.Add("$id $step has invalid exit or output evidence.") + } + if ($steps[$step] -eq 1) { + $stderr = [string](Get-P1Property $process 'standardError') + if ($isV1) { + $diagnostic = Get-P1Property $Fixture 'diagnosticContains' + $stdout = Get-P1NormalizedOutput $process + if ($diagnostic -and -not ($stdout.Contains($diagnostic, [StringComparison]::Ordinal) -or + $stderr.Contains($diagnostic, [StringComparison]::Ordinal))) { + $errors.Add("$id $step is missing diagnostic text '$diagnostic'.") + } + } else { + $field = if ($step -ceq 'rustcCompile') { 'rustcDiagnostic' } else { 'rustSharpDiagnostic' } + $diagnostic = Get-P1Property $Fixture $field + if (-not $diagnostic -or -not ($stderr.Contains("error[${diagnostic}]:", [StringComparison]::Ordinal) -or + $stderr.Contains("error ${diagnostic}:", [StringComparison]::Ordinal))) { + $errors.Add("$id $step is missing diagnostic '$diagnostic'.") + } + } + } + if ($step -cin $runs -and ($expectedOutput -isnot [string] -or + (Get-P1NormalizedOutput $process) -cne $expectedOutput -or + (Get-P1Property $process 'standardError') -cne '')) { + $errors.Add("$id $step output differs from the frozen expectation.") + } + } + if ($errors.Count -gt 0) { throw ($errors -join ' ') } +} + +function Test-P1LegacyExecutionEvidence($Audit, [string] $LegacyDirectory, [string] $CandidateSha, [string] $Rid, $Build, [string] $Root) { + $errors = [Collections.Generic.List[string]]::new() + $clock = [Diagnostics.Stopwatch]::StartNew() + $execution = Get-P1Property $Audit 'legacyExecution' + $bindings = @(Get-P1Property $execution 'reports') + $compilerHash = [string](Get-P1Property $Build 'compilerSha256') + $acceptedRids = if ($Rid -ceq 'linux-x64') { @('linux-x64','ubuntu.24.04-x64') } else { @($Rid) } + if ((Get-P1Property $execution 'runtimeIdentifier') -cnotin $acceptedRids -or $bindings.Count -ne 5 -or + $compilerHash -notmatch '^[a-fA-F0-9]{64}$' -or (Get-P1Property $execution 'compilerSha256') -ine $compilerHash) { + return @('Four legacy execution bindings and the v3 successor with the native RID and Release compiler SHA-256 are required.') + } + if ([IO.Directory]::Exists($LegacyDirectory) -and + ([IO.DirectoryInfo]::new($LegacyDirectory).Attributes -band [IO.FileAttributes]::ReparsePoint)) { + return @('The legacy execution directory must contain retained local files.') + } + $expected = [ordered]@{ + 'safe-core-regression-v3' = @{ denominator=26; kind='safe-core-typed-mir-regression'; schema=2; file='safe-core-regression-v3-manifest.json' } + 'safe-core-regression-v1' = @{ denominator=8; kind='safe-core-regression'; schema=1; file='safe-core-regression-manifest.json' } + 'safe-core-regression-v2' = @{ denominator=24; kind='safe-core-typed-mir-regression'; schema=2; file='safe-core-regression-v2-manifest.json' } + 'p1-differential-v2' = @{ denominator=16; kind='p1-source-borrow-drop-differential'; schema=2; file='p1-differential-v2-manifest.json' } + 'p1-platform-v1' = @{ denominator=12; kind='p1-platform-coreclr-ilverify-native-aot'; schema=1; file='p1-differential-v2-manifest.json' } + } + # These v2 rejection expectations were versioned as executable cases in v3. + $transitions = [ordered]@{'typed-mir-binding-or-pattern'="7`n"; 'typed-mir-mutable-capture'="3`n"} + $successorCases = @{} + foreach ($profile in $expected.Keys) { + if ($clock.Elapsed.TotalSeconds -ge 15) { $errors.Add('Legacy execution validation timed out.'); break } + try { + $spec = $expected[$profile] + $binding = @($bindings | Where-Object { (Get-P1Property $_ 'profile') -ceq $profile }) + $suite = @(Get-P1Property $Audit 'suites' | Where-Object { (Get-P1Property $_ 'profile') -ceq $profile }) + $isSuccessor = $profile -ceq 'safe-core-regression-v3' + if ($binding.Count -ne 1 -or (-not $isSuccessor -and $suite.Count -ne 1)) { throw 'Missing or duplicate suite binding.' } + $report = Read-P1LegacyExecutionInput (Join-Path $LegacyDirectory ($profile + '.json')) ([string](Get-P1Property $binding[0] 'reportSha256')) + $launch = Read-P1LegacyExecutionInput (Join-Path $LegacyDirectory ($profile + '-launch.process.json')) ([string](Get-P1Property $binding[0] 'launchSha256')) + $isPlatform = $profile -ceq 'p1-platform-v1' + $isHistoricalV2 = $profile -ceq 'safe-core-regression-v2' + $expectedExit = if ($isHistoricalV2) { 1 } else { 0 } + $expectedStatus = if ($isHistoricalV2) { 'failed' } else { 'passed' } + $manifestPath = Join-Path $Root ('tools/RustSharp.Conformance/fixtures/' + $spec.file) + $manifestInfo = [IO.FileInfo]::new($manifestPath) + if (-not $manifestInfo.Exists -or $manifestInfo.Length -lt 1 -or $manifestInfo.Length -gt 256KB) { throw 'Invalid legacy manifest input.' } + $manifestBytes = [IO.File]::ReadAllBytes($manifestPath) + $manifestHash = [Convert]::ToHexString([Security.Cryptography.SHA256]::HashData($manifestBytes)) + $embeddedManifestHash = Get-P1Property $report 'manifestSha256' + if ($isPlatform -or $profile -ceq 'safe-core-regression-v1') { $embeddedManifestHash = Get-P1Property (Get-P1Property $report 'manifest') 'sha256' } + if ($embeddedManifestHash -ine $manifestHash) { throw 'Legacy execution used a different manifest.' } + $reportProfile = if ($isPlatform) { 'p1-differential-v2' } else { $profile } + $launcherEntry = if ($isPlatform) { 'eng/Invoke-P1PlatformEvidence.ps1' } else { 'tools/RustSharp.Conformance/bin/Release/net10.0/RustSharp.Conformance.dll' } + $arguments = @(Get-P1Property $launch 'Arguments') + if ((Get-P1Property $launch 'Pid') -le 0 -or (Get-P1Property $launch 'ParentPid') -le 0 -or + -not (Get-P1Property $launch 'StartedAt') -or -not (Get-P1Property $launch 'FilePath') -or + (Get-P1Property $launch 'ExitCode') -cne $expectedExit -or (Get-P1Property $launch 'CleanupComplete') -cne $true -or + $arguments.Count -notin (1..24) -or $launcherEntry -cnotin $arguments -or + (-not $isPlatform -and ($arguments[1] -cne '--profile' -or $arguments[2] -cne $profile)) -or + @($arguments | Where-Object { ([string]$_).Replace('\','/').EndsWith("/legacy/$profile.json", [StringComparison]::Ordinal) }).Count -ne 1) { + throw 'Launch process identity or successful invocation is missing.' + } + $summary = Get-P1Property $report 'summary' + if ((Get-P1Property $report 'schemaVersion') -ne $spec.schema -or (Get-P1Property $report 'evidenceKind') -cne $spec.kind -or + (Get-P1Property $report 'profile') -cne $reportProfile -or (Get-P1Property $report 'harnessError') -or + (Get-P1Property $summary 'status') -cne $expectedStatus -or (Get-P1Property $summary 'exitCode') -cne $expectedExit) { + throw 'Legacy report identity or summary is invalid.' + } + if ($profile -ceq 'safe-core-regression-v1') { + foreach ($field in @('denominator','executed','passed')) { + if ((Get-P1Property $summary $field) -ne 8) { throw "Legacy summary.$field must be 8." } + } + foreach ($field in @('failed','skipped')) { + if ((Get-P1Property $summary $field) -cne 0) { throw "Legacy summary.$field must be zero." } + } + if ((Get-P1Property (Get-P1Property $report 'cleanup') 'completed') -cne $true -or + (Get-P1Property (Get-P1Property $report 'execution') 'deadlineExpired') -cne $false) { throw 'Legacy regression cleanup or deadline is invalid.' } + } else { + if ((Get-P1Property $report 'candidateSha') -cne $CandidateSha) { throw 'Legacy execution candidate SHA differs.' } + if ($isHistoricalV2) { + if ((Get-P1Property $summary 'denominator') -ne 24 -or (Get-P1Property $summary 'executed') -ne 24 -or + (Get-P1Property $summary 'passed') -ne 22 -or (Get-P1Property $summary 'failed') -ne 2 -or + (Get-P1Property $summary 'blocked') -cne 0 -or (Get-P1Property $summary 'skipped') -cne 0) { + throw 'Historical v2 must record 22 matches and the two explicitly versioned transitions.' + } + } else { Test-P1FixedSummary $report $spec.denominator $errors } + $hostReport = Get-P1Property $report 'host' + $observedRid = Get-P1Property $hostReport 'runtimeIdentifier' + if ($isPlatform) { + $hostReport = Get-P1Property $report 'platform' + $observedRid = Get-P1Property $hostReport 'runtimeIdentifierObserved' + } + $hostOs = [string](Get-P1Property $hostReport 'operatingSystem') + $osPattern = if ($Rid -ceq 'linux-x64') { '^Ubuntu 24\.04(?:\.|\s|$)' } else { '^Microsoft Windows\b' } + if ($observedRid -cnotin $acceptedRids -or $hostOs -notmatch $osPattern -or + (Get-P1Property $hostReport 'processArchitecture') -cne 'X64') { + throw 'Legacy execution did not occur on the expected x64 host.' + } + if ($isPlatform -or $profile -ceq 'p1-differential-v2') { + if ((Get-P1Property (Get-P1Property $report 'compiler') 'sha256') -ine $compilerHash -or + (Get-P1Property (Get-P1Property $report 'cleanup') 'completed') -cne $true -or + (Get-P1Property (Get-P1Property $report 'execution') 'deadlineExpired') -cne $false) { throw 'Legacy compiler, cleanup or deadline evidence is invalid.' } + } elseif ((Get-P1Property $report 'deadlineExpired') -cne $false -or (Get-P1Property $report 'cleanupDiagnostic')) { + throw 'Legacy regression cleanup or deadline is invalid.' + } + } + $cases = @(Get-P1Property $report 'cases') + $frozenCases = @(Get-P1Property (ConvertFrom-P1StrictJson $manifestBytes) 'cases') + if ($isPlatform) { + $frozenCases = @($frozenCases | Where-Object { (Get-P1Property $_ 'expectation') -in @($null,'run-pass') }) + } + if ($cases.Count -ne $spec.denominator -or $frozenCases.Count -ne $spec.denominator) { throw 'Legacy case denominator changed.' } + $seen = [Collections.Generic.HashSet[string]]::new([StringComparer]::Ordinal) + foreach ($case in $cases) { + if ($clock.Elapsed.TotalSeconds -ge 15) { throw 'Legacy case validation timed out.' } + $id = [string](Get-P1Property $case 'id') + $frozen = @($frozenCases | Where-Object { (Get-P1Property $_ 'id') -ceq $id }) + $source = Get-P1Property $case $(if ($isSuccessor -or $isHistoricalV2) { 'file' } else { 'source' }) + $expectedSource = Get-P1Property $frozen[0] 'file' + $transition = $isHistoricalV2 -and $transitions.Contains($id) + $expectedCaseStatus = if ($transition) { 'failed' } else { 'passed' } + if (-not $seen.Add($id) -or $frozen.Count -ne 1 -or (Get-P1Property $case 'status') -cne $expectedCaseStatus -or + $source -cne $expectedSource) { throw "Legacy case '$id' does not match its frozen identity and result." } + Assert-P1LegacyCaseExecution $case $frozen[0] $profile $transition + if ($isSuccessor -and $transitions.Contains($id)) { + if ((Get-P1Property $case 'expectation') -cne 'run-pass' -or + (Get-P1Property $frozen[0] 'expectedOutput') -cne $transitions[$id]) { throw "Successor case '$id' does not declare its frozen output." } + $successorCases[$id] = $case + } + if ($transition) { + $sourceHash = [string](Get-P1Property $case 'sourceSha256') + if ((Get-P1Property $case 'expectation') -cne 'rustsharp-fail' -or (Get-P1Property $case 'rustSharpDiagnostic') -cne 'RSM2002' -or + $sourceHash -notmatch '^[a-fA-F0-9]{64}$' -or $sourceHash -ine (Get-P1Property $successorCases[$id] 'sourceSha256') -or + $source -cne (Get-P1Property $successorCases[$id] 'file')) { throw "Historical v2 case '$id' does not match its verified v3 successor." } + } + } + } + catch { $errors.Add("$profile evidence failed. $($_.Exception.Message)") } + } + return @($errors.ToArray()) +} + function Test-P1BuildEvidence($Report, [string] $CandidateSha, [string] $Rid = '', [string] $Root = '') { $errors = [Collections.Generic.List[string]]::new() if ((Get-P1Property $Report 'schemaVersion') -ne 1 -or (Get-P1Property $Report 'evidenceKind') -cne 'p1-release-build' -or diff --git a/eng/Test-P1ProductionCiGate.ps1 b/eng/Test-P1ProductionCiGate.ps1 index 9d24027..d74293e 100644 --- a/eng/Test-P1ProductionCiGate.ps1 +++ b/eng/Test-P1ProductionCiGate.ps1 @@ -8,6 +8,8 @@ param( [Parameter(Mandatory)][ValidatePattern('^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$')][string] $Repository, [Parameter(Mandatory)][string] $NativeJobResult, [Parameter(Mandatory)][string] $SuiteJobResult, + [Parameter(Mandatory)][AllowEmptyString()][string] $DropJobResult, + [Parameter(Mandatory)][AllowEmptyString()][string] $DropTransportResult, [Parameter(Mandatory)][string] $EvidencePath, [Threading.CancellationToken] $CancellationToken = [Threading.CancellationToken]::None ) @@ -16,12 +18,14 @@ Set-StrictMode -Version 3.0 $ErrorActionPreference = 'Stop' if ($PSVersionTable.PSVersion.Major -lt 7) { throw 'PowerShell 7 or newer is required.' } $root = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..')) +$sdkVersion = (Get-Content -LiteralPath (Join-Path $root 'global.json') -Raw | ConvertFrom-Json).sdk.version . (Join-Path $PSScriptRoot 'P1SuiteEvidenceValidation.ps1') $clock = [Diagnostics.Stopwatch]::StartNew() $started = [DateTimeOffset]::UtcNow $maximumSeconds = 480 $failures = [Collections.Generic.List[string]]::new() $hosts = [Collections.Generic.List[object]]::new() +$dropProofs = [Collections.Generic.List[object]]::new() $matrix = $null $tree = $null $sourceNames = @( @@ -75,6 +79,22 @@ function Bound-Artifact($Binding, [string] $ExpectedPath, [long] $MaximumBytes = Require ($Binding.repositoryPath -ceq $ExpectedPath -and $Binding.sha256 -cmatch '^[A-Fa-f0-9]{64}$') 'Receipt artifact identity/hash is invalid.' Require ((File-Hash $ExpectedPath $MaximumBytes -AllowEmpty:$AllowEmpty) -ieq $Binding.sha256) ('Transported receipt artifact bytes are stale: ' + $ExpectedPath) } +function Check-DropTransport([string] $Platform, [string] $Rid) { + $path = 'artifacts/p1-candidate/drop-transport-' + $Platform + '.json' + $proof = Read-Json $path 4194304 + Require ($proof.schemaVersion -eq 1 -and $proof.evidenceKind -ceq 'p1-drop-transport-validation' -and + $proof.candidateSha -ceq $CandidateSha -and $proof.candidateTreeSha -ceq $tree -and $proof.runtimeIdentifier -ceq $Rid -and + [string]$proof.runId -ceq $RunId -and [string]$proof.runAttempt -ceq $RunAttempt) 'Drop transport proof identity, candidate, platform or run mismatch.' + Require ($proof.artifactContentVerified -ceq $true -and $proof.actualNativeMachineVerified -ceq $true -and + $proof.sourceBoundValidator -ceq $true -and $proof.fullP1Closure -ceq $false -and $proof.fullP1LanguageGateApproved -ceq $false -and + $proof.originalPeCount -eq 30 -and $proof.originalPeVerifierReports -eq 30 -and $proof.nativeExecutableCases -eq 28 -and + $proof.callableArtifacts -eq 2 -and $proof.callableCases -eq 7 -and $proof.processLedgers -eq 36 -and + @($proof.errors).Count -eq 0) 'Drop transport proof is missing physical validation or fixed case evidence.' + $receiptPath = 'artifacts/p1-drop-ci/' + $Platform + '/native-receipt.json' + Require ($proof.receipt.path -ceq $receiptPath -and $proof.receipt.sha256 -match '^[a-fA-F0-9]{64}$' -and + (File-Hash $receiptPath 4194304) -ieq $proof.receipt.sha256) 'Drop transport proof does not bind to the original receipt bytes.' + return [ordered]@{platformName=$Platform;runtimeIdentifier=$Rid;path=$path;sha256=(File-Hash $path 4194304);receiptSha256=$proof.receipt.sha256} +} function Same-Json($Left, $Right) { $a = [Text.Json.Nodes.JsonNode]::Parse(($Left | ConvertTo-Json -Depth 48 -Compress)) $b = [Text.Json.Nodes.JsonNode]::Parse(($Right | ConvertTo-Json -Depth 48 -Compress)) @@ -156,7 +176,7 @@ function Check-Host([string] $ReceiptPath, [string] $Platform, [string] $Rid, [s } Require ($originalPeCount -eq 39) 'The source package original-PE verification denominator changed.' Require ($backend.candidateSha -ceq $CandidateSha -and $backend.candidateTreeSha -ceq $tree -and $backend.targetRuntimeIdentifier -ceq $Rid) 'Backend report native identity mismatch.' - Require ($build.sdkVersion -ceq '10.0.401' -and $build.succeeded -ceq $true -and $build.summary.warnings -eq 0 -and $build.summary.errors -eq 0 -and + Require ($build.sdkVersion -ceq $sdkVersion -and $build.succeeded -ceq $true -and $build.summary.warnings -eq 0 -and $build.summary.errors -eq 0 -and $build.candidateSha -ceq $CandidateSha -and $build.sourceProvenance.candidateTreeSha -ceq $tree -and $snapshot.candidateSha -ceq $CandidateSha -and $snapshot.treeSha -ceq $tree -and $snapshot.verified -ceq $true) 'Native source/fresh build provenance mismatch.' Require ((Same-Json $source.sourceSnapshot.raw $snapshot) -and (Same-Json $source.releaseBuild.raw $build) -and (Same-Json $backend.sourceSnapshotRaw $snapshot) -and (Same-Json $backend.releaseBuildRaw $build)) 'Embedded native input reports differ from retained original bytes.' @@ -220,12 +240,16 @@ try { $env:GITHUB_WORKFLOW_SHA -ceq $CandidateSha -and $env:GITHUB_RUN_ID -ceq $RunId -and $env:GITHUB_RUN_ATTEMPT -ceq $RunAttempt -and $env:GITHUB_REPOSITORY -ceq $Repository) 'Aggregate gate requires this authenticated same-SHA Actions context.' Require ($NativeJobResult -ceq 'success' -and $SuiteJobResult -ceq 'success' -and $env:NATIVE_JOB_RESULT -ceq $NativeJobResult -and $env:SUITE_JOB_RESULT -ceq $SuiteJobResult) 'Both trusted upstream job results must match the successful workflow needs context.' + Require ($DropJobResult -ceq 'success' -and $env:DROP_JOB_RESULT -ceq $DropJobResult) 'Native Drop jobs must pass in the trusted workflow needs context.' + Require ($DropTransportResult -ceq 'success' -and $env:DROP_TRANSPORT_RESULT -ceq $DropTransportResult) 'Both native Drop transport proofs must pass in the trusted workflow step context.' $freshBuild = Read-Json 'artifacts/p1-candidate/production-aggregate-release-build.json' 4194304 - Require ($freshBuild.sdkVersion -ceq '10.0.401') 'Aggregate validator requires a fresh SDK401 Release build.' + Require ($freshBuild.sdkVersion -ceq $sdkVersion) "Aggregate validator requires a fresh SDK $sdkVersion Release build." $buildErrors = @(Test-P1BuildEvidence $freshBuild $CandidateSha 'linux-x64' $root) Require ($buildErrors.Count -eq 0) ('Fresh aggregate physical build binding failed: ' + ($buildErrors -join '; ')) $tree = $freshBuild.sourceProvenance.candidateTreeSha Require ($tree -cmatch '^[a-fA-F0-9]{40}$') 'Aggregate candidate tree is missing.' + $dropProofs.Add((Check-DropTransport 'windows-x64' 'win-x64')) + $dropProofs.Add((Check-DropTransport 'linux-x64' 'linux-x64')) $hosts.Add((Check-Host $WindowsReceipt 'windows-x64' 'win-x64' 'Windows')) $hosts.Add((Check-Host $LinuxReceipt 'linux-x64' 'linux-x64' 'Linux')) Check-Budget 255 @@ -240,11 +264,11 @@ try { Check-Budget } catch { $failures.Add($_.Exception.Message) } -$closed = $failures.Count -eq 0 -and $hosts.Count -eq 2 -and $null -ne $matrix -and $clock.Elapsed.TotalSeconds -lt $maximumSeconds +$closed = $failures.Count -eq 0 -and $hosts.Count -eq 2 -and $dropProofs.Count -eq 2 -and $null -ne $matrix -and $clock.Elapsed.TotalSeconds -lt $maximumSeconds $evidence = [ordered]@{ schemaVersion=1;evidenceKind='p1-production-ci-gate';candidateSha=$CandidateSha;candidateTreeSha=$tree - ci=[ordered]@{repository=$Repository;runId=$RunId;runAttempt=$RunAttempt;workflowSha=$env:GITHUB_WORKFLOW_SHA;nativeJobResult=$NativeJobResult;suiteJobResult=$SuiteJobResult} - fixedDenominators=$fixed;nativeHosts=@($hosts.ToArray());backendMatrix=$matrix + ci=[ordered]@{repository=$Repository;runId=$RunId;runAttempt=$RunAttempt;workflowSha=$env:GITHUB_WORKFLOW_SHA;nativeJobResult=$NativeJobResult;suiteJobResult=$SuiteJobResult;dropJobResult=$DropJobResult;dropTransportResult=$DropTransportResult} + fixedDenominators=$fixed;nativeHosts=@($hosts.ToArray());dropTransport=@($dropProofs.ToArray());backendMatrix=$matrix summary=[ordered]@{status=if($closed){'passed'}else{'blocked'};satisfiesGate=$closed;sourceNativePlatforms=if($closed){2}else{0};sourcePackagesPerPlatform=19;sourceOriginalPePerPlatform=39;backendClosedCells=if($closed){24}else{0};fullP1Closure=$false} execution=[ordered]@{startedAtUtc=$started.ToString('O');finishedAtUtc=[DateTimeOffset]::UtcNow.ToString('O');maximumNativeHosts=2;maximumSourceArtifactsPerHost=1024;maximumBackendArtifactsPerHost=192;maximumRetainedBytesPerHost=2147483648;timeoutSeconds=$maximumSeconds} failures=@($failures.ToArray()) diff --git a/eng/Test-P1RegressionAudit.ps1 b/eng/Test-P1RegressionAudit.ps1 index 268627e..bc4a9cb 100644 --- a/eng/Test-P1RegressionAudit.ps1 +++ b/eng/Test-P1RegressionAudit.ps1 @@ -3,6 +3,7 @@ param( [Parameter()][string] $RepositoryRoot = (Join-Path $PSScriptRoot '..'), [Parameter(Mandatory)][ValidatePattern('^[a-fA-F0-9]{40}$')][string] $CandidateSha, [Parameter(Mandatory)][string] $ReportPath, + [Parameter()][string] $LegacyEvidenceDirectory, [Parameter()][ValidateRange(1, 300)][int] $DeadlineSeconds = 120 ) @@ -27,6 +28,7 @@ $candidateTreeSha = $null $checkedFiles = 0 $sourceMatches = $false $harnessError = $null +$legacyExecution = $null $startedAt = [DateTimeOffset]::UtcNow $gitExecutable = (Get-Command git -CommandType Application -ErrorAction Stop | Select-Object -First 1).Source @@ -213,6 +215,37 @@ try { } } $sourceMatches = $auditErrors.Count -eq 0 + if ($LegacyEvidenceDirectory) { + $legacyDirectory = [IO.Path]::GetFullPath($LegacyEvidenceDirectory, $root) + $expectedDirectory = Join-Path ([IO.Path]::GetDirectoryName($reportFullPath)) 'legacy' + if ($legacyDirectory -cne $expectedDirectory -or [IO.Path]::GetRelativePath($root, $legacyDirectory).StartsWith('..', [StringComparison]::Ordinal)) { + throw 'Legacy executions must be stored beside the immutable regression audit.' + } + $legacyProfiles = @($suiteSpecs.profile) + 'safe-core-regression-v3' + $legacyReports = foreach ($profile in $legacyProfiles) { + Assert-Budget + $path = Join-Path $legacyDirectory ($profile + '.json') + $launchPath = Join-Path $legacyDirectory ($profile + '-launch.process.json') + foreach ($inputPath in @($path, $launchPath)) { + $inputFile = [IO.FileInfo]::new($inputPath) + if (-not $inputFile.Exists -or $inputFile.Length -lt 1 -or $inputFile.Length -gt 4MB -or + ($inputFile.Attributes -band [IO.FileAttributes]::ReparsePoint)) { + throw "Missing or invalid legacy execution input: $inputPath" + } + } + [ordered]@{ + profile = $profile + reportSha256 = (Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash + launchSha256 = (Get-FileHash -LiteralPath $launchPath -Algorithm SHA256).Hash + } + } + $compilerPath = Join-Path $root 'src/RustSharp.Cli/bin/Release/net10.0/rsc.dll' + $legacyExecution = [ordered]@{ + runtimeIdentifier = [Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier + compilerSha256 = (Get-FileHash -LiteralPath $compilerPath -Algorithm SHA256).Hash + reports = @($legacyReports) + } + } } catch { $harnessError = $_.Exception.Message; $auditErrors.Add($harnessError) } finally { @@ -230,6 +263,7 @@ finally { summary = @{ suites = $suiteRecords.Count; denominator = 60; passed = $passed; failed = 60 - $passed } suites = @($suiteRecords); processes = @($processRecords); cleanupComplete = $cleanupComplete; harnessError = $harnessError; errors = @($auditErrors) } + if ($null -ne $legacyExecution) { $report.legacyExecution = $legacyExecution } $directory = [IO.Path]::GetDirectoryName($reportFullPath) $null = [IO.Directory]::CreateDirectory($directory) $ownedTemporaryPath = Join-Path $directory ('.p1-regression-audit-' + [Guid]::NewGuid().ToString('N') + '.json.tmp') diff --git a/eng/Test-P1SuiteGate.ps1 b/eng/Test-P1SuiteGate.ps1 index cd319cb..5cd95cf 100644 --- a/eng/Test-P1SuiteGate.ps1 +++ b/eng/Test-P1SuiteGate.ps1 @@ -98,7 +98,14 @@ try { foreach ($name in @('harness','baselineAudit')) { $key = $rid + '-' + $name if (-not $documents.ContainsKey($key)) { $bindingErrors.Add('blocked: candidate verification report is missing: ' + $key); continue } - $errors = if ($name -ceq 'harness') { @(Test-P1HarnessEvidence $documents[$key] $CandidateSha $tree $rid $documents[$rid + '-build']) } else { @(Test-P1BaselineEvidence $documents[$key] $CandidateSha $tree) } + if ($name -ceq 'harness') { + $errors = @(Test-P1HarnessEvidence $documents[$key] $CandidateSha $tree $rid $documents[$rid + '-build']) + } else { + $errors = @(Test-P1BaselineEvidence $documents[$key] $CandidateSha $tree) + $auditPath = Resolve-SuitePath (@($inputs | Where-Object name -CEQ $key)[0].path) + $legacyDirectory = Join-Path ([IO.Path]::GetDirectoryName($auditPath)) 'legacy' + $errors += @(Test-P1LegacyExecutionEvidence $documents[$key] $legacyDirectory $CandidateSha $rid $documents[$rid + '-build'] $root) + } $check = @($checks | Where-Object name -CEQ $key)[0] $check.errors = @($check.errors) + @($errors) if ($check.errors.Count -gt 0) { $check.status = 'failed' } @@ -164,7 +171,7 @@ $report = [ordered]@{ schemaVersion=1; evidenceKind='p1-versioned-suite-aggregate'; profile='p1-suite-gate-v1'; candidateSha=$CandidateSha scope='P1-10 frozen suite conjunction'; fullP1Closure=$false summary=[ordered]@{status=$status;exitCode=if($status -ceq 'passed'){0}elseif($status -ceq 'failed'){1}else{2};denominator=15;executed=$checks.Count;passed=$passed;failed=$failed;blocked=$blocked;skipped=0} - denominators=[ordered]@{requirements=40;coverageInventoryCases=160;expandedDifferentialPerPlatform=32;expandedPlatformPerPlatform=24;immutableBaselines=60;minimumFullHarnessPerPlatform=464} + denominators=[ordered]@{requirements=40;coverageInventoryCases=160;expandedDifferentialPerPlatform=32;expandedPlatformPerPlatform=24;immutableBaselines=60;legacyExecutionsPerPlatform=60;legacyV2ExactMatches=22;legacyV2VersionedTransitions=2;regressionV3PerPlatform=26;minimumFullHarnessPerPlatform=464} checks=@($checks.ToArray());inputs=@($inputs.ToArray());requirementBindings=@($requirementBindings.ToArray()) execution=[ordered]@{startedAtUtc=$started.ToString('O');finishedAtUtc=[DateTimeOffset]::UtcNow.ToString('O');timeoutSeconds=$TimeoutSeconds;maximumInputReports=16;maximumReportBytes=$MaximumReportBytes;candidateValidationProcesses=@($script:P1SnapshotValidationProcesses.ToArray())} harnessError=$harnessError diff --git a/eng/Test-P1SuiteGateValidation.ps1 b/eng/Test-P1SuiteGateValidation.ps1 index d443b91..068f344 100644 --- a/eng/Test-P1SuiteGateValidation.ps1 +++ b/eng/Test-P1SuiteGateValidation.ps1 @@ -1,5 +1,5 @@ [CmdletBinding()] -param([ValidateRange(1,60)][int] $TimeoutSeconds=45, [ValidateRange(1,43)][int] $MaximumChecks=43) +param([ValidateRange(1,60)][int] $TimeoutSeconds=45, [ValidateRange(1,48)][int] $MaximumChecks=48) Set-StrictMode -Version 3.0 $ErrorActionPreference='Stop' if ($PSVersionTable.PSVersion.Major -lt 7) { throw 'PowerShell 7 or newer is required.' } @@ -153,4 +153,31 @@ foreach ($control in $linuxControls) { elseif ($errors.Count -gt 0) { throw ('Linux envelope positive control failed: '+$control.name+'; '+($errors -join '; ')) } $linuxChecks++ } + +$legacyCase = @{ + expectedOutput="42`ntrue`n"; kind='run-pass'; expectation='run-pass' + rustcCompile=Copy-Fixture $process; rustSharpCheck=Copy-Fixture $process + rustSharpCompile=Copy-Fixture $process; rustcRun=Copy-Fixture $process; rustSharpRun=Copy-Fixture $process +} +$legacyCase.rustcRun.standardOutput = $legacyCase.expectedOutput +$legacyCase.rustSharpRun.standardOutput = "42`r`ntrue`r`n" +$legacyFixture = @{id='run-pass-functions';kind='run-pass';expectedOutput=$legacyCase.expectedOutput} +Assert-P1LegacyCaseExecution $legacyCase $legacyFixture 'safe-core-regression-v2' $false +Assert-SuiteResult @() +foreach ($control in @( + @{step='rustSharpCompile';field='';value=$null;message='process evidence is missing'}, + @{step='rustSharpRun';field='standardOutput';value="incorrect`n";message='output differs'}, + @{step='rustcRun';field='outputDrainTimedOut';value=$true;message='output evidence is incomplete'}, + @{step='rustSharpCheck';field='exitCode';value=1;message='invalid exit'} +)) { + if ($clock.Elapsed.TotalSeconds -ge $TimeoutSeconds) { throw 'Legacy control time bound exceeded.' } + $value = Copy-Fixture $legacyCase + $step = $value.PSObject.Properties[$control.step] + if ($control.field) { $step.Value.PSObject.Properties[$control.field].Value = $control.value } + else { $step.Value = $null } + $failure = $null + try { Assert-P1LegacyCaseExecution $value $legacyFixture 'safe-core-regression-v2' $false } + catch { $failure = $_.Exception.Message } + Assert-SuiteResult @($failure) $control.message +} Write-Output "✅ Complete: $checks bounded P1 suite evidence controls and rejection checks; $linuxChecks Linux envelope controls; synthetic data was kept in memory and cannot serve as candidate evidence." diff --git a/global.json b/global.json index 77b023b..1f4a137 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "10.0.402", + "version": "10.0.404", "rollForward": "disable", "allowPrerelease": false } -} \ No newline at end of file +} diff --git a/src/RustSharp.Compiler/CoreContract.cs b/src/RustSharp.Compiler/CoreContract.cs index ca809d6..79b84bd 100644 --- a/src/RustSharp.Compiler/CoreContract.cs +++ b/src/RustSharp.Compiler/CoreContract.cs @@ -124,7 +124,10 @@ public static CoreContractValidation Validate(string json, CancellationToken can issues.Add("$.testTargets contains an unbounded or invalid target."); } ExactStrings(root.GetProperty("evidenceRequiredFields"), ["leafId", "manifestSha256", "candidateSha", "tools", "runtimeIdentifier", "command", "denominator", "passed", "failed", "skipped", "timeResourceLimits", "cleanup", "failureReasons", "provenance"], issues, "$.evidenceRequiredFields", cancellationToken); - string contractHash = Hash(Encoding.UTF8.GetBytes(Canonicalize(root))); + using var canonical = new MemoryStream(); + using (var writer = new Utf8JsonWriter(canonical)) + root.WriteTo(writer); + string contractHash = Convert.ToHexString(SHA256.HashData(canonical.GetBuffer().AsSpan(0, checked((int)canonical.Length)))); if (!string.Equals(contractHash, FrozenContractSha256, StringComparison.Ordinal)) issues.Add("The frozen core-v1 canonical contract hash differs; create a new profile version for expansion."); return new(issues.Count == 0, Profile, LeafId, CaseDenominator, issues.Count == 0 ? verified : 0, @@ -180,6 +183,5 @@ private static void Equal(JsonElement root, string name, string expected, List issues, string path) { if (root.GetProperty(name).GetInt32() != expected) issues.Add(path + " differs from the frozen value."); } - private static string Canonicalize(JsonElement root) => JsonSerializer.Serialize(root, new JsonSerializerOptions { WriteIndented = false }); private static string Hash(byte[] bytes) => Convert.ToHexString(SHA256.HashData(bytes)); } diff --git a/tests/RustSharp.Tests/P1GateCoverageContractTests.cs b/tests/RustSharp.Tests/P1GateCoverageContractTests.cs index 53c836d..2ce31e7 100644 --- a/tests/RustSharp.Tests/P1GateCoverageContractTests.cs +++ b/tests/RustSharp.Tests/P1GateCoverageContractTests.cs @@ -8,7 +8,7 @@ internal static class P1GateCoverageContractTests { private const string Candidate = "1111111111111111111111111111111111111111"; private const string Tree = "2222222222222222222222222222222222222222"; - private static string Root => Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../../../")); + private static string Root => FindRepositoryRoot(); private static string Text => File.ReadAllText(Path.Combine(Root, "tools/RustSharp.Conformance/fixtures", P1GateCoverageContract.ManifestFileName)); public static IReadOnlyList All { get; } = [ @@ -24,6 +24,22 @@ internal static class P1GateCoverageContractTests new("P1-GATE.01 bounds strict JSON source inventories and cancellation", BoundsAsync), ]; + private static string FindRepositoryRoot() + { + using var deadline = new CancellationTokenSource(TimeSpan.FromSeconds(2)); + foreach (string seed in new[] { AppContext.BaseDirectory, Directory.GetCurrentDirectory() }) + { + DirectoryInfo? directory = new(Path.GetFullPath(seed)); + for (int depth = 0; depth < 16 && directory is not null; depth++, directory = directory.Parent) + { + deadline.Token.ThrowIfCancellationRequested(); + if (File.Exists(Path.Combine(directory.FullName, "RustSharp.slnx"))) return directory.FullName; + } + } + + throw new DirectoryNotFoundException("The RustSharp repository root could not be located from the bounded test roots."); + } + private static P1GateCoverageContract.Manifest Parse() => P1GateCoverageContract.ParseManifest(Text, Root); private static JsonObject Node() => JsonNode.Parse(Text)!.AsObject(); private static Task ManifestAsync() @@ -41,6 +57,13 @@ private static Task ManifestAsync() P1GateCoverageContract.HarnessSource constants = manifest.Requirements.Single(item => item.Id == "P1-REQ-015").HarnessSources.Single(); AssertEx.Equal(16, constants.CaseIds.Count, "Const fixture array terminators must not truncate the C# All registrations."); AssertEx.True(constants.CaseIds.Contains("safe-core-mir constants inline const functions and bounded loops", StringComparer.Ordinal), "The required const-loop case must remain in the complete source registration."); + const string genericSource = "tests/RustSharp.Tests/SafeCoreGenericProfileTests.cs"; + string actualGenericHash = P1GateCoverageContract.Hash(File.ReadAllText(Path.Combine(Root, genericSource))); + P1GateCoverageContract.HarnessSource generic = manifest.Requirements.Single(item => item.Id == "P1-REQ-004") + .HarnessSources.Single(item => item.File == genericSource); + AssertEx.Equal(actualGenericHash, generic.Sha256, "The recorded binding must name the actual generic CLI test source revision."); + AssertEx.Equal(generic.Sha256, manifest.Requirements.Single(item => item.Id == "P1-REQ-038") + .HarnessSources.Single(item => item.File == genericSource).Sha256); return Task.CompletedTask; } private static Task AggregateAsync() @@ -68,7 +91,9 @@ private static Task SourceBindingsAsync() => MutationsAsync( [node => node["requirements"]![0]!["harnessSources"]!.AsArray().RemoveAt(0), node => node["requirements"]![8]!["harnessSources"]![0]!["caseIds"]![0] = "invented pass", node => node["requirements"]![8]!["harnessSources"]![0]!["caseIds"]![1] = node["requirements"]![8]!["harnessSources"]![0]!["caseIds"]![0]!.GetValue(), - node => node["requirements"]![8]!["harnessSources"]![0]!["sha256"] = new string('0', 64), + node => node["requirements"]![3]!["harnessSources"]!.AsArray().Single(source => + source!["file"]!.GetValue() == "tests/RustSharp.Tests/SafeCoreGenericProfileTests.cs")!["sha256"] = + "61030413F0AB6139A0D9C35C2657C962C48F1DB86E7C01D31C3090EA42F8F26D", node => node["requirements"]![8]!["harnessSources"]![0]!["status"] = "passed", node => node["requirements"]![8]!["harnessSources"]!.AsArray().Add(node["requirements"]![8]!["harnessSources"]![0]!.DeepClone())]); private static Task CatalogueAsync() => MutationsAsync( diff --git a/tests/RustSharp.Tests/P2CoreContractTests.cs b/tests/RustSharp.Tests/P2CoreContractTests.cs index 7c66341..14eddd6 100644 --- a/tests/RustSharp.Tests/P2CoreContractTests.cs +++ b/tests/RustSharp.Tests/P2CoreContractTests.cs @@ -120,8 +120,7 @@ private static Task PreservesLeafTargetsAsync() private static Task RejectsDuplicateAndScenarioAsync() { string original = ReadManifest(); - int end = original.IndexOf("\"schemaVersion\"", StringComparison.Ordinal); - AssertEx.True(end >= 0); + AssertEx.True(original.Contains("\"schemaVersion\"", StringComparison.Ordinal)); string duplicate = "{\"schemaVersion\":1,\"schemaVersion\":1," + original[(original.IndexOf(',') + 1)..]; AssertEx.False(CoreContract.Validate(duplicate).IsValid, "Duplicate properties must reject."); JsonObject changed = JsonNode.Parse(original)!.AsObject(); diff --git a/tests/RustSharp.Tests/P2CoreRuntimeTests.cs b/tests/RustSharp.Tests/P2CoreRuntimeTests.cs index 94a2b77..f43ad77 100644 --- a/tests/RustSharp.Tests/P2CoreRuntimeTests.cs +++ b/tests/RustSharp.Tests/P2CoreRuntimeTests.cs @@ -99,5 +99,10 @@ internal static class P2CoreConsumerTests new("P2-01.06 composed core operations retain types", CompositionAsync), ]; private static Task ConsumerAsync() { Result result = Option.Some(20).Map(value => value * 2).Match(value => Result.Ok(value), () => Result.Err("missing")); AssertEx.Equal(40, result.Unwrap()); return Task.CompletedTask; } - private static Task CompositionAsync() { AssertEx.True(CoreIterator.Map(new[] { 1, 2 }, value => Option.Some(value)).All(item => item.IsSome)); return Task.CompletedTask; } + private static Task CompositionAsync() + { + IEnumerable> values = CoreIterator.Map([1, 2], Option.Some); + AssertEx.True(values.All(item => item.IsSome)); + return Task.CompletedTask; + } } diff --git a/tools/RustSharp.Conformance/P1ExpandedPlatformRunner.cs b/tools/RustSharp.Conformance/P1ExpandedPlatformRunner.cs index dd7175f..a6da262 100644 --- a/tools/RustSharp.Conformance/P1ExpandedPlatformRunner.cs +++ b/tools/RustSharp.Conformance/P1ExpandedPlatformRunner.cs @@ -86,11 +86,8 @@ internal static async Task RunAsync(string root, string reportPath, TimeSpa string pwshPath = ResolveToolPath("RUSTSHARP_P1_PWSH_PATH", OperatingSystem.IsWindows() ? @"C:\Program Files\PowerShell\7\pwsh.exe" : "pwsh"); string cliPath = ResolveCliPath(root); string compilerSha256 = ComputeSha256IfPresent(cliPath); - // Keep SDK/tool probing outside the repository tree. The repository - // global.json pins an SDK that may be unavailable on a validation - // host, while `dotnet tool run` discovers its manifest from the - // current directory. Copy the frozen manifest into this task-owned - // directory so both concerns remain bounded and reproducible. + // Run the local tool from the owned directory with the same SDK and + // manifest used by the candidate's tool restore. string runDirectory = Path.Combine(Path.GetTempPath(), ".run-p1-platform-v2-" + Environment.ProcessId + "-" + Guid.NewGuid().ToString("N")); string toolWorkingDirectory = Path.Combine(runDirectory, "tooling"); string toolManifestPath = Path.Combine(toolWorkingDirectory, ".config", "dotnet-tools.json"); @@ -99,6 +96,7 @@ internal static async Task RunAsync(string root, string reportPath, TimeSpa { Directory.CreateDirectory(Path.GetDirectoryName(toolManifestPath)!); File.Copy(Path.Combine(root, ".config", "dotnet-tools.json"), toolManifestPath, overwrite: true); + File.Copy(Path.Combine(root, "global.json"), Path.Combine(toolWorkingDirectory, "global.json"), overwrite: true); } catch (Exception exception) when (exception is IOException or UnauthorizedAccessException or ArgumentException) { diff --git a/tools/RustSharp.Conformance/P1GateCoverageContract.cs b/tools/RustSharp.Conformance/P1GateCoverageContract.cs index f3c4301..fb8fc1c 100644 --- a/tools/RustSharp.Conformance/P1GateCoverageContract.cs +++ b/tools/RustSharp.Conformance/P1GateCoverageContract.cs @@ -17,6 +17,9 @@ internal static class P1GateCoverageContract internal const int RequirementDenominator = 40; internal const int CatalogueDenominator = 160; private const int MaximumManifestCharacters = 262_144; + private const string GenericProfileTestPath = "tests/RustSharp.Tests/SafeCoreGenericProfileTests.cs"; + private const string FrozenGenericProfileTestHash = "CC3A85D6AEB246F369E22178C74491058EE1223DAB74D56B662D2E41D28A8F0D"; + private const string IsolatedGenericProfileTestHash = "61030413F0AB6139A0D9C35C2657C962C48F1DB86E7C01D31C3090EA42F8F26D"; private static readonly TimeSpan Deadline = TimeSpan.FromSeconds(15); private static readonly TimeSpan RegexTimeout = TimeSpan.FromSeconds(1); private static readonly string[] Categories = ["positive", "negative", "boundary", "budget"]; @@ -74,8 +77,8 @@ internal static Manifest ParseManifest(string json, string repositoryRoot, Cance Require(Text(root, "evidencePolicy") == "catalogue-is-not-execution; source-bound-full-harness; native-obligations-remain-open; aggregate-ownership-is-not-prerequisite", "Gate mapping cannot equate inventory or status text with execution."); Require(Text(root, "testTarget") == "dotnet run --project tests/RustSharp.Tests -c Release --no-build --no-restore -- --filter P1-GATE.01 --timeout 30 --deadline 120", "Gate target changed."); - string ledgerText = ValidateBoundFile(root.GetProperty("scopeLedger"), "docs/p1-exit-scope-v1.md", repositoryRoot, started, cancellationToken); - string catalogueText = ValidateBoundFile(root.GetProperty("legacyCatalogue"), "tools/RustSharp.Conformance/fixtures/p1-coverage-v1-manifest.json", repositoryRoot, started, cancellationToken); + string ledgerText = ValidateBoundFile(root.GetProperty("scopeLedger"), "docs/p1-exit-scope-v1.md", repositoryRoot, started, cancellationToken).Text; + string catalogueText = ValidateBoundFile(root.GetProperty("legacyCatalogue"), "tools/RustSharp.Conformance/fixtures/p1-coverage-v1-manifest.json", repositoryRoot, started, cancellationToken).Text; P1CoverageProfileRunner.Manifest catalogue = P1CoverageProfileRunner.ParseManifest(catalogueText, repositoryRoot); Require(catalogue.Denominator == 40 && catalogue.Cases.Count == 160, "Legacy denominator changed."); JsonElement rows = root.GetProperty("requirements"); @@ -108,7 +111,7 @@ internal static Manifest ParseManifest(string json, string repositoryRoot, Cance string file = Text(source, "file"); Require(sourceFiles.Add(file), "Duplicate harness source file."); Require(file.StartsWith("tests/RustSharp.Tests/", StringComparison.Ordinal) && file.EndsWith("Tests.cs", StringComparison.Ordinal), "Evidence must name an actual regression source."); - string sourceText = ValidateBoundFile(source, file, repositoryRoot, started, cancellationToken); + (string sourceText, string sourceHash) = ValidateBoundFile(source, file, repositoryRoot, started, cancellationToken); string[] ids = Strings(source.GetProperty("caseIds"), 64); int declaration = sourceText.IndexOf("All { get; }", StringComparison.Ordinal); Require(declaration >= 0 && ids.Length > 0, "Test registration must be statically addressable."); @@ -119,7 +122,7 @@ internal static Manifest ParseManifest(string json, string repositoryRoot, Cance Require(closingLine.Success && closingLine.Index > 0, "Test registration must have its own array closing line."); MatchCollection names = Regex.Matches(declarationText[..closingLine.Index], "new\\(\"([^\"]+)\"", RegexOptions.CultureInvariant, RegexTimeout); Require(ids.ToHashSet(StringComparer.Ordinal).SetEquals(names.Select(item => item.Groups[1].Value)), "Named tests do not equal the actual source registration."); - sources.Add(new(file, Text(source, "sha256"), ids)); + sources.Add(new(file, sourceHash, ids)); } Require(role == "aggregate-ownership" ? sources.Count == 0 : sources.Count > 0, "Only aggregate ownership has no implementation test evidence."); int requirementIndex = int.Parse(id[^3..], System.Globalization.CultureInfo.InvariantCulture) - 1; @@ -213,7 +216,7 @@ internal static HarnessAudit ValidateHarnessEvidence(Manifest manifest, string r return new(runtimeIdentifier, candidateSha, 40, 160, bound.Count, true, false, pending.AsReadOnly()); } - private static string ValidateBoundFile(JsonElement binding, string expectedPath, string repositoryRoot, + private static (string Text, string Sha256) ValidateBoundFile(JsonElement binding, string expectedPath, string repositoryRoot, long started, CancellationToken cancellationToken) { Fields(binding, binding.TryGetProperty("caseIds", out _) ? ["file", "sha256", "caseIds"] : ["file", "sha256"]); @@ -269,9 +272,16 @@ void CheckParents() Require(complete && captured.Length > 0, "Bound source exceeded its fixed read-count bound."); ReadGuard(); string text = new UTF8Encoding(false, true).GetString(captured.ToArray()); - Require(Text(binding, "sha256") == Hash(text), "Bound source hash changed: " + relative); + string sourceHash = Hash(text); + string frozenHash = Text(binding, "sha256"); + // b5dc186 made CLI discovery work with isolated outputs. The v1 manifest + // still binds the original case inventory and its original source hash. + bool matches = relative == GenericProfileTestPath + ? frozenHash == FrozenGenericProfileTestHash && (sourceHash == frozenHash || sourceHash == IsolatedGenericProfileTestHash) + : sourceHash == frozenHash; + Require(matches, "Bound source hash changed: " + relative); ReadGuard(); - return text; + return (text, sourceHash); } private static string[] ExpandOwners(string text) {