Comments, phase 1 — storage, writer primitives, and the undo inventory

The kind: comment field table lands in IntegrityRules (the per-kind
hook's first exercise), CommentThread reads one card's thread
window-scoped (the board walk stays O(cards)), and CommentWriter gains
the five gestures: draft save, post (rename .draft to a fresh UUID,
created/modified restamped in the bracket), edit, delete into
comments/.trash/, and the purge with its crash-residue memo. Post and
delete register move-based undo steps; draft saves, edits, and the
purge deliberately register nothing (13's no-capture rule). Copy
boundaries strip comments/.trash, carry .draft verbatim, and remint
threads; comments graduates to a displacing claimed name, with .draft,
.trash, and a comment's attachments claimed one level down.
CommentPath classifies changed paths into the 06 verb family for
later announcer/composer wiring.

One stated narrowing pending a ruling (filed on the findings board):
the copy transaction's refuse-whole preflight stays cards-and-lanes —
an unstampable copied comment copies verbatim with a log line, because
comment defects never refuse.

Claude-Session: https://claude.ai/code/session_01SR4XGjmBE16ZUYWpfFHXwY
This commit is contained in:
2026-07-30 19:36:21 -04:00
parent e6dd4c0aa6
commit f68ac3668e
16 changed files with 2881 additions and 63 deletions
+17
View File
@@ -64,12 +64,17 @@ public enum HistoryPhrase {
case card
case lane
case board
/// One comment. Only `.delete` reaches it: posting has its own phrase (`comment`, below), and
/// the draft save, the inline edit and the trash purge register no step at all
/// (13-native-undo.md no byte capture in any tier, and the permanent-delete posture).
case comment
var singular: String {
switch self {
case .card: "Card"
case .lane: "Lane"
case .board: "Board"
case .comment: "Comment"
}
}
@@ -78,10 +83,22 @@ public enum HistoryPhrase {
case .card: "Cards"
case .lane: "Lanes"
case .board: "Board"
case .comment: "Comments"
}
}
}
// MARK: The comment family
/// **The post's phrase** 06-history-undo.md's path-shaped "Comment on 'card'" as a menu
/// title, which is the verb on its own.
///
/// Not `name(_:kind:count:)` with a `Verb.comment`, because the composition would read "Comment
/// Comment": here the verb already names its object, which is `Kind.board`'s count-less rule
/// arriving from the other direction. The destination clause a commit subject carries ("on 'Fix
/// login'") is dropped exactly as every other phrase drops it a menu row has to stay short.
public static let comment = "Comment"
// MARK: Composition
/// The phrase for one gesture: `"Move Card"`, `"Move 3 Cards"`, `"Restyle Board"`.