Skip to content

Seed canonical morph types and regenerate search index#2219

Draft
myieye wants to merge 15 commits intofeat/sync-morph-typesfrom
claude/fix-morph-type-syncing-bQo8X
Draft

Seed canonical morph types and regenerate search index#2219
myieye wants to merge 15 commits intofeat/sync-morph-typesfrom
claude/fix-morph-type-syncing-bQo8X

Conversation

@myieye
Copy link
Copy Markdown
Collaborator

@myieye myieye commented Mar 24, 2026

Summary

This PR ensures all canonical morph type definitions are seeded into new and existing CRDT projects, and regenerates the full-text search index to include morph-type prefix/postfix tokens in searchable headwords.

Key Changes

  • Added canonical morph type definitions (CanonicalMorphTypes.cs): Defines 20 standard morph types matching FieldWorks/LibLCM specifications with verified GUIDs, names, abbreviations, and affixes. Uses frozen dictionary for immutability and performance.

  • Automatic seeding on project creation and migration: Modified CrdtProjectsService and CurrentProjectService to seed canonical morph types when:

    • Creating a new project with SeedNewProjectData: true
    • Opening an existing project that lacks morph types (via MigrateDb)
  • Search index regeneration: Added migration 20260318120000_RegenerateSearchTableForMorphTypes that clears the EntrySearchRecord table to force FTS rebuild with updated morph-type affixes.

  • Legacy snapshot patching: Updated CrdtFwdataProjectSyncService to patch legacy snapshots missing morph types during sync operations, preventing duplicates when syncing with FwData.

  • Comprehensive test coverage: Added MorphTypeSeedingTests verifying:

    • New projects receive all canonical morph types
    • Existing projects without morph types get seeded on open
    • Seeding is idempotent (no duplicates on repeated opens)
    • All MorphTypeKind enum values are covered

    Added integration test in Sena3SyncTests validating canonical definitions match FwData morph types.

  • Regression test versioning: Updated RegressionTestHelper to version 3 for snapshot compatibility.

Implementation Details

  • Morph types are seeded with fixed GUIDs matching SIL.LCModel constants, ensuring consistency across projects and with FieldWorks data.
  • Seeding uses PreDefinedData.PredefinedMorphTypes() to integrate with existing predefined data infrastructure.
  • Search index regeneration is safe: FTS table is lazily rebuilt on next query if cleared.
  • Sync operations detect and skip seeding if morph types already exist, preventing duplicates in legacy workflows.

https://claude.ai/code/session_01WDKE2vXP4gjMWjfn4cmL4p

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fcada7a8-9f5d-4e94-91a5-df1e34abaac3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-morph-type-syncing-bQo8X

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 and usage tips.

@github-actions github-actions bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Mar 24, 2026
@myieye myieye force-pushed the claude/add-lexeme-headwords-TowRX branch from dc45a12 to 823531a Compare March 24, 2026 14:27
claude and others added 7 commits March 24, 2026 15:28
- Add CanonicalMorphTypes with all 19 morph-type definitions (GUIDs from LibLCM)
- Seed morph-types for new projects via PreDefinedData.PredefinedMorphTypes
- Seed morph-types for existing projects in MigrateDb (before FTS refresh)
- Add EF migration to clear FTS table so headwords are rebuilt with morph tokens
- Patch legacy snapshots (empty MorphTypes) in sync layer to prevent duplicates
- Add tests: seeding, Sena3 verification, sync with legacy snapshots
- Add v3 to RegressionVersion enum (v3.sql dump to be generated)

https://claude.ai/code/session_01WDKE2vXP4gjMWjfn4cmL4p
… check

- Add SecondaryOrder = 0 to all morph types that were relying on the default
- Add assertion that all canonical morph types exist in FwData (not just the reverse)

https://claude.ai/code/session_01WDKE2vXP4gjMWjfn4cmL4p
@myieye myieye force-pushed the claude/fix-morph-type-syncing-bQo8X branch from 46c8f87 to f8f4cfe Compare March 24, 2026 15:39
@myieye myieye changed the base branch from claude/add-lexeme-headwords-TowRX to feat/sync-morph-types March 24, 2026 15:40
@myieye myieye marked this pull request as ready for review March 24, 2026 15:40
@myieye myieye closed this Mar 24, 2026
@myieye myieye reopened this Mar 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

UI unit Tests

  1 files  ±0   54 suites  ±0   25s ⏱️ -1s
140 tests ±0  140 ✅ ±0  0 💤 ±0  0 ❌ ±0 
207 runs  ±0  207 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f8f4cfe. ± Comparison against base commit c62728c.

@argos-ci
Copy link
Copy Markdown

argos-ci bot commented Mar 24, 2026

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Mar 24, 2026, 3:44 PM

@myieye myieye marked this pull request as draft March 27, 2026 08:17
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.

2 participants