Repository navigation
cairn get: lead redirected output with a NOTE line - #133
Merged
Merged
Conversation
added 5 commits
August 20, 2026 07:55
… at read time (refs crn-evw98.3)
…read time (refs crn-evw98.3)
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.
cairn get plain-text redirect NOTE-line reorder (crn-evw98.3 feature, review round 2 fix). See release-gates/crn-6b1g8-gate.md for full criteria evidence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
cairn geton a corrected/redirected entry now leads its plain-text outputwith a
NOTE:line naming both the originally-requested id and the idactually serving the content, before the
id: titleline:Previously the redirect was only surfaced via a separate
redirected_from:line printed after the id:title line — easy to miss when scanning output.
An uncorrected entry is unaffected: no
NOTE:line, straight toid: titleas before. The
--jsonoutput (redirectedFromfield) is unchanged.Why
When a lookup silently substitutes a different entry's content, that should
be the first thing a reader sees, not a trailing annotation.
Testing
go test ./... -race -count=1: full suite green.expected line order.