Skip to content

Add FLEx semantic-domain fields to MiniLcm - #2536

Open
hahn-kev-bot wants to merge 3 commits into
developfrom
feat/semantic-domain-fields
Open

Add FLEx semantic-domain fields to MiniLcm#2536
hahn-kev-bot wants to merge 3 commits into
developfrom
feat/semantic-domain-fields

Conversation

@hahn-kev-bot

@hahn-kev-bot hahn-kev-bot commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

The first part of adding more fields to semantic domains, after this I want to add questions.


AI Summary

Summary

  • Add Abbreviation, Description, OcmCodes, and LouwNidaCodes to MiniLcm SemanticDomain, wired through FwData bridge, CRDT create/sync, normalization, and generated TS types.
  • Keep scalar Code as a UI/filter convenience: prefer an explicit Code (e.g. from FLEx), otherwise derive from Abbreviation; do not map Code back into Abbreviation.
  • Add EF migration for the new projected columns plus round-trip/sync/normalization test coverage.

Test plan

  • dotnet test backend/FwLite/LcmCrdt.Tests --filter FullyQualifiedName~SemanticDomain
  • dotnet test backend/FwLite/FwDataMiniLcmBridge.Tests --filter FullyQualifiedName~SemanticDomain
  • dotnet test backend/FwLite/FwLiteProjectSync.Tests --filter FullyQualifiedName~UpdateDiffTests.SemanticDomain
  • dotnet test backend/FwLite/MiniLcm.Tests --filter FullyQualifiedName~WriteNormalizationTests
  • Confirm task fw-lite:has-stale-generated-types is clean after building FwLiteShared

Made with Cursor

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>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@hahn-kev, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cc0c949c-2964-4c8d-9ed3-d7297cc6dfb3

📥 Commits

Reviewing files that changed from the base of the PR and between 6f8fbf1 and 76a2bd4.

📒 Files selected for processing (39)
  • backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs
  • backend/FwLite/FwDataMiniLcmBridge/Api/LcmHelpers.cs
  • backend/FwLite/FwDataMiniLcmBridge/Api/UpdateProxy/UpdateSemanticDomainProxy.cs
  • backend/FwLite/FwLiteProjectSync.Tests/Import/ImportTests.cs
  • backend/FwLite/FwLiteProjectSync.Tests/Import/ResumableTests.cs
  • backend/FwLite/FwLiteProjectSync.Tests/Snapshots/sena-3_snapshot.2026-06-18.verified.txt
  • backend/FwLite/FwLiteProjectSync.Tests/SyncTests.cs
  • backend/FwLite/FwLiteProjectSync.Tests/UpdateDiffTests.cs
  • backend/FwLite/FwLiteProjectSync.Tests/sena-3-live.verified.sqlite
  • backend/FwLite/FwLiteProjectSync.Tests/sena-3-live_snapshot.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Changes/ChangeDeserializationRegressionData.latest.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Changes/ChangeDeserializationRegressionData.legacy.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Data/MigrationTests_FromScriptedDb.v1.ChangeEntities.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Data/MigrationTests_FromScriptedDb.v1.ProjectSnapshot.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Data/MigrationTests_FromScriptedDb.v1.Snapshots.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Data/MigrationTests_FromScriptedDb.v2.ChangeEntities.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Data/MigrationTests_FromScriptedDb.v2.ProjectSnapshot.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Data/MigrationTests_FromScriptedDb.v2.Snapshots.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Data/SnapshotDeserializationRegressionData.latest.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Data/SnapshotDeserializationRegressionData.legacy.verified.txt
  • backend/FwLite/LcmCrdt.Tests/Data/VerifyRegeneratedSnapshotsAfterMigrationFromScriptedDb.v1.verified.json
  • backend/FwLite/LcmCrdt.Tests/Data/VerifyRegeneratedSnapshotsAfterMigrationFromScriptedDb.v2.verified.json
  • backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.VerifyDbModel.verified.txt
  • backend/FwLite/LcmCrdt/Changes/CreateSemanticDomainChange.cs
  • backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs
  • backend/FwLite/LcmCrdt/Migrations/20260807043954_AddSemanticDomainExtendedFields.Designer.cs
  • backend/FwLite/LcmCrdt/Migrations/20260807043954_AddSemanticDomainExtendedFields.cs
  • backend/FwLite/LcmCrdt/Migrations/LcmCrdtDbContextModelSnapshot.cs
  • backend/FwLite/MiniLcm.Tests/AutoFakerHelpers/AutoFakerDefault.cs
  • backend/FwLite/MiniLcm.Tests/BasicApiTestsBase.cs
  • backend/FwLite/MiniLcm.Tests/Helpers/NfcTestData.cs
  • backend/FwLite/MiniLcm.Tests/QueryEntryTestsBase.cs
  • backend/FwLite/MiniLcm.Tests/SemanticDomainTestsBase.cs
  • backend/FwLite/MiniLcm/Models/SemanticDomain.cs
  • backend/FwLite/MiniLcm/Normalization/MiniLcmApiWriteNormalizationWrapper.cs
  • backend/FwLite/MiniLcm/SyncHelpers/SemanticDomainSync.cs
  • backend/FwLite/MiniLcm/Validators/SemanticDomainValidator.cs
  • frontend/viewer/src/lib/dotnet-types/generated-types/MiniLcm/Models/ISemanticDomain.ts
  • frontend/viewer/src/project/demo/in-memory-demo-api.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Aug 7, 2026
@hahn-kev
hahn-kev requested a review from myieye August 7, 2026 06:30
@argos-ci

argos-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Aug 7, 2026, 7:35 AM
e2e (Inspect) ✅ No changes detected - Aug 7, 2026, 7:43 AM

hahn-kev and others added 2 commits August 7, 2026 14:23
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>
@hahn-kev
hahn-kev marked this pull request as ready for review August 7, 2026 09:01

@myieye myieye left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread backend/FwLite/FwLiteProjectSync.Tests/UpdateDiffTests.cs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +43 to +44
public string OcmCodes { get; init; } = string.Empty;
public string LouwNidaCodes { get; init; } = string.Empty;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be safer, possible and or tidier to remove the setter and make it purely calculated?

Comment thread backend/FwLite/MiniLcm/SyncHelpers/SemanticDomainSync.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants