Coverage matrix and value share filled
Coverage matrix and value share filled, version 1.2.2: a build hook that runs inside each build and writes coverage cells, no conclusion.
Coverage: n/a- ID
m:coverage.matrix- Version
- 1.2.2
- Kind
- metric
- Status
- in use
- Model class
- deterministic accounting
- How inputs co-vary
- none: counts and shares over the build's admitted rows
- Review grain
- 1 review per conclusion row
- Run review
- n/a: a build hook writes no conclusion, so no run review applies build hook
- Released
- missing
Description
A build hook, not a compute run: build_coverage(build_conn, core_conn, mode, allowed_mask) writes coverage_cell, coverage_summary and edition_coverage into each build database at the build's as_of, since the states depend on the build mode and date (04 section 15.1; critic round FEA-F6; package C14). 1.2.0 (report 04 of C14 stage 2): trade shares on C01's primary basis against C01's D, capped at C01's covered share; signed balance variables weigh on var:fbs.prod_t; area 351 by C01's rule; group aggregates and items with C01's livestock and fish CPC prefixes out of subjects; production value in current US$, read for crops from the produces rows. 1.2.1 (G2 lineage fix): each read of conclusions takes the highest version per method and variant, with the variants taken from the trade and price source the build resolves to: a conclusion joins the trade source it names, else the build's, at the build's price source, and a variant pools the proposed or accepted conclusions of its own sources or of none, as BuildContext reads them (04 sections 1.10 and 15.1; parameter variant_pick). A conclusion of another price source is not read. The reads take the build's trade source or none, as BuildContext shows them (parameter trade_read), save C01's D for a trade expectation, which reads the pool of the expected source's run the catalogue names, among the versions the rule keeps (parameter d_read_unsourced); the automatic expectations count only the rows the rule keeps; a control point's weight is the unit's row of the latest period, then the highest version, conclusion ID and value, where the last row written won; a value share whose filled cells carry no known weight is NULL with its reason in the overview, where it read 0.0; a control point counts its filled units without a trade-value weight (n_filled_unweighted) beside the share, which is NULL when no filled unit carries one. 1.2.2: observed trade subjects follow the build's trade source under trade_read build, including forestry beside FAOSTAT TM; trade_subjects union restores the previous combined subject pool.
Formula
missing: not in the method registry
Parameters
| Parameter | Default | Range tested | Unit | Basis |
|---|---|---|---|---|
auto_per_layer | 8 | n/a | n/a | automatic expectations per layer for variables with a layer tag and data that no other expectation covers; the largest variable of each family first |
d_read_unsourced | yes | n/a | n/a | hook 1.2.1: C01's D reads the expected source's run as a variant pools it, the conclusions of that trade source or of none at the pool's highest version, among those the reading rule keeps at the build's price source; false restores the exact match on params.trade_source. Orchestrator default open for Taras's review |
target_share | 0.9 | n/a | share | value_share_filled target per commodity for production and trade (proposed in HANDOFF section 10) |
trade_read | build | n/a | n/a | hook 1.2.1, under variant_pick build: build reads the conclusions of the build's trade source or of none, as BuildContext shows them, save C01's D for a trade expectation, which reads the run of the trade source the catalogue names; union restores the read of each trade source's run at its own highest version, under which a BACI build read C03's FAOSTAT TM weights beside the version of no source it shows. Orchestrator default open for Taras's review |
trade_subjects | build | n/a | n/a | hook 1.2.2: observed trade subjects follow the build's trade source under trade_read build; union restores the subject pool from both trade sources. Orchestrator default open for Taras's review |
variant_pick | build | n/a | n/a | hook 1.2.1: build takes the variants of the reading rule from the trade and price source the build resolves to (build.resolve_sources over the mode's sources and the build_run policies); all restores the pick over base.TRADE_SOURCES x base.PRICE_SOURCES, under which a version that names no source stayed current through a variant no build of the mode resolves to. Orchestrator default open for Taras's review |
window | 3 | n/a | n/a | latest periods of an expectation's grain when it names no period range |
Assumptions
- structural: A cell is subject x place x period of a coverage expectation. States: filled when the mode admits at least 1 value; withheld_licence when values exist only in snapshots or conclusions the mode does not admit; the state of a result_absent row (not_assessed counts as missing); searched_not_found with a standing absence row; else the expected source's state (key_not_set, source_unreachable, withheld_licence) or missing (04 section 15.1; 01 section 11).
- scope: The places of a subject are those that report the variable for it in the window or carry a result_absent or absence row for it; a subject without such a place gets 1 subject-level cell, which reads the subject's values at each place but the World (hook 1.2.0: values held only at places of an aggregate level, such as the WGSRPD botanical areas of var:taxon.wgsrpd_status, left 437,536 such cells missing on the core of 9 November 2026). World, region and aggregate places (FAOSTAT area 351, codes 5000 and above, read from place_attr, exact fao_area xrefs or a dk:place:fao-<code> ID, and places of an aggregate level) are not cells and stay out of reference sums; the reference is the first world place by ID that holds a total.
- scope: The window is the latest 3 periods of the expectation's grain that hold the variable; when the expected source holds no row (a blank key, a failed fetch) the window of the variable the subjects come from serves, so those cells carry the same years. An observed scope keeps the subjects that hold the variable in the window, so an item a source stopped reporting holds no cells. Commodities of no plant origin (commodity_attr.plant_origin 'no'), group aggregates (commodity_attr.level 'group', such as FBS Grand Total and Cereals - Excluding Beer, and the FAOSTAT aggregate items with CPC 'F....') and items whose exact CPC code starts with one of C01's livestock and fish prefixes are no subjects and enter no layer count; the report counts them by reason. C01's prefix 'F' on an item marks a FAOSTAT code without a CPC code, such as cocoa powder and cake (F0665), which C01's exporter measures, so it stays a subject. A crop subject reads a variable's produces rows first, since FAOSTAT QCL and QV hold the same variables as observations on the FAO item commodities.
- scope: Expectations: the core's coverage_expectation rows, then the built-in tranche 1 catalogue for variables the core does not cover (FAOSTAT production, value, producer prices, trade matrix, food balances and forestry; C01 producer and exporter HHI; C02 IDR), then up to 8 automatic expectations per layer for the variables with a layer tag and data that no other row covers, the largest variable of each family (the ID up to its first dot) first. A tier or priority scope without its set conclusion falls back to the subjects observed for the named variable.
- data: value_share_filled = the filled cells' weight / the subject's world reference total of the weight variable less n/a weight. Production: production value in current US$ (QV element 57, as C03 reads it; constant 2014 to 2016 I$ holds no row for 27 EU members and Colombia after 2017), else production quantity, at the first world place by ID. Trade: the reference is C01's D of the exporter HHI for the subject and year (details.denominator_value of the trade source's run), else D rebuilt by C01's rule, max(reconciled, exporter-reported, importer-reported / (1 + m), the FAOSTAT TCL World export row and world imports / (1 + m)), with flows of aggregate places and re-imports out and area 351 kept as unattributed mass where none of 41, 96, 128 and 214 holds a row; each place weighs its value on C01's primary basis, so a mirror-only exporter weighs 0 as a missing reporter and the report counts those cells apart; a reference without an independent total (C01's own-sum rule, cr-138 narrow form) leaves the share NULL, and C01's covered share caps the share, so the page reads no higher than C01. A filled cell of unknown weight adds nothing; without a reference total the share is NULL; a measured 0 needs a reference total and no filled cell.
- data: Public builds count only admitted values and leave out subjects and places that only non-admitted snapshots attest, so a withheld value is neither filled nor zero.
- scope: edition_coverage: the Tier B HS 2022 inclusion set (else the HS 2022 subheadings of plant origin in the core, else all HS 2022 subheadings) x each trade source edition x year. Direct for the same edition or a 1:1 exact map; aggregate_parent for an n:1 or broader map; evidence_split only for apportioned links citing a claim; a 1:1 close map is direct with the served code named; a narrower target or several targets without cited shares are unresolved_split; related links serve nothing; not_in_source without a row; withheld_licence when the mode admits no snapshot of that source (04 section 2.3; amendment A0, objection d).
- data: A signed balance variable of the food balances (stock variation, stock draw, residuals, domestic supply, processing) takes no weight of its own and weighs on var:fbs.prod_t of the item; a negative or NaN weight of any other variable reads as an unknown weight (the share is then a lower bound), and the report counts those places.
Tested domain
missing: not in the method registry
What this method leaves out
- the quality of a filled value (its review state shows on the value)
- places a source has not reported for any subject, which stay outside the reporting universe
Inputs
missing: no input listed in the registry
Variables
missing: not in the method registry
Version history
| Version | Status | Released | Replaces | Conclusions in this build | Run review |
|---|---|---|---|---|---|
| 1.2.2 current | in use | missing | n/a | n/a: a build hook: it runs inside each build and writes coverage cells and build settings, no conclusion | n/a: a build hook writes no conclusion, so no run review applies |
Conclusions in this build
n/a: a build hook: it runs inside each build and writes coverage cells and build settings, no conclusion a build hook: it runs inside each build and writes coverage cells and build settings, no conclusion