fix(when): stop rejecting weekday names like "monday"#103
Merged
Conversation
`--when monday` was rejected with "did you mean today?" because
levenshtein("monday","today") == 2, inside the typo-detection
threshold. Weekday names are valid natural-language values that
Things accepts verbatim (and SKILL.md already documents them).
Allowlist weekday names and their abbreviations so they bypass the
keyword typo detector before nearKeyword runs.
Owner
Author
Manual verification against live Things3Built the branch and created test tasks for every allowlisted weekday form, then read back the
All resolved to a correctly scheduled date ( |
ryanlewis
added a commit
that referenced
this pull request
Jun 13, 2026
Release notes header for **v0.4.2**, required at the tagged commit by `.goreleaser.yaml` (`readFile`). v0.4.2 is a patch release shipping the `--when` weekday fix from #103: `things add --when monday` was wrongly rejected as a typo of `today` (Levenshtein distance 2). Weekday names and abbreviations now pass through to Things, verified against Things3. Merge → then tag `v0.4.2`.
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.
The bug
--when mondaywas rejected client-side with "did you mean today?". The--whenhandler runs a typo detector that flags any input within Levenshtein distance 2 of a keyword — andlevenshtein("monday", "today") == 2, somondaywas swallowed as a "typo" oftoday.mondayis the only weekday that collides (the rest are distance ≥3 from every keyword), which is why it slipped through. It also directly contradictsSKILL.md, which advertises:The fix
Add a weekday allowlist (
monday…sundayplusmon/tue/wed/… abbreviations) checked before the typo detector inNormalizeWhen. Weekday names are valid natural-language values Things accepts verbatim, so they pass through with original casing.internal/things/dates.go—weekdayWordsallowlist +isWeekdayWordguardinternal/things/dates_test.go— cases formonday,Monday,tuesday,sunday,monVerification
gofmtcleango test -race ./internal/things/— 76 passedgo build ./cmd/things— OKgolangci-lint run— no issuestommorrow,evning, …) — existing test unchanged and passing