(03bdc76) Draw a symmetric relation once, and refuse the mirror, and bump to 0.32.1
`relate` refused a relation the ticket already held but never looked at what the target held, so both ends of a `relates to` could store a line. `show` then drew the same neighbour twice under the same label, since `RelatesTo` maps to itself in `inverse_label`: one row from the stored line and one derived from the far ticket's mirror of it, indistinguishable. Live on this board, where 8556048 and 8c8a520 each stored the other. Both ends of the fix, because they do different jobs. `relation_rows` drops a derived row that reads exactly like a stored one, which repairs the boards that already hold both directions without an edit. `cmd_relate` refuses to store the mirror in the first place, reporting no change since the edge is already recorded at the far end, which stops it recurring. Neither alone closes it. The dedupe keys on the **label** and the target, not the kind and the target. Two tickets each blocking the other is two facts and the block has to say both, `blocked by` from this end and `blocks` from the other; keying on the kind would fold them into one row and lose half of what the ticket says. Only a symmetric kind can collide with its own stored line, and `RelationKind::is_symmetric` derives that from `label() == inverse_label()` rather than naming `RelatesTo`, so a kind added later answers by construction. The same gate is what keeps the refusal off a cycle: a target holding `blocked by <this>` is not a duplicate. The stored row is the survivor, not the derived one, because it is the line `relate --clear` can address. The consequence is worth knowing and is written down: with both ends holding a line, clearing one leaves the other's, which then draws as the derived row. Correct, since the far end still asserts the relation. 4179958 decided that `relates to` is symmetric and "written once, not onto both files". Nothing enforced it until now. The board's own data is left alone. 8556048 and 8c8a520 still both store the line and the block now draws it once, which is what the criterion asked for. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0f0767ac00
commit
00a64adca8
@@ -182,6 +182,10 @@ and this file is for what someone changing worklane's own code needs.
|
||||
- **`add` does not write the section.** The plan on 4179958 asked for it in the ticket writer; it is out on purpose. A `_No relations._` block in every new ticket is noise in every `show`, and the insertion path has to exist regardless for every ticket written before the section did, so leaving it out means one path that is always exercised rather than two
|
||||
- **The full uuid is stored, not the seven characters `ls` prints.** It resolves without a scan and cannot turn ambiguous as the board grows. `show` renders the short id and the target's title instead: the file is the machine's copy, the output is the reader's
|
||||
- **One direction is stored and the inverse is derived.** `blocked by` goes on the gated ticket rather than `blocks` on the blocker, because the gated ticket is the one whose move is refused and whose author knows about the dependency. `relates to` is symmetric and is written once, on whichever end the caller ran it from. `RelationIndex::inbound` finds the far end by scanning, which is what keeps `relate` a single-file write
|
||||
- **A derived row that reads exactly like a stored one is dropped, and the stored one is kept.** Both ends of a symmetric relation could hold a line, since nothing stopped it until 03bdc76, and the block then drew the same neighbour twice under the same label. The stored row survives because it is the line `relate --clear` can address; the derived one is on a file this ticket does not own
|
||||
- **The dedupe keys on the label and the target, not the kind and the target.** Two tickets each blocking the other is two facts and the block says both, `blocked by` from this end and `blocks` from the other; keying on the kind would fold them into one row and lose half of what the ticket says. Only a symmetric kind can collide with its own stored line, and `RelationKind::is_symmetric` derives that from `label() == inverse_label()` rather than naming `RelatesTo`, so a kind added later answers by construction
|
||||
- **`relate` also refuses to store the mirror, which is the other half of the same fix.** The dedupe repairs a board that already holds both directions; the refusal stops it recurring. `mirrored` in `cmd_relate` reads the target's own relations and reports no change, gated on `is_symmetric` because a target holding `blocked by <this>` is a cycle rather than a duplicate. 4179958 decided `relates to` is written once and not onto both files; for six months nothing enforced it
|
||||
- **A symmetric edge is cleared from the end that stores it.** With both ends holding a line, `--clear` on one leaves the other's, which then draws as the derived row: correct, since the far end still asserts the relation, and the reason the dedupe keeps the stored row rather than the derived one
|
||||
- **A line in the section that is not a relation is an error naming the ticket**, not a line quietly dropped. Nothing but `relate` writes there, so a bad line means a hand-edited file. The TUI is the deliberate exception: `detail_of` falls back to no block, since one corrupt ticket must not take the whole board down
|
||||
- **The block is built outside `content_trim` and passed in.** Half of it comes from other tickets and `content_trim` has only the body. It is spliced over the stored lines where the file has the section, and injected ahead of the metadata where it does not, because a ticket that is only pointed at has no section of its own and still has relations to show
|
||||
- `ensure_section` inserts against `SECTION_ORDER`, before the first following section that is actually in the file, and adds no blank line that was not already there. A handwritten `## Notes` between the plan and the metadata therefore keeps its place, and Metadata is in that list as an anchor rather than as something anything appends to
|
||||
|
||||
Reference in New Issue
Block a user