Skip to content

feat(csharp): read and enforce the reference facet in the C# loader - #694

Merged
dmealing merged 5 commits into
mainfrom
fm/mo-140-w1-b1-cs
Dec 3, 2026
Merged

dmealing merged 5 commits into
mainfrom
fm/mo-140-w1-b1-cs

Conversation

@dmealing

@dmealing dmealing commented Dec 3, 2026

Copy link
Copy Markdown
Member

What Changed

  • The C# spec reader validates the ref facet on provider attr entries and carries it to AttrSchema.Ref. ResolveReferences resolves facet-bearing attrs through a new SymbolTable lookup: typed by target kind, dotted paths (System.child, pkg::System.child), referrer-container lookup for bare values, and ERR_REF_UNRESOLVED / ERR_REF_WRONG_KIND / wrong-system refusals.
  • The registry manifest writes ref only on attrs that declare one. ReferenceDescriptor becomes (Attr, Facet), and provider ErrorCode values outside the enum keep their spelling in MetaError.ProviderCode. This is a C# API break for providers that set TypeDefinition.References in code (migration noted in changelog.d/csharp-reference-facet.md).

No definition file uses the facet yet, so registry output and generated code do not change.

Validation

Risk Assessment

✅ Low: No new material defect found; the facet paths are unused by any shipped definition file, the four existing core references keep their error codes, and the last fix round's changes match their decisions on reading (no tests run in this phase).

Testing

Baseline scripts/ci-local.sh --affected --strict-toolchains passed at this commit and was not re-run. I drove the ReferenceFacet xUnit suite (44 pass) against the real C# loader in-process. That covers the intent's required cases: unresolved, wrong kind, wrong subtype, crosses system, and kind-typed lookup where a role and an app are both named api. None of these scenarios were driven through the live dotnet meta CLI, so none are marked live and all are reported as untested live. The verdict is inconclusive because the live CLI surface was not exercised, not because of a failure.

  • Live validation: ⚠️ inconclusive - 0 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Unresolved reference reports unresolved error (xUnit, in-process loader) ⏸️ untested no Only in-process test; no live dotnet meta drive. Needs a disposable provider definition with a ref facet.
