Type Resonite execution contracts#334
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors “planned” slot/world element references used by the Resonite batch planner/interpreter from nullable multi-field containers into closed discriminated cases, and updates tests to assert those cases directly. This improves type-safety by removing downstream “unsupported reference type” fallbacks and centralizing resolution via case-owned Match methods.
Changes:
- Replace
PlannedSlotTargetReference/PlannedWorldElementReferencenullable multi-field representations with closed nested-case records andMatch(...)dispatch. - Route slot/world element ID resolution through the new
Match(...)APIs in the batch emission interpreter. - Update batch planning tests to assert the concrete reference cases rather than nullable fields.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/PlateauResoniteLink.Tests/Targets/ResoniteSceneBatchEmissionPlanningTests.cs | Updates assertions/helpers to validate the new closed reference cases (and uses Match for ID resolution in test helpers). |
| src/PlateauResoniteLink/Targets/Resonite/ResoniteSceneEmissionPlan.cs | Implements the new closed-case reference types with Match-based dispatch. |
| src/PlateauResoniteLink/Targets/Resonite/Execution/ResonitePlannedBatchEmissionInterpreter.cs | Updates runtime resolution of planned/canonical references to use Match instead of nullable-field probing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
このままだと Close / 作り直し寄りです。 planned world reference は実行可能な参照だけを表す形ならマージ可能です。非対応は variant ではなく diagnostic / skip / failure に閉じてください。 |
f303f33 to
5918c84
Compare
e57bb75 to
518443e
Compare
|
レビュー対応しました。PlannedSlotTargetReference / PlannedWorldElementReference から Unspecified を持つ value union をやめ、実行可能な concrete case だけを作れる型に戻しました。加えて PlannedBatchEmission.Create で planned slot/component の参照先と順序を検証し、未発行 planned reference は interpreter ではなく planning 境界で失敗するようにしています。\n\nこの変更で、下流の batch interpreter は default/unsupported variant を受ける前提ではなく、validated plan の executable reference を解決するだけになります。\n\n検証:\n- dotnet restore PlateauResoniteLink.sln --locked-mode --disable-build-servers\n- dotnet format whitespace . --folder --verify-no-changes\n- dotnet build PlateauResoniteLink.sln --configuration Release --no-restore --disable-build-servers -m:1 -p:UseSharedCompilation=false\n- dotnet test PlateauResoniteLink.sln --configuration Release --no-restore --verbosity normal -m:1 --disable-build-servers -p:UseSharedCompilation=false\n- Fake Live Sink canonical dump for plateau-13213-higashimurayama-shi-2020 / 53395325 / dem,bldg / grid matched the existing semantic baseline with git diff --no-index. |
|
追加レビュー対応です。前回の対応で Unspecified は消えていましたが、interpreter/test helper 側に closed union を受けた後の _ => throw / unsupported fallback がまだ残っていたため、planning contract側へ寄せました。
検証:
|
6fb77b6 to
1f7cb0c
Compare
785e4cc to
c1c1a03
Compare
1f7cb0c to
c4fd4b2
Compare
c1c1a03 to
1e65faa
Compare
|
restack で live-send run contract の construction-time validation をこの PR に移しました。planned emission reference の closure と同じ Resonite target-side execution contract の整理として扱います。\n\n検証は最上位 #356 の同一 tree 上で restore / format whitespace verify / Release build / Release test (1038 passed) まで通しています。 |
|
Superseded by #326: the Resonite execution contract changes require the scene import plan source-resolution boundary, so they have been folded into the same main-target PR instead of keeping a dependent stack. |
c4fd4b2 to
54a4c78
Compare
Summary
Verification