Repository navigation
Source the agent's withdrawal findings and widen its tools - #12
Merged
Merged
Conversation
The agent's instructions stated findings its sources don't support. They put network upgrades at about 70 percent of withdrawn projects' costs, where Berkeley Lab's PJM brief says 94 percent, and called cost the dominant driver of withdrawal, where the brief says likely a key driver. They gave no source for cascading withdrawals, and told the agent to treat a quoted cost as an upper bound, which no source supports. The agent also couldn't write a query in steps with WITH, could hang on a runaway join, and couldn't search one project's report. - The four findings follow Berkeley Lab's Queued Up 2026, its PJM cost brief and FERC Order No. 2023 (paragraphs 47, 49, 793, 798 and 799), and each ends with its source. The PJM costs are the network upgrade averages, the part closest to cost_per_kw, with the medians of total cost to show how uneven costs are. - The instructions say the research costs are in 2022 dollars, while cost_per_kw is in its own study's dollars, and that a quoted cost is a preliminary estimate that a later study can change. - search_studies takes an optional queue_id to search only that project's report. - The agent's SQL may start with WITH. A query still running after 10 seconds is stopped with a plain message. - docs/decisions.md records the findings, the query limits and the one-project search. The README drops the limitation this fixes, describes the new limits, and cites FERC paragraph 49. make test: 170 passed offline. A WITH that reads a file is refused, as are the other file and web reads, alone and inside a WITH.
…kDB reports it A review found gaps in the query limits and in the agent's findings. A stop that lands while DuckDB streams a result back can surface as an invalid input error, which passed through as a raw DuckDB error. The tool read every row before keeping 50, so a huge result was loaded in full. A result with two columns of the same name silently lost one. The select guard let words like "selection" through. The findings called 94 percent a share of total cost rather than of the average, and the caveat didn't say the study's megawatts can differ from the nameplate capacity Berkeley Lab divides by. - query_projects turns any DuckDB error raised after the timer fired into the plain "was stopped" message, reads at most max_rows rows, and refuses repeated column names. query_queue asks for 51 rows, so it can say there were more than 50. MAX_QUERY_ROWS moves to config. - The guard needs SELECT or WITH as a whole word. - The findings say 94 percent of the average total cost, "their high costs", and that projects studied with a withdrawn one, not only those behind it, can be restudied and take on its shared costs. The caveat says the study's dollar year is Berkeley Lab's assumption. - docs/decisions.md says why WITH adds no new risk, that only a join with no condition makes 450 billion combinations, why the row limit complements the time limit, and that nothing yet checks whether the live model passes a queue_id. make test: 175 passed offline. Six planted bugs each fail a test, including the stop reported as another error, which a stand-in for the connection now raises every time.
cost_per_kw divides by the panel's capacity_mw when a study gives no megawatts, as the README says, but the agent's instructions and docs/decisions.md didn't say so. Both now do, and a test checks the instructions. docs/decisions.md also says that AG1-462's report studied 300 MW of output, of which PJM counts 180 MW as capacity, and puts typical panel queries under 50 milliseconds: four timed runs took 7 to 38. make test: 210 passed offline.
Owner
Author
|
Evidence for
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem. The agent's instructions stated findings their sources don't support. They put network upgrades at about 70% of withdrawn projects' costs, where Berkeley Lab's PJM brief says 94%, and called cost "the dominant driver" of withdrawal, where the brief says "likely a key driver". They gave no source for cascading withdrawals, and told the agent to treat a quoted cost as an upper bound, which no source supports. The agent also couldn't write a query in steps with
WITH, could hang on a runaway join, and couldn't search one project's report.What changes.
cost_per_kw, with the medians of total cost to show how uneven costs are.cost_per_kwis likely in its own study's dollars and per kW of the megawatts the study assessed, or of the panel's capacity when the study gives none, so a comparison between them is a rough guide. A quoted cost is a preliminary estimate that a later study can change. The upper-bound instruction is gone.search_studiestakes an optionalqueue_idand then searches only that project's report.query_queueaccepts a query that starts withWITH. A query still running after 10 seconds (QUERY_TIMEOUT_SECONDS) is stopped with a plain message. The tool reads at most 51 rows, shows the agent 50 and says if there were more, and refuses a result with two columns of the same name.docs/decisions.mdrecords the findings, the query limits and the one-project search. The README drops the limitation this fixes and describes the new limits, and future work drops the three items this PR does.Verification.
make test: 210 passed offline, with the currentmainmerged in. Six planted bugs each fail a test.WITH.make checkfinds the panel of 7,666 projects and the 25 reports.make embedestimates 5,499 passages, 1,980,104 tokens and $0.0396, as onmain.make extractfinds nothing to extract, because a dry run embeds nothing.make evalwires all six questions and says 4 checks would be skipped.python -m src.cli askgives the dry-run reply, naming both tools.Not checked against OpenAI's live API. This PR changes the agent's instructions and tools, which would normally need a paid
make eval. The OpenAI account has no credits, so under the owner's waiver it merges on the offline tests, dry runs, free CI and review. Nothing has yet checked that the real model passes aqueue_idwhen a question is about one project, weighs the findings sensibly or writesWITHqueries that run. The paid evaluation comes first once credits arrive.Review. Separate agents reviewed this work three times before this PR: two rounds on the first version, then the branch on 30 November, whose findings
22a3731fixes. A further separate review, of22a3731, was stopped before it reported. Before it stopped, it had confirmed that the other callers ofquery_projectsstill work with the new limits, and questioned how the docs described AG1-462's megawatts. My own final review of the whole diff after mergingmainfound that the instructions anddocs/decisions.mddidn't saycost_per_kwdivides by the panel's capacity when a study gives no megawatts.619201bfixes both points. These last fixes had my review only.