Skip to content

cairn get: follow explicit corrections across topics - #129

Closed
quad341 wants to merge 5 commits into
mainfrom
deploy/crn-v6jix-gate
Closed

quad341 wants to merge 5 commits into
mainfrom
deploy/crn-v6jix-gate

Conversation

@quad341

@quad341 quad341 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Adds an explicit `Corrects` link on entries (set via `--corrects` on remember), followed at read time regardless of topic. Looking up an entry that has since been corrected now redirects to the correction and prints a leading note naming both the original and the corrector, instead of silently serving stale content.

Previously, corrections only linked entries within the same topic (an inferred match). This adds an author-declared link that crosses topics, matching how a single-topic lookup already prefers the more specific/current entry.

cairn-reviewer-scratch added 5 commits August 19, 2026 19:18
golangci-lint flags return nil, nil as ambiguous; the codebase already
has a precedented idiom for this exact "no match" contract (recurrenceMatch
in cmd/remember.go), so apply the same nolint:nilnil annotation rather than
inventing a sentinel error.

crn-evw98.3
Review round 1 (crn-0mdsv) flagged spec criterion 5 as unmet: getCmd's
plain-text output printed the corrector's "id: title" line first, then
a separate "redirected_from: <id>" line second -- never leading, never
combining both ids on one line, no NOTE phrasing.

Reorder/reword the two Printf calls so the NOTE line (when a redirect
occurred) prints before the id:title line and names both the
originally-requested id and the serving id in one line:
  NOTE: <original-id> redirected to <corrector-id>

Update the two plain-text redirect tests to pin the new contract:
TestGetRedirectsToCorrectionWhenOriginalIsRequested now asserts the
leading line is exactly the NOTE line (order-sensitive, previously
only an order-insensitive substring check that would not have caught
this gap); TestGetDoesNotRedirectWhenNoCorrectionExists now asserts
the absence of "NOTE:" rather than the no-longer-emitted
"redirected_from" string.

--json output (EntryResult.RedirectedFrom) is unchanged -- already
correct per round 1's review.
Cross-topic-key Corrects/Supersedes link, consulted at read time.
@quad341

quad341 commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #133 (crn-6b1g8), which merged the rebased + criterion-5-fixed redo of this feature (commit 161eaa9 -> squash-merged as 14eb15c). This PR was blocked on a genuine criterion-6 merge conflict (crn-v6jix) and was correctly never merged. Closing per mayor's standing authorization recorded on crn-v6jix's notes (2026-08-20).

@quad341 quad341 closed this Aug 20, 2026
@quad341
quad341 deleted the deploy/crn-v6jix-gate branch August 20, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant