fix: an operator-supplied value reaches the wire - #125
Merged
Conversation
audit/inputs.json declares three keys and only two of them did anything to a live run. Derive resolves parentRefs and skip at plan time, but Run replaces every entity's steps with the program its compiled strategy describes, and those bodies are synthesised from schema hints alone: the values key never left the plan. Options carries the inputs, strategize hands each entity its own, and both paths that put a value in a body now read them first — the skeleton the translator sends, and the field the adjustment loop is forced to add live. A field the API demands mid-loop is the same field the operator supplied a value for, and synthesising a different one there would send two values for one field across a single run. An operator value outranks the variant gate as well as the example: a discriminator is one of the things an operator has to supply when the document does not say which shape is valid. It substitutes rather than adds, scoped to the body's own fields, exactly as the plan's own synthesis does. 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.
The defect
audit/inputs.jsondeclares three keys —values,parentRefs,skip— and only two of them affected a live run.plan.DeriveappliesparentRefs(which survive inPathValues) andskip(applied at derive time). ButRununconditionally strategizes when the document and config are present, andstrategizereplaces every entity'sStepswithtranslateProgram(...), whose bodies come fromsynthSkeletonBody/synthValue— schema hints only.Optionshad noInputsfield at all, sovaluesreached the wire on no path a real run takes.handoff.mdranks "populateaudit/inputs.json" as its second-highest next step. As things stood, thevalueshalf of that would have had no effect.The change
Optionscarries*plan.Inputs;strategizehands each entity its own; and both places a value enters a body read them first:synthSkeletonBody— the body the translator sends.synthField— the field the adjustment loop is forced to add live. A field the API demands mid-loop is the same field the operator supplied a value for, and synthesising a different one there would send two values for one field across a single run.An operator value outranks the variant gate as well as the example: a discriminator is one of the things an operator supplies when the document does not say which shape is valid.
It substitutes rather than adds, scoped to the body's own fields — the same contract
synth.valuealready has in the plan package.plan.ValuesForis exported for the run to read.Verification
make check(90.7% total;audit/plan93.0%,audit/run90.6%,cli88.1%) andgolangci-lint run(0 issues).Both paths are covered by a test confirmed to fail with that path's override removed — the integration test through
synthField, and a direct test ofsynthSkeletonBody.Writing those tests corrected two assumptions worth recording. The first target field was optional, so it was absent from the minimal skeleton and the value legitimately never appeared; the second was in a different variant from the one the run recorded. Both were found by dumping the recorded bodies rather than by reading the code again.
What this does not do
No benchmark movement on its own — the pilot has no
audit/inputs.jsonyet. This is what makes authoring one work.🤖 Generated with Claude Code