Eloverblik

Dokumentation · Arkitektur og beslutninger

The municipality method – Build specification: mix and CO2e as Eloverblik's report "Kommune" has them

Status: version 1.1, 25 November 2026. Written by worker elo-a4-municipality-method (Claude · Fable) on the brief orchestration/tasks/a4-municipality-method.md, after the owner compared the pages with Eloverblik's report made with "Geografisk opdeling: Kommune" and asked for that split beside the price area's. Version 1.1 applies the static read reviews/architecture/A4-agy-method.md and A4-agy-delivery.md (fifteen findings) with the lead's rulings (orchestration/tasks/a4f-municipality-fixes.md); the last section says what was done.

Precedence. docs/architecture/phase-1.md and phase-2.md stay the specification of everything they describe; this document adds to them and changes only the sentences listed in §10. Where it differs from docs/architecture/solution.md (its LB-MU methods, B29 to B31), this document wins. An epic is built from this document, the two specifications and the research they cite.

0. Reading guide

Who reads what. Every builder: §0, §1, §2.7. Then the sections named in the epic's row of §8.2.

Conventions. Those of phase-2.md §0: "§2" is a section of this document, "P1 §9.2" of phase-1.md, "P2 §3.3" of phase-2.md, "R2 §3.4.2" of a research document, "guide p. 5" a page of Energinet's docs/sources/energi-data-service/beregning-af-klimaaftryk.pdf. [LT] marks a fact from the lead's trials of 25 November 2026 on the owner's year 2025, one E17 root, with the snapshots of 15 and 24 November (which gave the same output to the last digit): the lead ran each rule and reported relative residuals, (computed − report) ÷ report, never a figure. Nobody re-verified them for this document. [code] marks a statement about the code as it is on main at 7cb894d, read for version 1.1. The short names: GE and GM are DeclarationGridEmission and DeclarationGridmix (the price area's, loaded today); TE and TM are DeclarationTransmissionEmission and DeclarationTransmissionGridmix; RE is ReCoverageMunicipality. Epics are B80 to B93; migrations start at 0320.

No municipality of a real account is named in this repository (the lead's rule of 25 November): not in this document, an example, a fixture, a test or a default. A municipality is part of an address. Examples and tests use the demo organisation's two invented municipalities, 999 "Vesterfjord" and 998 "Østerfjord" (elo_devtools.synth.organisation), and tests that search for a municipality use codes that are not numbers (§8.1).

The owner's decisions that are built in (25 November): the product delivers both splits; a request to Energi Data Service may name municipalities; three municipalities of the owner's choosing are fetched at first, for the test, "… test og herefter kun kommuner hvor et token har adresser".

1. Scope, and what is not built

#WhatSection
M1A third method, LB-MU-125: the emission of the consumption that the municipality's own renewable production did not cover in the same hour, at the transmission grid's factor§2.3
M2The sources and the origin under the same split: "Kommunal vedvarende energi" first, the transmission grid's mix for the rest, and the municipal table§2.4
M3Three datasets loaded, the municipal one only for the municipalities that are wanted§3
M4The split chosen once for the whole address, on every page that shows emissions or sources§5, §6
M5make validate for a municipality report, and for the mix blocks of both splits§7
Not builtWhy
The municipality as a dimension of the selection, a filter by it, a ranking of municipalitiesP2 §3.5 is not changed by this document: "Postcode, city, municipality: never for a private or unclassified account". The method reads a point's municipality inside the calculation; a reader never selects by it (§4)
All 98 municipalities loadedThe owner chose the named ones (§3.2)
A fall-back to the price area for a point without a municipalityA price-area figure under the municipality's name is the error this document exists to prevent: such a point has no figure under this method (§2.2)
Stored emission or mix factsP2 ruling 5 and ADR-004 are not reopened
The variants of solution.md §5.3 as parameters (src, bioBase)The trials settled both: TE, and the biogenic emission on the remainder (§2.3). What they did not settle is in §2.7, as candidates for one validation, not as switches
"Øvrige" split into the report's "Andet" and "Anden vedvarende energi"Not asked; the validation compares their sum (§7)
A second dimension of the row budgetThe method's cost is a factor on the budget a query has (§5)

2. The method

2.1 Codes and names

**Decision: the geographic split is part of the method. LB-MU-125 is method 3, beside LB-PA-125 and LB-PA-200; LB-MU-200 is method 4, seeded and not offered until the owner has answered question 2 of §9.** Reason: the method is already a parameter of every emission query, a field of the address and a line of every title (D11), and ref.method has the column geography for it (price_area for methods 1 and 2 [code]). TE has 125%, 200% and Total rows as GE has, so method 4 costs one row; but neither of the owner's reports prints a method [LT], the Kommune report's figures fit the 125% rows [LT], and whether Eloverblik's form offers 200 % with "Kommune" is not known. Rejected: a parameter geo beside m on the emission queries (two fields for one choice, and four combinations of which a title must still name one).

method_idcodegeographyallocationname_dastatus
3LB-MU-125municipality1Lokationsbaseret · time · kommune · 125 %available
4LB-MU-200municipality2Lokationsbaseret · time · kommune · 200 %reserved: in no list of methods, 422 invalid_parameter as m. One UPDATE makes it available, and nothing else changes with it (§6, §7)

What "location-based, municipality" means, in the footnote of every page that shows a figure of the method: "Kommunemetoden: den del af forbruget, som kommunens egen vedvarende elproduktion dækkede i samme time, regnes uden udledning; resten regnes med transmissionsnettets emissionsfaktor i prisområdet. Kilde: Energinet (www.energidataservice.dk)." It is Energinet's own definition (guide p. 2 and p. 5; the metadata of TE: "The total emissions per kWh in a municipality are EmissionFactor × consumption × (1 − REshare)") and Eloverblik's "Kommune" (R2 §3.4.2). The municipal part is nobody's purchase (§6).

The sources have no allocation (P2 §3.3), so their queries take the geography alone: geo, price_area or municipality (§5). The shell keeps one choice (§6).

2.2 A point's municipality

**Decision: a point's municipality is the municipality_code of the current master-data version of its E17 root, for every hour of every year.** Reason: a point does not move; a changed code is a correction, and a correction holds for the past too. The versions cannot answer "the code in 2021" anyway: observed_from is when this install first saw a version. It is the rule P2 §3.5 has for the selection.

CaseRule
The code is usableWhen it is a row of ref.municipality (§3.3): the 98 municipalities; in the demo also the generator's two
No usable code (NULL, 999 outside the demo, anything else)The point has no municipality: no figure under this method, status noMunicipality, reason no_municipality. Never the price-area figure, never 0 % local
A usable code that the setting's list leaves out (§3.2)The same status, reason municipality_not_loaded. Decided from the setting, never from what happens to be loaded: under auto every usable code is wanted, so a root that came an hour ago has a wanted municipality whose hours are pending until the next run of eds-recoverage has loaded them (§2.5)
A childHas no figure of its own under any method (P1 §9.2); D1 shows a child with its root's emissions as today
Several points, several municipalitiesEach point-hour by its own municipality's share; the lines are sums. The municipal table has a row per municipality (§2.4)
The price areaUnchanged: from the grid area, per local day (core.mp_geo, docs/emission.md). The municipality gives the share alone. Municipality 330 lies in both areas (R2 §2.8) and has one RE series: a point there takes that share and the TE and TM rows of its own area
A corrected codeThe next query computes every hour by the new code; ops.data_version is incremented by the merge that changes a root's code; the new municipality is loaded from the next run of eds-recoverage (§3.2)

calc.mp_municipality(mp_ids int[]) returns, per root, its usable code or NULL and whether the setting wants it: the one place of this rule in SQL. Nothing is stored (core.mp_geo gains no column).

2.3 The emission of an interval

Per interval i of an E17 root's series, with quantity q (kWh), R the re_share_pct of the row of fx.re_coverage_hour for the root's municipality and the UTC hour of the interval start (a percentage, 0 to 100), and f the row of fx.factor_hour with dataset = 2 (TE) for that hour, the point's price area on the local day and the method's allocation. A quarter-hour takes its hour's R as it takes its hour's f.

QuantityFormulaUnitSource, and the trial
The municipal partq_L = q × R × 0.01kWh, 11 decimalsGuide p. 5: LokalVE = forbrug × REshare/100. [LT] the year's sum equals the report's line "Kommunal vedvarende energi" (+7e-8); REekWhKeep ÷ ConsumptionkWh differs from REshare ÷ 100 by at most 7.8e-8 in every hour of 2025, so the column is used as delivered
The remainderq_E = q − q_LkWhGuide p. 5: ForbrugE
CO2, CH4, N2Oq_E × f.co2_g; q_E × f.ch4_mg; q_E × f.n2o_mgg; mg; mgGuide p. 5. [LT] with GE in place of TE the emission is 15 % low: R2 §3.4.4's disagreement is settled, TE
CO2eAs P1 §9.2, with the GWP set of the requestg[LT] AR5
Biogenic CO2q_E × (f.co2_origin_g − f.co2_g)g[LT] on q it is 62 % high, on q_E 2.2e-4: the guide's "Forbrug kWh" in this line is a slip for ForbrugE
Transmission and distribution loss, per amountamount × (f.t_factor − 1); amount × (f.d_factor − 1); additive, never compounded, never part of Scope 2as the amountGuide p. 5. Not equal to the report: §2.7
An intensity (G16; CO2, CH4, N2O per kWh)Σ amount ÷ Σ q of the intervals with both inputs: per kWh of the consumption, not of the remainderg/kWh, mg/kWh[LT] equal at the report's printed precision

Exactness is P2 §3's: every operation is +, − or × on exact decimals; × 0.01, never ÷ 100. The only division is the intensity's, made by the query at 9 decimals.

An interval is pending under this method when either input is missing: no RE row for its municipality and hour, a row whose share is NULL or outside 0 to 100, or no TE row under the basis (P1 §9.3). It keeps its consumption and has no amount and no municipal part: a missing share is never 0 % (S §5.7, A1x-13). A share of 100 % is a figure: the remainder and every amount are zero.

The rule exists twice, as docs/emission.md has it. In SQL the one reader of fx.factor_hour is calc.v_emission_interval (migration 0100, ON f.dataset = 1 [code]): B83 makes the dataset the method's (1 for price_area, 2 for municipality), joins the share, and adds re_share_pct, local_kwh and grid_kwh to the view; the functions that read the view take the columns through. In Python, elo_core.emission.

2.4 The sources and the origin

**Decision: under the municipal split the sources of an hour are the municipal part first, as a group of its own, and then the rows of TM applied to the rest by the steps of P2 §3.3.** The mix rows are those of fx.mix_hour with dataset = 2; completeness, groups, families, the residual, E07, the shares, the status and the comparison are P2 §3.3's and docs/mix.md's, with the changes below. [LT] every hour of 2025 in TM sums to between 999 993 and 1 000 007, every row is Final, no code or area is unknown: the bounds of "complete" hold as they are.

StepRule under the municipal split
In the figuresA metering-point hour is in the figures when it has a price area, a wanted municipality with a share for the hour (§2.3), and a complete TM hour (of version Final under basis=final). Decided per point and hour before anything is summed, as today
The municipal part (new step, before step 2)Per price area and hour, over the point-hours in the figures: q their energy, L = Σ q_p × R_p × 0.01 (exact, 11 decimals). The group local is L rounded half away from zero to 9 decimals. In integers, with q_p in Wh and R_p in millionths of a per cent: (Σ q_p × R_p + 50) div 100 units of 10⁻⁹ kWh
Step 2 on the restG = q − local, exact at 9 decimals, takes the place of q: families first with the residual to the largest family, then each family's groups (B78), by the integer formula with G in units of 10⁻⁹ kWh: (2 × G × s + S) div (2 × S). The municipal part and the nine groups of an hour sum to q exactly; the rule of families holds unchanged inside G
The signBoth integer formulas are computed on the absolute value, the sign put back, as docs/mix.md has it for step 2 ("on |q|"): div truncates, and only on a non-negative dividend is that the rounding meant
Per municipalityThe hour's local is divided among the municipalities of its point-hours in the order of their codes, each round₉(Σ L of the codes up to it) − round₉(Σ L of the codes before it): they add to local (the technique of a family's groups). The order is inside the calculation and leaves with no response (§5)
ref.mix_groupA tenth row: local, "Kommunal vedvarende energi", sort 0, renewable_share 1, nuclear false, family local, and the new column municipal true. A row with municipal is a part only under the municipal split: by price area the nine groups stay nine
E07, E11a, E11blocal counts whole in E07; the denominator is the consumption of the hours in the figures (guide p. 5: (LokalVE + Vind + Sol + Vandkraft + Biomasse + 55 % × affald) / sum). R15x stays outside, as P2 §3.3 has it: [LT] with it the share is further from the report
Originlocal first, then step 2 on G with the connected areas. The municipal part is not a connected area: the report prints it as a row of its own under the price area's column [LT]; by=origin returns it as the part local
The municipal tableOne row per municipality of the selection: its municipal energy, and two shares of it: of the selection's consumption in the figures (A), and of its own points' consumption in the figures (B). The report's "Forbrug" is the municipal energy and its "Procentvis" equals the source line's per cent [LT]; with one municipality A and B are one number, so which the report prints is not known (§2.7). The pages show A, the share every other part of the page has

