0641-a-row-without-a-build met
- Issue
- #641
- Stated in
- expectations/0641-a-row-without-a-build.json
- Graded against
- Statuses are those of the build recorded on 2026-11-24 07:55 UTC (run 20261124T0755302069730000, merging ecoinvent-3.13, ecoinvent-3.12, ecoinvent-3.8, bafu-2026-v1, stepwise-2006-1.09, agribalyse-3.2).
Why this file exists
Somebody outside this project has a flow list and one question about every row of it: **which consensus flow is this?** Until now the only way to ask was to add the list as a SourceList, fetch it and run a build -- the better part of an hour, writing to the results database, and requiring the list to be a first-class citizen of this project before anyone could find out whether it was worth adding. brightway_flows.lookup answers the question in under a millisecond a row, against a build that has already happened, writing nothing. See #328 and plans/lookup-api.md.
The whole capability rests on one claim: **an answer from the lookup is the answer a build would have given.** It is not a second implementation of matching -- it calls resolve_flow_object and _select_elementary_flow, the merge's own two functions, which are already pure -- but the row it hands them is assembled from what a caller supplies rather than from an enriched source flow, and that assembly is where it could be wrong.
So the claim is measured rather than argued. merge_outcomes holds every question this API answers, with the build's answer beside it: 16,953 rows on the 21 August 2026 build. The replay rebuilds a query from each one, asks, and counts by *how the build decided the row*, because the buckets are not equally answerable and lumping them would hide that.
The expectations below are the shape of that result. The one that matters most is not an agreement rate: it is lookup.evidence.other_flow, which counts rows the lookup places on a flow the build did not choose. It should be nothing. Where the lookup differs from the build it should **decline**, because a wrong match is silent and an unmatched row is reviewable -- and an unmatched row comes back naming every substance it could have been.
Measured on the unbounded three-list build of 21 August 2026 at 8be43a3: EF 3.1 with ecoinvent 3.12, ecoinvent 3.8 and BAFU 2026-v1 merged.
Expectations
9| What should be true | State | About |
|---|---|---|
|
No row the lookup can answer for is put on a flow the build did not choose
0641-the-lookup-never-places-a-row-somewhere-else
**The safety claim, and the only one of these that is about correctness rather than coverage.**
The |
met |
measure
key: lookup.evidence.other_flow
|
|
The lookup reaches the same consensus flow for the rows it has the evidence for
0641-the-lookup-reproduces-the-rows-it-can-answer-for
2,490 of 2,519 on the 21 August 2026 build -- 98.9%, and 2,488 of them by the same route as well as to the same flow.
Not 2,519, and the shortfall is the replay's limit rather than the lookup's. |
met |
measure
key: lookup.evidence.same_flow
|
|
A row the merge created a consensus flow for now resolves to that flow
0641-a-row-the-merge-had-to-create-a-flow-for-finds-it
840 of 842 on the 21 August 2026 build.
These are the rows no consensus flow existed for, so the merge made one. Replayed against the *finished* build that flow is there, and the row finds it. |
met |
measure
key: lookup.created.same_flow
|
|
A water row whose kind only a curated table knows is declined rather than guessed at
0641-the-curated-water-rows-are-declined-and-not-guessed
**The documented limit, stated as a claim about what the lookup does *not* do.**
Which kind of water a row is comes from a table keyed on the vendor's own flow identifier, and a caller's row has none -- deriving the kind from the name is precisely what the water taxonomy exists to avoid. So 100 of the 288 water rows are declined, and every kind of water shares 7732-18-5, which means a lookup willing to guess would have twelve substances to guess between.
0 on the 21 August 2026 build: it guesses at none of them. The 188 it does place are the ones the algorithm reaches by another route -- a name that identifies the body, an origin qualifier -- and those it places on the flow the build chose.
A caller who knows may state |
met |
measure
key: lookup.material.other_flow
|
|
A land row whose class only a curated table knows is declined rather than guessed at
0641-the-curated-land-rows-are-declined-and-not-guessed
The same claim for land, and the bucket where the shortfall is largest: 19 of 98 rows placed, 79 declined, none guessed at.
Land is worse off than water for a reason worth stating: a land flow carries no registry number at all, so once the curated class is unavailable there is no second route to it. A water row at least has a CAS to narrow from. |
met |
measure
key: lookup.land_class.other_flow
|
|
The algorithm alone reaches the same flow as the correspondence table for most rows
0641-the-algorithm-mostly-agrees-with-the-curated-tables
This compared the algorithm's answers against 13,206 published table rows; #141 retired the tables, and the prepared universe is now the ~250 rows this project authors in ecoinvent-match-overrides.json. The claim keeps its meaning at the new scale: the lookup, replaying the authored rows, reaches the same flow for nearly all of them -- 268 on the 2026-08-23 build. |
met |
measure
key: lookup.prepared.same_flow
|
|
Every row the build recorded is asked again, and none of them raises
0641-every-recorded-row-is-answerable
16,953 on the 21 August 2026 build: every row of |
met |
measure
key: lookup.rows
|
|
A row whose name carries its unit or its place still reaches the flow the build gave it
0641-a-simapro-name-that-carries-its-unit-still-finds-its-flow
**The measure the other six cannot take.** Every expectation above replays the name |
met |
measure
key: lookup.shipped.bafu-2026-v1.placed
|
|
Rewriting a row's name can give it a match and can never move one it already had
0641-preparing-a-name-never-moves-a-row
**The safety claim for preparation, and the reason it is written the way it is.**
Taking the unit or the place out of a name could have been a replacement: swap the caller's spelling for the derived one and look that up. It is not. The derived name goes *in front of* the caller's, and the spelling as sent stays among the synonyms -- which is exactly what |
met |
measure
key: lookup.shipped.bafu-2026-v1.elsewhere
|