proposal: enrichment phases - a moment a silent write announces - #57
Open
delchev wants to merge 1 commit into
Open
proposal: enrichment phases - a moment a silent write announces#57delchev wants to merge 1 commit into
delchev wants to merge 1 commit into
Conversation
A value a listener computes after the insert (a moving-average cost, a snapshot column, an external lookup) must be written back without raising an update event, since an enrichment is not a user's edit. So it announces nothing at all, and a declarative consumer of that value has no moment to bind: bound to the create event it races the enriching listener, and can produce a perfectly balanced journal entry for a null amount with the parse, the generation, the compile and the deployment all green. The proposal adds an entity-level `phases:` declaration and an `onPhase` event axis. The generated data-access layer exposes one operation per declared phase that applies the enriched values AND announces the phase in one write, so a consumer can never observe one without the other. Rejected alternatives are recorded: a global ordering tier is a contract concurrent delivery cannot keep, and documenting the race leaves the automation inexpressible while the failure stays silent.
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.
Adds
proposals/0028-enrichment-phases.md. Per the proposal-first process this PR does not touchversions/.The gap
Not everything a record needs is known when its row is inserted. An inventory ledger values stock at a moving average: the movement row is created when a goods document posts, and a listener on that create event reads the pool, computes the cost, and writes it back. That write-back must not raise an update event - an enrichment is not a user's edit - so it announces nothing at all.
A declarative consumer of the enriched value therefore has no moment to bind. Bound to the create event it runs as a sibling of the enriching listener, with nothing ordering the two, and can produce a perfectly balanced journal entry for a null amount with the parse, the generation, the compile and the deployment all green.
The proposal
An entity-level
phases:declaration and anonPhaseevent axis. For each declared phase the generated data-access layer exposes an operation that applies the enriched values and announces the phase in one write, so a consumer can never observe the announcement without the values.The two alternatives are recorded as rejected: a global ordering tier across independent subscribers is a contract concurrent delivery cannot keep, and documenting the race leaves the automation inexpressible while the failure stays silent.
Implementation: eclipse-dirigible/dirigible#6933 (issue eclipse-dirigible/dirigible#6929).