Who reads fx.mix_hour is in §3.3: until B87 gives calc.mix_hours its parameter, B82 has made it read dataset = 1 alone. From B87 the Python reference (elo_core.mix) and the SQL take the split (calc.mix_hours(…, p_dataset), calc.mix_buckets(…, p_geo)); calc reads the table through calc.mix_hours alone, and a reading still never meets the rows of its hour: the sum per price area and hour carries q and L (P2 §4).

2.5 Status, data basis, comparison

TopicRule
Status of a point-hour's consumption, emissionThe first that applies: noPriceArea; noMunicipality (no usable code, or a code the list leaves out: §2.2; a state of the install, not of the hour); pending (no share for the hour, or no TE row); otherwise the TE row's version
The same, sourcesnoPriceArea; noMunicipality; pending (no share, or TM not complete); otherwise the lowest version of the hour's TM rows
basis=finalAs P1 §9.3: TE rows of version Final (sources: every TM row Final). RE has no version: a share is neither preliminary nor final and never decides the basis; what changes in it is seen in its history (§3.5)
What Eloverblik's "Endelige tal" isEvery hour's published row, whatever its Version: the datasets hold one row per hour ("version blot er en information", guide p. 2), and GE's first hour of 2025 is Preliminary and inside the report [LT]. The product's final stays the stricter one, unchanged; how the validation compares such a report is §7
The comparisonBoth periods by the same method. A cell is matched when both sides are eligible (P1 §9.3) and have both inputs; excluded_factor counts the cells left out for either input of the method (excluded_mix for the sources)

2.6 Golden cases

CaseInputsResult
The emission1 000 kWh, share 30,000000 %, TE row 100 g CO2, 0,5 mg CH4, 0,1 mg N2O, CO2 origin 150 g, factors 1,0145 and 1,0387, AR5Municipal part 300 kWh, remainder 700 kWh; 70,02835 kg CO2e (0,7 × P1 §9.2's 100,0405); biogenic 35 kg CO2; transmission loss 1,015411075 kg, distribution 2,710097145 kg; intensity 70,02835 g CO2e/kWh, per kWh of the 1 000
Share 100 % and share 0 %2 kWh each, the same row0 g, a figure; and 2 × the TE row (not the GE row of the hour)
No share2 kWh, no RE row; and a row with a NULL sharePending both times; the consumption counts, no amount
The sources (P2 §3.3's hour 1)4 kWh, share 25 %, TM rows summing to 1 000 000 as in that examplelocal 1,0; wind 1,5, solar 0,3, biomass 0,3, waste 0,3, nuclear 0,15, gas 0,3, other 0,15: together 4,0. E07 = 1,0 + 1,5 + 0,3 + 0,3 + 0,55 × 0,3 = 3,265 kWh; E11a 81,625 %; E11b 85,375 %
The residual1 kWh, share 33,333333 %, TM rows wind 333 330, gas 333 330, coal 333 329 (Σ 999 989)local 0,333 333 330; G 0,666 666 670; wind 0,222 222 446, fossil 0,444 444 224 (no residual here); coal 0,222 221 779, gas 0,222 222 445: together 1,000 exactly
Two municipalities in one hourTwo points of 0,001 kWh in one price area, 999 with 33,333333 % and 998 with 66,666666 %L 0,000 999 999 99; local 0,001 000 000; 998 (the lower code) 0,000 666 667, 999 0,000 333 333; G 0,001. The table: A 33,3 % and 16,7 %; B 66,7 % and 33,3 %
A point without a municipality beside one withOne hour eachThe first is noMunicipality and outside every figure; the second's figures are its own

2.7 What the trials did not find

The rule of §2.3 and §2.4 is Energinet's published one and the nearest of every rule tried. Against the owner's report of 15 November it is equal on the consumption, the municipal part, the three gases per kWh and seven of the seventeen source and origin lines, and not equal on these [LT]:

LineResidual of §2's ruleWhat was tried and excluded
Emissions excluding losses−2.0e-4Another hour's TE and TM rows (one hour either way; the local and the UTC wall time exchanged): 0.8 to 2.4 % off. Weights by either loss factor: worse. The ratio REekWhKeep ÷ ConsumptionkWh: identical
Biogenic emissions+2.2e-4The same
Wind, hydro, natural gas, coal and oil, "Andet", waste+6.0e-4, −5.1e-4, −3.4e-4, −2.1e-4, −5.7e-4, +1.2e-3Division by 1 000 000 instead of the hour's sum, Final rows only: no change to four digits
Origin: the price area's own, Norway, Sweden, the Netherlands+8.6e-4, −3.5e-4, −9.5e-4, −1.5e-3The same
Renewable share+2.0e-4–
Distribution loss, transmission loss+5.0e-3, −1.7e-2GE's two factors (+3.2e-2, +2.0e-2); either loss compounded on the other; 1 − 1/factor; the price-area report's own lines (a quarter larger); factors rounded to 2 or 3 decimals; the loss as a ratio of period sums, weighted by the remainder or by the consumption. One mixed form brings the transmission line within its one printed decimal (amount × t × (t − 1), −2.1e-3) and leaves the distribution line out

The reading of the lead and of this document: the remainder is exact hour by hour, the rows are the right hours' rows, and no rounding makes 2e-4 where the price-area method equals to 1e-5 by the same steps. What is left is the data: the pattern (the area's own production high, the imports low, signs that cancel) is what other values in TE and TM give, and the report was made while the declarations were being moved to a new method (R2 §2.2.1; RE's lastDataUpdate is of that morning). The two loss residuals have opposite signs, which no common scaling mends: either the factors are another vintage's, or the two lines are not made of t_factor and d_factor.

**To be found, in this order. Each step is the lead's, by a trial or a validation on the owner's data; none is a builder's task, and no epic loads a dataset for it.**

  1. The vintage. The owner makes the Kommune report again (question 3 of §9; the lead has asked) and the snapshot is taken that day; B85's tool compares it. Equal on every line: the rule is §2's, and the report of 15 November is recorded as made from older rows. This is the expected outcome and needs no change. 2. The losses alone still differ. Then they are not TE's two factors. The next trial, by hand as trials 1 to 3 were, from ProductionConsumptionSettlement (R2 §2.4; public, one call a year and area): per price area and hour net = GrossConsumptionMWh − GridLossTransmissionMWh − GridLossDistributionMWh (the dataset's own definition of net consumption), t′ = GridLossTransmissionMWh ÷ net, d′ = GridLossDistributionMWh ÷ net; transmission loss Σ amount × t′, distribution loss Σ amount × d′; and the same with GridLossInterconnectorsMWh added to the transmission's. After it, what Energinet's note "Miljødeklarationen time og kommune" says of losses: R2 §6 gives its address; it is not in the repository and the lead reads it. Until found, the two loss lines of this method carry the note of §6 and a validation that is equal on every other block has a status of its own, never VALIDATED (§7). 3. The emission and the sources still differ by the same pattern. Then Eloverblik computes from rows that Energi Data Service does not publish that day. The owner makes the report for single months; the months that are equal bound where the rows differ. The rule stays §2's, the residual is recorded, and the footnote says it (§6). 4. The municipal table with two municipalities: whether "Procentvis" is A or B. No report of the owner's can tell; the query returns both and the validation says which holds (§7). A report of an account with points in two municipalities settles it; the demo's two municipalities show the difference (§2.6).

3. Data

3.1 The three datasets

All three are described to B51's loader (docs/declarations.md, "A dataset, described"): timezone=UTC, the UTC key, explicit sort, limit=0 with a window, the budget of 17 500 rows, only a complete response applied, the metadata read at each run, an unknown column in extras, a missing expected column stopping that dataset.

DatasetIntoDescriptionRows a dayFirst load, from 2020-12-31T23:00Z, on 25 November 2026 (2 155 days)
TE (PT1H; dataFrom 2017)fx.factor_hour, constants dataset = 2DECLARATION's, with the name and the constant changed: the same eleven columns (R2 §2.2.7), row replacement into fx.factor_hour_history, windows of 121 days, oldest first, daily the last 120 days14418 calls
TM (PT1H; dataFrom 2017)fx.mix_hour, constants dataset = 2GRIDMIX's, likewise: set replacement, no history, windows of 5 days (59 rows an hour and area in R2's sample: 14 160), newest first2 × 24 × the rows of an hour431 calls of data, 15 of metadata
RE (PT1H; dataFrom 2014; published about ten days behind)fx.re_coverage_hourNew, with a filter of municipalities (below): keys HourUTC → hour_utc, MunicipalityNo → municipality_code; values REshare → re_share_pct, REekWhKeep, ConsumptionkWh; HourDK known and not kept; row replacement with history; newest first; daily the last 30 days24 a municipality11 calls for three municipalities, 7 for one

Both price areas of TE and TM are loaded, as GE and GM are (P2 §2.1): which areas an install needs changes with its accounts, and a load by area would need a state per area.

