The requested change is one line. The generated patch changes the whole file.
Sometimes the model rewrote more than it needed to. Sometimes a client normalized line endings while saving the answer. Sometimes the prompt requested a complete file, so the application replaced the original bytes with newly generated text. These failures can produce a similar diff while having different causes.
A useful Fable 5.2 versus Astra API comparison should separate those cases. Correct-looking code is only one part of a usable patch. The change must apply to the intended revision, stay within scope, preserve required file properties, and pass the relevant behavioral check.
This article proposes a local acceptance fixture for comparing those properties. It does not report invented model scores or claim that one model consistently preserves diffs better. You can use the fixture with verified Fable and Astra routes, or adapt it to another coding model.
The review contract comes before the prompt
For the experiment, choose a small repository task whose expected behavior is clear. For example, change a timeout constant while preserving a non-English comment and an existing test fixture.
Write down the invariants. Only one source file may change. The comment must retain its meaning and required spelling. The file's required encoding must remain valid. Its line-ending convention must remain compatible with the repository. The test must still exercise the same behavior.
Some invariants are project-specific. A repository may intentionally normalize all text to LF. Another may maintain a particular generated fixture byte for byte. Treat the repository policy as the standard; do not assume that preserving every original byte is always the correct objective.
The existing Fable and GPT Astra comparison provides general selection context. Here, the narrower decision is whether a route produces reviewable changes for your repository conventions.
Gate one: the request identifies the source revision
A patch is meaningful relative to a particular source state. Save the commit identifier or content digest before sending the task. If the source changes while generation is running, do not blindly apply the result to the new version.
The request should include the exact relevant code and a concise change instruction. State whether the response should be a unified diff or a structured edit. Also state which files may change. These instructions define the requested behavior; your application still needs to enforce file access and validate the result.
Avoid an evaluation prompt that asks for several unrelated improvements. “Fix the timeout, improve style, modernize dependencies, and clean up comments” makes a large diff unsurprising. Start with a single change so unnecessary edits are easy to recognize.
Keep the exact request content and model settings consistent across routes. Where native request formats differ, document the adapter rather than pretending the wire payloads are identical. The JSON schema compatibility guide is relevant if you request structured edits instead of raw patches.
Gate two: the transport preserves the response
Capture the completed model response before the application edits the repository. Store it in a controlled test location, with secrets and unrelated repository material excluded from anything you share.
Then compare what the model returned with what the client wrote. A Markdown fence remover, JSON decoder, newline normalizer, or text editor can transform the answer. If the saved patch differs from the response, investigate that transformation before assigning the failure to the model.
Streaming deserves particular care. Assemble the complete content according to the protocol before extracting a patch. A partial event is not a complete file. Tool arguments may arrive incrementally and require a different assembly path from visible assistant text.
For a native Claude tool workflow, review the official tool-call handling documentation. For an OpenAI route, review the function-calling guide. A model response proposing an edit and an application successfully applying it are separate observations.
If a forced tool choice causes a request error, use the tool-choice compatibility article first. A rejected request cannot provide evidence about patch quality.
Gate three: inspect bytes before interpreting the diff
Text editors can hide newline differences. The following standard-library helper reports basic byte properties without rewriting the file. It is a diagnostic aid, not a universal encoding detector.
The fixture shows an intended constant change and an additional newline change. It does not imply that LF is wrong. Whether that change is acceptable depends on the repository's policy and the requested scope.
A hash tells you whether bytes differ; it does not tell you whether the change is correct. UTF-8 validity tells you whether decoding succeeds; it does not prove that names or comments retain their meaning. Combine these observations with the actual diff.
The Git attributes documentation describes repository controls for text handling and line endings. Check those settings before diagnosing every newline change as model behavior. A checkout or staging operation can also transform text according to Git configuration.
Gate four: apply only inside a disposable review copy
Use a separate test checkout with no valuable uncommitted work. Review the candidate patch before applying it. A syntactically valid patch can still modify a build script, a dependency hook, or a file outside the task's intended scope.
These commands inspect a candidate and then check applicability without applying it:
The git apply reference defines the behavior of these options. Passing the applicability check does not establish semantic correctness or grant permission to execute changed code.
After reviewing the paths and contents, apply the patch in that disposable copy using your normal review process. Inspect the resulting changes:
Do not run an arbitrary command suggested inside a model response. Run the project's known verification command only after inspecting the changed files and considering what that command executes. This matters especially when the candidate modifies package scripts or test configuration.
The Codex staged JSON review article provides a related review pattern. The comparison here stays focused on the model-generated patch and its preservation of repository invariants.
Gate five: score the failure category, not the personality
For each candidate, record whether it applies cleanly, changes only allowed files, preserves required text properties, and satisfies the behavioral test. Record the first failed gate and any additional failures discovered during review.
A patch that changes the right constant but rewrites unrelated comments is different from a patch that does not apply. A patch that passes a test by deleting the assertion is different from a correct implementation. A single overall pass rate can hide those distinctions.
Use a small scorecard with categorical results rather than subjective labels such as “more careful.” Reviewers should be able to point to the changed line, violated constraint, or failed test.
Repeat the evaluation across representative files. Include an ordinary UTF-8 file, a file with non-English content, and a file whose repository attributes matter. Avoid constructing only artificial traps that have no connection to your actual codebase.
Blind the candidate labels during review where practical. Keep the route and model identifiers in the experiment ledger, but do not show them to the reviewer until judgments are recorded. This reduces the chance that a preferred model receives a more generous interpretation.
Preserve a review bundle for each candidate
Keep the original source digest, exact task instruction, completed model output, extracted patch, and final diff together. Add the model route, request identifier when available, client version, and reviewer decision. This bundle lets you distinguish generation defects from transformations introduced after the response arrived.
Do not overwrite the original candidate when repairing it manually. Save the repaired version separately and record the repair category. Otherwise, a later reviewer may see the corrected patch and conclude that the model passed without assistance.
Measure review scope as well as file count. One modified file can still contain hundreds of unrelated edits. Conversely, a legitimate interface change may require two tightly related files. The appropriate scope is the task's declared contract, not an arbitrary universal limit.
For generated or vendored files, define whether the model may edit them directly. Many repositories expect changes to a source template followed by a known generation step. A model that edits only the generated output may appear correct until the next regeneration removes its change. Include that rule in the fixture when it reflects your real workflow.
Finally, preserve failures that reveal weaknesses in the evaluation itself. If the test passes after the target behavior is removed, improve the test before ranking the candidates. A model comparison cannot compensate for an acceptance gate that rewards the wrong outcome. That repair is part of building a useful fixture, not an inconvenient result to omit from the report.
What a failed gate should change
If both routes fail on patch application, investigate the requested output format and source revision. If only the saved artifact has broken newlines, investigate the client. If the patch applies but expands scope, tighten the task and enforce allowed paths.
If the patch stays within scope but fails behavior, inspect the reasoning task itself. The model may need a more relevant test, additional code context, or a different model choice. Do not use a formatting workaround to conceal a semantic failure.
A reviewable result can still be slower or more expensive. Record attempts and review effort separately, using the same acceptance gates. A smaller diff is useful when it reduces review work while preserving correctness; it is not automatically better if it omits necessary changes.
For a gateway evaluation, register a 4SAPI test account, confirm the required Fable and Astra routes, and run the same fixture with separate recorded configurations. The API gateway guide explains the integration layer, while the Responses tool-call guide addresses protocol compatibility where applicable.
Your conclusion should name the tested repository task and configurations. “This route passed our patch-preservation fixture” is useful evidence. “This model always writes better code” is not supported by that experiment.




