Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
761ee0e to
d758c69
Compare
🟡 Waiting for changesLast updated: 2026-10-09 18:40 UTC |
rtibblesbot
left a comment
There was a problem hiding this comment.
PR #390: one parity bug in AppModelValidate's error classification; the rest is sound.
CI pending. No UI files changed.
- blocking: child's own validation error reported as
MorangoDirtyParentwhen its parent was accepted earlier in the run (inline). - suggestion:
ValueErrorfrom validation aborts the pipeline instead of failing one record (inline). - suggestion: validation failures are no longer logged (inline).
- suggestion: parity tests don't cover deletion propagation (inline).
- praise: failure-only, batched
Storelookup, pinned by query-count tests.
Written by rtibblesbot, an LLM-based coding agent.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
d758c69 to
c232030
Compare
rtibblesbot
left a comment
There was a problem hiding this comment.
PR #390: no new findings. 3 of 4 prior findings are resolved. The fourth, missing failure logging, is deferred to the part 3 sink. CI is pending.
Prior-finding status
RESOLVED — morango/sync/stream/deserialize.py — child's own validation failure reported as MorangoDirtyParent when parent accepted in run
RESOLVED — morango/sync/stream/deserialize.py — ValueError from validation aborts the whole run
ACKNOWLEDGED — morango/sync/stream/deserialize.py:277 — validation failures no longer logged (deferred to part 3 sink)
RESOLVED — tests/testapp/tests/sync/stream/test_deserialize.py:999 — parity tests don't cover deletion propagation
Written by rtibblesbot, an LLM-based coding agent.
Superseded by my review of c232030: no blocking findings remain.
Summary
This PR moves the transform logic in
_deserialize_from_storeinto the Source → Transform → Sink streaming architecture. It follows the structure already used for streaming serialization. The deserialization sink, the entry point and operation wiring, and removing the legacy code come in a later part.DeserializeTasknow has anoutcomeproperty that returns one of theDeserializeOutcomevalues:SAVE,DELETE,PROPAGATE_DELETE,PROPAGATE_HARD_DELETEorERROR. The transforms only read and resolve the outcome. The future sink does every write.AppModelDeserialize: builds the unsaved app model from the store record's serialized data and sets the morango source ID, partition and dirty bit. Deleted store records pass through untouched. JSON and validation errors are recorded on the task.AppModelValidate:cached_clean_fields, using the sharedfk_cache.Storequery to classify the cause. The checks, in order: a reference to a deleted record propagates the deletion; thenMorangoMissingParent, thenMorangoDirtyParent, then anIntegrityErrorfor a missing target. Otherwise the original error is kept. The error messages match the legacy ones.Facilitymodel: gains aclean_dereferences_parentflag. Tests can now cover both the current behavior, whereclean_fieldsloads the parent, and the default expected behavior of production models, which don't load related objects (checked against Kolibri).Why this approach handles FK references. The sink may not have written a record yet when a record that references it is validated. The existing ordering guarantees (#297 and #318) cover this together with
fk_cache:fk_cache.References
_deserialize_from_store#210Reviewer guidance
DeserializeTransformsIntegrationTestCase) run realStorerows throughStoreModelSource → AppModelDeserialize → AppModelValidateinto a sink that only collects results, so no app rows are ever written. This reproduces the window where the sink hasn't caught up. The scenarios include:Facilityflag both on and offINSERT,UPDATEorDELETE)LegacyParityTestCase) run the transforms and then_deserialize_from_storeon the same fixtures. They compare the errors recorded for the failed-parent, missing-parent and missing-target scenarios.fk_cachegrows for the whole run. We accepted this for now.AppModelDeserializeandAppModelValidatelook right before the sink is built on top of it?AI usage
I used Claude Code throughout:
fk_cacheshould combine to handle FK references. I corrected it when it proposed changes to the source ordering that were out of scope. I also had it check Kolibri's models to confirm productionclean_fieldsimplementations don't load related objects.