What the loader is today, and what RE needs of it [code]. DatasetClient.window sends the filter {"PriceArea": […]} whatever the dataset; a description has one name, which is the service's path, the row of ingest.dataset_state, the advisory lock and the endpoint raw.fetch records; a retried attempt skips the windows that an earlier attempt of its job applied under that endpoint (_applied_by_earlier_attempts); the scope of a replacement is the description's constants. RE has no price area, and its set of municipalities changes. Decision: one request per window names every municipality that needs the window (the allowance is the scarce thing; the owner accepted that a request names municipalities), **and a municipality that is wanted later is caught up by a second description of the same dataset, with its own state.** Rejected: one chain per municipality (a call a day and municipality, and one metadata call each).

Change, all B81'sDetail
Dataset.filterThe request's filter, a property of the description; its default is the price areas', so every description of today sends what it sent. DatasetClient takes it from the description (elo_sources.eds.client)
Dataset.state_keyThe row of ingest.dataset_state, the advisory lock, the recorded endpoint (dataset/<state_key>) and the chain's key; its default is the name. The service's path and the metadata call stay the name's. Read by DatasetLoader (_endpoint, lock_name, awaits_first_load, the state's reads and writes) and by slices.run_slice (with per_dataset, as eds-prices runs two descriptions in one job)
A column of kind memberA key column whose value must be one the request's filter named. In a live response another value refuses the response; in file mode it is skipped (a snapshot may hold every municipality: §7)
The scope of a replacementThe description's constants and its filter's values: a changed row goes to the history, and a key the response no longer holds is removed, only among the municipalities the request named
Dataset.payloadrecords (default) or none: RE keeps no body in raw.payload (the dataset and the number of records only). With the window as the request's key, no row of raw.* and no job payload names a municipality (§4). The price: a damaged RE response cannot be read again from the database; it is asked again
The windows of an RE descriptiondays = min(364, 700 div k) for a filter of k municipalities: at most 16 800 rows a call (and k more on the 25-hour day). 364 days for one, 233 for three, 7 for 98
B51's and B53's testsPass unchanged in their assertions: every default above is today's behaviour

The two descriptions of RE, built at each run from ingest.municipality_state (§3.2):

The setThe catch-up
state_keyReCoverageMunicipalityReCoverageMunicipality+catchup
FilterThe municipalities in state 3The municipalities in state 2
What it loadsThe daily window (the last 30 days) and the monthly reloadAn ordinary first load, newest first: its own last 30 days, then back to the first day
When it runsIn every run, when the set has a memberWhen a municipality is catching up
MetadataOne call per description that runs: one a day, two while a catch-up runs beside the set

A municipality that becomes wanted waits (state 1). When no catch-up is under way, the waiting ones begin one together (state 2) and the catch-up's state row is cleared. When the catch-up's stretch covers the set's (from the first day through the set's last day; a set without a member has no stretch and takes the catch-up's), its municipalities join the set (state 3), in one transaction of eds-recoverage. So the first load of an install is one catch-up of the whole wanted set, and a municipality added later is loaded without a call for the others' history. A retried attempt skips what an earlier attempt of its job applied **under its own description's endpoint**: the two never share one, and membership changes only at the joining, after which the joined hold every day the set's skipped window covered.

Two traps of a shared table, each an acceptance criterion: a reload of a window of GM leaves the rows of dataset = 2 in the same hours untouched, and the reverse; a request that names 999 leaves the rows of 998 untouched.

3.2 Which municipalities

**Decision: the wanted municipalities are a setting, ELO_MUNICIPALITIES: auto (the default, and the only value this repository holds) or a list of three-digit codes separated by commas.**

