Conversation
…ine) Same change as #251 (which targets the v3 line), applied to the 4.x line that general actually consumes: general webpack- bundles leo-connector-common/postgres from npm pins (4.0.13-rc/4.0.24-rc, development-cut) while everything else resolves to the awsv3 layers, and the active 4.1.0-rc release stream cuts from this branch. A field flagged `combineOrder` in the table's dw_fields schema makes the fold keep the row with the highest value of that field (e.g. source_eid) per natural key; the arrival counter only breaks ties. Rows with no order value (backfill rows) sort before every row that has one. Opt-in and default-off; plumbed through load.js combineOpts alongside emitSequence. Composes with combineRecords (RPL-5795): this change orders the rows the collapse sees; it does not touch the collapse itself. PMT-4302 / Zero-Inventory design v2 'Sharpened Option E' Change 3 (fold half). Both DW suites pass together (15 tests). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhcouH67CgpNGpBZ29ujbk
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…ion; warn at runtime; fix clean-install test deps Per review on #254: a checkforDelete marker carries no order value, so on an ordered table it sorts first in its group and combineRecords takes its reactivate branch — a delete that genuinely arrived last is dropped when a write for the same key shares the batch. Latent today (nothing sets combineOrder; the planned ordered table receives no queue deletes and keys on a composite NK), and deliberately NOT 'fixed': order-less rows sorting first is load-bearing for backfill-loses-to-live, and both obvious repairs were analyzed and rejected in the review (structural delete-wins is the RPL-6780 defect; refusing the batch poison-pills the queue with no clean recovery). - Document the interaction on the orderFields option. - console warn (once per table per batch) when a marker is written for an ordered table — a runtime signal that cannot stop a queue. - Characterization tests pinning the truth table, incl. the unordered control, so a change to this behavior is deliberate. - devDependencies += aws-sdk: combine-order.test.js loads combine.js -> leo-sdk, which pulls aws-sdk undeclared; fixes clean-install test runs (verified by reviewer). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhcouH67CgpNGpBZ29ujbk
|
Verified your truth table against this PR's head before touching anything — reproduced exactly, including the write→delete drop and the unordered control. Agree on all points, including both rejected repairs; the checkpoint-deadlock analysis on the refusal option matches how RStreams actually behaves. Pushed 7f849d1 addressing everything actionable: the interaction is documented on the One addition to your latency analysis for Your composite-NK census deserves to outlive this thread — 🤖 Posted with Claude Code on Grant's behalf |
|
Composite-NK issue filed: #255 |
…runtime; declare aws-sdk devDependency Mirrors the review outcome on #254 for the v3 line, minus the characterization tests: this branch still has the pre-combineRecords delete fold, so the 4.x truth table does not apply verbatim and arrives with the next development sync. aws-sdk devDependency fixes clean-install test runs (leo-sdk pulls it undeclared). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhcouH67CgpNGpBZ29ujbk
|
I read this against the delete-marker work that just landed (#252, #253). The base is clean — #254 branches off the tip that already includes both, preserves This is not a request for changes. There is one semantic interaction between A delete marker carries no value for the
Control with Four conditions have to hold for that to bite, and in the configuration I checked, none of them does: (a) A table sets (b) and (c) fail independently there, so the composite key is not what is protecting that consumer — (b) already does it alone. (c) matters for whatever sets Worth flagging why (c) holds broadly today: in the configuration set I checked, every table has a single-column natural key, so a composite one would be the first. That also means Two repairs look obvious and are not. Sorting order-less markers last makes the delete win the batch, which settles delete-versus-write by a fixed structural rule instead of by event order — that is the defect rather than a fix for it. Sorting them first is not a bug to be corrected either: a data row with no order value sorting below every row that has one is load-bearing and separately tested, because it is how a backfill row loses the fold against a live one. I did build the middle path and then threw it away: resolve the order value off the delete event ( It deadlocks. A consuming bot that records the error without advancing its checkpoint re-reads the same event and fails the same way. The offending event is already on the queue and the event stream is append-only, so fixing the producer changes future events, not that one. The exits are an operator advancing the checkpoint past it — which discards the delete, the loss the refusal existed to prevent — or an emergency release of this library to downgrade the refusal. Until one of those lands, that consumer's whole load is stopped. It also over-triggers, firing on every order-less delete including the majority that would have applied correctly, because the silent drop needs (d). The net trade is a narrow silent bug for a broad outage with no clean recovery. What the interaction is worth instead is README guidance in this repo, plus the ordering guard as the default posture for new merge-type groups. If you want a runtime signal, a warn-level log when a marker gets built for an ordered table costs nothing and cannot stop a queue. Separately and unrelated: |
What
The 4.x-line twin of #251: an opt-in, default-off ordering mode for the datawarehouse
combine.jsin-batch fold. A field flagged"combineOrder": truein the table'sdw_fieldsschema makes the fold keep the row with the highest value of that field per natural key (e.g.source_eid) instead of the last row by arrival; the arrival counter remains as tie-breaker. Tables without the flag keep the arrival-order fold byte-for-byte (locked by test).Why this branch
Audit of the
generalservice (2026-08-31): its runtime is the awsv3 layer line (Node 22, leo-sdk 7.x), butwebpack.config.jsdeliberately filtersleo-connector-common/leo-connector-postgresout of the layer externals, so the offloader executes the npm-pinned, development-cut4.0.13-rc/4.0.24-rcbundled at build time — the 5.x copies inside the layers are shadowed dead weight. The active4.1.0-rc.<run_id>release stream publishes from this branch, so landing here is the shortest consumable path: next rc → bump general's two pins. No layer republish needed.#251 carries the identical change for the v3 line (
feature/aws-sdk-v3-again); general benefits from that copy only at the real 5.x cutover.Stacked on #249
combineOptsplumbing (orderFieldsrides alongsideemitSequence).combineRecords(RPL-5795): this change orders the rows the collapse sees; it never touches the collapse. Its delete/reactivate rules are order-relative and stay correct under source-EID order.__leo_seq__): on an ordered table the surviving row's sequence is the winning (highest-order-key) row's sequence, not the batch-latest arrival — which is the semantically right sequence for that row. Tables usingemitSequencewithoutcombineOrderare unaffected.combine-order.test.js(no collision with this branch'scombine.test.js); both DW suites pass together — 15 tests.Mechanics (same as #251)
load.jsscansstructurefor acombineOrderfield flag (likenk/sk/scd) →combine()orderFields. The flag rides in the shareddw_fieldsentry, so every loader that reads the schema folds identically.{md5(nk)}-{48-char order key}-{9-digit arrival}{json}; sort already runs underLC_ALL=C; a row with no order value (backfill) pads with spaces and sorts before every row that has one — asserted by test, per the Zero-Inventory design's testing plan.Consumption plan
developmentif feat: combine collapse and delete-marker correctness, plus per-package release automation (RPL-6000, RPL-6780) #249 lands first — the change applies cleanly either way).4.1.0-rccut picks it up.item-dwadds"combineOrder": truetosource_eidindw_fields/f_current_inventory_state.json(one line on item-dw#23).generalbumpsleo-connector-common+leo-connector-postgrespins.🤖 Generated with Claude Code
https://claude.ai/code/session_01DhcouH67CgpNGpBZ29ujbk