fabro/lib
Bryan Helmkamp 0e0dfe4f9d
refactor: simplify structured output error rendering
Follow-up review of the repair-error work. Behavior is the same or better;
the machinery is smaller.

Fixes a false "unchanged from your previous repair" nudge. same_problem_as
fell through to `_ => true`, so any two non-Required issues at the same
instance path, schema path and keyword compared equal. A model that removed
one unexpected property and added another was told it had changed nothing.
SchemaValidationIssue already derives PartialEq, so the 17-line comparison
is now `previous.contains(issue)`.

Drops the hand-written Type and Enum rendering. jsonschema already renders
both, and its messages name the offending value, which the hand-written
ones did not. Also switches masked() back to to_string(): masking replaced
the bad value with a placeholder, working against the goal of an actionable
message, and buys no privacy since the full response is already in the
prompt.

Resolves the schema fragment when the issue is captured rather than
threading Option<&OutputSchemaKind> through rendering. That reverts the
command.rs change and drops the test-only messages() shim. The fragment is
now attached only to Other, where it adds information; for required, type,
enum and additionalProperties it just repeated the prose.

Also: caps the model-controlled unexpected-property list so a wide object
cannot turn the repair prompt into megabytes; drops evaluation_path, which
was dead except under $ref, where it printed a pointer that does not
resolve; drops the keyword field, already named by the schema path; and
records the previous error only after the agent session accepted the
repair, since failover rebuilds the session from the original prompt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-01 09:04:28 -04:00
..
apps refactor: simplify model-keyed fallback internals 2026-07-30 12:51:36 -04:00
components refactor: simplify structured output error rendering 2026-08-01 09:04:28 -04:00
foundation fix: keep stored run events from older releases deserializable 2026-07-30 13:24:08 -04:00
packages/fabro-api-client refactor: simplify model-keyed fallback internals 2026-07-30 12:51:36 -04:00