fix(cli): split link-escape from link-target for independent control - #25
Open
davidmoshal wants to merge 1 commit into
Open
fix(cli): split link-escape from link-target for independent control#25davidmoshal wants to merge 1 commit into
davidmoshal wants to merge 1 commit into
Conversation
davidmoshal
force-pushed
the
fix/validate-escapes-bundle-root
branch
from
August 4, 2026 04:28
3706033 to
e99bfd8
Compare
The "link target escapes bundle root" warning and the "does not exist" warning shared a single link-target rule, so link-target = "off" silenced both and there was no way to keep missing-link detection while suppressing the escape noise. Move the escape warning to a new link-escape rule, keeping link-target for in-bundle missing targets only. The unconfigured default is unchanged (the escape warning still appears by default); bundles can silence escape warnings alone via link-escape = "off" without losing missing-link detection. Existing link-target = "off"|"error" configs now affect only missing-target, so add a matching link-escape entry to preserve prior behavior.
davidmoshal
force-pushed
the
fix/validate-escapes-bundle-root
branch
from
August 4, 2026 04:30
e99bfd8 to
f1b54d2
Compare
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.
Fixes #24
Problem
openknowledge validate <bundle>warnslink target escapes bundle root: <href>for every local Markdown link that resolves outside the bundle. In an integrated knowledge base (Wiki/inside a repository), links from concepts to the source files they document are deliberate, so the warning fires on every run.The warning shares a single rule ID,
link-target, with the "does not exist" warning. Solink-target = "off"silences both — there is no way to keep missing-link detection while suppressing the escape noise. (One real 48-file wiki reports ~200 escape warnings and zero missing-target warnings, so the bundled rule loses nothing for it today, but would lose missing-link detection the moment a broken in-bundle link appears.)The OKF 0.1 spec does not require the escape check: section 5.2 allows standard relative paths with no in-bundle restriction, section 5.3 says an unresolved target is not malformed, and section 9 lists "Broken cross-links" among things consumers MUST NOT reject a bundle over.
Change
Splits the escape warning into its own
link-escaperule, keepinglink-targetfor in-bundle missing targets only..openknowledge.tomland no--rule, the same warnings appear with the same severity (warning) and the same message text. The only unconfigured difference is the JSONrulefield for escape issues, which changes fromlink-targettolink-escape.link-target = "off"previously silenced escape warnings too; after this change it affects only missing-target, so escape warnings reappear unlesslink-escape = "off"is also set. Likewiselink-target = "error"no longer escalates escape — addlink-escape = "error"to keep that. JSON CI consumers keying onrule: "link-target"for escape issues must update tolink-escape.link-escape = "off"in.openknowledge.toml, or--rule link-escape=off. Missing-link detection (link-target) is preserved.link-escapeis added to the rule registry, the "Link targets" check row, the command docs, and the changelog.Testing
TestValidateSeparatesEscapeAndMissingLinkRules: default emits both (link-escape+link-target);link-escape=offleaves only missing;link-target=offleaves only escape.link-targettests (broken in-bundle links, escalation, disable) unchanged and passing.go test ./packages/cli/...,gofmt,go vetclean.openknowledge validate Wikion this repository's own wiki still passes.link-escape+link-target);--rule link-escape=off-> 1 (missing);--rule link-target=off-> 1 (escape).