Repository navigation
Commit 5474090
authored
test: accept any first city in the Vertex K5 interpreter anomaly (#527)
## What
The Vertex K5 interpreter-anomaly check in
`src/__tests__/drift/vertex-misbehavior.drift.ts` matched 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_interpreter` call 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
- New: Paris variants (stream and object) are accepted on the native leg
and rejected on the modeled leg.
- Removed: the "unobserved first city is rejected" mutant. That behavior
is intentionally gone.
- New mutants that must fail: empty city (`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.
- Regex mutation check: using `\S` for the required character (it can
match the closing quote), removing either anchor, or making the city
optional each fails at least one test. Removing `origin === "native"`
fails 7 modeled-leg tests.
- Replay of all 161 live captures through the classifier: same verdict
for every capture before and after the regex change, 0 rejected, 63
interpreter anomalies.
## Local red/green
RED (Tokyo/London list, Paris variants):
```
AssertionError: contradictory-target: K5 tool or thought
Tests 2 failed | 2 passed | 108 skipped (112)
```
RED for the tightening (prefix-only check, new negative tests):
```
Tests 4 failed | 108 passed | 4 skipped (116)
```
GREEN (final, full drift file):
```
Tests 113 passed | 4 skipped (117)
```
## 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:
- Run 1: k5-object and k5-stream `approved-interpreter-anomaly`;
k9-object and k9-stream `visible-answer-completion`.
- Run 2: k5-object and k5-stream `approved-interpreter-anomaly`;
k9-object `reasoning-only-exhaustion`, k9-stream
`visible-answer-completion`.
## Gates
`pnpm typecheck`, `pnpm lint`, `pnpm format:check`, `pnpm build` and
`pnpm test` (377 files, 14079 passed) all pass.1 file changed
Lines changed: 75 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
246 | 247 | | |
247 | 248 | | |
248 | 249 | | |
249 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
250 | 255 | | |
251 | 256 | | |
252 | 257 | | |
| |||
530 | 535 | | |
531 | 536 | | |
532 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
533 | 544 | | |
534 | 545 | | |
535 | 546 | | |
| |||
555 | 566 | | |
556 | 567 | | |
557 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
558 | 592 | | |
559 | 593 | | |
560 | 594 | | |
| |||
608 | 642 | | |
609 | 643 | | |
610 | 644 | | |
611 | | - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
612 | 679 | | |
613 | | - | |
| 680 | + | |
614 | 681 | | |
615 | 682 | | |
616 | 683 | | |
| |||
0 commit comments