Skip to content

fix(intent): a settlement follows a re-filed payment, and a delayed create event can no longer shrink it - #6873

Merged
delchev merged 1 commit into
masterfrom
fix/settlement-rekey-and-race
Aug 20, 2026
Merged

fix(intent): a settlement follows a re-filed payment, and a delayed create event can no longer shrink it#6873
delchev merged 1 commit into
masterfrom
fix/settlement-rekey-and-race

Conversation

@delchev

@delchev delchev commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Closes #6864 and #6865 — the two settlement residues of #6846's review.

Verified: GlueSettlementRekeyTest, EdmIntentGeneratorTest (+51 total in the edm suite), engine-intent unit suite, IntentEngineIT 56/56 (extended settlement block), IntentEmissionCoverageIT.

🤖 Generated with Claude Code

…reate event can no longer shrink it (#6864, #6865)

Two residues of #6846, found in its review:

- A corrected MATCH column - the payment re-filed under another Customer -
  was invisible to the amount-based recompute (pot - allocated == 0), so
  the junction rows kept paying the OLD counterparty's invoices forever.
  The payment's match columns are now grouping keys, so its DAO publishes
  "-rekeyed" when one moves, and a third settlement listener releases
  everything and re-allocates from the STORE - both re-key notices run the
  same store-driven recompute, so their delivery order cannot matter and a
  redelivery converges. Emitted only for a LOCAL payment: a cross-model
  payment's DAO belongs to the owner model, and a projection has no
  repository to re-read - absent rather than silently dead. Closes #6864.

- The create handler no longer releases. A create event is the FIRST word
  about a payment - it has nothing to take back - so a negative pot there
  can only be a DELAYED create racing a correction the updated handler
  already allocated, and releasing on the stale payload transiently
  undid the correction. The updated handler owns every shrink.
  Closes #6865.

Also corrects the module guide's glue-collection note, which still cited
the generateUtils.js twin removed by #6707.

Covered by GlueSettlementRekeyTest (the third listener, and its deliberate
absence for a cross-model payment), EdmIntentGeneratorTest (the match
columns as the payment's grouping keys), and IntentEngineIT's settlement
emission block (the store-driven re-key recompute, the release-all, and
that the create handler carries no release).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@delchev
delchev merged commit 919d254 into master Aug 20, 2026
10 checks passed
@delchev
delchev deleted the fix/settlement-rekey-and-race branch August 20, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

intent: a corrected settlement match field never re-allocates - allocations stay with the old counterparty

1 participant