Wrong kind is rejected (xUnit, in-process) ⏸️ untested no Only in-process test; no live CLI drive.
Wrong subtype is rejected (xUnit, in-process) ⏸️ untested no Only in-process test; no live CLI drive.
Reference crossing a system fails with wrongSystemCode (xUnit, in-process) ⏸️ untested no Only in-process test; no live CLI drive.
Role and app both named api resolve by kind (xUnit, in-process) ⏸️ untested no Only in-process test; no live CLI drive.
Evidence: ReferenceFacet xUnit results (TRX)
<?xml version="1.0" encoding="utf-8"?>
<TestRun id="6605e062-79fd-4dc9-9924-9b0d154a7366" name="@pop-os-desktop 2026-12-03 00:10:25" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <Times creation="2026-12-03T00:10:25.0796522-05:00" queuing="2026-12-03T00:10:25.0796523-05:00" start="2026-12-03T00:10:24.2459602-05:00" finish="2026-12-03T00:10:25.5478519-05:00" />
  <TestSettings name="default" id="61aaf5a4-0bd4-4a1c-88bd-d4048a6689a5">
    <Deployment runDeploymentRoot="_pop-os-desktop_2026-12-03_00_10_25" />
  </TestSettings>
  <Results>
    <UnitTestResult executionId="a6d2eaa0-ab11-4a35-b7d6-62baf8a5fe88" testId="2267691f-cfd9-f0c5-e7ff-8fb4f691f3fa" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.The_reader_refuses_a_facet_the_format_does_not_allow(reference: &quot;{ \&quot;targetType\&quot;: \&quot;role\&quot;, \&quot;targetSubTypes\&quot;: []&quot;···, subType: &quot;string&quot;, why: &quot;targetSubTypes&quot;)" computerName="pop-os-desktop" duration="00:00:00.0000286" startTime="2026-12-03T00:10:24.9842088-05:00" endTime="2026-12-03T00:10:24.9842089-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="a6d2eaa0-ab11-4a35-b7d6-62baf8a5fe88" />
    <UnitTestResult executionId="4ee18749-00f5-456d-b335-68cbe0512f61" testId="8017da93-995a-7ff9-a72e-0ae2a13c0a06" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.The_reader_refuses_a_facet_the_format_does_not_allow(reference: &quot;{ \&quot;targetType\&quot;: \&quot;role\&quot;, \&quot;errorCode\&quot;: \&quot;bad\&quot;&quot;···, subType: &quot;string&quot;, why: &quot;loader code&quot;)" computerName="pop-os-desktop" duration="00:00:00.0101066" startTime="2026-12-03T00:10:24.9802589-05:00" endTime="2026-12-03T00:10:24.9802913-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="4ee18749-00f5-456d-b335-68cbe0512f61" />
    <UnitTestResult executionId="45a5ffe4-9480-48d5-b9c9-98e4841c2529" testId="3c22c603-79ec-263c-83a1-0707ea70f1d2" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.A_bare_value_from_outside_a_system_does_not_see_inside_one" computerName="pop-os-desktop" duration="00:00:00.0029726" startTime="2026-12-03T00:10:25.4435063-05:00" endTime="2026-12-03T00:10:25.4435065-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="45a5ffe4-9480-48d5-b9c9-98e4841c2529" />
    <UnitTestResult executionId="678c574a-4f91-4891-8787-9cd85c7cce6b" testId="8eba3c63-ac1e-28ea-51bb-73f126e69d77" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.An_inherited_reference_is_looked_up_where_it_was_written" computerName="pop-os-desktop" duration="00:00:00.0033616" startTime="2026-12-03T00:10:25.4219222-05:00" endTime="2026-12-03T00:10:25.4219223-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="678c574a-4f91-4891-8787-9cd85c7cce6b" />
    <UnitTestResult executionId="40de4341-7de5-4783-a328-b67d951af0b0" testId="b8e9692a-2799-d324-cad4-d9e1ee78a547" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.The_reader_lowers_ref_onto_the_attribute_schema" computerName="pop-os-desktop" duration="00:00:00.0028203" startTime="2026-12-03T00:10:25.4495506-05:00" endTime="2026-12-03T00:10:25.4495511-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="40de4341-7de5-4783-a328-b67d951af0b0" />
    <UnitTestResult executionId="2f19ed8f-d45d-4e63-aa5b-83a184a1300c" testId="b1ff0e2e-22bb-b691-9fc9-0d131cd50ce3" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.A_facet_attribute_named_like_a_core_reference_is_bound_by_its_facet" computerName="pop-os-desktop" duration="00:00:00.0027456" startTime="2026-12-03T00:10:25.4339155-05:00" endTime="2026-12-03T00:10:25.4339158-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="2f19ed8f-d45d-4e63-aa5b-83a184a1300c" />
    <UnitTestResult executionId="ecea5a20-b909-481d-838d-3c70fd2a4bc4" testId="3c0c1848-363b-5f2e-aa15-3be0d46f57ff" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.The_reader_refuses_a_facet_the_format_does_not_allow(reference: &quot;{ \&quot;targetType\&quot;: \&quot;role\&quot;, \&quot;targetSubType\&quot;: \&quot;r&quot;···, subType: &quot;string&quot;, why: &quot;unknown key \&quot;targetSubType\&quot;&quot;)" computerName="pop-os-desktop" duration="00:00:00.0000284" startTime="2026-12-03T00:10:25.0194448-05:00" endTime="2026-12-03T00:10:25.0194452-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="ecea5a20-b909-481d-838d-3c70fd2a4bc4" />
    <UnitTestResult executionId="f60a25a6-2170-4f56-ae7b-7d1ccc86363b" testId="705f9806-2068-2783-f4a8-7d0438257318" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.The_reader_refuses_a_facet_the_format_does_not_allow(reference: &quot;[ \&quot;role\&quot; ]&quot;, subType: &quot;string&quot;, why: &quot;ref must be an object&quot;)" computerName="pop-os-desktop" duration="00:00:00.0000251" startTime="2026-12-03T00:10:25.0196631-05:00" endTime="2026-12-03T00:10:25.0196631-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="f60a25a6-2170-4f56-ae7b-7d1ccc86363b" />
    <UnitTestResult executionId="9b6445ca-2c21-4833-be2e-6f729014bcc4" testId="79aea8b3-1f18-8e76-6a8c-bbfcab35944a" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.System_child_and_pkg_System_child_resolve_from_outside_any_system" computerName="pop-os-desktop" duration="00:00:00.0028958" startTime="2026-12-03T00:10:25.4627502-05:00" endTime="2026-12-03T00:10:25.4627504-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="9b6445ca-2c21-4833-be2e-6f729014bcc4" />
    <UnitTestResult executionId="f64fc083-dcfa-42b6-a981-a24d446c54ca" testId="f63d4fb9-191e-9f7d-5893-383919d7ceac" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.The_reader_refuses_a_facet_the_format_does_not_allow(reference: &quot;{ \&quot;targetType\&quot;: \&quot;role\&quot;, \&quot;fieldPath\&quot;: true, \&quot;···, subType: &quot;string&quot;, why: &quot;fieldPath and sameSystem&quot;)" computerName="pop-os-desktop" duration="00:00:00.0006674" startTime="2026-12-03T00:10:24.9837237-05:00" endTime="2026-12-03T00:10:24.9837241-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="f64fc083-dcfa-42b6-a981-a24d446c54ca" />
    <UnitTestResult executionId="a59f8c36-f09c-4ce0-8ae2-364df32b7b8e" testId="74401be5-294f-6ac2-be37-dee2942173ed" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.The_reader_carries_a_facet_on_a_types_entry_attr" computerName="pop-os-desktop" duration="00:00:00.0006112" startTime="2026-12-03T00:10:25.4074542-05:00" endTime="2026-12-03T00:10:25.4074543-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="a59f8c36-f09c-4ce0-8ae2-364df32b7b8e" />
    <UnitTestResult executionId="a8eebceb-e6e9-42bb-a3d8-4d6c30a18c6a" testId="737c4c17-6869-9d7f-aa2e-65fab69b55b4" testName="MetaObjects.Conformance.Tests.ReferenceFacetTests.Unresolved_normative_case_b" computerName="pop-os-desktop" duration="00:00:00.0028379" startTime="2026-12-03T00:10:25.4368378-05:00" endTime="2026-12-03T00:10:25.4368380-05:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="a8eebceb-e6e9-42bb-a3d8-4d6c30a18c6a" />
    <UnitTestResult executionId="4a

... [56992 bytes truncated] ...

try testId="2267691f-cfd9-f0c5-e7ff-8fb4f691f3fa" executionId="a6d2eaa0-ab11-4a35-b7d6-62baf8a5fe88" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="8017da93-995a-7ff9-a72e-0ae2a13c0a06" executionId="4ee18749-00f5-456d-b335-68cbe0512f61" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="3c22c603-79ec-263c-83a1-0707ea70f1d2" executionId="45a5ffe4-9480-48d5-b9c9-98e4841c2529" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="8eba3c63-ac1e-28ea-51bb-73f126e69d77" executionId="678c574a-4f91-4891-8787-9cd85c7cce6b" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="b8e9692a-2799-d324-cad4-d9e1ee78a547" executionId="40de4341-7de5-4783-a328-b67d951af0b0" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="b1ff0e2e-22bb-b691-9fc9-0d131cd50ce3" executionId="2f19ed8f-d45d-4e63-aa5b-83a184a1300c" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="3c0c1848-363b-5f2e-aa15-3be0d46f57ff" executionId="ecea5a20-b909-481d-838d-3c70fd2a4bc4" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="705f9806-2068-2783-f4a8-7d0438257318" executionId="f60a25a6-2170-4f56-ae7b-7d1ccc86363b" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="79aea8b3-1f18-8e76-6a8c-bbfcab35944a" executionId="9b6445ca-2c21-4833-be2e-6f729014bcc4" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="f63d4fb9-191e-9f7d-5893-383919d7ceac" executionId="f64fc083-dcfa-42b6-a981-a24d446c54ca" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="74401be5-294f-6ac2-be37-dee2942173ed" executionId="a59f8c36-f09c-4ce0-8ae2-364df32b7b8e" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="737c4c17-6869-9d7f-aa2e-65fab69b55b4" executionId="a8eebceb-e6e9-42bb-a3d8-4d6c30a18c6a" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="2508600d-c0bc-b0ea-7956-811834e97a66" executionId="4abaea90-0c7f-4d65-9beb-f64b5fb9d2fe" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="7a7b95fa-a65b-9e8b-a107-7a7f14b9afaa" executionId="2bec1a23-4817-4757-b5d1-a2d006ee3345" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="f09545d8-c53e-4d39-6c94-4b9fc7143fe7" executionId="58188153-de0e-4b2e-9450-2fcbb1102dd6" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="1caf44e2-c1f2-48b0-a84e-3b67eb9abd2e" executionId="0076498e-009c-4456-9844-273cd3e77e7b" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="b34e5094-83a5-68db-0f07-2161b4390097" executionId="c5a69f7c-da4a-4e71-997a-3939a29c7ee4" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="cf935923-fa46-b686-890f-5635dddeb35a" executionId="57c7cf87-7a2c-41da-af67-081b3059be7f" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="50506992-6b56-6fa6-93f9-ae2a52d6532b" executionId="ea326e57-3556-4ce8-a103-dead88bf9f04" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="274e9371-1732-0ab7-e944-90969fb2be98" executionId="dde63e50-1e02-4062-9053-75b04d1ecba4" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="08578dd4-732e-3379-d6bd-cedc696ba664" executionId="43aa095e-ad63-4a86-8c32-2c52ad76deca" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="ef7fbc01-841e-3394-808e-748d8c5b830f" executionId="49c6296c-6564-44a0-bc5f-389c80fbce65" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="4611e602-89d9-0533-f64f-5c260c7ed3e8" executionId="e19d8599-d363-4e36-ac94-0ba27042c148" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="aa5d06df-74c7-a520-f8ed-82879a70f162" executionId="7849a481-3b10-40fd-a0a9-03257bf3c04e" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="f2ab159a-9b08-a72b-a0c5-c3ad1264bb9c" executionId="0a363ac4-a483-4557-8d65-e8e247920ad4" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="1cd3b928-b92e-d37d-10c3-db865816cec3" executionId="e95233bb-8618-434a-886e-1f0a8cf8378d" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="0a233c07-bb5e-7aa3-e3e1-dd6c74789370" executionId="0bc36b6d-a9a8-4ae2-9836-ea795f38423b" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="f246ffb7-08bc-9801-863b-63983086ec63" executionId="52ba9c31-1999-4f7b-8c53-35c434eba65b" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="55af773d-a705-91a7-5b2d-7a3c8e3c0c90" executionId="6175d17f-8c2e-4614-866f-7ade9b80b348" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="304fc24f-20a5-7866-aef3-1e86ccf712b6" executionId="deba2b4c-234a-4913-b314-198215fbcca2" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="103afd23-56e0-811f-1b0f-60db776d6eaa" executionId="3fa29f5d-fa23-46eb-a804-897d9a9bff89" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="7e4298e8-1140-994e-60dc-018d97dea193" executionId="c16d2355-d2d3-4562-a88e-43951aaff947" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="a7e88e42-c0e0-ab1e-4752-107e848399b0" executionId="faa2793e-a4be-4b92-81d5-2f67864364f4" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="0e6b245e-d949-73af-b518-fa433d4c3a04" executionId="10162c95-759d-4ed9-b7c3-1fb6b8c184db" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="a54d455d-2600-9cac-4e16-1f86a90122d0" executionId="f4906602-bd05-4cc7-81a9-5d93bee2bcbe" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="ee0e0172-22ff-3036-2d4f-71d9670e24d3" executionId="68adeb4a-c752-411f-b604-08e9c26384c8" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="b8bdf300-8292-a8d2-fd0c-57680fe59552" executionId="954e3496-5bc0-4ade-816a-53ed7f7a9b0e" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="ac46abf0-70c7-b60b-df28-93529dce7ec4" executionId="418dc5b7-78d6-48d3-a736-66021c7cc24f" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="e1b7615e-b0ac-62b7-6365-b6bf6d1a33cd" executionId="f4f4e55b-1515-47c8-b36f-b3f4607858f8" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="b1dbbf84-2c7c-3e14-cf64-6250a4e6a37e" executionId="cd030774-5f8e-42c3-853a-773f1f8044aa" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="cfffddff-6096-a349-f5d3-7399b92616f7" executionId="c8713d58-24c8-48fe-a734-3ef5732ef055" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="f8cb35ad-a445-9f73-cf87-ddea6e7cf303" executionId="ffae3fbb-d40c-4b37-92bf-db5bc6b945cf" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="e27d6b48-39be-7aa9-f625-9b98a15db4e6" executionId="5eebb627-996b-445a-9f2a-9dd37e974a3b" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestEntry testId="f76c2753-ad17-847f-a188-df4314deea14" executionId="d24659a2-0632-41c5-8c30-9480cf0667c2" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
  </TestEntries>
  <TestLists>
    <TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
    <TestList name="All Loaded Results" id="19431567-8539-422a-85d7-44ee4e166bda" />
  </TestLists>
  <ResultSummary outcome="Completed">
    <Counters total="44" executed="44" passed="44" failed="0" error="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
    <Output>
      <StdOut>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 8.0.34)
[xUnit.net 00:00:00.07]   Discovering: MetaObjects.Conformance.Tests
[xUnit.net 00:00:00.29]   Discovered:  MetaObjects.Conformance.Tests
[xUnit.net 00:00:00.30]   Starting:    MetaObjects.Conformance.Tests
[xUnit.net 00:00:00.85]   Finished:    MetaObjects.Conformance.Tests
</StdOut>
    </Output>
  </ResultSummary>
</TestRun>
  • Outcome: ⚠️ 2 issues (1 warning, 1 info) across 1 run (2m58s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 3 issues (1 warning, 2 infos)
  • ⚠️ CHANGELOG.md:13 - The change edits the ## [Unreleased] section of CHANGELOG.md directly and adds a ### Upgrading from 1.3.1 heading. changelog.d/README.md says: "Do not edit the ## [Unreleased] section of CHANGELOG.md in a pull request. Add one new file here per change instead." This PR is one of five parallel B1 PRs (B1-ts, B1-cs, B1-java, B1-py, B1-rs), so the shared top of [Unreleased] is very likely to conflict. Fix: move the entry to changelog.d/csharp-reference-facet.md as one bullet. Put the ReferenceDescriptor upgrade note in an indented Upgrading: paragraph. Keep TargetType, TargetSubType, DottedFieldPath and ErrorCode in code spans so check-export-surface.mjs still finds them, because it reads fragment Upgrading: paragraphs. Then revert the CHANGELOG.md hunk.
  • ⚠️ server/csharp/MetaObjects.Cli/VerifyCommand.cs:438 - The provider code (MetaError.CodeName) is used in only one CLI site. VerifyCommand.cs:322 now prints CodeName, but these sibling load-error paths still use e.Code: VerifyCommand.cs:438 (verify --codegen error text), VerifyCommand.cs:548 (the templates outcome's LoadErrors, which Program.cs:621 prints as load error: {e}), and GenCommand.cs:124 (the dotnet meta gen LoadErrors). When a facet's errorCode or wrongSystemCode names a provider code such as ERR_GRANT_CROSSES_SYSTEM, those paths print ERR_UNKNOWN and lose the code. The CHANGELOG says that CodeName "gives either". Fix: use e.CodeName at all three sites.
  • ℹ️ server/csharp/MetaObjects/Validation/RegisteredValidation.cs:61 - Validation and resolution disagree on which schema owns an attribute name. ReferenceAttrDescriptors checks attr.Ref is null before seen.Add(attr.Name). So a per-type attr with no facet does not shadow a common (*.*) attr of the same name that has a facet, and validation enforces the common facet. ResolveReferences.FacetOf (ResolveReferences.cs:38) and TypeRegistry.FindAttrSchema use per-type-wins, so the resolver skips that facet. Result: the loader can check an attr with one rule and bind it with another. No shipped definition can reach this case today. Fix: if (!seen.Add(attr.Name) || attr.Ref is null) continue;.
  • ℹ️ server/csharp/MetaObjects/Validation/RegisteredValidation.cs:119 - The sameSystem check finds the target's system from the lookup path (path.LastOrDefault(n =&gt; n.Type == TYPE_SYSTEM)), not from the target's physical ancestors. spec/metamodel-definitions.md says: "The system of a node is its nearest ancestor, or the node itself, whose type is system." The two rules differ for a child inherited through extends. In the test An_inherited_child_keeps_the_path_it_was_addressed_by_and_is_in_that_system, Ledger extends Parcels and Ledger's web has runsAs: clerk, where clerk is physically in Parcels. The implementation passes this case; the literal spec rule fails it. The behavior looks deliberate because a test pins it. Please confirm that the spec text should be amended to say "the system the lookup path went through", or that the check should use the physical ancestor. Whichever rule is chosen, B1-ts, B1-java, B1-py and B1-rs must use the same rule.

🔧 Fix applied.
3 issues (1 warning, 2 infos) still open:

  • ⚠️ CHANGELOG.md:13 - The change edits the ## [Unreleased] section of CHANGELOG.md directly and adds a ### Upgrading from 1.3.1 heading. changelog.d/README.md says: "Do not edit the ## [Unreleased] section of CHANGELOG.md in a pull request. Add one new file here per change instead." This PR is one of five parallel B1 PRs (B1-ts, B1-cs, B1-java, B1-py, B1-rs), so the shared top of [Unreleased] is very likely to conflict. Fix: move the entry to changelog.d/csharp-reference-facet.md as one bullet. Put the ReferenceDescriptor upgrade note in an indented Upgrading: paragraph. Keep TargetType, TargetSubType, DottedFieldPath and ErrorCode in code spans so check-export-surface.mjs still finds them, because it reads fragment Upgrading: paragraphs. Then revert the CHANGELOG.md hunk.
  • ℹ️ server/csharp/MetaObjects/Validation/RegisteredValidation.cs:119 - The sameSystem check finds the target's system from the lookup path (path.LastOrDefault(n =&gt; n.Type == TYPE_SYSTEM)), not from the target's physical ancestors. spec/metamodel-definitions.md says: "The system of a node is its nearest ancestor, or the node itself, whose type is system." The two rules differ for a child inherited through extends. In the test An_inherited_child_keeps_the_path_it_was_addressed_by_and_is_in_that_system, Ledger extends Parcels and Ledger's web has runsAs: clerk, where clerk is physically in Parcels. The implementation passes this case; the literal spec rule fails it. The behavior looks deliberate because a test pins it. Please confirm that the spec text should be amended to say "the system the lookup path went through", or that the check should use the physical ancestor. Whichever rule is chosen, B1-ts, B1-java, B1-py and B1-rs must use the same rule.
  • ℹ️ server/csharp/MetaObjects.Conformance.Tests/ReferenceFacetTests.cs:581 - A_parent_relative_references_value_resolves_its_owner uses a model that cannot load cleanly. Order is an object.value with an enforced identity.reference (no enforce: false), which ValidateValuePurity refuses with ERR_SUBTYPE_RULE_VIOLATION. The test therefore only asserts that ERR_INVALID_REFERENCE is absent. It would still pass if ..::Address.id bound the wrong node, was never bound, or caused a different error. Fix: make Order an object.entity with a primary identity (or add enforce: false), call Clean(r), and assert that the reference binds acme::Address and is rewritten to acme::Address.id. The sibling test A_parent_relative_references_value_still_suggests_the_object_in_another_package (line 552) uses the same invalid value-object shape.

🔧 Fix applied.
6 issues (2 warnings, 4 infos) still open:

  • ⚠️ CHANGELOG.md:13 - The change edits the ## [Unreleased] section of CHANGELOG.md directly and adds a ### Upgrading from 1.3.1 heading. changelog.d/README.md says: "Do not edit the ## [Unreleased] section of CHANGELOG.md in a pull request. Add one new file here per change instead." This PR is one of five parallel B1 PRs (B1-ts, B1-cs, B1-java, B1-py, B1-rs), so the shared top of [Unreleased] is very likely to conflict. Fix: move the entry to changelog.d/csharp-reference-facet.md as one bullet. Put the ReferenceDescriptor upgrade note in an indented Upgrading: paragraph. Keep TargetType, TargetSubType, DottedFieldPath and ErrorCode in code spans so check-export-surface.mjs still finds them, because it reads fragment Upgrading: paragraphs. Then revert the CHANGELOG.md hunk.
  • ℹ️ server/csharp/MetaObjects/Validation/RegisteredValidation.cs:119 - The sameSystem check finds the target's system from the lookup path (path.LastOrDefault(n =&gt; n.Type == TYPE_SYSTEM)), not from the target's physical ancestors. spec/metamodel-definitions.md says: "The system of a node is its nearest ancestor, or the node itself, whose type is system." The two rules differ for a child inherited through extends. In the test An_inherited_child_keeps_the_path_it_was_addressed_by_and_is_in_that_system, Ledger extends Parcels and Ledger's web has runsAs: clerk, where clerk is physically in Parcels. The implementation passes this case; the literal spec rule fails it. The behavior looks deliberate because a test pins it. Please confirm that the spec text should be amended to say "the system the lookup path went through", or that the check should use the physical ancestor. Whichever rule is chosen, B1-ts, B1-java, B1-py and B1-rs must use the same rule.
  • ⚠️ server/csharp/MetaObjects/Registry/Spec/SpecMetamodelReader.cs:229 - Simplification: the change adds SpecMetamodelReader.FromJson as new public API. The intent needs the spec reader to carry ref, with xUnit tests that use a test provider. It does not ask for a public way to load definitions from JSON text. MetaObjects.csproj already grants InternalsVisibleTo to MetaObjects.Conformance.Tests, so the narrower form is to make FromJson internal. Publishing it commits the 1.x surface to a data-form provider path in C#. NamingRefs.DeclaringNodeFor (NamingRefs.cs:252) is also newly public for in-assembly callers only, and can be internal for the same reason.
  • ℹ️ server/csharp/MetaObjects/Errors.cs:433 - One path still drops the new ProviderCode. This is a sibling site that the round 2 CodeName fix did not cover. SharedModel.Load (Config/SharedModel.cs:210) turns the first MetaError into new MetaModelException(Message, Code). For example, call SharedModel.Build with publisher providers and a Files list that omits the target of a facet that names its own errorCode. The exception then carries only ERR_UNKNOWN, and the provider's code appears nowhere. Fix: when ProviderCode is set, keep it on the exception, for example by prefixing CodeName to the message.
  • ℹ️ server/csharp/MetaObjects/Loader/ResolveReferences.cs:38 - FacetState.FacetOf is a second copy of the rule that a per-type attribute wins over a common attribute. TypeRegistry.FindAttrSchema already defines that rule, so registry?.FindAttrSchema(node.Type, node.SubType, name)?.Ref is equivalent. The copy also calls GetCommonAttrs(), which allocates a new list, for every own attribute that is not declared on the type, on every load. Fix: replace the body with the FindAttrSchema call.
  • ℹ️ server/csharp/MetaObjects/Errors.cs:349 - C# now raises ERR_REF_UNRESOLVED and ERR_REF_WRONG_KIND (lines 349-350), but neither is in fixtures/conformance/ERROR-CODES.json. spec/metamodel-definitions.md says the two default codes are in that file "once a reader raises them". The remedy needs coordination across the parallel B1 PRs. The TypeScript errors.test.ts requires its code list and the JSON file to agree exactly, so adding the codes from this PR alone also needs the TypeScript list changed. Please confirm that B1-ts (or a named follow-up) adds both codes before the release.

🔧 Fix applied.
3 issues (1 warning, 2 infos) still open:

  • ⚠️ CHANGELOG.md:13 - The change edits the ## [Unreleased] section of CHANGELOG.md directly and adds a ### Upgrading from 1.3.1 heading. changelog.d/README.md says: "Do not edit the ## [Unreleased] section of CHANGELOG.md in a pull request. Add one new file here per change instead." This PR is one of five parallel B1 PRs (B1-ts, B1-cs, B1-java, B1-py, B1-rs), so the shared top of [Unreleased] is very likely to conflict. Fix: move the entry to changelog.d/csharp-reference-facet.md as one bullet. Put the ReferenceDescriptor upgrade note in an indented Upgrading: paragraph. Keep TargetType, TargetSubType, DottedFieldPath and ErrorCode in code spans so check-export-surface.mjs still finds them, because it reads fragment Upgrading: paragraphs. Then revert the CHANGELOG.md hunk.
  • ℹ️ server/csharp/MetaObjects/Validation/RegisteredValidation.cs:119 - The sameSystem check finds the target's system from the lookup path (path.LastOrDefault(n =&gt; n.Type == TYPE_SYSTEM)), not from the target's physical ancestors. spec/metamodel-definitions.md says: "The system of a node is its nearest ancestor, or the node itself, whose type is system." The two rules differ for a child inherited through extends. In the test An_inherited_child_keeps_the_path_it_was_addressed_by_and_is_in_that_system, Ledger extends Parcels and Ledger's web has runsAs: clerk, where clerk is physically in Parcels. The implementation passes this case; the literal spec rule fails it. The behavior looks deliberate because a test pins it. Please confirm that the spec text should be amended to say "the system the lookup path went through", or that the check should use the physical ancestor. Whichever rule is chosen, B1-ts, B1-java, B1-py and B1-rs must use the same rule.
  • ℹ️ server/csharp/MetaObjects/Errors.cs:349 - C# now raises ERR_REF_UNRESOLVED and ERR_REF_WRONG_KIND (lines 349-350), but neither is in fixtures/conformance/ERROR-CODES.json. spec/metamodel-definitions.md says the two default codes are in that file "once a reader raises them". The remedy needs coordination across the parallel B1 PRs. The TypeScript errors.test.ts requires its code list and the JSON file to agree exactly, so adding the codes from this PR alone also needs the TypeScript list changed. Please confirm that B1-ts (or a named follow-up) adds both codes before the release.
⚠️ **Test** - 2 issues (1 warning, 1 info)
  • ℹ️ No live drive of the reference facet through dotnet meta verify/gen. The facet only appears in provider definitions, and building a disposable provider fixture was not attempted within the time budget. Coverage is in-process xUnit only.
  • ⚠️ live validation verdict: inconclusive (0 of 5 scenarios were driven live against the product); untested: Unresolved reference reports unresolved error (xUnit, in-process loader), Wrong kind is rejected (xUnit, in-process), Wrong subtype is rejected (xUnit, in-process), Reference crossing a system fails with wrongSystemCode (xUnit, in-process), Role and app both named api resolve by kind (xUnit, in-process)
  • Live validation: ⚠️ inconclusive - 0 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Unresolved reference reports unresolved error (xUnit, in-process loader) ⏸️ untested no Only in-process test; no live dotnet meta drive. Needs a disposable provider definition with a ref facet.
Wrong kind is rejected (xUnit, in-process) ⏸️ untested no Only in-process test; no live CLI drive.
Wrong subtype is rejected (xUnit, in-process) ⏸️ untested no Only in-process test; no live CLI drive.
Reference crossing a system fails with wrongSystemCode (xUnit, in-process) ⏸️ untested no Only in-process test; no live CLI drive.
Role and app both named api resolve by kind (xUnit, in-process) ⏸️ untested no Only in-process test; no live CLI drive.
  • scripts/ci-local.sh --affected --strict-toolchains
  • DOTNET_CLI_TELEMETRY_OPTOUT=1 dotnet test server/csharp/MetaObjects.Conformance.Tests --filter &#34;FullyQualifiedName~ReferenceFacet&#34; → 44 passed, 0 failed (trx at evidence dir refacet.trx)
  • Listed test names in server/csharp/MetaObjects.Conformance.Tests/ReferenceFacetTests.cs to map intent cases: unresolved, wrong kind, wrong subtype, crosses system, role and app both named api
🔧 **Document** - 2 issues found → auto-fixed ✅
  • ⚠️ spec/metamodel-definitions.md:175 - spec/metamodel-definitions.md "## Status" still says "no port's spec reader reads it" and "No definition file uses ref yet". The C# loader now reads and enforces ref, so that line is stale for C#. It is not edited here because the five B1 PRs run in parallel and all edit the same per-port status fact, so it would conflict. Fix once B1-ts, B1-java, B1-py and B1-rs have merged: state per port which ports read the facet.
  • ℹ️ changelog.d/csharp-reference-facet.md - Nothing else needs a doc edit. CHANGELOG.md is untouched, the change lives in the changelog.d fragment, and docs/ports/csharp.md and docs/features/extending-with-providers.md do not describe the C# reference types.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

The spec reader validates `ref` on an attr entry and carries it to AttrSchema.Ref; the
registry-derived walk enforces it through a kind-typed symbol table (System.child,
pkg::System.child, bare values found in the referrer's containers first, untyped lookup
only for the wrong-kind code); the reference pass binds facet attributes to the walked
path and keeps a value as written when its canonical spelling would not reload to the
same target; the registry manifest writes `ref` only when present. Provider codes keep
their spelling in MetaError.ProviderCode. Mirrors the TypeScript loader; no definition
file uses the facet, so no registry, manifest or generated output changes.
@dmealing
dmealing merged commit 99b6d20 into main Dec 3, 2026
11 checks passed
@dmealing
dmealing deleted the fm/mo-140-w1-b1-cs branch December 3, 2026 05:55
dmealing added a commit that referenced this pull request Dec 3, 2026
…er (#696)

* feat(java): read and enforce the reference facet in the Java loader

The spec reader validates `ref` on an attr entry (refusing a bad facet, or one on a
structural child) and carries it onto the attr's ChildRequirement / CommonAttributeDef; the
registry-derived walk enforces it through a kind-typed symbol table (System.child,
pkg::System.child, bare values found in the referrer's containers first, untyped lookup only
for the wrong-kind code, sameSystem judged on the walked path); the reference pass binds
facet attributes to the walked path and keeps a value as written when its canonical spelling
would not reload to the same target; the registry manifest writes `ref` only when present.
A provider's own code keeps its spelling (MetaDataException.getProviderCode / getCodeName).
A parent-relative `..::` owner now resolves (the walk no longer cuts at the first dot), and a
dotted `extends` whose owner is a non-object top-level node resolves, as in TS and C#.
Kotlin runs on it. No definition file uses the facet, so no registry, manifest or generated
output changes. Mirrors the C# loader (#694) case for case.

* no-mistakes(review): apply reviewer inline fixes

* no-mistakes(document): correct stale reference-facet notes for Java
dmealing added a commit that referenced this pull request Dec 3, 2026
…697)

The spec reader in providers.rs validates `ref` on an attr entry (refusing a bad facet, or
one on a structural child) and carries it to AttrSchema::reference. The registered walk
enforces it through a kind-typed symbol table: System.child and pkg::System.child, bare values
found in the referrer's containers first, an untyped lookup only for the wrong-kind code, and
sameSystem judged on the walked path. The reference pass writes the walked path and keeps a
value as written when its canonical spelling would not look up the same target. The registry
manifest writes `ref` only when present. A provider's own code keeps its spelling in
MetaError::provider_code. A parent-relative `..::Owner.field` value resolves its owner.

A same-document root-level node and a same-named packaged node are no longer merged, which
closes yaml-ref-root-escape: yaml-conformance is 19 of 19 with an empty ledger. No definition
file uses the facet, so no registry, manifest or generated output changes. Mirrors the
TypeScript (#695), C# (#694) and Java (#696) loaders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant