feat(generator): discover DTOs carried as [Factory] entity properties (TRIM-002) - #70
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Intermittent 2s WaitAsync timeout under parallel test load (observed locally and on PR #69 CI; passes in isolation and on re-runs). Skipped per user decision; no fix queued. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…aft) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… (TRIM-002) WalkDtoGraph correctly refused to treat [Factory] entities as DTOs but never walked their properties, so a DTO reachable only as an entity property (zTreatment's TreatmentBanner / DashboardContactResult) got no preservation and was trimmed on the client. Every class carrying [Factory] directly now walks its own public property graph during TypeInfo construction (alongside the ordinal-property walk) and emits Register/PreserveType for reachable DTOs in its own registrar. The entity itself is never bucketed (DI registration preserves it), and factory-typed properties are skipped — each [Factory] class's own registrar owns its graph. Also tightens the System-namespace exclusion to a segment match (Systems.Domain-style consumer namespaces were silently excluded — TRIM-001 code-review callout). - Unit: EntityPropertyDtoDiscoveryTests (9) incl. per-tree child-vs-parent registrar assertions, LazyLoad<T> Value-descent, cycles, Systems.* - Trimmed harness: EntityPropertyDtoSmokeTest — carried DTO + record never constructed in harness code; negative control verified (walk disabled → ctor stripped → harness exits 1) - Docs: trimming.md + CLAUDE-DESIGN.md entity property-graph discovery - Skips second flaky RelayTimingTests member (same signature, per user decision) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dedupe, System exclusion
Adds the four gate-requested tests (inherited base-chain property,
[Factory] record aggregate self-walk, cross-walk dedupe, System.*
exclusion half of the hardening) and anchors the per-tree FactoryTree
helper to the .{hint}.g.cs file-name shape so hints can never
substring-match another factory's tree.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lout Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third plan of the TRIM todo — the second of the two zTreatment failure classes. DTO discovery correctly refused to treat
[Factory]entities as DTOs, but never walked their properties, so a DTO reachable only as an entity property (TreatmentBanneron the[Execute]-opened aggregate,DashboardContactResultin aList<T>on a query entity) got no preservation and was trimmed on the client.Changes
[Factory]directly walks its own public property graph (inherited chain included) during generation and emitsRegister<T>/PreserveType<T>for reachable DTOs in its own registrar. The entity itself is never bucketed (DI registration preserves it); factory-typed properties are skipped — each[Factory]class's own registrar owns its graph, so no global reachability set and free cross-entity cycle safety.IsDtoStructureCandidate'sSystemexclusion is now a segment match — consumer namespaces likeSystems.Domainare no longer silently excluded, whileSystem/System.*framework types remain excluded (both halves pinned by tests).EntityPropertyDtoDiscoveryTestswith per-tree registrar assertions (child-vs-parent separation), base-class inheritance,[Factory]record aggregates,LazyLoad<T>Value-descent, cycles, cross-walk dedupe. Harness:EntityPropertyDtoSmokeTest— carried DTO + record never constructed in harness code, negative control verified (walk disabled → ctor stripped → exit 1).docs/trimming.md+ CLAUDE-DESIGN.md now document the entity-graph entry point, the manual-preservation boundary, and the deliberate interface-factory-impl exception.RelayTimingTestsmember (identical timeout signature; per user decision).Reviews (in
docs/todos/TRIM-dto-trimming-preservation-gaps/reviews/)Test plan
🤖 Generated with Claude Code