Commit 542cc19
napkin-math(compress): preserve acronym casing in the deterministic if/then rewrite
Review feedback on PR #750 (third round): the rewrite naively lowercased the first character of the subject and consequence, which damages acronyms — 'API job queue latency exceeds 100ms, ...' was being rewritten to 'If aPI job queue latency...' which is visibly broken.
Fix: only lowercase the first character when it is followed by a lowercase letter (a regular capitalised word like 'Middleware'). Acronyms like 'API' / 'OPC UA' / digit prefixes like '5G' all have a non-lowercase second character, so they are left unchanged.
Two new regression tests: (1) 'API job queue latency exceeds 100ms, ...' rewrites to 'If API job queue latency exceeds 100ms, then ...' with the acronym intact, (2) 'Middleware development bid exceeds $75,000, ...' still rewrites to 'If middleware development bid exceeds $75,000, then ...' (regular capitalisation still adjusted).
44 unit tests pass (42 prior + 2 new).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b495818 commit 542cc19
2 files changed
Lines changed: 57 additions & 6 deletions
File tree
- worker_plan/worker_plan_internal/parameter_extraction
- tests
Lines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1108 | 1123 | | |
1109 | 1124 | | |
1110 | 1125 | | |
| |||
1126 | 1141 | | |
1127 | 1142 | | |
1128 | 1143 | | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1129 | 1150 | | |
1130 | 1151 | | |
1131 | 1152 | | |
| |||
1140 | 1161 | | |
1141 | 1162 | | |
1142 | 1163 | | |
1143 | | - | |
| 1164 | + | |
1144 | 1165 | | |
1145 | 1166 | | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
| 1167 | + | |
1151 | 1168 | | |
1152 | 1169 | | |
1153 | 1170 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
665 | 699 | | |
666 | 700 | | |
667 | 701 | | |
| |||
0 commit comments