Add expect(transcript).toContainText() for deterministic transcript assertions#172
Merged
Conversation
gaojude
marked this pull request as ready for review
July 17, 2026 00:48
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.
Asserting the agent never said or reached for something currently needs either a judge run (wasteful, and
.not.toSatisfyCriterionwould invert the judge's fail-closed default into fail-open) or a manualreadFileSync(transcriptPath()). This adds a deterministic, judge-free matcher on thetranscriptsentinel:Misuse (wrong subject, empty needle) and a missing or empty transcript throw instead of returning
pass: false, because a returned failure inverts into a silent pass under.not, and an uncaptured transcript is an infra failure rather than evidence of absence. A.notviolation cites where the needle appears:[transcript] expected NOT to contain "getServerSideProps", but found it at char 34: …context…. The transcript is the agent's native format (claude-codewrites raw session JSONL), so quotes and newlines appear JSON-escaped there; the README says to stick to identifier-like needles.