Commit 9521b68
napkin-math(compress): tighten token-overlap fallback to require every quote token (was 90%)
Code review on PR #744 noted the 90% threshold lets a long quote pass with one substituted content word (13/14 overlap), so 'highest'/'lowest' inversions in a long quote could verify even though they invert meaning. Tighten to require all quote tokens to appear in the source — the digit-bearing anchor is subsumed by the all-tokens rule, so it is removed.
Empirically (1366 scored candidates across 6 plans, 8 compress runs): 0 items lose qv=True under the tightening. The 90% rule was never functionally looser than the 100% rule on observed data; the LLM's paraphrases are either full token-overlap (reordering/elision) or hit the substring fast path. Tightening removes the theoretical false-positive surface at no empirical cost.
Adds a long-quote substitution test (14 tokens with one 'highest'/'lowest' swap) to lock the new bound in.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4242687 commit 9521b68
2 files changed
Lines changed: 35 additions & 17 deletions
File tree
- worker_plan/worker_plan_internal/parameter_extraction
- tests
Lines changed: 8 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
923 | | - | |
924 | 923 | | |
925 | 924 | | |
926 | 925 | | |
| |||
929 | 928 | | |
930 | 929 | | |
931 | 930 | | |
932 | | - | |
933 | | - | |
| 931 | + | |
934 | 932 | | |
935 | 933 | | |
936 | 934 | | |
| |||
940 | 938 | | |
941 | 939 | | |
942 | 940 | | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
949 | 947 | | |
950 | 948 | | |
951 | 949 | | |
| |||
959 | 957 | | |
960 | 958 | | |
961 | 959 | | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
| 960 | + | |
967 | 961 | | |
968 | 962 | | |
969 | 963 | | |
| |||
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
514 | | - | |
515 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
527 | 551 | | |
528 | 552 | | |
529 | 553 | | |
| |||
0 commit comments