fix(xcresult): keep objects open when a property cannot be modelled - #1162
Merged
trunk-io[bot] merged 1 commit intoAug 19, 2026
Conversation
`SortedKeyValueArrayPair` is declared by Apple as `key: String` and
`value: SchemaSerializable`. `SchemaSerializable` is never defined in the format
description, so the generator skips the property — but still emitted
`additionalProperties: false`, which typify turns into `deny_unknown_fields`. The
object then claims to hold exactly `_type` and `key` while every payload also
carries `value`, and the whole enclosing object fails to deserialize:
failed to parse json from xcresulttool output:
unknown field `value`, expected `key` or `_type`
That array holds attachment metadata, so any test summary with an attachment is
unparseable. `find_file_in_test_summary` swallows the error and returns `None`,
which means `--use-experimental-failure-summary` has silently been a no-op for
every UI test bundle: attribution falls through to the workspace document
location, the one source that points at wherever the failure surfaced. On a real
UI test bundle this is the difference between reporting a vendored page object
and reporting the test's own file.
The generator now tracks whether it had to drop a property and leaves those
objects open, inheriting the flag through sub-types. It stays off everywhere
else, because `deny_unknown_fields` is what keeps the untagged `oneOf` sub-type
unions apart — relaxing it wholesale makes `ActionTestSummaryIdentifiableObject`
resolve to the wrong variant and loses `summaryRef` entirely. Four objects
change: `SortedKeyValueArrayPair` and three `ActivityLog*Section`s.
Regenerating under a newer Xcode also picks up unrelated format drift, so only
the rule this changes is applied to the checked-in schema; a full regeneration
belongs in its own change.
`build.rs` now declares `rerun-if-changed` for the schemas. Without it an edit
appears to do nothing until something else forces the build script to rerun,
which is a confusing way to lose an afternoon.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dfrankland
force-pushed
the
claude/xcresult-schema-unmodellable-properties
branch
from
August 18, 2026 23:32
fca29c6 to
16a1392
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## claude/xcresult-attribution-fixtures #1162 +/- ##
========================================================================
+ Coverage 83.34% 83.37% +0.02%
========================================================================
Files 72 72
Lines 16180 16197 +17
========================================================================
+ Hits 13486 13504 +18
+ Misses 2694 2693 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
TylerJang27
approved these changes
Aug 19, 2026
Member
Author
|
/trunk merge |
|
😎 Stack merged successfully - details. |
|
This PR is already queued as a stacked merge. Cancel it first to re-submit. |
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.
Stack 4/4 — depends on #1160.
Apple declares
SortedKeyValueArrayPairaskey: Stringandvalue: SchemaSerializable.SchemaSerializableis never defined in the format description, so the generator skips the property — but still emittedadditionalProperties: false, which typify turns intodeny_unknown_fields. The object then claims to hold exactly_typeandkeywhile every real payload also carriesvalue:Why this matters more than it looks
That array holds attachment metadata, so any test summary with an attachment is unparseable.
find_file_in_test_summaryswallows the error and returnsNone, which means--use-experimental-failure-summaryhas silently been a no-op for every UI test bundle. Attribution falls through to the workspace document location — the one source that points at wherever the failure surfaced rather than at the test.Confirmed on a customer UI test bundle from this thread, whose single failure is a
UI test with attachments. This is the difference between:
.../Tuist/.build/checkouts/<dependency>/...The test's own frame was in the call stack the whole time; we just never got far enough to look at it.
The change
The generator tracks whether it had to drop a property and leaves those objects open, inheriting the flag through sub-types. It stays off everywhere else, because
deny_unknown_fieldsis what keeps the untaggedoneOfsub-type unions apart — I tried relaxing it wholesale first andActionTestSummaryIdentifiableObjectresolved to the wrong variant, losingsummaryRefentirely. Four objects change:SortedKeyValueArrayPairand threeActivityLog*Sections.Regenerating under a newer Xcode also picks up unrelated format drift (~21 types), so only the rule this changes is applied to the checked-in schema — a full regeneration belongs in its own change.
build.rsnow declaresrerun-if-changedfor the schemas. Without it an edit to a schema appears to do nothing until something else forces the build script to rerun.Tests
A regression test deserializes a summary carrying
SortedKeyValueArrayPair; it fails onmainwith exactly the production error and passes here. Pure JSON, no macOS required.🤖 Generated with Claude Code