Fact-check a draft against its sources.
Done by an agent. Checked twice.
Every line of a draft article marked supported, contradicted or unsourced, with the exact source words and the corrected figure.
Real files in
- draft.md
A 35 line draft newsletter article with wrong figures and unsourced lines planted among the correct ones. 42 lines, 4 KB. - source_1_world_generation.txt
U.S. Energy Information Administration article "Global electricity generation more than doubled from 2000 to 2025" (November 27, 2026). Article text only, without charts, menus and contributor names.. 22 lines, 4 KB. - source_2_energy_losses.txt
U.S. Energy Information Administration article "Almost 60% of primary energy used for electricity is lost to conversion and transmission" (November 25, 2026). Article text only, without charts, menus and contributor names.. 34 lines, 4 KB. - source_3_solar_batteries.txt
U.S. Energy Information Administration article "The share of solar generation with co-located battery storage is increasing" (October 30, 2026). Article text only, without charts, menus and contributor names.. 18 lines, 2 KB. - source_4_southwest_hydropower.txt
U.S. Energy Information Administration article "Hydropower generation in the Southwest fell to record lows this summer" (November 13, 2026). Article text only, without charts, menus and contributor names.. 19 lines, 3 KB.
A mix of real public documents and sample data. Each file says which.
Three steps
- 1.Read the draft and the source pack
- 2.Judge every line
- 3.Write the check sheet and the note
Claude Sonnet 5.5, 1 min 23 s. No web. It never saw the check.
Checked twice
- Passed: 35 of 35 draft lines have exactly one verdict
- Passed: 35 of 35 verdicts match the answer key and 35 of 35 key facts were confirmed in the source files
- Passed: 30 of 30 pieces of evidence appear word for word in the right source file
- Passed: 9 of 9 corrections use the source's own figure and drop the wrong one
- Passed: 5 of 5 unsourced lines carry no made up evidence
- Passed: editor_note.md gives 3 of 3 verdict counts correctly and names 14 of 14 lines that need work
- Passed: 75 of 75 numbers and line references in editor_note.md are found in the draft line or the source file they describe
Second review by Claude Opus 5.5: pass.
Then we broke a copy of the output 6 ways on purpose. The check caught 6.
## Lines to fix (contradicted) - **04**: The draft says renewables are 36% of the world's generation mix. The source says 34% in 2025 (`source_1_world_generation.txt`). Right figure: 34%. - **06**: The draft says "since 2010". The source says the three largest generators have held that rank "since 2013". Right year: 2013. - **09**: The draft says China's 10.7 trillion kWh is "about one-quarter" of the world total. The source says "more than one-third". The arithmetic agrees: 10.7 / 31.8 is about 34%. Right wording: more than one-third. - **12**: The draft says nuclear supplied 19% of US electricity. The source says 17%. Gas at 40% and renewables at 26% are correct. - **16**: The draft says India's generation grew 7% a year. The source says an average of 5% per year. Right figure: 5%. - **20**: The draft says coal takes about one-third *less* energy than gas. The source says coal takes about one-third *more*. The direction is wrong, and it also contradicts line 19, where coal needs more than twice the energy of its output. - **21**: The draft says transmission and distribution losses were 3 quads. The source says "less than 1 quad". Right figure: less than 1 quad. The arithmetic agrees: 5% of about 20 quads lost is about 1 quad. - **29**: The draft says Lake Mead is 9% *below* the Hoover Dam minimum. The source says 9% *higher* than minimum power pool. The arithmetic agrees: 1,038 ft is above the 950 ft minimum. Right wording: 9% above. - **35**: The draft says coal supplied 35% of world electricity in 2025. The source says 33%. Right figure: 33%. This also conflicts with line 03 in the draft, which already says 33%.
How this was run
An AI agent on Claude Sonnet 5.5 was given a folder with the files below and a three-step flow, and nothing else. It had no web access and never saw the check. The check was written before the run and made stricter after it. It works the answer out again from the input files. Then Claude Opus 5.5 reviewed the result against the inputs. Some input files are real public documents and some are sample data written by Atris. Each file says which.
Run 2 of 2 on 1 December 2026. The agent took 1 min 23 s. Run 1 passed both checks and the job was run again later. Each run starts clean. Between runs the written flow was made clearer, or a check was corrected or made stricter. Nobody edits the output.
What the second review verified
- All 35 draft lines have exactly one row each, in order 01 to 35. My tally of 21 supported, 9 contradicted and 5 not_in_sources matches the editor note.
- Every one of the 30 evidence quotes appears word for word in the source file named beside it. The not_in_sources rows (14, 22, 26, 33, 34) leave source, evidence and correction empty, and only the contradicted rows have a correction.
- Each contradicted line conflicts with the source: renewables are 34% in the source, not 36% (04). The three-country lead dates from 2013, not 2010 (06). Nuclear is 17%, not 19% (12). India grew 5% a year, not 7% (16). Coal takes one-third more energy than gas, not less (20). Grid losses were less than 1 quad, not 3 (21). Lake Mead was 9% above the minimum, not below (29). Coal was 33%, not 35% (35).
- The arithmetic in the note holds: 10.7/31.8 is about 34%, which rules out 'about one-quarter' on line 09. The 20 quads lost (34 minus 14) less 18 from conversion leaves about 1 quad of grid losses. And 10.6/31.8 is about 33%.
What this run does not show
- The check holds a list of right verdicts marked by hand before the run, with each fact on it confirmed in the source files.
- The draft was written for this run with errors planted in it, so every line has one clear verdict, which a real draft would not.
- Numbers in the editor note are only looked up in the draft or source they describe, so the wording of the note is read only by the second review.
Would the check catch a wrong answer?
A check that cannot fail proves nothing. After the run we took a copy of the output, broke it one small way at a time and ran the check again. It caught 6 of 6. The check was made stricter after the first try at this, and the same untouched output was graded again.
Open every file
flow.md · the three steps the agent followed
# Fact-check a draft against its sources function: research for: the editor who signs off an article before it is published goal: Every line of the draft is marked supported, contradicted or not in the sources, with the exact words that prove it. ## 1. Read the draft and the source pack Read input/draft.md. Each numbered line is one claim to check. Read every source file in input/ (the files whose names start with `source_`). The source pack is the only evidence. What you know from elsewhere does not count, even when you are sure. ## 2. Judge every line Give each numbered line exactly one verdict: - `supported` when every fact in the line (each number, date, name, rank and direction) is stated in a source. Rounding words the source itself uses, such as "about" or "more than", must be kept. - `contradicted` when at least one fact in the line conflicts with what a source says, even if the rest of the line is right. A fact also conflicts when simple arithmetic on the source's own numbers rules it out. - `not_in_sources` when the sources neither state the fact nor conflict with it. Do not guess. Check each number against the source digit by digit. Also check the year, the unit and the direction (higher or lower, more or less) that go with it. ## 3. Write the check sheet and the note Write output/factcheck.csv with columns line,verdict,source,evidence,correction. One row per numbered line, in order. line is the two digit line number. - source is the file name of the source that settles the line, such as source_2_energy_losses.txt. - evidence is the sentence or part of a sentence from that source that settles it, copied word for word. Do not join separate passages. - correction is filled only for `contradicted`: the draft line rewritten so it matches the source, using the source's figure. - For `not_in_sources` leave source, evidence and correction empty. - Quote any field that contains a comma. Write output/editor_note.md for the editor: the count of each verdict in the form `supported: 12`, `contradicted: 3`, `not_in_sources: 2`, then the lines to fix with what is wrong and the right figure, then the lines to cut or find a source for. Name each line by its two digit number. ## Done looks like - Every numbered line of the draft has one row and one verdict. - Every piece of evidence can be found word for word in the source named beside it. - No line is marked supported or contradicted without evidence and no unsourced line has evidence made up for it.
input/draft.md · 42 lines, 4 KB
# Draft for fact-check Publication: Gridline Weekly (trade newsletter for plant and facility managers) Working headline: Four things the new federal numbers say about electricity Writer: staff draft, not yet edited Note to the checker: every sentence is on its own numbered line. Check each line against the source pack only. 01 | The world generated 31.8 trillion kilowatthours of electricity in 2025. 02 | That is more than double the 15.1 trillion kilowatthours generated in 2000. 03 | Coal's share of world generation peaked at 41% in 2007 and fell to 33% in 2025. 04 | Renewables overtook coal in 2025 and now make up 36% of the world's generation mix. 05 | Renewable generation grew from 2.9 trillion kilowatthours in 2000 to 10.6 trillion kilowatthours in 2025. 06 | China, the United States and India have been the three largest electricity generators in the world since 2010. 07 | Together those three countries generated 17.3 trillion kilowatthours in 2025, more than the rest of the world combined. 08 | China's electricity generation grew at an average rate of 9% a year between 2000 and 2025. 09 | China generated 10.7 trillion kilowatthours in 2025, about one-quarter of the world's total. 10 | More than half of China's generation in 2025 came from coal. 11 | The United States was the second-largest generator in 2025, producing 4.5 trillion kilowatthours. 12 | Natural gas supplied 40% of United States electricity in 2025, renewables 26% and nuclear energy 19%. 13 | United States generation growth averaged 2% a year between 2020 and 2025, with much of it tied to commercial demand that includes data centers. 14 | Data centers now use 6% of all United States electricity. 15 | India generated 2.1 trillion kilowatthours in 2025, with 70% of it coming from coal. 16 | India's electricity generation grew by an average of 7% per year from 2000 to 2025. 17 | In 2025 the United States consumed 34 quads of primary energy to deliver 14 quads of electricity sales to end users. 18 | About 95% of the losses came from converting primary energy into electricity. 19 | The coal burned in United States power plants holds about 10,077 British thermal units per kilowatthour, against 3,412 in a kilowatthour of electricity. 20 | Generating a kilowatthour from coal takes on average about one-third less energy than generating it from natural gas. 21 | Transmission and distribution losses came to 3 quads in 2025. 22 | Those grid losses cost United States customers $19 billion in 2025. 23 | As of September 2026, over 16% of the new utility-scale solar capacity added this year is co-located with operable battery storage, compared with 2% in 2017. 24 | Plans submitted for 2027 and 2028 put that share at more than 30%. 25 | Solar photovoltaic is 13% of total United States utility-scale generating capacity. 26 | Texas leads the nation in solar capacity paired with batteries. 27 | Hydropower generation in the Southwest from April through August 2026 was 19% lower than in the same period last year and 28% lower than the 10-year average. 28 | Lake Powell needs an elevation of at least 3,490 feet to generate power at the Glen Canyon Dam, and at the end of September it stood at 3,518 feet. 29 | Lake Mead ended September at 1,038 feet, 9% below the minimum the Hoover Dam requires. 30 | The Department of the Interior decided to reduce the combined water consumption of California, Arizona and Nevada by 1.25 million acre-feet each year over the next two years. 31 | The federal forecast puts Southwest hydropower at 6.13 billion kilowatthours in 2026 and 6.1 billion kilowatthours in 2027. 32 | Hydropower's share of the region's generation mix has declined from a peak of 8% in 2011 to about 4% in 2026. 33 | The Hoover Dam stopped generating power for eleven days in August. 34 | Battery prices fell 20% in 2025. 35 | Coal still supplied 35% of the world's electricity in 2025.
input/source_1_world_generation.txt · 22 lines, 4 KB
Source: U.S. Energy Information Administration, Today in Energy Published: November 27, 2026 Title: Global electricity generation more than doubled from 2000 to 2025 Link: https://www.eia.gov/todayinenergy/detail.php?id=68525 Data source: U.S. Energy Information Administration, International Energy Statistics Note: Renewables includes electricity generation from hydroelectricity, geothermal, solar, wind, tide and wave, and biomass and waste. Solar generation includes solar photovoltaic and solar thermal generation, and distributed solar generation where available. U.S. biomass and waste generation includes wood and waste generation from the MER Table 7.2, and other generation from the Electric Power Annual table 3.1A. Other includes generation from oil, other gases, and hydroelectric pumped storage. The world generated 31.8 trillion kilowatthours (kWh) of electricity in 2025, more than double the 15.1 trillion kWh generated in 2000, according to our recently updated International Energy Statistics data. This growth in global electricity generation is driven by increasing electricity demand from global population and economic growth, and an increase in global median household income. Coal was the largest global source of electricity generation from 2000 to 2024, increasing 83% from 5.8 trillion kWh to 10.5 trillion kWh. However, the share of the world’s total generation from coal decreased from its peak of 41% in 2007 to 33% in 2025. Generation from renewable energy saw the largest growth between 2000 and 2025, increasing from 2.9 trillion kWh to 10.6 trillion kWh. Renewables made up 19% of the world’s generation mix in 2000 and increased to 34% in 2025, surpassing coal as the largest source of the world’s electricity generation in 2025. Data source: U.S. Energy Information Administration, International Energy Statistics China, the United States, and India have been the three largest electricity generators in the world since 2013. Together these three countries generated 17.3 trillion kWh in 2025, more electricity than the rest of the world combined. China has a large population and has experienced rapid economic growth since 2000, leading to increasing electricity generation. Between 2000 and 2025, China’s electricity generation grew at an average annual rate of 9%, increasing from 1.4 trillion kWh in 2000 to 10.7 trillion kWh in 2025. China’s generation in 2025 accounted for more than one-third of the world’s total electricity generation and more than any other country based on our preliminary estimates. More than half of China’s generation in 2025 came from coal and more than one-third from renewables. The United States was the second-largest generator of electricity in 2025, producing 4.5 trillion kWh (including small-scale solar photovoltaic generation and other generation). In 2025, natural gas accounted for 40% of electricity in the United States, renewables for 26%, and nuclear energy for 17%. Electricity generation growth in the United States averaged less than 1% annually from 2000 to 2020. The relatively slow growth in electricity generation correlates with the United States' shift from a manufacturing economy to a service economy. Between 2020 and 2025, however, electricity generation growth averaged 2% annually; much of that growth is because of increasing demand in the commercial sector, including data centers. India generated 2.1 trillion kWh of total electricity in 2025, with 70% of generation coming from coal. India’s electricity generation more than tripled from 2000 to 2025, with an average growth rate of 5% per year. According to the World Bank, between 2000 and 2025, India’s population grew from 1.1 billion to 1.5 billion, when it became the most populous nation in the world. Over that period, the manufacturing sector in India also grew quickly, increasing electricity demand.
input/source_2_energy_losses.txt · 34 lines, 4 KB
Source: U.S. Energy Information Administration, Today in Energy Published: November 25, 2026 Title: Almost 60% of primary energy used for electricity is lost to conversion and transmission Link: https://www.eia.gov/todayinenergy/detail.php?id=68524 Data source: U.S. Energy Information Administration, Monthly Energy Review In 2025, the United States consumed 34 quadrillion British thermal units (quads) of primary energy to deliver 14 quads of electricity sales to end users, with nearly 60% lost. About 95% of the losses came from converting primary energy into electricity, mostly due to lost heat from burning coal and natural gas. The remaining 5% was lost in the course of delivering electricity across grid infrastructure to homes and businesses. Electricity is a secondary energy source that is produced when primary energy sources, such as natural gas, nuclear, and wind, are converted into electric power. Usually, this conversion means: For natural gas, coal, petroleum, and biomass energy sources, burning fuels to produce heat and spin steam turbines For nuclear, solar thermal, and geothermal energy, using direct heat to spin steam turbines For wind, solar photovoltaic, and hydropower energy, directly converting forces of nature into electricity When primary energy is transformed into electricity, some of the input energy is lost in the process. For example, the average potential energy contained in coal used by U.S. power plants is about 10,077 British thermal units per kilowatthour (Btu/kWh), more than twice the energy contained in electricity output, which is the constant 3,412 Btu/kWh. For coal, natural gas, and petroleum plants, we survey both the energy that power plants consume and the electricity they produce. The difference between the two is the conversion loss. Most of the energy potential is lost as heat in combustion that escapes the system into the surrounding environment. Other conversion losses include fuels that do not fully burn and system efficiency limits. For noncombustible renewable energy sources—wind, solar, hydropower, and geothermal energy—we account for only the output electricity and do not calculate conversion losses. The technology and the type of fuel used to generate electricity affect the efficiency of power plants. Coal-fired generation plants in the United States are often older and less efficient than many natural gas-fired plants. In U.S. power plants, generating a kilowatthour of electricity from coal requires on average about one-third more British thermal units of energy than producing a kilowatthour from natural gas. Data source: U.S. Energy Information Administration, Monthly Energy Review In recent decades, the fuel mix for U.S. electricity generation has shifted from mostly coal to a more diverse selection of fuels, including natural gas and renewable energy. In particular, the shift toward newer, more efficient natural gas-fired power plants in combined-cycle configurations has increased the average efficiency of fossil fuel-fired electric power plants, decreasing conversion losses. Data source: U.S. Energy Information Administration, Electric Power Monthly and Monthly Energy Review Note: T&D=transmission and distribution The electrical system also experiences transmission and distribution (T&D) losses when transforming and delivering electricity to consumers. T&D losses are much smaller than conversion losses but still significant. In 2025, T&D losses accounted for less than 1 quad of the energy consumed to generate electricity, compared with 18 quads lost to conversion. As the electric grid has grown more efficient, T&D losses have fallen as a share of retail electricity sales.
input/source_3_solar_batteries.txt · 18 lines, 2 KB
Source: U.S. Energy Information Administration, Today in Energy Published: October 30, 2026 Title: The share of solar generation with co-located battery storage is increasing Link: https://www.eia.gov/todayinenergy/detail.php?id=68384 Data source: U.S. Energy Information Administration, EIA-860M, Monthly Update to the Annual Electric Generator Report Utility-scale solar developers are increasingly co-locating battery storage with new solar photovoltaic capacity. As of September 2026, over 16% of new utility-scale solar capacity added this year is co-located with operable battery storage, compared with 2% in 2017, according to data reported to EIA by operators. Reported plans for solar additions scheduled to come online in the last three months of this year show that the share with co-located battery storage could increase to 19% this year. Longer-term plans indicate that this trend will continue, with the portion increasing to more than 30% in plans submitted for 2027 and 2028. When operators co-locate battery storage with solar, they can direct solar electricity output to the grid or to the battery, depending on the wholesale prices. Wholesale prices in regions with large solar participation tend to fall when solar contributions are high and rise as they decrease. Plants with both solar and battery storage can manage the combined output of their generating resources to maximize their value in a changing wholesale price environment. We publish unit-level generator inventory data based on our annual and monthly data collections, including information on design attributes for all utility-scale plants. Although battery storage and solar units at the same plant often enter commercial service at different times, the EIA-860 and EIA-860M data collection program tracks these developments and provides a monthly summary that can be used to identify co-located technologies. Southwest states have higher-than-average solar capacity shares relative to their total generating capacity and also have higher levels of co-located utility-scale solar and battery capacity. As of September, 13% of the total U.S. utility-scale generating capacity is solar photovoltaic, and 18% of that is co-located with battery storage. The share of solar generation co-located with battery capacity in California, Arizona, New Mexico, and Nevada is more than double the national average. Data source: U.S. Energy Information Administration, EIA-860M, Monthly Update to the Annual Electric Generator Report
input/source_4_southwest_hydropower.txt · 19 lines, 3 KB
Source: U.S. Energy Information Administration, Today in Energy Published: November 13, 2026 Title: Hydropower generation in the Southwest fell to record lows this summer Link: https://www.eia.gov/todayinenergy/detail.php?id=68445 Data source: U.S. Energy Information Administration, Form EIA-923, Power Plant Operating Data Prolonged drought conditions affecting the Colorado River Basin led to record low hydropower generation this summer in the Southwestern electricity supply region, which includes Arizona, New Mexico, and small parts of Nevada and California. Hydropower generation from April through August 2026 was 19% lower than during the same period last year and 28% lower than the 10-year average, according to the latest data from our Form EIA-923 survey. Water elevations at Lake Powell and Lake Mead, which are formed by the Glen Canyon Dam and Hoover Dam, respectively, hit record lows. To be able to generate hydropower at the Glen Canyon Dam, Lake Powell should have an elevation of at least 3,490 feet, also known as the minimum power pool. At the end of September, this elevation reached 3,518 feet, less than 1% above minimum power pool. The Hoover Dam requires an elevation of at least 950 feet at Lake Mead, which by the end of September reached 1,038 feet, 9% higher than minimum power pool. The U.S. Bureau of Reclamation manages most dams across the Colorado River Basin. Seven states (Arizona, California, Colorado, Nevada, New Mexico, Utah, and Wyoming) depend on the river for hydropower generation and for other water supply needs. To mitigate the risk of Lake Powell’s water elevation falling below the minimum power pool, water was released from Flaming Gorge, a reservoir located in the Upper Colorado River Basin. Additionally, water releases from Lake Powell were reduced to maintain an elevation of at least 3,510 feet given the most probable water inflows. However, lower water releases from Lake Powell could also impact water elevation downstream at Lake Mead, in turn affecting hydropower generation at the Hoover Dam. To address this possibility, the Department of the Interior decided to reduce the collective water consumption of California, Arizona, and Nevada by 1.25 million acre-feet each year over the next two years. Data source: U.S. Energy Information Administration, Short-Term Energy Outlook, November 2026 We expect hydropower generation in the Southwest will total 6.13 billion kilowatthours (BkWh) in 2026 in our November Short-Term Energy Outlook (STEO), 9% lower than last year and 24% lower than the 10-year average. In 2027, we expect hydropower generation in the Southwest to total 6.1 BkWh, 0.5% lower than this year. This year’s El Niño could bring more precipitation than normal, providing some drought relief and improving the hydropower generation forecast in the region. However, one good water year likely won't eliminate the effects of multiple years of water scarcity. According to the STEO, hydropower generation in the Southwest is expected to account for about 4% of the region's generation mix in 2026. That share has declined from a peak of 8% in 2011.
output/editor_note.md · written by the agent, 35 lines
# Editor note: fact-check of "Four things the new federal numbers say about electricity" Checked against the four source files in input/ only. Full evidence is in factcheck.csv. supported: 21 contradicted: 9 not_in_sources: 5 ## Lines to fix (contradicted) - **04**: The draft says renewables are 36% of the world's generation mix. The source says 34% in 2025 (`source_1_world_generation.txt`). Right figure: 34%. - **06**: The draft says "since 2010". The source says the three largest generators have held that rank "since 2013". Right year: 2013. - **09**: The draft says China's 10.7 trillion kWh is "about one-quarter" of the world total. The source says "more than one-third". The arithmetic agrees: 10.7 / 31.8 is about 34%. Right wording: more than one-third. - **12**: The draft says nuclear supplied 19% of US electricity. The source says 17%. Gas at 40% and renewables at 26% are correct. - **16**: The draft says India's generation grew 7% a year. The source says an average of 5% per year. Right figure: 5%. - **20**: The draft says coal takes about one-third *less* energy than gas. The source says coal takes about one-third *more*. The direction is wrong, and it also contradicts line 19, where coal needs more than twice the energy of its output. - **21**: The draft says transmission and distribution losses were 3 quads. The source says "less than 1 quad". Right figure: less than 1 quad. The arithmetic agrees: 5% of about 20 quads lost is about 1 quad. - **29**: The draft says Lake Mead is 9% *below* the Hoover Dam minimum. The source says 9% *higher* than minimum power pool. The arithmetic agrees: 1,038 ft is above the 950 ft minimum. Right wording: 9% above. - **35**: The draft says coal supplied 35% of world electricity in 2025. The source says 33%. Right figure: 33%. This also conflicts with line 03 in the draft, which already says 33%. Corrected wording for each line is in the `correction` column of factcheck.csv. ## Lines to cut or find a source for (not_in_sources) - **14**: "Data centers now use 6% of all United States electricity." The sources only say commercial-sector demand, including data centers, drove growth. They give no data-center share. - **22**: "Those grid losses cost United States customers $19 billion in 2025." No source gives a dollar cost for grid losses. - **26**: "Texas leads the nation in solar capacity paired with batteries." The solar-battery source names only California, Arizona, New Mexico and Nevada, as having shares above the national average. It does not mention Texas or rank any state first. - **33**: "The Hoover Dam stopped generating power for eleven days in August." The sources say Lake Mead hit record lows but do not say the dam stopped generating. - **34**: "Battery prices fell 20% in 2025." No source mentions battery prices. ## Other things to know - Line 04: the source says renewables were 34% of 2025 generation. Its own figures give 10.6 / 31.8, about 33%. I used the source's stated 34%. - Line 31: the 2026 and 2027 figures are correct. The 2026 figure is 6.13 BkWh, which the source says is 9% below last year. Line 27's 19% is for April through August only, so keep the two periods distinct if both are used. - Line 28: the source says Lake Powell was "less than 1% above minimum power pool". That is useful context if you want it.
output/factcheck.csv · written by the agent, 36 lines
line,verdict,source,evidence,correction 01,supported,source_1_world_generation.txt,The world generated 31.8 trillion kilowatthours (kWh) of electricity in 2025, 02,supported,source_1_world_generation.txt,more than double the 15.1 trillion kWh generated in 2000, 03,supported,source_1_world_generation.txt,the share of the world’s total generation from coal decreased from its peak of 41% in 2007 to 33% in 2025, 04,contradicted,source_1_world_generation.txt,"Renewables made up 19% of the world’s generation mix in 2000 and increased to 34% in 2025, surpassing coal as the largest source of the world’s electricity generation in 2025",Renewables overtook coal in 2025 and now make up 34% of the world's generation mix. 05,supported,source_1_world_generation.txt,increasing from 2.9 trillion kWh to 10.6 trillion kWh, 06,contradicted,source_1_world_generation.txt,"China, the United States, and India have been the three largest electricity generators in the world since 2013","China, the United States and India have been the three largest electricity generators in the world since 2013." 07,supported,source_1_world_generation.txt,"Together these three countries generated 17.3 trillion kWh in 2025, more electricity than the rest of the world combined", 08,supported,source_1_world_generation.txt,"Between 2000 and 2025, China’s electricity generation grew at an average annual rate of 9%", 09,contradicted,source_1_world_generation.txt,China’s generation in 2025 accounted for more than one-third of the world’s total electricity generation,"China generated 10.7 trillion kilowatthours in 2025, more than one-third of the world's total." 10,supported,source_1_world_generation.txt,More than half of China’s generation in 2025 came from coal, 11,supported,source_1_world_generation.txt,"The United States was the second-largest generator of electricity in 2025, producing 4.5 trillion kWh", 12,contradicted,source_1_world_generation.txt,"In 2025, natural gas accounted for 40% of electricity in the United States, renewables for 26%, and nuclear energy for 17%","Natural gas supplied 40% of United States electricity in 2025, renewables 26% and nuclear energy 17%." 13,supported,source_1_world_generation.txt,"Between 2020 and 2025, however, electricity generation growth averaged 2% annually; much of that growth is because of increasing demand in the commercial sector, including data centers", 14,not_in_sources,,, 15,supported,source_1_world_generation.txt,"India generated 2.1 trillion kWh of total electricity in 2025, with 70% of generation coming from coal", 16,contradicted,source_1_world_generation.txt,"India’s electricity generation more than tripled from 2000 to 2025, with an average growth rate of 5% per year",India's electricity generation grew by an average of 5% per year from 2000 to 2025. 17,supported,source_2_energy_losses.txt,"In 2025, the United States consumed 34 quadrillion British thermal units (quads) of primary energy to deliver 14 quads of electricity sales to end users", 18,supported,source_2_energy_losses.txt,About 95% of the losses came from converting primary energy into electricity, 19,supported,source_2_energy_losses.txt,"the average potential energy contained in coal used by U.S. power plants is about 10,077 British thermal units per kilowatthour (Btu/kWh), more than twice the energy contained in electricity output, which is the constant 3,412 Btu/kWh", 20,contradicted,source_2_energy_losses.txt,generating a kilowatthour of electricity from coal requires on average about one-third more British thermal units of energy than producing a kilowatthour from natural gas,Generating a kilowatthour from coal takes on average about one-third more energy than generating it from natural gas. 21,contradicted,source_2_energy_losses.txt,"In 2025, T&D losses accounted for less than 1 quad of the energy consumed to generate electricity, compared with 18 quads lost to conversion",Transmission and distribution losses came to less than 1 quad in 2025. 22,not_in_sources,,, 23,supported,source_3_solar_batteries.txt,"As of September 2026, over 16% of new utility-scale solar capacity added this year is co-located with operable battery storage, compared with 2% in 2017", 24,supported,source_3_solar_batteries.txt,the portion increasing to more than 30% in plans submitted for 2027 and 2028, 25,supported,source_3_solar_batteries.txt,"As of September, 13% of the total U.S. utility-scale generating capacity is solar photovoltaic", 26,not_in_sources,,, 27,supported,source_4_southwest_hydropower.txt,Hydropower generation from April through August 2026 was 19% lower than during the same period last year and 28% lower than the 10-year average, 28,supported,source_4_southwest_hydropower.txt,"Lake Powell should have an elevation of at least 3,490 feet, also known as the minimum power pool. At the end of September, this elevation reached 3,518 feet", 29,contradicted,source_4_southwest_hydropower.txt,"The Hoover Dam requires an elevation of at least 950 feet at Lake Mead, which by the end of September reached 1,038 feet, 9% higher than minimum power pool","Lake Mead ended September at 1,038 feet, 9% above the minimum the Hoover Dam requires." 30,supported,source_4_southwest_hydropower.txt,"the Department of the Interior decided to reduce the collective water consumption of California, Arizona, and Nevada by 1.25 million acre-feet each year over the next two years", 31,supported,source_4_southwest_hydropower.txt,"will total 6.13 billion kilowatthours (BkWh) in 2026 in our November Short-Term Energy Outlook (STEO), 9% lower than last year and 24% lower than the 10-year average. In 2027, we expect hydropower generation in the Southwest to total 6.1 BkWh", 32,supported,source_4_southwest_hydropower.txt,expected to account for about 4% of the region's generation mix in 2026. That share has declined from a peak of 8% in 2011, 33,not_in_sources,,, 34,not_in_sources,,, 35,contradicted,source_1_world_generation.txt,the share of the world’s total generation from coal decreased from its peak of 41% in 2007 to 33% in 2025,Coal still supplied 33% of the world's electricity in 2025.
check.py · the check, written before the run
"""Checks every verdict against an answer key whose facts are first looked up in the source files."""
import csv, re, sys
from pathlib import Path
root = Path(sys.argv[1]); ok = True
def say(passed, text):
global ok; ok = ok and passed; print(("PASS " if passed else "FAIL ") + text)
def norm(s):
for a, b in (("“", '"'), ("”", '"'), ("‘", "'"), ("’", "'"), ("–", "-"), ("—", "-"), (" ", " ")):
s = s.replace(a, b)
return re.sub(r"\s+", " ", s).strip()
def has(tok, text):
return re.search(r"(?<![\w.,$])" + re.escape(tok) + r"(?![\w%]|[.,]\d)", text) is not None
src = {int(f.name.split("_")[1]): (f.name, norm(f.read_text())) for f in (root/"input").glob("source_*.txt")}
draft = {a: norm(b) for a, b in re.findall(r"(?m)^(\d{2}) \| (.+)$", (root/"input/draft.md").read_text())}
alltext = " ".join(t for _, t in src.values())
S, C, N = "supported", "contradicted", "not_in_sources"
# supported: line -> (source number, words the source and the draft share)
SUP = {"01": (1, "31.8 trillion"), "02": (1, "15.1 trillion"), "03": (1, "41% in 2007"), "05": (1, "10.6 trillion"),
"07": (1, "17.3 trillion"), "08": (1, "9%"), "10": (1, "More than half"), "11": (1, "4.5 trillion"),
"13": (1, "2%"), "15": (1, "70%"), "17": (2, "14 quads"), "18": (2, "95%"), "19": (2, "10,077"),
"23": (3, "16%"), "24": (3, "30%"), "25": (3, "13%"), "27": (4, "28%"), "28": (4, "3,518"),
"30": (4, "1.25 million"), "31": (4, "6.13"), "32": (4, "8% in 2011")}
# contradicted: line -> (source number, what the source says, what the draft says instead)
CON = {"04": (1, "34%", "36%"), "06": (1, "2013", "2010"), "09": (1, "one-third", "one-quarter"),
"12": (1, "17%", "19%"), "16": (1, "5%", "7%"), "20": (2, "one-third more", "one-third less"),
"21": (2, "less than 1 quad", "3 quads"), "29": (4, "9% higher", "9% below"), "35": (1, "33%", "35%")}
# not in sources: line -> words in the draft that no source file contains
NOT = {"14": "6%", "22": "$19 billion", "26": "Texas", "33": "eleven days", "34": "Battery prices"}
want = {**{k: S for k in SUP}, **{k: C for k in CON}, **{k: N for k in NOT}}
key_ok = sum(has(t, src[n][1]) and has(t, draft.get(k, "")) for k, (n, t) in SUP.items())
key_ok += sum(has(t, src[n][1]) and has(w, draft.get(k, "")) and not has(t, draft.get(k, "")) for k, (n, t, w) in CON.items())
key_ok += sum(has(w, draft.get(k, "")) and not has(w, alltext) for k, w in NOT.items())
path = root/"output/factcheck.csv"
if not path.exists():
say(False, "output/factcheck.csv was not written"); sys.exit(1)
rows = {}
for r in csv.DictReader(path.open(newline="")):
rows.setdefault(re.sub(r"\D", "", r.get("line") or "").zfill(2), []).append(r)
once = sum(1 for ln in draft if len(rows.get(ln, [])) == 1)
say(once == len(draft) and set(rows) == set(draft), f"{once} of {len(draft)} draft lines have exactly one verdict")
got = {ln: rs[0] for ln, rs in rows.items()}
right = sum(1 for ln, v in want.items() if (got.get(ln, {}).get("verdict") or "").strip().lower() == v)
say(key_ok == len(want) == len(draft) and right == len(want), f"{right} of {len(want)} verdicts match the answer key and {key_ok} of {len(want)} key facts were confirmed in the source files")
need = {**{k: v[0] for k, v in SUP.items()}, **{k: v[0] for k, v in CON.items()}}
ev = 0
for ln, n in need.items():
r = got.get(ln, {}); q = norm(r.get("evidence") or "").strip('"')
ev += len(q.split()) >= 4 and q in src[n][1] and (r.get("source") or "").strip() == src[n][0]
say(ev == len(need), f"{ev} of {len(need)} pieces of evidence appear word for word in the right source file")
# a correction may word the right fact its own way where the source uses words, not digits
FIX = {"09": ("third", "quarter"), "20": ("third more", "third less"), "29": ("9%", "below")}
fix = 0
for ln, (n, t, w) in CON.items():
c = norm(got.get(ln, {}).get("correction") or ""); yes, no = FIX.get(ln, (t, w))
fix += (yes in c if ln in FIX else has(yes, c)) and (no not in c if ln in FIX else not has(no, c))
say(fix == len(CON), f"{fix} of {len(CON)} corrections use the source's own figure and drop the wrong one")
clean = sum(1 for ln in NOT if not any((got.get(ln, {}).get(c) or "").strip() for c in ("source", "evidence", "correction")))
say(clean == len(NOT), f"{clean} of {len(NOT)} unsourced lines carry no made up evidence")
note = (root/"output/editor_note.md").read_text().lower() if (root/"output/editor_note.md").exists() else ""
counts = {v: sum(1 for x in want.values() if x == v) for v in (S, C, N)}
c_ok = sum(1 for v, n in counts.items() if re.search(rf"(?<![a-z_ ]){v.replace('_', '[_ ]')}\W{{0,6}}{n}\b", note) or re.search(rf"\b{v.replace('_', '[_ ]')}\W{{0,6}}{n}\b", note))
work = list(CON) + list(NOT)
named = sum(1 for ln in work if re.search(rf"\b{ln}\b", note))
say(c_ok == 3 and named == len(work), f"editor_note.md gives {c_ok} of 3 verdict counts correctly and names {named} of {len(work)} lines that need work")
# every number in the note is looked up in the draft line it is about or in the source that settles that line
raw_note = (root/"output/editor_note.md").read_text() if (root/"output/editor_note.md").exists() else ""
toks = lambda s: [t.replace(",", "").rstrip(".") for t in re.findall(r"(?<![\w.])\d[\d,]*(?:\.\d+)?", s)]
free = {str(v) for v in list(counts.values()) + [len(draft), len(src), len(work)]}
tot = good = 0
for ln in raw_note.splitlines():
refs = re.findall(r"\*\*(\d{2})\*\*", ln) + re.findall(r"\b[Ll]ines?\s+(\d{2})\b", ln)
tot += len(refs); good += sum(1 for i in refs if i in draft)
allowed = set(free) if not refs else set()
for i in refs:
allowed |= set(toks(draft.get(i, ""))) | set(toks(src[need[i]][1] if i in need else alltext))
here = toks(re.sub(r"\*\*\d{2}\*\*|\b[Ll]ines?\s+\d{2}\b|source_\d\w*\.txt", " ", ln))
vals = [float(x) for x in here]
for t in here:
worked = any(b and round(100 * a / b) == float(t) for a in vals for b in vals if a < b)
tot += 1; good += t in allowed or worked
say(tot > 0 and good == tot, f"{good} of {tot} numbers and line references in editor_note.md are found in the draft line or the source file they describe")
sys.exit(0 if ok else 1)
draft.md: sample data written by Atris. Fingerprint b547bebf2fc1.
source_1_world_generation.txt: public document. Fingerprint 4180f440fd90.
source_2_energy_losses.txt: public document. Fingerprint ae0b95d50d25.
source_3_solar_batteries.txt: public document. Fingerprint c632556fcf60.
source_4_southwest_hydropower.txt: public document. Fingerprint 3150b5bbd150.
editor_note.md: written by the agent. Fingerprint 5ddb3c75e35f.
factcheck.csv: written by the agent. Fingerprint 97b21d33ff0a.