Map the basket
Six essential UK food products are mapped through supply chain nodes and risk channels.
See how global shocks move through the UK food basket.
An independent prototype that maps six everyday UK foods to their supply chains, replays disruption scenarios such as grain export shocks and avian flu, and checks modelled pressure against ONS and Defra observed series.
From supermarket basket to global supply chain pressure.
Food Chain Lens lets users move from a basket item to observed movement, possible drivers, event windows, and evidence.
Project goal
Food prices do not move in isolation. A disruption in grain, energy, disease, imports, or logistics can move through farms, processors, distributors, and retailers. Food Chain Lens makes those modelled pathways visible.
Platform workflow
Six essential UK food products are mapped through supply chain nodes and risk channels.
Test grain disruption, energy spikes, avian flu, diesel shocks, and weather stress.
See where imported inputs enter the UK supply chain.
Compare model pressure with official ONS and Defra observed evidence.
Observed evidence
Evidence caveat: This validates direction and timing, not exact retail shelf prices.
Credibility and scope
Work with the project
Food Chain Lens is being developed as an independent food security intelligence prototype. If you work in food policy, retail data, commodity analysis, supply chain risk, research, or technology and want to discuss the work, suggest data sources, or explore collaboration, please get in touch.
Interactive prototype
Build a basket, follow a product pathway upstream, run a modelled shock scenario, inspect import origin exposure, or review directional validation evidence.
Official evidence mappings support directional comparison for the food basket, eggs, and milk during selected historical shocks. Local row coverage varies by deployment.
Build Your Basket
Choose the foods in a basket, compare the best available observed series over time, and see which supply chain pressure channels may explain the movement. This is an evidence based pressure view, not an exact supermarket receipt.
Quantities scale the upstream value for eggs and milk. Category index proxy products contribute directional movement only.
The default basket loads automatically using the best available observed series.
Estimating basket movement…
Directional explanations from the supply chain model and shock registry. Channel coverage shows how many basket products each channel touches.
Build a basket to read a text summary of the movement, coverage, and pressure channels.
Each product uses its best available observed series over a window anchored on the latest observation. Eggs (pence per dozen, Defra producer price) and milk (pence per litre, Defra farmgate price) produce quantity-scaled upstream GBP subtotals. Bread, chicken, potatoes, and pasta use ONS CPI category indices as directional proxy movement; no GBP value is invented for them. A pack of eggs is treated as 12 eggs. When the basket mixes price-level and index products, the headline movement is the unweighted average of each product's own movement and no basket GBP total is shown.
Calculation modes: price_level, mixed_price_and_index, index_only, synthetic_fixture_only (explicitly labelled demonstration data), and insufficient_data. Pressure channels map each product to shocks in the platform registry (for example grain_export_disruption, energy_price_spike, avian_flu, fertiliser_price_shock) through the supply chain graphs.
Read-only endpoints: /basket_cost/products,
/basket_cost/default, /basket_cost/estimate (POST),
and /basket_cost/summary. To light up real data, import the ONS
MM23 dataset with python -m gcmrp.jobs.import_ons_cpi path/to/mm23.csv
and Defra files with python -m gcmrp.jobs.import_product_prices.
Six essential UK food products. Verified rings show official evidence. Select a product to inspect.
Select a product in the constellation to see its exposure channels and evidence status.
Loading basket overview…
Click a node to understand how it may connect to basket movement.
Select a product to trace its supply chain pressure.
Pick a product on the left, or start from a basket card in the Food Basket Overview tab.
Choose a scenario below, or use the dropdown to model a custom shock.
Estimated price pressure across basket products from this shock.
Select this tab to load shared upstream exposure data.
Select an event to replay the model signal and compare with official evidence.
Select this tab to load data source status.
Food Chain Lens can now describe products through bounded product graph specs. This makes it easier to add new products consistently. Each spec must declare dependencies, evidence status, limitations, and confidence. Brand level graphs are possible later, but the current system does not claim exact retailer traceability, and it does not predict exact shelf prices.
Bundled example specs load with this tab.
Specs are pure data (YAML or JSON), strictly validated, and compiled into the existing supply chain graph structure. The format is bounded, not a programming language: fixed vocabularies and hard size and depth limits.
python -m gcmrp.jobs.import_product_specs examples/product_specs.
See docs/product_graph_spec.md for the full format guide.
Food Chain Lens keeps retail evidence in a separate review-gated layer. Open Food Facts provides product metadata only. Open Prices provides community retail price observations only. ONS and Defra remain the official observed evidence used by the validation layer. The layer can later support future licensed sources. Generated product graph candidates stay unreviewed until a human promotes them.
Reported observations are evidence, not live supermarket truth. Open Prices is not official evidence and community observations are not blended with ONS or Defra. Open Food Facts is not a price history source. Brand and country labels are not supply chain proof. Unreviewed records are blocked from calibration. Generated candidates require human review.
Bundled example coverage loads with this tab.
Situation ledger · persisted retail evidence
Persisted family evidence loads with this tab.
Product identity: barcode, name, brand, quantity, categories, labels. A community open dataset — identity, not price, and not supply chain proof.
Community price observations linked to barcodes, with shop and date metadata where available. A community open dataset — not official retailer verified pricing.
Controlled local imports of historical retail price observations, including Kaggle style research datasets where the licence permits. Missing licence metadata adds an explicit limitation.
ONS and similar official indices stay validation benchmarks: category index evidence, not product level shelf price truth unless the data is genuinely granular.
A placeholder slot for future licensed data sources. Nothing is implemented until credentials, documentation, and licence terms exist.
Represented as a future source type only. No supermarket scraping is implemented in this version.
Represented as a future source type only. No accounts, no receipt photos, and no personal data collection.
Every source normalises into the same internal objects with a declared source type, evidence status, confidence, and limitations. Unit prices are normalised per kg, per litre, per egg, or per loaf where the quantity can be parsed; unknown quantities keep the original price and gain a limitation.
python -m gcmrp.jobs.import_retail_prices path/to/file.csv.
Generate unreviewed candidates from a local product export:
python -m gcmrp.jobs.import_open_food_facts_products examples/open_food_facts/sample_products.json.
See docs/retail_price_evidence_hub.md.
Where upstream food basket commodities enter the UK supply chain.
This layer shows UK import exposure by origin country based on UN Comtrade trade statistics. It does not claim exact retailer traceability. Import partner country does not always equal production origin.
Select the Global Origin Map tab to load origin data.
Schematic origin map based on import country weights. Data source: UN Comtrade.
Select a product and commodity to view import origin exposure and concentration analysis.
Food Chain Lens compares model pressure signals against official observed datasets. These checks confirm direction and timing, not exact shelf prices.
Pressure index, not retail price prediction. Static graph weights are expert estimates. Origin data shows UK import exposure, not exact retailer traceability.
Reviewed product evidence
Browse reviewed products by name, brand and pack, then open each product's evidence file to see its identity, the sources behind it, its evidence quality, and exactly which fields are still missing. Supply chain templates are secondary technical metadata.
Reviewed products are not automatically part of the live six product basket. Promotion remains a separate manual, human-reviewed decision.
Product evidence files
Try: milk, eggs, or wholemeal to see reviewed demo evidence.
Archetypes are the backend scaling templates a reviewed product reuses. They are not the product. This technical reference shows each template's reusable rules.
Evidence collection health
Import runs and cache snapshots support review. They never approve a product or publish it into the live basket. Open Food Facts and Open Prices remain community evidence unless explicitly classified otherwise.
Reviewed live promotion
This is the first reviewed live-product promotion. It does not change the default basket and does not make community prices official. A promoted product inherits the existing basket graph and the existing official price series; community evidence stays display only.
Audit only
This map shows what is connected today. It is intentionally read-only and does not promote products. For each live basket product it shows the formal archetype it maps to, its reviewed variants, and which layers it actually influences.
Governance metadata
Each datasheet records the assumption behind a supply-chain graph edge: the evidence source, a five-dimension Pedigree grade, the limitations, and whether it is inherited from the template baseline. These datasheets explain existing assumptions and do not change the live risk formula. They do not change graph weights, shock simulation, price history, validation, or promotion. The A–E Pedigree grade is a data-quality signal and is not statistical proof. It is not used in live risk scoring.
Inheritance safety
These gates evaluate whether inheritance is safe, conditional, unsafe, or quarantined, using explicit rules and the assumption datasheet coverage above. This panel does not change the live basket and does not change the live risk formula. It does not change graph weights, shock simulation, price history, validation, or promotion. No reviewed variant joins the default basket; default-basket promotion is always blocked in this sprint.
Structural variation
Variation points show where an archetype is allowed to vary and the value it assumes by default. Reviewed variants inject contextual values against those points, and the completeness gates above can inspect the result. Variation points show where an archetype is allowed to vary. They do not change the live graph. This panel does not change the live graph and does not change the live basket. It does not change the live risk formula, graph weights, shock simulation, price history, validation, or promotion. No reviewed variant joins the default basket; default-basket promotion is always blocked in this sprint.
Scaling readiness
Batch review evaluates the reviewed candidate variants through the lineage, assumption, completeness gate and variation layers above, and reports an advisory verdict for each. No candidate is auto-promoted. Default-basket promotion remains blocked for every candidate. This panel does not change the live basket, the live risk formula, graph weights, shock simulation, price history, validation, or live promotions.
Analysts review staged imported candidates through the existing admin and staging infrastructure. Review is advisory and owner-gated: it does not promote products, the default basket is unchanged, and these candidates are not added to live-products. registry_ready means a candidate could be drafted into a reviewed-registry proposal for an explicit owner merge; proposals are not registry entries and are not loaded automatically. These are staged-file candidates only, not real product coverage.
Synthetic performance fixtures test scaling toward 1,000 to 10,000 candidates. They are synthetic only, not real reviewed products, and never represent real 10,000-product coverage. Imported candidates are staged only: they are not promoted and are not added to the default basket.
Observed evidence timelines
Track how the best available observed series has moved over time for each basket product. Some series are producer or farmgate prices, while others are CPI category indices. These are evidence signals, not exact supermarket shelf prices.
Eggs and milk use producer and farmgate prices, which are not supermarket shelf prices. Bread, chicken, potatoes, and pasta use CPI category indices, which are not exact product shelf prices.
Click a point or event window to inspect movement.
Historical series loads with the Evidence and Validation tab.
This chart uses observed upstream or CPI proxy evidence, not exact shelf prices.
Select a product to read a text summary of the observed series, its source type, coverage, date range, latest value, and main caveat.
Each product maps to its best available observed series. Producer and farmgate prices are upstream prices. CPI category indices track a whole category against 2015=100. Synthetic retail fixtures are bundled demonstration data and never real market evidence. None of these are supermarket shelf prices.
| Product | Series | Frequency | Unit |
|---|---|---|---|
| Eggs | Defra egg producer prices | Quarterly | pence per dozen |
| Milk | Defra farmgate milk prices | Monthly | pence per litre |
| Bread | ONS bread and cereals CPI (D7D5) | Monthly | index, 2015=100 |
| Chicken | ONS meat CPI (D7D6) | Monthly | index, 2015=100 |
| Potatoes | ONS vegetables CPI (D7DB) | Monthly | index, 2015=100 |
| Pasta | ONS bread and cereals CPI as a labelled proxy (D7D5) | Monthly | index, 2015=100 |
python -m gcmrp.jobs.import_ons_cpi path/to/mm23.csv.
To load Defra egg or milk data, run
python -m gcmrp.jobs.import_product_prices path/to/file.ods eggs_producer_price eggs
(or milk_farmgate_price milk).
Read-only endpoints for this explorer: /price_history/products,
/price_history/summary, /price_history/{product_slug},
and /price_history/{product_slug}/sources. Retail evidence fixtures
from the Retail Price Evidence Hub can be selected as a clearly labelled
synthetic secondary source.
Food Chain Lens checks whether model pressure signals move in the same direction as official observed series during known historical shocks. This tests directional reliability and timing. It does not prove causality or predict exact shelf prices.
Reliability results load with the Evidence and Validation tab.
Food prices often respond months after an upstream shock. Each reliability check re-tests directional agreement after shifting the observed series by 0, 1, 3, 6, 9, 12, 14, and 18 months, then reports the best-matching lag. The best lag is descriptive, not a fitted parameter.
Observed sources are producer prices, farmgate prices, and CPI sub-indices — partial proxies, not supermarket shelf prices. A directional match shows the model pointed the right way at a plausible lag. It does not prove the shock caused the price movement and it does not forecast exact prices.
Reliability metrics load with the Evidence tab.
Official ONS and Defra series used to validate model direction and timing.
Observed CPI series validate direction and timing, not exact product shelf prices. This is directional validation only — not causal proof or quantitative prediction.
python -m gcmrp.jobs.import_ons_cpi path/to/mm23.csv.
Product level data may be farmgate or producer price data, not supermarket shelf price. This is partial product evidence only — not causal proof or exact retail price prediction.
date and value columns,
then run python -m gcmrp.jobs.import_product_prices path/to/file.csv eggs_producer_price eggs.
Governance trail
This view shows the governance trail only. It does not approve evidence, promote records, edit graphs, change model weights, or implement queued tasks.
Read only. The browser reads the approved evidence registry, the reviewed implementation queue, and the promotion completion audit log. It never writes, approves, promotes, merges, or runs anything, and it does not change live graphs, scores, archetypes, or validation claims.
Governance counts load with the Evidence and Validation tab.
Human-reviewed evidence records that passed the registry gate. Approved does not mean promoted into live graphs, weights, or scores.
Records load with the Evidence and Validation tab.
Reviewed task briefs only, not live model changes. Any task text is inert and is never executed by this view.
Records load with the Evidence and Validation tab.
Audit entries created only after separate manual implementation and tests. Recording a completion does not promote anything automatically.
Records load with the Evidence and Validation tab.
Read-only endpoints used: GET /evidence-registry/summary,
GET /evidence-registry/claims,
GET /implementation-queue/summary,
GET /implementation-queue/tasks,
GET /promotion-completion/summary, and
GET /promotion-completion/records.
There is no approve, promote, implement, merge, write, sync, or run action here. If a queued task carries codex prompt text it is shown only inside a collapsed block, labelled as inert task text, and is never executed.
Proof to impact
This view links a source-backed claim through the governance trail so you can see how far it has moved and whether any model impact has been measured. It does not approve evidence, promote records, edit graphs, change model weights, or implement queued tasks.
Read only. It explains the proof chain and the impact status only. It does not approve, promote, implement, mutate, execute, merge, or write anything, and it does not claim cost, price, or exact shelf-price impact.
Evidence-to-impact counts load with the Evidence and Validation tab.
Traces load with the Evidence and Validation tab.
Read-only endpoints used: GET /governance-trace/summary,
GET /governance-trace/records,
GET /governance-trace/claims/{claim_id},
GET /governance-trace/archetypes/{archetype},
GET /governance-trace/stages/{trace_stage}, and
GET /governance-trace/impact-statuses/{impact_status}.
Source proof is not the same as model impact. A queued task is not a live change, and a completion record is an audit record, not a measured cost change. Before and after model impact numbers are shown only when explicit reviewed, test-backed impact metrics exist for a trace; otherwise the platform states that impact is not measured yet.
A trace may explain why a future graph or product specification change is proposed. It does not prove a basket cost change yet. There is no approve, promote, implement, merge, sync, run, or write action here, and no codex prompt is ever executed.
Select the Validation tab to load the validation report.
Creator and contact
Interested in food security, supply chain analytics, data engineering, or policy applications? I am open to feedback, collaboration, and internship conversations.