Three defects the catalogue triage found (#104) - #457
Merged
Conversation
Classifying all 87 non-validating examples by their actual `validate` output
turned up three clusters that were not example problems. Each reported *the
pipeline* as broken when the fault was ours, so repairing the examples by hand
would have meant "fixing" files that were already correct.
1. A JSON Schema was read as a model specification.
Any nested dict carrying a `name` or `model` key counted as a model spec,
which makes this look like one:
parameters.schema.properties.records.items.properties
-> {'id': {...}, 'name': {'type': 'string'}, 'active': {...}}
`name` there is a *field* called "name", and its value is a mapping, so the
"model name" came back as a dict and `validated_models.add(...)` raised
`TypeError: unhashable type: 'dict'`. The TypeError escaped and surfaced as
"Model validation failed", blaming the pipeline for a bug in the validator.
Six examples.
A dict is now a model specification when it is reached under a model key --
`model`, `llm`, `language_model` -- and not merely for having a `name`. The
non-string guard stays as well: two independent defences, one test each.
My first hypothesis was a task-level `model:` written as a requirements
dict. Wrong: none of the three files has one, and a synthetic pipeline with
one produces a different, correct error. The traceback located it.
2. `execution['timestamp']` was read as a task id.
References were split on `.`, which leaves a subscript attached, so the
bracket spelling of something #454 makes valid was reported as an undefined
*task* -- on pipelines that run correctly. Same class as `now()` before
#451. It hits step outputs too (`get_full_context['keys']`), and `a[0]` now
resolves to `a` rather than to a name called "a[0]".
3. `json_encode` did not exist.
Registered as an alias of `to_json` -- the same function object, not a
second implementation, since two implementations of one filter is exactly
the drift #449 removed.
Measured: catalogue validating 30 -> 34 of 117; blocking suite 700 -> 711
passed, 0 failed.
Four mutations, all killed:
- treat any dict with a `name` key as a model -> 1 test
- drop the non-string model-name guard -> 1 test
- drop subscript normalisation -> 5 tests
- give json_encode its own implementation -> 1 test
Co-Authored-By: Claude Opus 5 (1M context) <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.
Classifying all 87 non-validating examples by their actual
validateoutput turned up three clusters that were not example problems. Each reported the pipeline as broken when the fault was ours — so repairing examples by hand would have meant "fixing" files that were already correct. That's the argument for triaging before repairing.1. A JSON Schema read as a model specification (6 files)
Any nested dict carrying a
nameormodelkey counted as a model spec, which makes this look like one:namethere is a field called "name", and its value is a mapping — so the "model name" came back as a dict andvalidated_models.add(...)raised:The
TypeErrorescaped and surfaced asModel validation failed, blaming the pipeline for a bug in the validator.A dict is now a model specification when reached under a model key (
model,llm,language_model), not merely for having aname. The non-string guard stays too — two independent defences, one test each.My first hypothesis was wrong and worth recording: I guessed a task-level
model:written as a requirements dict. None of the three files has one, and a synthetic pipeline with one produces a different, correct error. The traceback located it; the guess would have sent me to fix something that wasn't broken.2.
execution['timestamp']read as a task id (2 files)References were split on
., which leaves a subscript attached — so the bracket spelling of something #454 makes valid was reported as an undefined task, on pipelines that run correctly. Same class asnow()before #451.Also fixes step outputs (
get_full_context['keys']), anda[0]now resolves toarather than a name calleda[0]..form['...']formexecution.timestampexecution.bogus3.
json_encodedid not exist (2 files)Registered as an alias of
to_json— the same function object, not a second implementation, since two implementations of one filter is exactly the drift #449 removed. A test asserts identity rather than equal behaviour, because identity can't drift.Measured
Mutations — four, all killed
namekey as a modeljson_encodeits own implementationNote on the remaining failures
The files fixed here still fail for other reasons —
fact_checker.yamlandweb_research_pipeline.yamlnow reportUndefined variable: 'item', a loop-scope issue that is next. Full classification innotes/catalog-triage.md.🤖 Generated with Claude Code