reconcile: agami's answer may be several statements (ACE-135) - #321
Open
sandeep-agami wants to merge 1 commit into
Open
reconcile: agami's answer may be several statements (ACE-135)#321sandeep-agami wants to merge 1 commit into
sandeep-agami wants to merge 1 commit into
Conversation
The cold client's reply was read as one string under `sql`, so a list of statements, or several in one string, lost everything but the first object or read as unreadable. The generator keeps every statement in order (`GeneratedSql.statements`, a reply string cut at its top-level semicolons, never regenerated) and answers with the last, which the prompt now asks for; the ask door writes `statements` beside `sql`; the row record carries `agami_statements`; the report card's SQL block lists them numbered with the last marked "compared", and the rows and answer checks note that agami ran N queries. Only the last is run and graded. Spec: ACE-135 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Spec: ACE-135 (agami-sdlc
projects/agami-core-extension/specs/reconcile-evidence/ACE-135-several-statements.md)Stacked on #320 (ACE-134). Round 9 of the reconcile stack.
The ask
"we need to handle when agami fires multiple queries to answer a question and show it appropriately in the report." The cold client's reply was read by
_first_json_objectandsqlhad to be one string: a list undersql, two statements in one string, or a second JSON object lost everything but the first object without a word, or read as unreadable. The card had onesql_agamiand no place for the others.The change
golden_run.py:GeneratedSql.statements(every statement, in order;sqlis the last)._spawnacceptssqlas a string or a list; a string is cut at its top-level semicolons (outside quotes and comments; text splitting only, no regeneration per ACE-093); a list carrying anything but statements is unreadable as a whole. The question prompt gains: "If answering takes more than one query, put them in order in a list under sql; the last must be the statement whose result answers the question." The golden run readssqlas before.run_golden_eval.py --ask/--ask-file: the payload carriesstatements(a generator that did not say gives[sql]).SKILL.md2b: onlysqlgoes toagami.sqland runs; the others go into the record'sagami_statements(2d, afterwords) and are never run: the read-only rule refuses anything but a SELECT, so an earlier statement can only be a look at the data.reconcile.py report-items:sql_agami_stepswhen there was more than one; therowsandanswerchecks carry "agami ran N queries; the last one's result is compared". Renderer validates the field; the page's SQL block lists agami's statements numbered, the last marked "compared". CHANGELOG under Added.Tests
test_golden_run.py: a list keeps every statement and answers with the last; two statements in one string are cut at the top-level semicolons and not inside a literal or a comment; one statement reads(sql,); an empty list, a list with a non-string, or a string of semicolons is unreadable; the prompt sentence.test_run_golden_eval_ask.py: the payload'sstatements(one existing pin gains the key).test_reconcile_report_items.py: the steps and the note, and their absence for one statement.test_render_reconcile_report.py: the SQL block and the field's validation.test_reconcile_learning_loop_skill.py: the 2b and 2d prose. 224 passed across the golden-run, ask-door, reconcile card, renderer, skill-pin and eval-skill suites (the client test is the known local failure).🤖 Generated with Claude Code