Strip v0's [tz=...] markers: migration rule and live clean-up (#151) #209

Closed
kayg wants to merge 0 commits from issue/151-tz-merge into dev
Owner

Closes #151.

Migration rule M10 (crates/migrate-v0/src/tzmarker.rs, used by transform.rs): [tz=...] markers on log lines are removed. A line whose zone differs from the note's zone has its times converted to the note's zone first. An unknown zone, a line with no times, or a conversion that would leave the day keeps the line exactly as written and is counted in the report (tz_lines_left). Code (fences, inline spans) is never touched. Idempotent.

Live clean-up (calternal fix strip-tz-markers --user NAME --data DIR [--dry-run], calternal fix undo --user NAME --job ID --data DIR): asks the running server, over a private Unix socket, to run a bulk-edit job through the notes plugin (Notes::rewrite, crates/notes/src/rewrite.rs). Journaled, merges with people typing (ADR 0020), undoable as one step, refuses to run while the startup scan is incomplete.

No new marker, ever: a test scans the repo sources and fails if anything but the rule, its tests and the clean-up spells a marker. (Nothing in the daily plugin, makenote or the web app writes one today.)

Tests: unit and migration tests for M10 ([tz=Asia/Calcutta], [tz=Europe/Berlin], unknown zone, code, idempotence), and crates/calternal/tests/fix_tz_live.rs: a real server, a websocket client typing 40 lines in the same note while the fix runs, dry run changes nothing, undo keeps the typing.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

(Replaces #179, merged with current dev. Review on #179.)

Closes #151. **Migration rule M10** (`crates/migrate-v0/src/tzmarker.rs`, used by `transform.rs`): `[tz=...]` markers on log lines are removed. A line whose zone differs from the note's zone has its times converted to the note's zone first. An unknown zone, a line with no times, or a conversion that would leave the day keeps the line exactly as written and is counted in the report (`tz_lines_left`). Code (fences, inline spans) is never touched. Idempotent. **Live clean-up** (`calternal fix strip-tz-markers --user NAME --data DIR [--dry-run]`, `calternal fix undo --user NAME --job ID --data DIR`): asks the running server, over a private Unix socket, to run a bulk-edit job through the notes plugin (`Notes::rewrite`, `crates/notes/src/rewrite.rs`). Journaled, merges with people typing (ADR 0020), undoable as one step, refuses to run while the startup scan is incomplete. **No new marker, ever:** a test scans the repo sources and fails if anything but the rule, its tests and the clean-up spells a marker. (Nothing in the daily plugin, makenote or the web app writes one today.) Tests: unit and migration tests for M10 (`[tz=Asia/Calcutta]`, `[tz=Europe/Berlin]`, unknown zone, code, idempotence), and `crates/calternal/tests/fix_tz_live.rs`: a real server, a websocket client typing 40 lines in the same note while the fix runs, dry run changes nothing, undo keeps the typing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T (Replaces #179, merged with current dev. Review on #179.)
Strip v0's [tz=…] markers: migration rule M10 and a live clean-up command (#151)
Some checks failed
CI / rust (pull_request) Failing after 27s
CI / web (pull_request) Failing after 10m12s
5446b65056
Migration: [tz=…] markers on log lines go; times in another zone are
converted to the note's zone, or the line is kept and reported when the
zone is unknown or the time would leave the day.

Live Home: calternal fix strip-tz-markers [--dry-run] and fix undo ask
the running server over a private Unix socket to run a bulk-edit job
through the notes plugin (journaled, undoable, merges with typing).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Merge remote-tracking branch 'origin/dev' into issue/151-strip-tz-markers
Some checks failed
CI / rust (pull_request) Successful in 2m14s
CI / web (pull_request) Failing after 7m28s
036c87e26c
# Conflicts:
#	crates/calternal/src/main.rs
Author
Owner

Closing: this branch is already fully contained in dev (it landed through a merge train). Branch cleanup, 2026-10-15.

Closing: this branch is already fully contained in `dev` (it landed through a merge train). Branch cleanup, 2026-10-15.
kayg closed this pull request 2026-10-15 08:34:47 +00:00
Some checks failed
CI / rust (pull_request) Successful in 2m14s
CI / web (pull_request) Failing after 7m28s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!209
No description provided.