fix: preserve tested_by edges for Swift, Rust, Ruby, and PHP - #689
Merged
Merged
Conversation
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.
Summary
Extend deterministic test-file classification for Swift, Rust, Ruby, and PHP so valid LLM-emitted
tested_byedges are not misclassified as production-to-production relationships and dropped during graph merging.The change adds language-specific filename and test-directory conventions while preserving the existing JavaScript/TypeScript helper-file behavior.
Linked issue(s)
Closes #646
What changed
*Test.swift,*Tests.swift, and*Spec.swifttest_*.rsand*_test.rstest_*.rb,*_test.rb,*_spec.rb, andspec_helper.rb*Test.phptests/directories as test files.tested_byedges for these languages.tested_byedges and apply thetestedtag to production nodes.Contest.swift,contest.rs,latest.rb, andContest.phpfrom being misclassified.merge_and_normalize()path.Scope
Objective-C
.m/.mmclassification and reporting extensions without configured test patterns are outside the scope of this focused fix.This PR focuses on preserving test-coverage relationships for the ecosystems identified in #646.
How I tested this
Test environment:
Results:
merge-batch-graphs.pytest suite: 91 passedpnpm lint: passedpnpm build: passedgit diff --check: passedSkipped tests
The skipped tests cover POSIX-only filesystem behavior that cannot be reliably tested on Windows, such as case-sensitive filenames, literal backslashes, newlines, and trailing dots. None of them exercise the test-file classification or
tested_byedge-preservation logic changed by this PR; all relevant tests ran and passed.Manual Swift smoke test
Ran
merge-batch-graphs.pyagainst a temporary batch containing:Sources/App/App.swiftTests/AppTests/AppTests.swifttested_byedge from the production file to the test fileVerified that:
The
tested_byedge remained inassembled-graph.json.The edge direction remained production → test.
The production node received the
testedtag.pnpm lintpnpm --filter @understand-anything/core testpnpm testManual smoke test (described above)
pnpm buildVersioning
2.9.6to2.9.7in all six manifests listed inCLAUDE.md.