fix(cal): show resolved times in create --dry-run - #91
Merged
Merged
Conversation
The preview echoed the raw --start/--end strings back, which tells the caller nothing they did not already type. It also hid the issue #89 class of bug: a naive datetime silently landing on a different UTC offset was only observable by creating a real event and reading the receipt. Dry-run now shows what the write would actually send, in the same flat shape `_parse_event` produces, so a preview and a real receipt read alike: --start 2026-11-11T17:30:00 -> "start": "2026-11-11T17:30:00-05:00" All-day values stay bare dates — there is no offset to resolve, so don't invent one. Unparseable input is now an INVALID_INPUT error from the preview rather than surfacing only on the real call, which is the point of a preview. This is idea 031 / ADR-004 applied to `cal create`: a dry-run exists so the caller can verify what *would happen*. `_parse_time_input` becomes the module-level `parse_time_input` so the command layer can resolve a time without performing the write. It never used `self`, and being private it carried no external contract, so no shim is left behind. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Follow-up to #90, closing the gap noted there:
cal create --dry-runechoed the raw--start/--endstrings back, so the #89 offset bug could only be observed by creating a real event.The change
The preview now shows what the write would actually send, in the same flat shape
_parse_eventproduces — so a dry-run target and a real receipt read alike:The whole of #89 is now diagnosable without touching a calendar.
--start 2026-11-11previews as"2026-11-11".INVALID_INPUTfrom the preview, rather than surfacing only on the real call. A preview that accepts input the real call will reject is not much of a preview.Why this shape
Idea 031 and ADR-004 already say a dry-run exists so the caller can verify what would happen. Echoing back the string they typed does not do that. Replacing the raw value rather than adding a second field keeps the preview and the receipt directly comparable, and the input is already in the caller's own command.
Refactor
_parse_time_inputbecomes the module-levelparse_time_inputso the command layer can resolve a time without performing the write. It never usedself, and being private it carried no external contract, so no shim is left behind.Verification
879 tests pass (5 new), ruff clean. Verified against a live account with no mutations — the #89 repro, an all-day event, and unparseable input.
🤖 Generated with Claude Code