RuleDetail
autoThe usable codes (§2.2) of the E17 roots of every account: "kommuner hvor et token har adresser"
A listExactly the listed codes. The owner's three municipalities "at first" are such a list in the owner's install alone
When the set is computedAt the start of every run of eds-recoverage (§3.4), into ingest.municipality_state: a code newly wanted gets state 1; so a new account's municipality is loading within a day of its master data. Until then its hours are pending, never noMunicipality (§2.2)
When a code is no longer wantedThe same run sets its state to 0 and calls fx.forget_municipality(code): owned by elo_owner, executable by elo_worker alone, it refuses a code whose state is not 0, deletes that municipality's rows of fx.re_coverage_hour and of fx.re_coverage_hour_history and nothing else, and increments ops.data_version. The worker's role gains no DELETE on a table it has none on (it has it on fx.re_coverage_hour for the loader's vanished rows, as on fx.factor_hour, and none on a history table) [code]. The state row stays, with state 0. So the change from the list to auto after the test removes the rows of the listed municipalities in which no point lies (question 5 of §9)
make account-removeUnder auto, a municipality that only the removed account's roots lay in is part of "nothing of the account is in the database" (P2 §6.3). B92 replaces ops.remove_account (migration 0310) in its own block: in the removal's transaction, as the owner, it deletes that municipality's rows of fx.re_coverage_hour, of the history and of ingest.municipality_state, and names each table once in its answer; ops.removal_statistics gains the schema fx, so that no planner statistic keeps the code. No request record is removed, because none names a municipality (§3.1); B75's search holds that. Under a list nothing is removed: the list is the owner's, not the account's. B81 enters the two new tables in the list of B75f3's catalogue walk with that reason until B92 names them in the function

The path of the setting (B92; ELO_MUNICIPALITY_NAMES of §4 and ELO_DEFAULT_METHOD of §5 take the same path, the second built by B93):

StepDetail
Where a person sets itA variable of the shell that runs make up, or a line of the file .env.local in the repository's root. .gitignore already excludes it (.env.*) [code]. It is never .env, which holds one line, the token (P1 §12.1)
The MakefileCOMPOSE gains $(if $(wildcard .env.local),--env-file .env.local) after .env; the demo's COMPOSE reads neither file, as today. COMPOSE_READABLE's sentence names the third file
PrecedenceCompose's own: the shell over the files, a later file over an earlier
deploy/compose.yamlIn the environment of migrate alone, beside ELO_EDS_SPACING_S: ELO_MUNICIPALITIES: ${ELO_MUNICIPALITIES:-auto}. An empty or blank value is therefore auto
migrateReads the value before the upgrade: auto, or codes separated by commas; spaces around a code are dropped, a code given twice counts once; anything that is not three digits refuses the start, naming the position of the item and never its value. After the upgrade install_settings writes it to ingest.municipality_setting as the owner, and refuses a code that is no row of ref.municipality the same way. Every process reads the table, never its own environment (as ELO_EDS_SPACING_S, B51v-05)
make doctorOne line more: .env.local, when it exists, has mode 0600, holds only lines ELO_…=…, no ELOVERBLIK_REFRESH_TOKEN and nothing shaped like a token
The demo, CIThe setting is not read: the generated extract holds the generator's municipalities and no job of the service runs (§3.7)

3.3 Tables

Each is created or changed by the epic of its row.

TableGrain / PKColumns, changeEpic
fx.factor_hour, fx.factor_hour_history(P1 §3.4)CHECK (dataset = 1) on fx.factor_hour becomes CHECK (dataset IN (1, 2)) (migration 0008; the history table has the column without a check [code]). No other changeB80
ref.municipalityPK code char(3)name_da text NULL, generated bool. The 98 codes of the saved sample derived_grid-area-and-municipality-to-price-area_2026-08.json (its 99 less the placeholder 999). The names are those of the public list the dataset's metadata points to; a seed of all 98 names singles none out, but whether the repository's privacy scan admits it is the lead's ruling at B81: without it the column stays NULL and a municipality's label is "Kommune <kode>". The demo load adds the generator's two rows, generatedB81
fx.re_coverage_hourPK (municipality_code char(3), hour_utc ts)re_share_pct num(12,6) NULL, re_kwh_keep num(18,6) NULL, consumption_kwh num(18,6) NULL (each as delivered: no check on the range, §2.3), retrieved_at ts, meta_updated_at ts, fetch_id bigint (a foreign key to raw.fetch, as B75f3's rule has it for every such column), generated bool, extras jsonb. elo_worker: SELECT, INSERT, UPDATE, DELETEB81
fx.re_coverage_hour_historyPK (municipality_code, hour_utc, superseded_at ts)The superseded or vanished row and cause smallint (1 changed, 2 vanished). elo_worker: SELECT, INSERTB81
ingest.municipality_settingOne rowmunicipalities text (auto or the list; auto until B92 wires the path), and from B92 names bool (§4). elo_worker: SELECTB81, B92
ingest.municipality_statePK municipality_codestate smallint (0 no longer wanted, 1 waiting, 2 catching up, 3 in the set), reason smallint (1 the list, 2 a root), wanted_since ts. elo_worker: SELECT, INSERT, UPDATEB81 (the table), B91 (who writes it)
ingest.dataset_state(P1 §3.2)Rows for TE, TM and the two descriptions of REB80, B81, B82
fx.mix_hourPK becomes (dataset smallint, price_area, hour_utc, connected_area, report_grp_code)dataset smallint NOT NULL DEFAULT 1 CHECK (dataset IN (1, 2)) (1 GM, 2 TM). The key is rebuilt once, over about 3 million rows on the owner's stackB82
ref.method(P1 §3.3)The rows 3 and 4 of §2.1 (B83); is_default bool, true on one available row (B93, §5)B83, B93
ref.mix_group(P2 §2.3)municipal bool NOT NULL DEFAULT false; the row local (§2.4)B87

elo_api has SELECT on every table of this section. Size: TE doubles fx.factor_hour (310 320 more rows); TM about doubles fx.mix_hour (3 to 6 million more, 0.5 to 1 GB); RE is 51 720 rows a municipality.

Every reader of the two shared tables, and what it reads after the change [code]. The criterion of the epic that changes a table is that every answer of phase 1 and phase 2 equals the answer before (B66's fixture; B78's test of the nine groups).

ReaderTodayAfter, and whose
calc.v_emission_interval (migration 0100), the only SQL reader of fx.factor_hourf.dataset = 1Unchanged by B80. B83: the method's dataset (§2.3)
elo_worker/status.py, the factors' newest hour; validate/declarations.py (compare-declarations); elo_devtools/emission_cases.py (the case store's reader)WHERE dataset = 1Unchanged by B80. B80 adds TE's own lines to make status; B83 gives the case store its second dataset
demo_load.py and scale.py, which count the rows of fx.factor_hour; synth/bulk.py, which copies generated rows inEvery row; dataset 1 writtenB80: the counts say each dataset apart; the bulk generator writes GE only, as today
DECLARATION (eds/dataset.py)constants dataset = 1, in its keyUnchanged; TE's description is a second one
calc.mix_hours (migrations 0270, 0315), the only SQL reader of fx.mix_hourEvery rowB82: WHERE dataset = 1, in the migration that adds the column. B87: the parameter p_dataset
GRIDMIX (eds/mix.py)conflict (price_area, hour_utc, connected_area, report_grp_code), no constantB82: constants dataset = 1 and dataset first in conflict, so that its upsert meets the new key and its set replacement is scoped to its own dataset (the scope is the constants)
status.py, MIX_PASS (one pass over fx.mix_hour grouped by price area and hour)Every rowB82: grouped by dataset as well; GM's lines read 1, TM's read 2. Without it every hour would sum to two million and count as incomplete
elo_devtools/mix_cases.py (read_mix_inputs), demo_load.py (the count), synth/mix.pyEvery rowB82: GM's rows; B87 gives the case store the split
The query files mix/structure.sql, mix/series.sql, providers/mix_status.sql, report/footprint.sql; the catalogue's readsThrough calc.mix_bucketsUnchanged by B82. B88: geo

3.4 Jobs, the lane, and what the first load costs

Seven jobs, one module each, all in the declaration lane, one at a time, under the one pace of P2 §2.2 (a call a minute for this address, shared with every other dataset and with a snapshot taken by hand). Slots in Europe/Copenhagen:

JobSlotWindowCalls
eds-tx-loadDaily 04:35TE, the last 120 days1 of data, 1 of metadata
eds-tx-monthlyThe 2nd, 03:10TE from 1 January of the previous year6 and 1 on 2 December 2026
eds-recoverageDaily 09:30 (Energinet: once between 08:00 and 09:00 is enough)The wanted set and its states (§3.2); the set's last 30 days; the catch-up's first load; the joining1 of data and 1 of metadata while the set has at most 23 municipalities; a catch-up's beside them
eds-recoverage-monthlyThe 2nd, 03:15The set from its first day: RE has no version and was republished whole with "a different method" on 5 November 2026 (R2 §2.2.1), so only a whole reload sees a restatement. It ends at once when the set has no member (awaiting_first_load); a catch-up is not its concern10 and 1 for three municipalities
eds-tx-mixDaily 05:00TM, the last 14 days3 of data, 1 of metadata
eds-tx-mix-weeklySunday 05:45TM, the last 120 days24 and 1
eds-tx-mix-monthlyThe 2nd, 04:00TM from 1 January of the previous yearabout 141 and 5 on 2 December 2026

The rules of P2 §2.2 hold for each: slices of 30 windows, the first load inside the daily job, a job that reloads ending at once on a dataset not loaded from its first day (awaiting_first_load). One rule more: **eds-tx-mix begins its first load only when TE is loaded from its first day and no municipality is waiting or catching up**; before that it ends at once, its slot covered (awaiting_emission_inputs). Reason: the emission needs 31 calls, the sources seven hours of the lane; the emission is the first thing the owner holds against the report.

As built (B82, 26 November 2026): "waiting or catching up" also counts a municipality that the setting and the roots want and that has no state row yet: on a first start the slots open eds-tx-load, eds-tx-mix, eds-recoverage in that order, and the state rows are written by the last, so by the states alone the seven hours would begin before the municipal share's catch-up was registered. The consequence is said where the owner looks (make status, docs/operations.md): while eds-recoverage fails, TM's first load does not begin. The static read found no state in which it waits for ever with nothing wrong.

Measured on the owner's install on 26 November 2026 (the first load of TE and RE): the service answered 429 to every second call at the worker's spacing of a minute, and with the cooldown of about four minutes that follows, the pace was one call in a little over five minutes, not one a minute: TE's 18 calls took about an hour and a half. The costs below are at a minute a call; at the measured pace TM's first load is nearer a day and a half than seven and a half hours. A spacing that the service accepts (or one that widens by itself after a 429) is open: the roster.

The cost of the first load for three municipalities from 2021, a minute a call: RE 11 calls (the catch-up's own 30 days, then ten windows of 233 days) and TE 18, with two of metadata: 31 minutes, after which the emission of every loaded hour is there. Then TM: 446 calls, about seven and a half hours, the newest months first. In all 477 calls, about eight hours of the lane, between whose slices the daily jobs run. Afterwards the method adds 8 calls a day, 25 each Sunday and about 165 on the 2nd of a month. At 98 municipalities the daily window is five calls and the monthly reload about 310.

3.5 Late and restated data

DataA changed or vanished rowOn a page
TETo fx.factor_hour_history with its cause, as GE (P1 §8)The emission of that hour under the municipal methods
TMThe hour's rows of dataset = 2 replaced as a set, no history (P2 §2.4)The sources of that hour
RETo fx.re_coverage_hour_history with its cause. A restatement is expected: every row of a municipality can change in one monthly runEvery figure of the method for that municipality, from the next query on; the page's notes give the newest retrieval (factor_retrieved_at is the later of the two inputs')

ops.data_version is incremented once per window that changed anything, as for every dataset. A report made before a restatement cannot be reproduced after it without its snapshot: the evidence rule of P1 §9.4.

3.6 make status

Per new dataset what P2 §2.4 gives: loaded from and through, the newest hour, the cooldown, stopped or not, unknown columns. Further:

LineWhen
The setting (auto, or "a list of n"), and per municipality of ingest.municipality_state: its label, its state in words, why it is wanted (the list; n roots), the newest hour, the hours of the set's range without a row; for the catch-up, loaded from and throughAlways. The label is the municipality's name or code: make status is the owner's terminal, as it names metering points by mp_id and count
! n metering point(s) in a municipality the list leaves out with the mp_idsOnly when the setting is a list, read from ingest.municipality_setting; never under auto, where a municipality not loaded yet is a plain line "waiting" or "catching up"
! n metering point(s) without a municipality with the mp_idsA root with no usable code
! n share(s) missing or outside 0–100 per municipality, with the first and last hourA NULL or impossible share
n row(s) restated in the last monthly run, per municipality, with the first and last hourPlain, not !: a restatement is the dataset's nature
TM: the hours not complete by version, as GMPlain
eds-tx-mix: awaiting the emission's inputsWhile the rule of §3.4 holds it back

3.7 Generated data for the demo and for CI

The generator elo_devtools.synth makes three more extracts in the loader's file format, from the organisation's seed, generated at load and not committed; a test asserts same seed, same bytes. **The organisation is not changed** (its sites lie in 999, price area DK1, and 998, DK2), so no existing fixture moves. A case the organisation lacks (a root without a usable code, a root with a protected address, a municipality the list leaves out) is made by the test that needs it, in its own database, as B75's tests set their sentinels.

ExtractCases
TEThe shape of the frozen GE extract (P1 §8): 144 rows a day, versions by the age of the hour, no row for the latest days; factors that differ from GE's of the same hour, so that a test can tell the datasets apart
RE, for 999 and 99824 rows a day; shares over the whole range, with hours of exactly 0 and exactly 100; one hour with a NULL share and one above 100; no row for the last ten days; one day without rows in the middle of 998
TMAs the GM extract (P2 §2.5), with shares that differ from GM's

make demo, the demo load and CI load them through the file mode, raw.fetch.source = 9, every row generated; the demo load adds the two rows of ref.municipality and loads RE with the filter of the two.

4. Privacy

TopicRule
What a request saysA call for RE names municipalities to a public service, from the install's address: the owner's decision. Under auto they are the municipalities of the accounts' points; with customers' tokens, of customers'. The client sends no identifying header (P1 §8); Energinet keeps the address of each call for three months (R2 §1.9). docs/operations.md says so where it describes the setting
What the database storesPublic rows per wanted municipality. The wanted set itself is not public: under auto it is where the accounts' points lie. A municipality's code is in four places and no other: fx.re_coverage_hour, its history, ingest.municipality_state and, under a list, ingest.municipality_setting. A request's record names none: its key is the window, its endpoint the description's, its body is not kept (§3.1), and a chain's payload holds windows. So a municipality leaves with three deletes (§3.2), and for a test municipality what stays is a state row that says it is no longer wanted: the owner's own list, in the owner's own database
LogsA municipality's code or name is in no log line: a run logs the description, the number of municipalities and counts. The allowlist of log fields gains none (P1 §12.1)
The selectionP2 §3.5 is not changed: the municipality is no dimension, sel refuses it, no query filters or ranks by it, and SELECTION_NEVER keeps municipality_code
What may leave to the browserFigures of the method, for any account. Never a municipality's code as such, and its label (its name; its code where the table has no name) only under two conditions. First, the setting ELO_MUNICIPALITY_NAMES is on: it is off until the owner has answered question 4 of §9, and stays off on a no. Second, every root of the selection in that municipality has a current version whose name is known to be unprotected and whose address is not protected (N4, the test an address has). Without both the municipality is a row without a label, "Kommune 1", "Kommune 2", numbered by the lowest mp_id of its roots, which says nothing of the code. Reason for the second: Eloverblik's own report names the municipality to its customer; the address, which is finer, already leaves under exactly this test; and a protected person's municipality must not appear because a method was chosen
The guards (B88, the epic of the first such column)One function returns a label: calc.municipality_parts(mp_ids): per root its part (m1, m2, …) and the label or NULL, by the two conditions. catalog.py [code] gains: a query file that names municipality_code or ref.municipality is refused, whatever the query (today only a file of the selection is, by SELECTION_NEVER); a file that calls municipality_parts counts as reading personal data (reads_personal, beside ADDRESS_WORDS, alias and meter number), so the column that carries the label must be declared under personal, and a declaration without the call is refused as today. The N4 test is in the function, not in the file: a test reads the function's text for protected_name IS FALSE and protected_address IS FALSE, and a test with a protected root gets no label and no code in any column. docs/queries.md, "What may leave the database", gains the bullet; mp.master keeps returning no municipality
make account-removeIts search (B75) gains the municipality that only the removed account had: found in no table, stored body, job payload, statistic or log line afterwards

5. Serving

The contract of P1 §10 and P2 §4 holds. New or widened:

ParameterValuesWhere
madds LB-MU-125 (and LB-MU-200 once available). Absent: the first of methodsEvery query that takes m
geoprice_area (default), municipalitymix.structure, mix.series, the provider of the mix's status
byadds municipality; with geo=price_area it is 422 invalid_parametermix.structure

The list of methods and its default (B93). meta.context.methods stays what phase 1's readers take: a list of codes, the available methods, the default first (context.tsx takes methods[0] [code]); gwpSets is unchanged. Beside it a new member, as B74 added accounts: methodInfo, one object per listed method, {code, geography, allocation, name}. The default is the row of ref.method with is_default; providers/catalogues.sql orders by it, then by method_id. ELO_DEFAULT_METHOD (LB-PA-125 unless the owner decides otherwise, question 1 of §9) takes the path of §3.2; install_settings sets the flag after the upgrade and refuses a code that is not an available method.

The response. method gains geography (price_area, municipality). basis.factorStatus and basis.mixStatus gain noMunicipality (§2.5), a share of the period's consumption like the others (zero under a price-area method); the runner's fixed lists of the status keys (BASIS_COLUMNS, MIX_COLUMNS) and the two providers gain it. factorSource and mixSource cover the RE rows too: a generated share is never Energinet's.

Reasons of a figure that no point-hour is in. no_data first, as today (nothing stored). Otherwise the cause that holds the largest share of the period's consumption, a tie in this order: no_price_area, no_municipality, municipality_not_loaded, no_local_share (a wanted municipality, and no share for the hour: a first load under way, or the last ten days), no_factor or no_mix. A selection of which a part has figures answers with that part's figures and the status shares; the pages say both (§6).

QueryChangeFiles (B84 unless named)
meta.contextmethods default first, methodInfo (above)B93: providers/catalogues.sql, runner.py
overview.cards, overview.months, development.series, consumption.weekday_hours (G01)Computed by the method; the reasons above. The G01 row of the cards gains local_kwh and local_share (÷ the consumption of the intervals with both inputs, 9 decimals), NULL under a price-area methodoverview/cards.sql, development/series.g01.sql, providers/factor_status.sql, runner.py (_emission_basis)
mp.emission_intervalsPer interval also re_share_pct, local_kwh, grid_kwh and pending_reason (no_factor, no_local_share, no_municipality, municipality_not_loaded); NULL under a price-area methodqueries/mp/
report.footprint, the emission blocksBy m's geography: the eight blocks by §2.3 and a ninth, local_energy (kWh, the exact Σ q_L), returned with blocks=emissions too. complete also needs a share for every hour with a quantity; reason gains no_municipality and municipality_not_loaded (no hour in the figures) and pending_share, before pending_factor. Until B88, a municipal method with blocks=all is 422 invalid_parameter; no page asks the footprintreport/footprint.sql
mix.structuregeo=municipality: by source ten rows, local first; by origin the part local first, then the areas. by=municipality uses the columns the query has (the runner refuses a result whose columns are not the catalogue's [code]): part is m1, m2, … (never a code); name the label or NULL and known whether it has one; ac_kwh the municipal energy; ac_share share A; the comparison's columns and delta_cp_pp likewise; the largest ac_kwh first. Two columns more, on every row and NULL for the other two by: own_kwh (the consumption in the figures of that municipality's points) and own_share (B)B88: mix/structure.sql, providers/mix_status.sql, runner.py (_mix_basis)
mix.seriesgeo: groups holds ten under the municipal splitB88
report.footprint, the mix rows (blocks=all)By §2.4: the two shares, source:local and the nine, origin:local and the areas, and per municipality two rows: municipality:<n> (kWh: the municipal energy in value and amount, the selection's consumption in the figures in per_kwh, so A is amount ÷ per_kwh) and municipality_own:<n> (a fraction: B in value, the municipal energy in amount, the municipality's own consumption in per_kwh). <n> is the number of the part, never a code. One column more, label, NULL on every other row. max_rows 60 becomes 100B88

What the new columns are to the guards (docs/queries.md, "What may leave the database"; each is declared in the catalogue with its source):

ColumnQuerySource, and why it may leave
local_kwh, local_shareoverview.cardsComputed (calc): a figure of the method
re_share_pct, local_kwh, grid_kwh, pending_reasonmp.emission_intervalsfx.re_coverage_hour (public data) and computed. A share is a fingerprint of a municipality only to somebody who holds the public dataset, and that reader holds the point's address or sees D1 under N4 already
own_kwh, own_sharemix.structureComputed
part (m<n>), <n> in blockmix.structure, report.footprintThe database's own numbering by mp_id; never a code
name (by municipality), labelmix.structure, report.footprintcalc.municipality_parts(): declared under personal; leaves only by the two conditions of §4

Budgets (B77's rule, ADR-004). The method adds one hash join per point-hour to a table of 8 760 rows a year and municipality, and nothing per reading. The catalogue keys a query's row_budget by one parameter, measure or blocks [code]; the split is not a third. Instead a query may carry municipal_budget_factor (1 when absent): under a municipal method or geo=municipality its budget is the one it has, times the factor, rounded down to a hundred thousand (Query.budget). B84 measures development.series G01, overview.cards and report.footprint, and B88 the two mix queries, for a year of every root of the demo with its previous year, through HTTP on analysed tables, under both splits; where the municipal split takes more than 1,10 times the price area's, the factor is the inverse of the ratio. Like B57's number for the cards it is an extrapolation from the demo's 18 roots, to be measured at 50 and 80 (ADR-004, item 4). The report gives both times.

6. Pages

Decision: the split is chosen once, for the whole address. The field is m, as today. Reason: a reader who holds a page against Eloverblik's report sets the report's split once; X1 by one split beside A4 by the other would be the misreading of 24 November again. Rejected: a split per page.

PartChange
The method control "Opgørelsesmetode"Lists methods in the groups of methodInfo's geography, "Prisområde" and "Kommune", each with its allocations. Offered on every page that shows emissions, as today. With the two methods of today it is one group
A4, which has no methodA two-way switch "Geografisk opdeling": Prisområde · Kommune, offered when methodInfo holds both geographies. It reads the geography of the address's m (the default method's without one) and the page sends geo. Chosen, it writes the method of the other geography with the same allocation when methods lists one, otherwise that geography's first method: from LB-PA-200 to LB-MU-125 while LB-MU-200 is reserved. The page then shows the line "Opdelingen »Kommune« findes kun med 125 %-metoden." It is decided from methodInfo, so the line goes with the UPDATE that makes method 4 available. No address of the product's own making answers 422
A4 between B86 and B90With a municipal m in the address the page still shows the price area's mix; B86 adds the caveat "Elmixet vises endnu kun med opdelingen »Prisområde«." beside B78's line, and B90 removes it
Title line 2The method's name (§2.1); A4: "Elmix, andel af elforbruget fra nettet i %, lokationsbaseret, time, kommune"
X1, the emission cardUnder the method a note from the query's columns, in the card's own scaling (at most three digits, manual §6): "Heraf dækket af kommunal vedvarende energi: 1,23 MWh (23,4 %). Det er kommunens produktion i de samme timer, ikke et køb af vedvarende el." The second sentence is there because the card shows a share (docs/mix.md: the caveat stands on every page and card that does)
D1, view udledningThe factor tier is titled "Emissionsfaktor, transmissionsnettet"; the interval table gains "Kommunal VE-andel (%)", "Kommunal VE (kWh)" and "Rest (kWh)"; a pending interval reads by pending_reason (below)
A4, sources"Kommunal vedvarende energi" is the first row of the structure chart and of the series; polarity 0 like every source
A4, originThe part local first, named "Kommunal vedvarende energi". Below the chart the municipal table, shown when the selection has more than one municipality or the one has a label: Kommune · Kommunal vedvarende energi (kWh) · Andel af forbruget (%) · Andel af forbruget i kommunen (%), the last from own_share
A4, the fixed caveat under the municipal split"Elmixet er kommunens egen vedvarende elproduktion først og derefter transmissionsnettets blanding i prisområdet, i de timer hvor forbruget lå. Det dokumenterer ikke køb af vedvarende el: det kræver oprindelsesgarantier." First among the caveats, word for word, as the price area's is
A4, B78's lineBy price area it stays as it is. Under the municipal split: "Elmixet følger Eloverbliks geografiske opdeling »Kommune«. Rapporten »Dit klimaaftryk« lavet med opdelingen »Prisområde« viser andre andele, fordi den ikke medregner kommunens egen vedvarende produktion først."
The wording rulesP2 §3.3's hold: no fixed text says grøn, din vedvarende, neutral or 100 %. "Kommunal vedvarende energi" is Eloverblik's name of the line and is used as it is; it is never called the reader's own
Comparison periodsNothing new: both periods by the chosen method; "Sammenlignet over h af H timer" with the cells left out for an input

Every new state and reason, and its words. A page shows no state it has no sentence for.

From the queryWhereThe words
Pending hours under the method (pending_hours)The caveat of X1, A1 and D1; D1's message"x % af forbruget (n timer) har endnu ingen kommunal VE-andel eller emissionsfaktor"
The same on A4The pending caveat"x % af forbruget (n timer) har endnu ingen kommunal VE-andel eller intet fuldstændigt elmix"
factorStatus.noMunicipality, mixStatus.noMunicipalityThe status line (factorStatusText, A4's status)"uden kommune", beside "uden prisområde"
The same, above zeroA caveat of X1, A1 and A4"x % af forbruget ligger i målepunkter uden kommune eller i en kommune, der ikke er indlæst; det indgår ikke i udledningen" (A4: "… i elmixet")
Reason no_municipalityIkke tilgængelig"målepunktet har ingen kommune"
Reason municipality_not_loadedIkke tilgængelig"kommunens data er ikke indlæst"
Reason no_local_shareIkke tilgængelig"kommunens VE-andel er endnu ikke offentliggjort for perioden"
pending_reason no_factorD1, the interval's band and tableafventer faktor
pending_reason no_local_shareThe sameafventer kommunal VE-andel
pending_reason no_municipalityThe sameuden kommune
pending_reason municipality_not_loadedThe samekommune ikke indlæst
A municipality without a labelThe municipal table"Kommune 1", "Kommune 2"; where the address is the reason, the note "navnet vises ikke, fordi en adresse er beskyttet"
A4's hintThe page's use string"Vælg periode, geografisk opdeling og sammenligning"

Never the price-area figure in the place of an unavailable one.

The emission footnote (validationNote, by the answer's method.code). For LB-MU-125, until a validation is recorded: "Kommunemetoden (LB-MU-125) er kontrolleret mod beregningseksempler. Mod én rapport »Dit klimaaftryk« med geografisk opdeling »Kommune« (AR5, året 2025, ét målepunkt) var forbruget og den kommunale vedvarende energi ens; udledningen afveg med 0,02 % og de to tabslinjer med op til 2 %." When B85's validation is VALIDATED the lead replaces it by B78's sentence with "Kommune" and LB-MU-125; when it is equal but for the losses, by that sentence with "bortset fra de to tabslinjer"; otherwise by the residuals it recorded. For LB-MU-200, once it is a method: B78's sentence for LB-PA-200 with "Kommune" ("… bruger 125 %-metoden; med LB-MU-200 afviger tallene derfor fra rapporten …"). The footnote is the emission's; what B89 records of the sources changes A4's line, as B78's does.

The key ("Signaturforklaring") gains no code. The method's footnote of §2.1 stands with the source line.

7. The validation

make validate (docs/validation.md) learns the municipality target and, for both splits, the blocks B59's report left to it. The evidence rule, the throwaway database and the comparison at half a unit of the last printed digit are unchanged.

TopicRule
The target's fieldsGeographic split: price area, municipality. Method is the allocation the report was made with, 125 % or 200 %, for both splits. No report prints it: "Beregningsgrundlag" has Oprettet, Periode, Geografisk opdeling and Datagrundlag [LT]; it is what was chosen in the form, and 125 % where the form gave no choice. The value municipality of targets typed before this document is read as 125 %. A municipality target with 200 % is refused (exit 3) while LB-MU-200 is reserved: "the method LB-MU-200 is reserved (municipality-method.md §2.1)"
The snapshotThe tool is the validation's, not the worker's: --municipality takes a list, and all 98 when omitted, as today. A municipality target is refused unless the snapshot holds TE, TM and RE for the period, each file retrieved on the report's day. The validation loads RE in file mode with a filter of the target's points' municipalities: rows of any other municipality in the file are skipped, never a refusal (§3.1); a month without a row for one of the filter's is refused
The data basisNothing of today's behaviour is lost, for either split. A report of "Endelige tal" is typed final and compared under final, as today. Where the answer under final rests on less than the period because hours are published with another version (the tool says how many, of which dataset, and names them when they are few), it is compared under best as well, and that comparison decides. A report of "Foreløbige tal" is compared under best, as today
The emission blocks of a municipality target (B85; the tool asks blocks=emissions)Consumption, the monthly control, emissions excluding losses, the two losses, biogenic, the three gases: as a price-area target's, by §2.3. New: Municipal renewable energy (kWh) against local_energy
The mix blocks, both splits (B89; the tool asks blocks=all)Renewable share (%) against E11a. Source: <line> (kWh) for each line the report prints: against source:<group>; the report's "Andet" and "Anden vedvarende energi" are typed as two lines and compared as their sum against source:other, at one unit of the last printed digit. Origin: <area> (%) against the area's energy ÷ the consumption of the hours in the figures (P2 §4: the denominator every share of the mix has). Under the municipal split also Source: Kommunal vedvarende energi, the municipal row of the origin table, and Municipality: <label> (kWh and %): the kWh against the row's energy, the per cent against A and against B, and the output says which holds: "A", "B", "both" (one municipality) or neither, which differs. A target must hold every line its report prints; a line of the product the report does not print must be zero
The statusesVALIDATED (exit 0): the target is complete and every block was compared and is equal. EQUAL BUT FOR THE LOSSES (exit 7), for a municipality target only: complete, every block compared, all equal but one or both loss lines; the output names the two residuals. Never read as VALIDATED (§2.7). DIFFERS, NOT VALIDATED, refused and failed as today. The status CONSUMPTION VALIDATED, EMISSIONS NOT VALIDATED (municipality method outside phase 1) and its exit 6 no longer exist; 6 is not used again
The first targetThe owner's report of 15 November 2026 (2025, Kommune, "Endelige tal") with data/validation/declarations-2026-11-15. By §2.7 it will say DIFFERS on the lines named there. The second is the report the owner makes again, with that day's snapshot (§2.7, 1)
The recordPer block "match" or the residual, without a figure of the owner's, in docs/emission.md and docs/mix.md, with which of §2.7's four it settled. The lead then sets the footnote (§6)

8. Delivery

8.1 Rules for every epic

Those of P1 §13.1 and P2 §7.1. Further:

8.2 The epics

EpicScopeAcceptance criteriaThe lead's validationDepends onOwnsSizeAgent · model · effortReview
B80 Transmission factors§3.1, §3.3, §3.4, §3.5 for TE: the constraint, the description, eds-tx-load, eds-tx-monthly, the generated extract and its loading by make demo, the demo load and CI, the lines of make status, the readers of §3.3 that count rowsOn the generated extract, without a network call: a row of dataset 2 is accepted by fx.factor_hour and one of 3 refused; after make demo fx.factor_hour holds rows of dataset 1 and 2 for the same hours with different values, all generated; a changed TE row leaves a history row of dataset 2 and no row of dataset 1 changes; the tests of the declaration loader pass unchanged; compare-declarations and the factors' line of make status give what they gave; every query of phase 1 and 2 answers as B66's fixtureThe first load on the owner's stack: 18 calls; the newest hour recorded–The worker's status.py, schedule.py, the generator, the demo load, the Makefile and the CI workflow, while it runs; eds/ (a new module); migrations 0320–0322SClaude · Sonnet · highCodex high
B81 A description with a filter; the municipal share's storage§3.1 (the loader's five changes, the windows by k, file mode), §3.3 (ref.municipality, fx.re_coverage_hour with its history, the two ingest tables with auto in the setting), §3.7 (the RE extract and its loading with the generator's two municipalities)Against a local replay server and on the generated extract: B51's and B53's loader tests pass unchanged in their assertions; a description without a filter sends the price areas'; a request for 999 that is answered with a row of 998 is refused, and the same file in file mode is applied with that row skipped; a reload of 999 changes no row of 998, in the table or the history; a filter of three asks windows of 233 days; no row of raw.* and no job payload holds ZZ8 or ZZ9 after a load of those two (§8.1); a NULL share and a share above 100 are stored as delivered; B75f3's catalogue walk passes with the two new tables in its list and their reason; after make demo every row of fx.re_coverage_hour is generated and no call was madeThe lead's ruling on the 98 names (§3.3)B80fx.re_coverage_hour*, ref.municipality, ingest.municipality_*; elo_sources/eds/client.py, eds/dataset.py, eds/loader.py, eds/slices.py; the files B80 held; migrations 0323–0329MClaude · Opus · highCodex x
B91 The wanted set and its load§3.1 (the two descriptions), §3.2 (the set under auto, the states), §3.4 (eds-recoverage, eds-recoverage-monthly), §3.6 for REAgainst a local replay server: with roots in ZZ8 and ZZ9 one catch-up loads both, newest first, in requests that name both, and they join the set when it reaches the first day; a root then added in a third municipality makes it wait, catch up alone (no request names the other two outside the set's own windows) and join; an attempt killed after the set's window and retried asks no window twice and skips none of the catch-up's; the monthly job ends at once with awaiting_first_load while the set is empty; one metadata call per description that ran; a municipality no root has any more gets state 0 and is in no later request; make status shows each municipality's state and never the line of a list under auto; no captured log line holds ZZ8 or ZZ9The first load on the owner's stack under auto; make status shows the municipality loaded from 2021B81ingest.municipality_state's writers; eds/ (the RE module), two job modules; the files B81 held; migrations 0365–0369MClaude · Opus · highCodex x
B92 The list, and what leaves§3.2 (the setting's path for ELO_MUNICIPALITIES and ELO_MUNICIPALITY_NAMES, fx.forget_municipality, make account-remove), §3.6 (the list's line), §4make up with the variable in the shell, with the line in .env.local, and with both (the shell wins) installs that value; an empty value installs auto; a list with spaces and a code given twice installs each code once; an item that is not three digits is refused naming its position and no value, and a three-digit code that is no municipality likewise after the upgrade; make doctor refuses a .env.local of mode 0644 and one with a token's line; under a list make status flags a root outside it and its hours are noMunicipality; a code dropped from the wanted set has no row in fx.re_coverage_hour or its history, the function refuses a code whose state is not 0, and elo_worker cannot delete from the history itself; make account-remove under auto leaves nothing of the municipality only the removed account had (B75's search over tables, bodies, payloads, statistics and logs, with a sentinel code) and keeps one another account shares, names each table once, and under a list removes noneThe owner's list in .env.local: the three loaded; then auto: the two without a point goneB91fx.forget_municipality, ops.remove_account and ops.removal_statistics (replaced); elo_api/db/migrate.py, deploy/compose.yaml, the Makefile, elo_devtools/doctor.py, elo_devtools/account_remove.py, while it runs; migrations 0370–0374MClaude · Opus · highCodex x
B82 The transmission mix§3.1, §3.3, §3.4 for TM: dataset in the key of fx.mix_hour, GRIDMIX's constant and conflict, calc.mix_hours and MIX_PASS by dataset, TM's description, the three jobs with the rule that holds the first load back, the generated extract, the lines of make statusOn the generated extract: after the migration every stored row has dataset 1 and every answer of mix.structure, mix.series and report.footprint equals the answer before it, value for value, also after TM is loaded beside; make status counts the same incomplete hours of GM before and after TM is loaded, and TM's apart; a reload of a GM window in which an hour has fewer rows leaves that hour's TM rows as they were, and the reverse; eds-tx-mix ends with awaiting_emission_inputs while TE is not loaded from its first day or a municipality waits or catches up, and loads newest first once they areThe first load on the owner's stack; from which day TM's hours are complete, by versionB91The files B91 held; eds/mix.py; migrations 0330–0334MClaude · Sonnet · highCodex high
B93 The list of methods and its default§5 (methods default first, methodInfo, ref.method.is_default, ELO_DEFAULT_METHOD on the path of §3.2), §6 (the grouped control)Through HTTP and in the web's tests, with the two methods of today: methods is a list of codes whose first is the default, and every reader of phase 1 passes unchanged; methodInfo holds one object per listed method; ELO_DEFAULT_METHOD=LB-PA-200 puts it first and decides the answer to a request without m; a code that is not an available method refuses the start after the upgrade; the control shows one group "Prisområde" and writes m as before; B66's fixture holds but for the new member––ref.method.is_default; queries/providers/catalogues.sql, runner.py, migrate.py and compose.yaml while it runs; web/packages/shell (MethodSwitch.tsx, context.tsx); migrations 0375–0379SClaude · Sonnet · highAgy
B83 The municipal emission§2.1 to §2.3, §2.5, §2.6: the methods' rows, calc.mp_municipality, the method's dataset and share in calc.v_emission_interval and through the functions that read it; the Python reference; the golden casesThe golden cases of §2.6 for the emission, figure by figure, under both bases and both GWP sets; SQL equals the reference on the demo organisation to the last decimal for LB-MU-125 over periods, grains, comparisons and selections that hold both municipalities; an hour without a share, with a NULL share and with a share above 100 is pending and never zero; a root without a usable code, and under a list one outside it, has noMunicipality and no amount, while a wanted municipality without rows is pending; with LB-PA-125 and LB-PA-200 every function returns what it returned (the existing tests of test_emission.py unchanged in their assertions); a changed share changes the next result; m=LB-MU-200 is refused while its row is reserved and computed by the 200% rows once a test sets it available–B81elo_core/emission.py, elo_devtools/emission_cases.py, docs/emission.md; migrations 0335–0344MClaude · Opus · highCodex x
B84 The method in the emission queries§5 without the mix and without B93's part: m widened, the status and the reasons, local_kwh and local_share on the cards, the columns of mp.emission_intervals, the emission blocks of report.footprint with local_energy, the factor on the budgetThrough HTTP on the demo organisation: every query that takes m answers under LB-MU-125 with method.geography municipality; with 999 alone in the list, a selection of 998's roots answers unavailable with municipality_not_loaded, one of both municipalities answers 999's figures with noMunicipality equal to 998's share of the consumption, and no response holds a price-area figure in their place (asserted against the same call with LB-PA-125); a period inside the last ten days answers no_local_share; a selection half without a price area and half without a municipality answers the reason of the larger share; report.footprint under the method returns nine blocks with blocks=emissions and 422 with blocks=all; under LB-PA-125 every answer equals B66's fixture; the report gives the time of the three measured queries under both splits and the factors that follow by §5's ruleOn the owner's stack: the emission blocks of report.footprint against the report of 15 November by hand, residuals recordedB83, B93The catalogue, catalog.py, runner.py, budget.sql; queries/overview/, queries/development/, queries/consumption/, queries/mp/, queries/report/, queries/providers/; migrations 0345–0349MClaude · Sonnet · highCodex high
B85 Validation I: the municipality target§7 for the emission blocks: the target's Method, the refusal of 200 %, the snapshot tool's list, RE in file mode, the data basis in two steps, Municipal renewable energy, the statusesOn the demo organisation with a generated snapshot (tools/tests): a municipality target whose blocks are the product's own is VALIDATED, exit 0; one loss line changed by two units of its last digit is EQUAL BUT FOR THE LOSSES, exit 7, with both residuals named; another figure changed likewise is DIFFERS with that block; a target typed municipality as its method is read as 125 %, one typed 200 % is refused with the sentence; a snapshot that holds all municipalities is loaded with the others skipped, one without a row for a target's municipality is refused, exit 3; a final target with one Preliminary hour is compared under final (not compared: the hour named) and under best, which decides; every price-area target of tools/tests/test_validate_footprint.py answers as before; the exit 6 status is returned by nothingThe owner's two Kommune reports (§2.7, 1 and 2): per block "match" or the residualB84elo_devtools/validate/, tools/snapshot_declarations.py, docs/validation.mdMClaude · Sonnet · highCodex high
B86 Pages X1, A1, D1 under the method§6 without A4's switch: the control's second group, the card's note, the words of every state and reason, D1's tier title and columns, the footnotes, A4's interim caveatWeb unit tests and Playwright on the demo organisation through Caddy at 390 and 1 280 px in the three themes, without console errors or overflow: the method chosen round-trips through the address and every figure of X1, A1 (G01) and D1 changes with it; the card's note is there under LB-MU-125 with both sentences and at most three digits, and absent under LB-PA-125; with 999 alone in the list a page of 998's roots reads Ikke tilgængelig with "kommunens data er ikke indlæst" and shows no emission figure; each row of §6's table of words is asserted from a response that carries its state; A4 opened with m=LB-MU-125 shows the interim caveat; the footnote is the municipal method's sentence under it and B78's under the price area's, and no code but the chosen one stands in the notes; design.spec and the checklist's notation block passThe owner's stack is shown to the owner with its addressB84The app's src/shared/, the three pages' directories, e2e/ (its own specs)MClaude · Sonnet · highAgy
B87 The municipal sources§2.4, §2.5, §2.6: calc.mix_hours by p_dataset, calc.mix_buckets by p_geo with the municipal part and the sign, the parts per municipality, calc.municipality_parts; the row local; the Python reference; the golden casesThe golden cases of §2.6 for the sources, the residual and the two municipalities, figure by figure; for 2 000 seeded hours, negative ones among them, the municipal part and the nine groups sum to the hour's energy exactly, and the municipalities' parts to the municipal part; SQL equals the reference on the demo organisation to the last decimal under geo=municipality, by source, origin and municipality, both bases, every kind of comparison; under geo=price_area every result equals B78's, value for value, and has nine groups; a point-hour without a share is outside numerator and denominator and counted in pending_hours; calc reads fx.mix_hour through calc.mix_hours alone and the parts are unnested only for the sums (the test on the function's text); calc.municipality_parts gives no label with the setting off, none for a root with a protected address with it on, and its text holds both tests of N4–B82, B83elo_core/mix.py, elo_devtools/mix_cases.py, docs/mix.md; migrations 0350–0359MClaude · Opus · highCodex x
B88 The sources in the queries§5 for the mix: geo, by=municipality on the query's columns, own_kwh and own_share, the mix rows of report.footprint with label, the guards of §4 in catalog.py, the factor on the budgetThrough HTTP on the demo organisation: mix.structure with geo=municipality returns ten rows by source, local first, summing to the consumption of the hours in the figures; by municipality two rows whose ac_share and own_share differ as §2.6's case has them; with the setting off no row has a name, with it on a root with a protected address leaves its municipality without one, and no column of any response holds a code; the catalogue's refusal test gains: a query file that names municipality_code or ref.municipality is refused; a file that calls municipality_parts without a personal declaration is refused, and a declaration without the call; by=municipality with geo=price_area is 422 invalid_parameter; report.footprint under LB-MU-125 with blocks=all returns source:local, origin:local and the two rows per municipality; under geo=price_area every answer equals the answer before the epic; the report gives the times under both splits–B87, B84The catalogue, catalog.py, runner.py; queries/mix/, queries/report/, queries/providers/; migrations 0360–0364MClaude · Sonnet · highCodex high
B89 Validation II: the mix blocks of both splits§7: Renewable share, Source:, Origin:, Municipality: under A and B; the sum of the report's two "other" lines; a line the report does not printOn the demo organisation with a generated snapshot: a price-area target and a municipality target that hold the product's own mix lines are VALIDATED; a source line changed by two units is DIFFERS with that line; a target that leaves out a line the report's kind requires is incomplete, exit 5; "Andet" and "Anden vedvarende energi" are compared as their sum; a product line with energy that the target does not hold is DIFFERS, never ignored; a target of two municipalities typed with A says "A", with B says "B", with another per cent differsThe owner's reports of both splits with their snapshots: per line "match" or the residual; B59's open note is closedB85, B88elo_devtools/validate/, docs/validation.mdMClaude · Sonnet · highCodex high
B90 Page A4 under the split§6 for A4: the switch with its fall-back and line, the row and the part local, the municipal table, the two caveats, the title; the interim caveat removedPlaywright on the demo organisation at 390 and 1 280 px in the three themes: the switch writes the method of the other geography, and X1 opened from the same address shows the same split; from m=LB-PA-200 it writes LB-MU-125 and shows the line, and with method 4 set available in the test it writes LB-MU-200 and shows none; no click on the page leads to an address that answers 422; under "Kommune" the fixed caveat of §6 is the first caveat, word for word, and B78's line is the municipal one; "Kommunal vedvarende energi" is the first of ten rows; the municipal table has two rows for the demo, "Kommune 1" and "Kommune 2" with the setting off; no fixed text of the strings module holds a forbidden word (the unit test over the module); the first screen at 1 280 px still holds message, titles, caveats, the two figures and the top of both charts (B78's measure)The lead shows the page to the owner beside the reportB88, B86The A4 directory, the shell's switchMClaude · Sonnet · highAgy

Where Codex's limit is reached, its review falls to Claude or Agy (the lead's standing rule); nothing waits.

8.3 Lanes and order

LaneShared filesOrder
The worker and the toolsstatus.py, schedule.py, the generator, the demo load, the Makefile, the CI workflow, the loaderB80 → B81 → B91 → B92 → B82
The named queriesThe catalogue, catalog.py, runner.py, budget.sqlB93 → B84 → B88
The settings' pathmigrate.py, deploy/compose.yaml, elo_devtools/doctor.pyB93 → B92
The web appweb/packages/shell, src/shared/B93 → B86 → B90
The validation toolelo_devtools/validate/B85 → B89

B83 and B87 change calc functions in their own migrations and no shared file; each starts when what it depends on has merged. The migration blocks say who owns a number, not an order: the lead sets every parent revision at its merge (P1 §13.3), and B83 merges before B82 although its numbers are higher.

The smallest first delivery the owner can hold against the report: B80, B81, B91, B93, B83, B84, B86, with B85 for the lead. The order of starting:

  1. At once: B80 and B93. They share no file. 2. When B80 has merged: B81. 3. When B81 has merged: B91 and B83, beside each other. 4. When B83 and B93 have merged: B84. 5. When B84 has merged: B86 and B85, beside each other. 6. In the worker's lane after B91, beside the rest: B92, then B82 (the owner's test list needs B92; the sources need B82, then B87 to B90).

What the first delivery shows, and where. After 31 minutes of loading on the owner's stack (B91): X1 under "Kommune · 125 %" shows the year's emission, its intensity, and the note "Heraf dækket af kommunal vedvarende energi", the report's first source line; A1 the emission by month; D1 the share and the remainder of every interval. The two losses, the biogenic emission and the three gases per kWh are on no page: they are rows of report.footprint, which the lead reads in make validate's output (B85) beside the report. A4 still shows the price area's mix and says so (§6). The sources follow with B82's seven hours and B87 to B90, without the owner waiting.

8.4 Exit

  1. On his own data the owner chooses "Kommune" once and sees the emission, the municipal part, the sources and the origin as the report has them, or the recorded residual of each line that differs, with the footnote saying which. 2. make validate compares every block of a report of either split, and the lead has recorded the outcome of §2.7's steps. 3. With auto a new account's municipality loads without anybody naming it, and a removed account's leaves. 4. The same pages pass on the demo organisation in CI, with two municipalities.

9. For the owner

#QuestionRecommendationUntil it is answered
1Skal siderne som udgangspunkt vise »Kommune«, som Eloverblik gør, eller »Prisområde«, som nu?Prisområde, indtil kommunemetoden stemmer med din rapport linje for linje; derefter Kommune, fordi det er den opdeling, du sammenligner med, og den Energinet kalder mest retvisendePrisområde (ELO_DEFAULT_METHOD), og du vælger Kommune i metodevælgeren
2Tilbyder Eloverbliks formular »Beregningsmetode« 125 % og 200 %, når den geografiske opdeling er Kommune? Rapporten selv skriver ikke metoden.Hvis ja: også LB-MU-200 på siderne, som LB-PA-200 er der i dag. Hvis nej: kun 125 %Kun LB-MU-125; 200 % ligger klar som én række
3Vil du lave rapporten »Dit klimaaftryk« for 2025 med Kommune og »Endelige tal« én gang til, så vi kan tage en kopi af Energinets data samme dag?Ja. Det afgør, om de små afvigelser (0,02 % på udledningen, op til 2 % på tabene) skyldes, at rapporten fra 15. november var lavet på ældre dataMetoden leveres med afvigelserne skrevet i fodnoten
4Må en side skrive kommunens navn i tabellen over kommunal vedvarende energi, som Eloverbliks rapport gør?Ja, når målepunktets adresse allerede må vises. Hvis ja: navnet står i tabellen, undtagen hvor en adresse er beskyttet. Hvis nej: tabellen bliver ved med at skrive »Kommune 1«, »Kommune 2«, og tallene er de sammeIntet navn vises: rækken og tabellen skriver »Kommune« med et nummer (ELO_MUNICIPALITY_NAMES er slået fra)
5Når testen er slut, hentes kun kommuner, hvor et token har adresser, og de testkommuner, hvor der ikke ligger et målepunkt, slettes igen. Er det rigtigt forstået?Ja: det er, hvad »herefter kun« siger, og en kommune kan hentes igen på få minutterSådan, når indstillingen sættes til auto

Questions 2 and 3 are with the owner since 25 November, 06:21, in these words.

One answer the owner asked for, which needs no decision. "Var det muligt at lave kommuneopdelt mix og CO2e?": yes, both. The municipal renewable energy already equals your report to the hundredth of a kWh; the emission is 0,02 % from it, and question 3 is how we find out why.

10. The sentences that change

Each is changed by the epic named, in the change that builds it; the lead writes the new sentence when the epic merges. A row quotes the file as it is on main at 7cb894d (and tools/snapshot_declarations.py as the lead changed it after).

phase-1.md:

#WhereThe sentence todayBecomesEpic
1§1.2, the jobs tableTwo rows of the service: eds-load, eds-monthly-repull (P2 §9 row 1 added the five of P2 §2.1)adds the seven jobs of §3.4, in the same laneB80, B91, B82
2§1.3, "Operational settings are environment variables"The list ends with ELO_ACCOUNT_PARTY_KINDadds ELO_MUNICIPALITIES (auto), ELO_MUNICIPALITY_NAMES (off), ELO_DEFAULT_METHOD (LB-PA-125): settings of migrate, installed in the database; .env.local as a second place for settingsB92, B93
3§1.4, row "Not built at all (A2v-10)""… ingest.token_request, ref.municipality, the off-peak window …"ref.municipality leaves the list (§3.3)B81
4§3.1, ops.data_version"Incremented once in every transaction that changes a reading, a ts.day_load row …, a factor row or a price area"adds a municipal share, and a root's municipality codeB81, B83
5§3.3, ref.method"Seeds: 1 LB-PA-125 …, 2 LB-PA-200 (allocation 2), both available. The other codes of solution.md §5.1 are reserved and not seeded"adds 3 LB-MU-125 (available), 4 LB-MU-200 (reserved), and is_defaultB83, B93
6§3.4, fx.factor_hour"dataset 1 = DeclarationGridEmission"adds 2 = DeclarationTransmissionEmissionB80
7§8, first sentence, and the rows "First load and daily", "The frozen factor extract""Phase 1 loads DeclarationGridEmission only (R2 §2.2.3)"adds: the transmission's declaration is loaded beside it by a second description (§3.1), with a generated extract of its own (§3.7)B80
8§9.2, the heading"The two price-area methods""The price-area methods"; the municipal methods are §2.3 of this documentB83
9§9.3, first sentence; the table's rows for G01 and for a point without a price area"An hour is pending for a method when it has no factor row"; "x % af forbruget (n timer) har endnu ingen emissionsfaktor"; "Ikke tilgængelig with the reason "no price area", never zero"adds: under a municipal method an hour is pending also without a municipal share, with the caveat and the reasons of §6B83, B86
10§9.4, row "Emissions, price area""… for 125 % and for 200 %, with best and with final"adds: a report of "Endelige tal" whose answer under final rests on less than the period is compared under best as well, and that decides (§7)B85
11§9.4, row "Not in phase 1" (P2 §9 row 10: "The municipality report only")"Renewable share, source and origin splits, the municipality report: they need datasets phase 2 loads"Nothing: every block of both reports is compared (§7)B85, B89
12§10.1, parameters"m (LB-PA-125 or LB-PA-200; default the first)"adds the municipal methods; the first is the setting's defaultB84, B93
13§10.2, the response"state is ok, empty, unavailable (with a reason: no price area, no factor in the period) or too_large_for_grain"; method with four members; factorStatusadds the three reasons of §5, method.geography, noMunicipalityB84
14§10.4, meta.context; overview.cards; mp.emission_intervals"the two methods, GWP sets"; "G01 by the method … and G16"; "Per interval: kWh, the amounts of §9.2, the factor with its version and retrieved_at, or pending"The listed methods, default first, and methodInfo; local_kwh and local_share; the share, the two energies and pending_reason (§5)B93, B84
15§11.1, the rows of the method switch and of the emission footnote"The method switch Opgørelsesmetode on every page that shows emissions"; "The emission footnote: …"adds: in two groups, Prisområde and Kommune; A4 shows the geography alone; the footnote by method (§6)B86, B90
16§12.1, row "Personal data"No sentence on a municipalityadds: a municipality's label leaves only by the two conditions of §4; the wanted set leaves with the last pointB92, B88

phase-2.md:

#WhereThe sentence todayBecomesEpic
17§1.3, row "The municipality, yearly and market-based methods; guarantees of origin""Unchanged from P1 §1.1"The yearly and market-based methods and guarantees of origin stay unbuilt; the municipality method is this document'sB83
18§2.1, the datasets and the jobs; §2.4, rows "The mix" and "Readings, factors"DeclarationGridmix alone feeds fx.mix_hour; "Readings, factors: Unchanged from phase 1"adds TM beside GM under the same rules, and RE with a history (§3.1, §3.5)B82, B81
19§2.1, first paragraph: "the requests filter PriceArea to DK1 and DK2"One filter for every dataset, one state per datasetA description may carry a filter and a state key of its own (§3.1)B81
20§2.3, fx.mix_hour; ref.mix_group"PK (price_area char(3), hour_utc ts, connected_area text, report_grp_code text)"; "The eight rows of §3.3" (nine since B78)dataset first in the key; a tenth row local and the column municipalB82, B87
21§3.3, the decision; the table of groups; the wording table"the rows of DeclarationGridmix …"; "It is one calculation for every method: the mix has no allocation method"; title line 2 "… time, prisområde"; the fixed caveatOne calculation for every allocation, by the method's geography: under the municipal split §2.4, with the group local, the title and the caveat of §6B87, B90
22§3.5, row "Postcode, city, municipality""Never for a private or unclassified account. …"Unchanged as a rule of the selection. adds one sentence: the municipal table of A4 is no dimension; it shows a municipality's label by §4B88
23§4, parameters; basis; the rows of the emission queries, mix.structure, mix.series, report.footprintby (source, origin); mixStatus with five shares; "one row per group (8)"; "max_rows goes from 10 to 60"geo; by gains municipality; noMunicipality; the columns of §5; ten rows under the municipal split; 100B84, B88
24§5.4, A4The page of the price area's mixadds the switch, the municipal row and table, the second fixed caveat (§6)B90
25§6.3, make account-remove, row "What goes"The account's rows, listedadds: under auto, what is stored of a municipality no remaining root has (§3.2)B92
26§6.5, row "Geography as dimensions (municipality, postcode, city) for company accounts, with ref.municipality"Named, not specifiedThe dimensions stay unbuilt; ref.municipality exists (§3.3)B81

The other documents:

#WhereThe sentence todayBecomesEpic
27docs/validation.md, the fields' table, "Method""a price-area report's "beregningsmetode"; a municipality report prints none and is made with the municipality method"; values "municipality: municipality (kommune)"No report prints a method; 125 % or 200 % for both splits; municipality is read as 125 %; 200 % with a municipality target is refused while method 4 is reserved (§7)B85
28docs/validation.md, "The target states its kind and omits nothing" with its table; "The energy source and origin tables of the report are not transcribed"The emission blocks of a municipality report "outside phase 1 …, never compared"; the renewable share "never compared"Every block is typed and compared (§7)B85, B89
29docs/validation.md, the runbook: the snapshot's command; the table of exits; "The four price-area reports … A municipality report … is never VALIDATED in phase 1"; "The owner's one existing report (2025, L2) is a municipality report" with its tableNo --municipality; exit 6; "never VALIDATED"; "Its record is "consumption equal""The command with the list; exit 7 and no exit 6; a municipality report is validated like the others; the owner's report is the first target (§7)B85
30docs/validation.md, "What it prints" and the table of notes"Query: report.footprint (m=LB-PA-125, gwp=AR5, basis=final)"; "outside phase 1: needs datasets phase 2 loads"; "outside phase 1: the municipality method"The line names both comparisons when best decided; the two notes go; the notes of §7 comeB85, B89
31docs/emission.md, the rule "Factor"; "Checked against Eloverblik's report (B78)""The row of dataset 1 … (LB-PA-125 → 1, LB-PA-200 → 2)"; "Under basis final the tool does not compare the seven emission blocks …"; "the municipal method is a later epic's"The method's dataset and the share (§2.3); the tool compares under best as well and that decides (§7); the municipal method's own recordB83, B85
32docs/mix.md, the steps, the wording table, "The split the figures are"DeclarationGridmix and nine groups throughout; "no tool compares these blocks yet, so no page claims it"The split as a parameter, the group local (§2.4); the tool compares them (§7)B87, B89
33docs/queries.md, meta.context; "What may leave the database"; the footprint's sources"methods and gwpSets list codes, the first the default"; no bullet on a municipality; "A report made with "Kommune" is no target for these rows"adds methodInfo; the bullet of §4; the rows follow the method's geography and both reports are targetsB93, B88
34docs/pages.md, A4; D1's master data; the footnote"no method: the mix has none, so the method switch is not offered"; "… or municipality code (not in the response)"; validationNote for two codesA4 offers the geography (§6); unchanged for mp.master, with one sentence that D1's interval table shows the share; the footnote by four codesB90, B86
35docs/storage.md, the rule B75f3 adds for a column that holds a fetch's id(as B75f3 writes it)The two new fx tables follow it; ops.removal_statistics covers fxB81, B92
36tools/snapshot_declarations.py, its usage line and --municipality's help"[--municipality <code>]"; "municipality number for ReCoverageMunicipality; all if omitted"A list of codes; all if omittedB85

Not changed, and said here so that nobody looks for it: P2 §3.5 as a rule of the selection, P2 ruling 5 (nothing derived is stored), the rule of families (B78), the bounds of a complete hour, the product's basis=final, the price-area methods' figures, and what make validate answers to a price-area target.

The static read A4v: what was done

All fifteen findings were accepted by the lead, with rulings (orchestration/tasks/a4f-municipality-fixes.md).

FindingWhat was doneWhere
method-01 who may deleteThe worker gains no DELETE; fx.forget_municipality as the owner's function for the two fx tables; make account-remove by B75's function, replaced by B92, with fx in the statistics and the tables in B75f3's walk. One thing differs from the ruling's wording: the ruling expected a request's record to name the municipality; by §3.1 no record of raw.* and no job payload names one (the key is the window, the body is not kept), so nothing of it stays and nothing is to be removed there§3.1, §3.2, §3.3, §4, B81, B92
method-02 the loaderThe filter, the state key, the kind member, the scope of a replacement and the payload as properties of a description, each with today's behaviour as its default; one request per window for the set, and a catch-up as a second description for municipalities wanted later; what a retried attempt skips; the monthly job's awaiting_first_load; the metadata call; the snapshot's "all when omitted" and the file mode that skips§3.1, §3.4, §7, B81, B91
method-03 the schema as it isThe constraint in B80's migration; the table of every reader of the two shared tables with what each reads after the change and whose it is; "every answer equals the answer before" as the criterion of B80 and B82§3.3, §2.3, §2.4, B80, B82
method-04 §7 against §2.7EQUAL BUT FOR THE LOSSES, exit 7; the municipal table under A and B; 200 % refused on a municipality target; the next loss trial as a formula, and both loss candidates as the lead's trials, not a builder's§2.7, §7, B85, B89
method-05 "Endelige tal"Under final as today, and under best as well where final rests on less than the period, which then decides; both splits; the origin's denominator is P2 §4's§2.5, §7, §10 rows 10, 27 to 31
method-06 the setting's pathThe shell or .env.local, the Makefile's and Compose's lines, the precedence, the empty value, the parsing, the code that is no municipality, make doctor's line, migrate and the table§3.2, B92, B93
method-07 the guardOne function that returns a label; the catalogue's two refusals and reads_personal; the tests; docs/queries.md§4, §5, B87, B88
method-08"Not wanted" is decided from the setting: under auto a municipality not loaded yet is pending; the sign of both integer formulas§2.2, §2.4, §2.5, §3.6
delivery-01 A4's switchThe method of the other geography with the same allocation, otherwise its first, with the line; decided from methodInfo, so the line goes with the UPDATE; no 422§6, B90
delivery-02 the new columnsby=municipality on the query's own columns with two more; the footprint's two rows per municipality and label; part and <n> numbered by mp_id; each column in the table for the guards§5, B88
delivery-03 the contractmethods stays a list of codes, default first; methodInfo beside it; ref.method.is_default and the setting's path; the 422's reason; the factor on the budget; the query directories and catalog.py in "Owns"; an epic of its own, B93§5, §8.2, §8.3
delivery-04 the wordsOne table of every new state and reason with its Danish sentence; the card's note with its caveat and three digits; the origin's part without "egen kommune"; the table's fourth column; the footnote for method 4§6, B86
delivery-05 the first deliveryWhat it shows and where (the losses, the biogenic emission and the gases on no page); the blocks say an owner, not an order; B81 divided in three (B81, B91, B92) and B93 taken out of B84; blocks=emissions until B88; A4's interim caveat; the sentinel codes; the cases a test makes itself; docs/storage.md§8.1, §8.2, §8.3
delivery-06 §10Every row checked against main; the rows that quoted loosely rewritten with the file's words; rows added for the sentences the document contradicts (36 rows where 24 stood)§10
delivery-07 question 4No name until the owner says yes (ELO_MUNICIPALITY_NAMES), the row reads "Kommune 1"; the question has its "Hvis nej"§4, §9
The lead's ownQuestions 2 and 3 word for word; the order of starting§9, §8.3

Fourteen epics where eleven stood: B91, B92 and B93 are new, each inside the size P1 §13.1 allows.

Kilde: docs/architecture/municipality-method.md i løsningens repository.