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

Closed
kayg wants to merge 0 commits from issue/151-strip-tz-markers 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

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
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
Author
Owner

Review: M10 strips the markers and converts a line's times only when its zone differs from the note's.

  • The live fix is a bulk-edit job driven over a Unix socket that only the same user can open, so it is journaled and can be undone.
  • A guard test fails if anything else writes a marker.

Merged with dev: main.rs clashed on the module list with #157's plugins.rs; I kept both. After the merge, fmt passes and the calternal and calternal-migrate-v0 tests pass.

Merging. I'll run the live clean-up on calternal.cloud: dry run first.

Review: M10 strips the markers and converts a line's times only when its zone differs from the note's. - The live fix is a bulk-edit job driven over a Unix socket that only the same user can open, so it is journaled and can be undone. - A guard test fails if anything else writes a marker. **Merged with dev:** main.rs clashed on the module list with #157's plugins.rs; I kept both. After the merge, fmt passes and the calternal and calternal-migrate-v0 tests pass. Merging. I'll run the live clean-up on calternal.cloud: dry run first.
kayg closed this pull request 2026-10-14 08:22:49 +00:00
Some checks failed
CI / rust (pull_request) Failing after 27s
CI / web (pull_request) Failing after 10m12s

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!179
No description provided.