Add FLEx semantic-domain fields to MiniLcm - #2536
Conversation
Map Abbreviation, Description, OcmCodes, and LouwNidaCodes through model, bridge, CRDT, and sync; keep Code as a convenience that prefers an explicit value then falls back to Abbreviation. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reached
Next review available in: 27 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (39)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Update demo API types, align AutoFaker Code/Abbreviation for FwData round-trips, treat LCM missing-string marker as empty, and regenerate Verify/sena-3 snapshots for the new fields. Co-authored-by: Cursor <cursoragent@cursor.com>
Set Code on fixtures alongside Abbreviation so BeEquivalentTo no longer needs to exclude it. Co-authored-by: Cursor <cursoragent@cursor.com>
myieye
left a comment
There was a problem hiding this comment.
I didn't find any concrete blockers per se.
It's obvious that you've already put lots of thought into the handling of the weird mini-lcm-only SemanticDomain.Code property. I do wonder though if maybe making it purely calculated and/or deprecated in the context of change objects might be good.
There was a problem hiding this comment.
I'd keep a single new change per type (same for the latest snapshots). E.g. there are multiple new "CreateSense" changes. It's unfortunate that, unless you remove some of the added data, the number of changes increases exponentially.
I suppose that's something we could change...just make it add a new json blob for the first occurence of each change type. That would probably be an improvement albeit a tiny bit more to reason about.
| public string OcmCodes { get; init; } = string.Empty; | ||
| public string LouwNidaCodes { get; init; } = string.Empty; |
There was a problem hiding this comment.
It was an interesting choice to make these non-nullable considering they appear to be nullable in LibLcm?
Null tends to be a clearer signal than an empty string, no? I guess we already have that handling for code.
|
|
||
| public required MultiString Name { get; init; } | ||
| public bool Predefined { get; init; } | ||
| public string Code { get; init; } = string.Empty; |
There was a problem hiding this comment.
Should code be deprecated or is the convenience warranted? I don't entirely understand how all these properties relate 🙃
| } | ||
|
|
||
| [SetsRequiredMembers] | ||
| public CreateSemanticDomainChange(Guid entityId, MultiString name, string code, bool predefined = false) |
There was a problem hiding this comment.
I think it would probably be an improvement to remove this constructor.
There are some callers that already have a semantic-domain object.
There are a few that don't, but it's probably worth migrating them.
| /// When empty, filled from Abbreviation via <see cref="ApplyResolvedCode"/>. | ||
| /// When set (e.g. by FLEx), Code is preferred over Abbreviation. | ||
| /// </summary> | ||
| public virtual string Code { get; set; } = string.Empty; |
There was a problem hiding this comment.
I wonder if it would be safer, possible and or tidier to remove the setter and make it purely calculated?
The first part of adding more fields to semantic domains, after this I want to add questions.
AI Summary
Summary
Abbreviation,Description,OcmCodes, andLouwNidaCodesto MiniLcmSemanticDomain, wired through FwData bridge, CRDT create/sync, normalization, and generated TS types.Codeas a UI/filter convenience: prefer an explicit Code (e.g. from FLEx), otherwise derive from Abbreviation; do not map Code back into Abbreviation.Test plan
dotnet test backend/FwLite/LcmCrdt.Tests --filter FullyQualifiedName~SemanticDomaindotnet test backend/FwLite/FwDataMiniLcmBridge.Tests --filter FullyQualifiedName~SemanticDomaindotnet test backend/FwLite/FwLiteProjectSync.Tests --filter FullyQualifiedName~UpdateDiffTests.SemanticDomaindotnet test backend/FwLite/MiniLcm.Tests --filter FullyQualifiedName~WriteNormalizationTeststask fw-lite:has-stale-generated-typesis clean after building FwLiteSharedMade with Cursor