Skip to content

proposal: enrichment phases - a moment a silent write announces - #57

Open
delchev wants to merge 1 commit into
mainfrom
propose/enrichment-phases
Open

proposal: enrichment phases - a moment a silent write announces#57
delchev wants to merge 1 commit into
mainfrom
propose/enrichment-phases

Conversation

@delchev

@delchev delchev commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Adds proposals/0028-enrichment-phases.md. Per the proposal-first process this PR does not touch versions/.

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 an onPhase event 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).

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.
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.

1 participant