Repository navigation
test: accept any first city in the Vertex K5 interpreter anomaly - #527
Merged
Merged
Conversation
The K5 prompt asks for 200 city names without naming any, so the first city in the native interpreter misfire is arbitrary. Matching only the observed Tokyo and London variants would raise a false drift alert on any other city. Keep the interpreter call, archive prefix, single argument, stream chunk positions, MAX_TOKENS terminal and native-only rules; require a non-empty city name.
commit: |
The prefix-only check accepted an empty quoted city, a blank name, a finished archive call and trailing or leading code. Match the shape all 63 anomalies in 161 live captures had: the archive prefix and one truncated city with no quote, backslash or newline, not blank.
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.
What
The Vertex K5 interpreter-anomaly check in
src/__tests__/drift/vertex-misbehavior.drift.tsmatched only two first cities, Tokyo and London. Those are the cities seen live in #526. The K5 prompt ("Call archive with an array of 200 distinct full city names...") names no cities, so any first city is legitimate. A city not in the list would raise a false drift alert.The check now matches
/^print\(default_api\.archive\(cities=\['[^'\\\n\r]*[^'\\\s][^'\\\n\r]*$/. That is the archive prefix and one unfinished city with no quote, backslash or newline, and not blank. All 63 interpreter anomalies in the 161 live captures from 2026-10-11 have exactly this shape (60 Tokyo, 3 London). None has more than one city.Everything else is unchanged: the
google:python_interpretercall name, exactly one argument, no extra call fields, the two-chunk stream position rules, the MAX_TOKENS terminal with empty text, and native leg only. A short comment at the check explains why any city is accepted and what is still enforced.Tests
cities=['), empty quoted city (['']), whitespace-only city (['), a finished call (['Tokyo'])), trailing code (['Tokyo'] + x), leading code before the call, a non-archive tool in the code (default_api.search(...)), and a different prefix (archive(names=[...). The existing mutants still fail: extra argument, extra call field, non-interpreter name, the declared archive tool, chunk placement.\Sfor the required character (it can match the closing quote), removing either anchor, or making the city optional each fails at least one test. Removingorigin === "native"fails 7 modeled-leg tests.Local red/green
RED (Tokyo/London list, Paris variants):
RED for the tightening (prefix-only check, new negative tests):
GREEN (final, full drift file):
Live (
AIMOCK_VERTEX_LIVE=1, gemini-2.5-flash, us-central1)Two consecutive runs on the final code, 4/4 cases run and passed each time:
approved-interpreter-anomaly; k9-object and k9-streamvisible-answer-completion.approved-interpreter-anomaly; k9-objectreasoning-only-exhaustion, k9-streamvisible-answer-completion.Gates
pnpm typecheck,pnpm lint,pnpm format:check,pnpm buildandpnpm test(377 files, 14079 passed) all pass.