[claude] Validate CreateEntry and compile-enforce the validation wrapper's writes - #2519
Draft
myieye wants to merge 1 commit into
Draft
Conversation
The validation wrapper auto-implemented the whole IMiniLcmApi via BeaKona, so a drifted or missing write override became a silent unvalidated forwarder instead of a compile error. That's how CreateEntry's validation went missing: its 1-arg override no longer matched the 2-arg interface member, and every caller bound to the generated forwarder (#2359 / #2362). - BeaKona now forwards only IMiniLcmReadApi; every write method is hand-written, so a missing write is a compile error. Submit* have no interface defaults after the base PR, so they're implemented here too (forwarding to the inner Submit* to keep CRDT delete-wins). - CreateEntry now validates and forwards its options. Other methods keep their current validate/pass-through behavior; where a write deliberately doesn't validate (CreateMorphType, bulk import) that's now explicit. Risk (why this is a draft): sync wraps both sides with this wrapper, and FwData reads preserve empty MultiString values, which EntryValidator.NoEmptyValues now rejects on create. A deliberately-failing sync test flags that gap. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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.
[Claude, autonomous]
Stacked on #2514 (base branch
identifiable-dry-run-records).Consolidates #2359 and #2362 (same underlying bug) and acts on the decision from #2359: turn on the entry validation that signature-drift silently removed.
What changed
MiniLcmApiValidationWrappernow auto-implements onlyIMiniLcmReadApivia BeaKona; every write method is hand-written. A drifted/missing write is now a compile error instead of a silently-unvalidated BeaKona forwarder (the root cause in Validation wrapper's CreateEntry override is never reached through IMiniLcmApi #2362).Submit*have no interface defaults after [claude] Standardize dry-run sync records and remove the Submit* defaults #2514, so they're implemented here too, forwarding to the innerSubmit*to keep the CRDT delete-wins semantics.CreateEntrynow validates and forwards itsoptions. Every other method keeps its current validate/pass-through behavior; where a write deliberately does not validate (CreateMorphType, bulk import) that's now an explicit, commented choice rather than an accident.Sync wraps both sides with this same validation wrapper (
CrdtFwdataProjectSyncService), andEntrySynccreates entries through it. FwData reads deliberately preserve emptyMultiStringvalues (FromLcmMultiStringmaps empty TsStrings back to""for round-tripping), andEntryValidator.NoEmptyValuesnow rejects those on create. So turningCreateEntryvalidation on can make sync of legitimate FLEx data throw.Note: user-facing JSON/REST/JS creates are safe —
MultiStringConverter.Readstrips empty values on deserialization. The gap is the in-process fwdata↔crdt sync path.Sync_CreatingEntryWithEmptyFlexValue_ShouldNotBeRejected(inEntrySyncTests) fails on purpose to keep this gap visible until we decide how to handle it (user-facing-only validation, a sync-specific profile, stripping empties on import, or reconsideringNoEmptyValues).Tests
MiniLcmApiValidationWrapperTests(new, unit): pins thatCreateEntryvalidates and forwards options, thatUpdateEntry/CreateSensevalidate, and thatCreateMorphTypedeliberately doesn't. Passing.Sync_CreatingEntryWithEmptyFlexValue_ShouldNotBeRejected: deliberately failing, flags the fwdata→crdt gap above.Closes #2359 (#2362 was consolidated into it).
🤖 Generated with Claude Code