Originally created by: grynn-in
Closes [#146]. konsol half: grynn-in/konsol#119.
Seeds materialise into epm_gold (seeds: +schema: gold), so
seeds/allocation_rules.csv was epm_gold.allocation_rules — the same
ClickHouse relation konsol TRUNCATE+INSERTs. Two writers, one table, last write
wins. dbt ls --select +tag:domain:consolidation --resource-type seed listed
three of the five, so publishing one of these doctypes fired the governed build
that reverted the publish. consolidation_groups was the sixth and was fixed in
F2 (#145); these are the rest.
"Use the seed, but only if the staging table happens to be empty" — the same
shape deleted from gold_consolidation_hierarchy, where the objection was that
which source a build trusts must not depend on whether some table was
populated at the time. Two of the four fallbacks were actively wrong:
allocation_engine_multistep hardcoded allocation_method = 'step_down' anddriver_formula on the seed half — so a formula-driven rule readgold_consolidation_adjustments labelled the seed half 'Approved'Rewired to the tables konsol actually writes: gold_spread_budget,
gold_scenario_versions, gold_ic_eliminations, gold_ic_reconciliation,
gold_consolidation_adjustments, allocation_engine,
allocation_engine_multistep, and two allocation tests that still used ref()
while three others already used the source.
epm_gold.spread_profiles and epm_gold.scenario_definitions are declared
sources with DDL in init-db.sql (matched byte-for-byte against konsol's
_REFERENCE_TABLE_DDL). The other three relations have no reader left, so
konsol stops writing them entirely.
The eight demo consolidation adjustments are not recreated. Six posted to a
consolidation group GLOBAL and an entity GROUP that exist nowhere in the
Consolidation Group tree, and a top-side journal is transactional data, not
configuration to ship.
The scenario seed was stale as well as colliding — 4 rows against the
doctype's 17, with BUDGET named "Budget 2024" where the doctype has both
BUDGET and a separate BUDGET_2024. gold_scenario_versions labelled those
rows 'seed'; they are labelled 'konsol' now, which is what they were.
(The third: IC_004 and IC_005 existed only in the deleted seed and are now
shipped as konsol fixtures — see grynn-in/konsol#119. They are the only two
rules whose accounts exist in the demo ledger, they had never fired, and
shipping them turns gold_ic_eliminations from 0 rows into 272.)
A full dbt build --full-refresh leaves epm_gold.scenario_definitions at the
doctype's 17 rows and epm_gold.spread_profiles at 24 — before, it reset them
to the CSVs' 4 and 24 — and ends on the same three errors that predate this
branch. All 11 rewired tests pass.
Ticket changed by: grynn-in