Align received naming single tfm
Aligns the .received. file name with its .verified. file name for single-target-framework projects, and clarifies the naming rules in the docs and AI guidance.
Background
UniqueForRuntime/UniqueForRuntimeAndVersion previously applied only to the verified name. On a single-TFM project that meant a mismatched pair:
WidgetTests.Render.received.txt <- no runtime token
WidgetTests.Render.DotNet.verified.txt <- runtime token
The two names could not be paired by name, which breaks external tooling that maps a received file to its verified file (e.g. review/accept tools). The received file now carries the same uniqueness as the verified file when a single framework is targeted.
Multi-TFM behaviour is deliberately unchanged: there the received file always keeps the runtime and version, so the parallel runs of each framework don't overwrite each other's received files.
How received and verified names can diverge
Both names are built from the same template:
{TypeName.MethodName} {parameters} {uniqueness} .received/.verified.{ext}
TypeName.MethodName and extension are always identical. Divergence comes from two independent axes, and a file can diverge on either or both at once:
- Uniqueness — the runtime token. This is the axis this PR changed.
- Parameters — the received name keeps parameters the verified name drops. Pre-existing; unchanged here.
Baseline for the examples: class WidgetTests { Task Render() } on net11.0 / x64 → Runtime = DotNet, RuntimeAndVersion = DotNet11_0.
Axis 1 — runtime uniqueness
The shared uniqueness (target-framework / assembly-config / architecture / OS-platform, if requested) is identical on both sides. The runtime token is what differs. Verified gets DotNet for UniqueForRuntime, DotNet11_0 for UniqueForRuntimeAndVersion, nothing otherwise. Received on multi-TFM always gets DotNet11_0; on single-TFM it now matches verified.
| # | Project | Settings | received | verified | Match? |
|---|---|---|---|---|---|
| A1 | multi-TFM | (none) | WidgetTests.Render.DotNet11_0.received.txt | WidgetTests.Render.verified.txt | ✗ |
| A2 | multi-TFM | UniqueForRuntime | WidgetTests.Render.DotNet11_0.received.txt | WidgetTests.Render.DotNet.verified.txt | ✗ |
| A3 | multi-TFM | UniqueForRuntimeAndVersion | WidgetTests.Render.DotNet11_0.received.txt | WidgetTests.Render.DotNet11_0.verified.txt | ✓ |
| A4 | single-TFM | (none) | WidgetTests.Render.received.txt | WidgetTests.Render.verified.txt | ✓ |
| A5 | single-TFM | UniqueForRuntime | changed — see below | WidgetTests.Render.DotNet.verified.txt | changed |
| A6 | single-TFM | UniqueForRuntimeAndVersion | changed — see below | WidgetTests.Render.DotNet11_0.verified.txt | changed |
A5 and A6 are the only rows this PR changes. A1–A4 are byte-for-byte identical before and after.
A5 single-TFM + UniqueForRuntime
BEFORE: received WidgetTests.Render.received.txt verified WidgetTests.Render.DotNet.verified.txt ✗ mismatch
AFTER: received WidgetTests.Render.DotNet.received.txt verified WidgetTests.Render.DotNet.verified.txt ✓ match
A6 single-TFM + UniqueForRuntimeAndVersion
BEFORE: received WidgetTests.Render.received.txt verified WidgetTests.Render.DotNet11_0.verified.txt ✗ mismatch
AFTER: received WidgetTests.Render.DotNet11_0.received.txt verified WidgetTests.Render.DotNet11_0.verified.txt ✓ match
A2 is the nastiest surviving mismatch, and the reason "just strip the runtime suffix from the received name" is bad advice: received is DotNet11_0, verified is DotNet — not a suffix-strip apart.
Axis 2 — parameters (unchanged by this PR)
Received always carries the full parameter set; verified may drop some or all. Using two parameters size="large", theme="dark" (single-TFM, no UniqueFor):
| # | Settings | received | verified | Match? |
|---|---|---|---|---|
| B1 | normal params | WidgetTests.Render_size=large_theme=dark.received.txt | WidgetTests.Render_size=large_theme=dark.verified.txt | ✓ |
| B2 | IgnoreParameters("size") | WidgetTests.Render_size=large_theme=dark.received.txt | WidgetTests.Render_theme=dark.verified.txt | ✗ |
| B3 | IgnoreParametersForVerified() | WidgetTests.Render_size=large_theme=dark.received.txt | WidgetTests.Render.verified.txt | ✗ |
| B4 | IgnoreConstructorParameters | keeps ctor args | drops ctor args | ✗ |
B2 drops the named parameter only, B3 drops all of them, B4 drops the class-constructor args. UseTextForParameters applies the same text to both sides, so it never diverges.
Both axes at once
They stack. E.g. multi-TFM + IgnoreParameters("size") (same before and after this PR):
received WidgetTests.Render_size=large.DotNet11_0.received.txt
verified WidgetTests.Render.verified.txt
Takeaway
Received and verified names can differ by a runtime token and/or by dropped parameters, and the divergence is not a simple reversible transform. So the safe rule — reflected in the doc and AI-guidance changes here — is: don't reconstruct the verified name from the received name; read it off the Verified: line of the exception message. The behavioural half of this PR just removes one specific mismatch (single-TFM UniqueForRuntime*, rows A5/A6) so that case pairs by name.
Changes
InnerVerifier.PrefixForFileConvention— newGetUniquenessReceivedhelper: single-TFM received uses the verified uniqueness; multi-TFM unchanged.SingleTfmTests— three tests covering single-TFMUniqueForRuntime,UniqueForRuntimeAndVersion, andUseFileName+UniqueForRuntime(verified to fail without the fix).docs/naming.md— new "Received and single-targeting" section; the multi-targeting section notes theUseUniqueDirectorycase.docs/ai-usage.md+claude.md— accept instructions point at theVerified:line rather than deriving the name; new rule covering the runtime-suffix and ignored-parameter divergences.