You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(specs,plans): amend #230 — drop 2-letter aliases entirely, week-fix only
3-letter English abbreviations are the supported standard. 2-letter aliases
removed from scope due to collision risk with common English words.
#230
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both bugs are addressed in the #177 tokenizer branch. Bug 1 is already resolved by the tokenizer's architecture — `recognizeWeek` uses `(?=\s|$)` as a zero-width lookahead so no character is consumed from the following text. Bug 2 requires adding `mo`, `tu`, `we`, `th` to `weekdayVocab()` (plus `fr` is already covered by the German section). `getDayOfWeekForString` in `dates.ts` already maps all five 2-letter forms correctly; only the vocab recognizer needs updating.
10
+
Bug 1 (week-text boundary) is already resolved by the #177tokenizer's architecture — `recognizeWeek` uses `(?=\s|$)` as a zero-width lookahead so no character is consumed from the following text. No code change needed; only regression tests required.
11
11
12
-
**Trade-off:**`we` and `th`are common English words; adding them as standalone weekday tokens introduces the same ambiguity class as German `di`/`do`. This is accepted per spec: the tokenizer marks them `ambiguous` (≤3 chars), which triggers the yellow border feedback in the QuickPick.
12
+
2-letter English aliases are out of scope — 3-letter forms are the supported standard.
2.**Add 2-letter English aliases to `weekdayVocab()`** — append `'mo', 'tu', 'fr'` after the 3-letter English block (`mon/tue/wed/thu/fri/sat/sun`). `we` and `th` excluded: both are high-frequency English words that would destructively consume text. `fr` already present in German section; adding it to English section makes intent explicit (same result from `getDayOfWeekForString`). Longest-first ordering preserved.
19
-
20
-
3.**Invalidate pattern cache** — `_weekdayPatterns` is built lazily from `weekdayVocab()`. Adding entries to the array changes the return value; since the cache is built per `MatchInput` instance, no reset needed.
21
-
22
-
4.**Add regression tests** to `src/test/suite/match-input-vocab.test.ts`:
18
+
2.**Add regression tests** to `src/test/suite/match-input-vocab.test.ts`:
Fix two parsing defects in `MatchInput`: (1) the week-token regex consumes the first character of the following text, and (2) 2-letter English weekday abbreviations (`mo`, `tu`, `we`, `th`, `fr`) are not recognized.
5
+
Fix one parsing defect in `MatchInput`: the week-token regex consumes the first character of the following text. 2-letter English weekday aliases are out of scope — 3-letter forms (`mon`, `tue`, `wed`, `thu`, `fri`) are the supported standard.
6
6
7
7
## Why now
8
8
9
-
Both defects break user-visible output in the current 1.1.0 milestone. The week-text bug silently corrupts task and memo content; the missing aliases were discovered in the same report.
9
+
Defect breaks user-visible output in the current 1.1.0 milestone. The week-text bug silently corrupts task and memo content (e.g. `"task week Finalize Shoppinglist"` → text becomes `"inalize Shoppinglist"`).
10
10
11
11
## In scope
12
12
13
13
- Fix `weekPattern` in `MatchInput.getExpression()` so it does not consume any character beyond the week token itself.
14
-
- Add `mo`, `tu`, `fr` to `getWeekdayPattern()` as recognized English aliases (longest-first ordering; after the 3-letter set). `we` and `th` are excluded — both are high-frequency English words that would destructively consume text (e.g. `"task we need to buy milk"` → `we` parsed as Wednesday).
15
-
- Add regression tests in `src/test/suite/input.test.ts` and/or `week-input.test.ts` covering the exact inputs from the issue report.
14
+
- Add regression tests covering the exact inputs from the issue report.
16
15
17
16
## Out of scope
18
17
18
+
- 2-letter English weekday aliases (`mo`, `tu`, `we`, `th`, `fr`) — 3-letter forms (`mon/tue/wed/thu/fri`) are the supported standard. Adding shorter forms introduces unacceptable collision risk with common English words (`we`, `th`).
19
19
- German 2-letter abbreviation conflicts (`di`, `do`, `fr`, `sa`, `so`) — tracked in #177 (parser rewrite).
20
20
- Locale-based weekday filtering — also #177.
21
-
- Any change to `getDayOfWeekForString` in `dates.ts` (already maps `mo/tu/we/th/fr` correctly).
21
+
- Any change to `getDayOfWeekForString` in `dates.ts`.
`(?:\\s\\D|$)` alternates between (whitespace + one non-digit character consumed) and end-of-string. For input `"week Finalize…"` the `\\D` captures `"F"`, leaving `"inalize…"` in the text group.
39
+
`(?:\\s\\D|$)` alternates between (whitespace + one non-digit character consumed) and end-of-string. For input `"week Finalize…"` the `\\D` captures `"F"`, leaving `"inalize…"` in the text group.
42
40
43
41
Fix: replace the consuming `\\D` with a lookahead so the non-digit character stays available for the trailing `\\s?` and `textPattern`:
`(?=\\s(?!\\d)|$)` asserts (without consuming) that the week token is followed by whitespace-then-non-digit or end-of-string, which prevents `"week15"` from matching this branch (it falls through to `weekNumPattern`).
48
46
49
-
### Bug 2 — 2-letter English aliases absent from weekday pattern
50
-
51
-
`getDayOfWeekForString` (dates.ts:86-90) already maps `mo → 1`, `tu → 2`, `we → 3`, `th → 4`, `fr → 5`. `getWeekdayPattern()` only lists 3-letter English forms (`mon`, `tue`, `wed`, `thu`, `fri`), so the 2-letter variants never reach `resolveWeekday`.
52
-
53
-
Fix: append `'mo', 'tu', 'fr'` after the 3-letter English group in the `alternatives` array (longest-first ordering preserved). `we` and `th` are excluded — `we` is a common English pronoun and would destructively consume words like "we" in `"task we need to buy milk"`; `th` appears at the start of many English words.
54
-
55
47
## Entities / interfaces
56
48
57
49
-`MatchInput.getExpression()` — `weekPattern` constant (one line change).
0 commit comments