Repository navigation
Complete a type listing in the reply, and score eval groups whose setup state already exists (#3268) - #3482
Conversation
Pragmatic Code Review — PR #3482Review Type: Initial Review (no prior reviews or comments on the PR) Verdict: REQUEST CHANGES — one finding (the stand-in path of the backstop). Everything else is optional. The append path of the backstop, the row trimming and the eval change are sound and well tested. The stand-in path decides "this turn was a type listing" from the tool calls alone, and that is not enough to tell: it can replace a confirmation request, or a neutral summary, with a type list the user did not ask for. What I verified, and what I could notVerified by reading the code or running tests:
Not verifiable here (no model runs): the 0/3 → 2/3 → 3/3 table, "10 of 12, all scored" for Requirements Check (issue #3268)
Code Review Findings🟡 Important1. The stand-in path can show a type list in answer to a different request let read_only = !result.tool_calls_made.iter().any(|r| super::tools::is_write_tool(&r.name));
let stand_in = result.response == CONFIRMATION_REQUEST
|| result.response == summarize_executions(&result.tool_calls_made);
if read_only && stand_in { /* "This workspace has N types: …" */ }The append path has a signal that the reply was a listing (two or more linked types). The stand-in path has none: it fires whenever any call in the turn was a complete type listing and the turn wrote nothing. By code reading (not observed in a run):
Recommendation:
Principle: a guard that replaces a reply must not weaken what an earlier guard established; the precondition should rest on evidence about the reply, not only on which tools ran. 2. "type": node["type"],
"properties": node["properties"],
3. A setup turn that failed for another reason no longer blocks its group
So the state is really there, but "state present" is being used to mean "setup was a correct no-op". Recommendation: release the block only when the failed setup turn made no write and asked no question, or at minimum mark the result (for example 🟢 Suggestions4. Two comments in the fixture now disagree
5. It is called inside 6. A failing
7. The hint match is loose for the venue type Any custom type whose id contains 8. The backstop lists every schema node, internal ones included The appended list is whatever the search returned, so abstract bases and internal types appear in the user's reply. That matches the criterion's wording ("every schema"); raise it only if the list reads badly in the app. Nitpicks
RecommendationREQUEST CHANGES for finding 1. Findings 2 and 3 are worth folding into the same pass; the rest are optional. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: REQUEST CHANGES (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressed (commit bc275ab)Addressed
Not changed
Verification: agent lib + it 841 passed; Re-Review DecisionDecision: RE-REVIEW NEEDED Rationale: Finding 1 changed where and on what evidence a reply is replaced, including a new branch inside the fabricated-id guard, and finding 3 changed the rule that decides whether an eval group is scored. Both are logic changes in the areas the review flagged. |
Pragmatic Code Review — PR #3482Review Type: Re-Review (commit Verdict: APPROVE — the blocking finding is fixed and the fix is sound. Three non-blocking findings remain, one of them a test gap worth closing in this PR. Previous Review Summary: 8 findings and 3 nits. 7 findings and 2 nits addressed, finding 8 declined with a reason I accept, 1 nit unanswered (no action needed). 3 new findings, none blocking. What I verified, and what I could not
Status of each earlier finding
New Findings🟡 Important (non-blocking)1. The write check in if executions.iter().any(|r| super::tools::is_write_tool(&r.name)) {
return None;
}This is the only thing that keeps Recommendation: 🟢 Suggestions2. A suppressed reply that links two types is still replaced by the list when the turn was about something else let types = executions.iter().rev().find_map(complete_type_listing)?;
…
(named >= TYPE_LISTING_MIN_LINKED).then_some(types)The empty-reply path requires the turn to be nothing but listings; this path only requires no write. Two cases, by reading the code, not observed:
This is the rule the first review recommended, and it is much narrower than before, so it does not block. If it is worth tightening, the cheap option is to also require every call in the turn to be a listing, as the empty path does; the cost is that a failed first search followed by a successful retry would fall back to the request to confirm. Otherwise add the first case to "Not fixed" and a test that records the chosen behaviour (the existing test covers zero and one linked type, not two beside an invented record). Checked and fine: a failed read in the same turn is still reported, because the tool-failure guard runs after this one and replaces the list. The exception is a type whose title contains "error", "fail" or "unable", which that guard's substring test reads as the reply acknowledging the failure. The narrated-call guard cannot match the written list ( 3. A setup turn that asks its question in prose still counts as "did nothing" const didNothing =
turn.toolsCalled.length === 0 &&
turn.sendFailed !== true &&
turn.routingDecision !== "clarify";Only a Stage-1 clarification is detected. A Stage-2 reply that asks a question in its own words ("Which fields should Company have?") has no tool call and routes as
Nitpicks
Project rulesNo compatibility code, lint suppression, RecommendationAPPROVE. Finding 1 from the first review is fixed on the principle it named. New finding 1 (the missing test) is worth adding before merge; findings 2 and 3 are judgment calls for the author. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Re-review addressed (commit ecaacdd)Addressed
Not changed
Verification: agent lib + it 842 passed; Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The re-review approved with no blocking findings. This commit narrows one already-reviewed branch with a single extra condition that has direct tests, adds the missing test, and makes comment, logging and naming changes. Nothing new is reachable that was not reachable before; one path is reachable in fewer cases. |
…up state already exists (#3268) agent - A turn-end backstop completes a reply that lists some of the workspace's types and not the rest: when the turn ran an unfiltered search over schema nodes and the reply links at least two of the types it returned, the ones left out are appended. When the reply is only the stand-in for an empty or suppressed one, and the turn wrote nothing, the list is written out. - search_nodes result rows omit an empty type, an empty property map and a snippet that repeats the title. eval - A setup turn that fails its own assertion blocks its group only when the fixture cannot show the state present. Groups in a rep share a database, so from the second group on the type exists and a model that creates nothing is right; four of twelve decisions groups were being excluded for it. Measured on gemma-4-e4b-q4km, three workspaces: "What schemas do we have here?" names every type in 3 of 3 (0 of 3 before). One rep of eval:decisions scores all 12 scenarios, 10 passing, the new outcome-list-types among them; eval:routing is 18 of 19, as without the change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tools ran - The backstop no longer writes a type list over any stand-in reply on a read-only turn. An empty reply is written out only when listing the types is all the turn did. A reply suppressed for an ungrounded id is handled where it is suppressed, and only when its own text links at least two of the listed types; a narrated call, or an invented id on some other question, keeps the request to confirm. - resolve_query copies the keys its row has instead of indexing ones the row may have left out, so a node with no properties does not resolve with "properties": null. - A setup turn that failed its assertion leaves its group scoreable only when it did nothing at all (no tool, no clarifying question, no failed send) and the fixture shows the state present. The result records it (setupStateAlreadyPresent). A state check that itself fails blocks the group. - Two fixture comments agree that re-creating a type is refused; a test documents that the type match is by word. Not changed: the appended list includes every schema node the search returns, internal types included, which is what the acceptance criterion asks for. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…when its bad ids are listed ids cut short - suppressed_type_listing also requires every ungrounded id in the reply to be the cut-short form of a listed type's id, which is the slip a space inside an id produces. A reply that invents a record id keeps the request to confirm however many types it links beside it. - Direct tests for each condition, the write check included; it had none. - The guard's log line says whether the list was written out. - eval: the setup rule's comment says a prose question is not detected and that any tool call blocks; the result is held by name rather than by index; a failed state check is logged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
692d853 to
7075bdb
Compare
Part of #3268: the two acceptance criteria PR #3463 left open.
Criterion 5 — the eval scenario had no score
outcome-list-typeswas excluded in every rep, with three other scenarios. Groups in a rep share a database, so a setup turn can find its type already there. A model that sees the type and creates nothing is right, but fails the setup turn'screate_schemaassertion, and the runner then drops every scenario after it.EvalFixture.setupStatePresent(env, scenario): asked when a setup turn fails its own assertion by doing nothing at all — no tool call, no clarifying question, no failed send. The group is scored only if the fixture then shows the state present (setupLeftStateMissing). A turn that asked a question or called another tool still blocks its group, and so does a state check that fails.schema list, matching the company and venue types by the same word hints the seed already uses.setupStateAlreadyPresent, so a results file shows which groups were scored on that basis.One rep now scores all 12 scenarios; 4 of 12 were excluded before. In that rep the venue setup turn did nothing in 8 of 12 groups, each time replying that the type already exists.
Criterion 3 — the reply did not name every type
The turn runs the schema search and gets every type back, then names the custom ones and writes "…and several built-in types like task, text, date, etc."
Measured on gemma-4-e4b-q4km, "What schemas do we have here?" on three workspaces with different custom types, pass = the reply names task, person, project and every custom type, with no link to an id that is not a type:
complete: trueon the resultTwo changes:
search_nodesrows carry only what they have. A type's row was an id beside an empty property map and a snippet repeating its title, twenty-odd times.resolve_query, which answers from the same row, copies the keys that are there.type_listing_backstop, applied over the finished turn likeduplicate_entity_backstop. When the turn ran an unfiltered search over schema nodes that was not cut off at the limit, and the reply links at least two of the types it returned but not all, the rest are appended as links. The model's wording stands.Two ways a listing turn ends with no usable reply are covered, each only on evidence that the turn was a listing:
nodespace://codefornodespace://code-block). A narrated tool call, or a reply carrying an invented record id, still gets the request to confirm.Evals on the branch (one rep each)
Taken on the first commit, before the review changes. The three-workspace check above was re-run after them and still passes 3 of 3; the two evals were not re-run.
eval:decisions: 10 of 12, all scored.outcome-list-typespasses.skill-instance-requestanddeclarative-fact-report-resolvedfail.eval:routing: 18 of 19 (indirect-schema-freelancefails), the same result as a second rep on this branch.Not fixed
route_clarify's description changed nothing (0 of 3 phrasings). A seeded "Types & Schemas" skill routed all three, with all six vague controls still clarifying — but with it one rep ofeval:routingwent from 18 of 19 to 16 of 19 ("show me stuff about our release process" started clarifying; one indirect schema request created plain nodes). It is not in this PR.Tests
resolve_query's payload. The completion test fails with the backstop call removed.setupLeftStateMissing,setupTypePresent, and that every setup scenario names the type it establishes.bun run test:changed(Rust workspace, scripts, generated-types check) andquality:fixpass.🤖 Generated with Claude Code