Skip to content

reconcile: agami's answer may be several statements (ACE-135) - #321

Open
sandeep-agami wants to merge 1 commit into
ACE-134-reconcile-card-agreementfrom
ACE-135-several-statements
Open

reconcile: agami's answer may be several statements (ACE-135)#321
sandeep-agami wants to merge 1 commit into
ACE-134-reconcile-card-agreementfrom
ACE-135-several-statements

Conversation

@sandeep-agami

Copy link
Copy Markdown
Collaborator

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_object and sql had to be one string: a list under sql, 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 one sql_agami and no place for the others.

The change

  • golden_run.py: GeneratedSql.statements (every statement, in order; sql is the last). _spawn accepts sql as 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 reads sql as before.
  • run_golden_eval.py --ask / --ask-file: the payload carries statements (a generator that did not say gives [sql]).
  • SKILL.md 2b: only sql goes to agami.sql and runs; the others go into the record's agami_statements (2d, after words) 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_steps when there was more than one; the rows and answer checks 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's statements (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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant