Skip to content

A posting's rule column is required where the line that reads it books - #7680

Merged
delchev merged 1 commit into
eclipse-dirigible:masterfrom
nedelcho-delchev-tues:issue-7649-posting-rule-column-per-item
Oct 5, 2026
Merged

delchev merged 1 commit into
eclipse-dirigible:masterfrom
nedelcho-delchev-tues:issue-7649-posting-rule-column-per-item

Conversation

@nedelcho-delchev-tues

Copy link
Copy Markdown
Contributor

Fixes #7649

usedRuleColumns collected every rule(<column>) reference of every item row, and the generated handler checked all of them before deriving anything. So a column read by a single when:-guarded line gated the whole posting. The day an optional line was added — a promotion account on the few invoices that carry one — every document of that type stopped posting on every tenant whose rule row predated the new column, including the ones the line does not apply to. Nothing threw and nothing was logged, so the documents just accumulated on the unposted worklist.

The gate now follows the line that reads the column.

  • An unguarded row books on every document of its type, so a null column of its own genuinely stops the posting. Those columns keep the up-front check.
  • A guarded row's columns ride on the row (ruleColumns) and are checked inside that row's own guard, where the line actually books. The classifier ternaries of rule(by: ...) split the same way (ruleCaseGuards on the row, conditionalRuleGuards keeping only the unguarded rows').

Every skip path now says so. No matching rule row, a null column, an undetermined account — each WARNs naming the rule entity, the match value and the source key. The handler fires only on the event, so a silent skip left nothing anywhere to explain the gap.

The item rows are derived into a list before anything is written, so the early return a missing column takes still happens before the first write.

Covered by GluePostingsTest (the existing fixture's third row is when: "Vat != 0", so its VAT account moves off usedRuleColumns and onto the row — a rule row without one now posts a zero-rated invoice) and GlueGeneratorTest.aGuardedRowsRuleCaseCellsGuardThatRowAlone. Both suites green: 1479 in engine-intent, 217 in ide-template.

`usedRuleColumns` collected every `rule(<column>)` reference of every item
row, and the handler checked them all before deriving anything. So a column
read by a single `when:`-guarded line gated the whole posting: the day an
optional line was added - a promotion account on the few invoices that carry
one - every document of that type stopped posting on every tenant whose rule
row predated the new column, the ones the line does not apply to included.
Nothing threw and nothing was logged, so the documents simply accumulated on
the unposted worklist.

The gate now follows the line that reads the column. An UNGUARDED row books on
every document of its type, so its columns keep the up-front check. A guarded
row's columns ride on the row and are checked inside its own guard, where the
line actually books. The classifier ternaries of `rule(by: ...)` split the same
way.

Every skip path now WARNs - no rule row, a null column, an undetermined
account - naming the rule entity, the match value and the source key. The
handler fires only on the event, so a silent skip left nothing anywhere to
explain the gap.

Fixes eclipse-dirigible#7649

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@delchev
delchev merged commit 7d92e88 into eclipse-dirigible:master Oct 5, 2026
10 checks passed
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 postings: rule column referenced only by a when:-guarded item gates the whole posting when it is null

2 participants