fix: bracketed link labels drop the edge; add released_in (#48, #49) - #50
Merged
Conversation
LINK_RE used [^]]+ for the label, which stops at the first ], so a bracketed
label matched nothing:
[[AREA NAME]](/requirements/area-name.md) -> no match
That produces a MISSING edge, not a broken one, and validate only reports
broken edges. The orphan check needs a concept to have neither inbound nor
outbound links, so anything carrying one outbound link silently lost its
catalog backlink with zero diagnostics. Bracketed titles are routine in
exported wiki content and the capture plugins interpolate titles unescaped.
The new label alternation keeps [^]] -- the entirety of the old language --
and adds balanced [...] pairs, tried first. Keeping the old branch is what
makes this a superset. Two earlier attempts regressed: an escape-aware branch
swallowed labels ending in a backslash ([a\](/c.md)), and * instead of +
started matching the empty label.
Measured: 0 losses over 20k generated links covering trailing backslashes,
embedded ] and multi-bracket labels; identical edge sets on sample-okf; empty
label still unmatched; "[" * 200 returns in under a millisecond.
Tests fail on the old regex (27/28) and pass on the new one.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011XXDjM9WnCtsdRTU441WUu
A bundle that models releases emitted one info line per edge:
info: non-standard rel 'released_in' (allowed but uncommon)
That is one per shipped work item. The relation already worked -- the guard at
extract_frontmatter_links passes unknown non-empty rels through unchanged -- so
only the vocabulary was missing. The cost was noise, and noise is what makes
piping validate through a severity filter a habit.
This repo already models a release axis on the worklog side: milestone is a
core work-item field (bin/item_fields.py) and bin/ia_graph.py turns it into
edge(key, "targets", "release/" + milestone). So "which release did this ship
in" is already first-class here; bundles just had no way to say it. Whether
the two should be unified under one name is a design question I have not
assumed an answer to.
The rel list is duplicated in three prose files, so typed-edges.md, SKILL.md
and graph-engineer.md are updated together and the new test pins them to the
frozenset so they cannot drift apart.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011XXDjM9WnCtsdRTU441WUu
Bumps the four manifests the consistency test guards, plus the README version row and a release bullet. .grok-plugin/marketplace.json carries the version twice -- once at the top level, once in the plugin entry -- and the test only checks the entry, so the top-level one is easy to leave stale. 29/29 tests pass; validate sample-okf --strict is clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011XXDjM9WnCtsdRTU441WUu
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.
Two independent fixes, one commit each, plus the release bump.
fix: match link labels containing bracketsLINK_REaccepts balanced brackets. One regex, one call site.feat: add released_in to KNOWN_RELSchore: release 0.4.0Why #48 is worth reading first
LINK_RE's label class was[^\]]+, which stops at the first]. So abracketed label matched nothing:
The important part is what that does downstream. It produces a missing edge,
not a broken one — and
validatereportsbroken linkonly for edges thatexist. The
orphancheck needs a concept to have neither inbound noroutbound links, so any concept carrying one outbound link loses its catalog
backlink with zero diagnostics. I built that bundle to check:
validatereturned 0 issues and
backlinksreturned[].The concept itself is never lost —
load_bundleglobs every file, so it staysqueryable by path. Only the inbound edge goes.
This matters because the capture plugins interpolate concept titles into catalog
links unescaped, and bracketed titles are ordinary in exported wiki content
(
[AREA]prefixes,[DEPRECATED]suffixes). Companion issues cover thatproducer side; this is the reader half, and it is the half that also repairs
bundles already on disk.
The regex, and two ways I got it wrong first
The label alternation keeps
[^\]]— the entirety of the old language — andadds balanced pairs, tried first. Keeping the old branch is what makes it a
superset. Two earlier drafts regressed:
\\.) swallowed the closing bracket on a label endingin a backslash, so
[a\](/c.md)stopped matching.*instead of+started matching[](/x.md), an empty label the old patternrejects — which would have added edges to existing bundles.
Measured, rather than asserted:
\, embedded], multi-bracket labels)sample-okfedge sets, old vs new[](/x.md)"[" * 200test_link_re_is_a_superset_of_the_plain_formpins both regressions so theycannot come back.
#49
released_inalways worked — the guard passes unknown non-empty rels throughunchanged. Only the vocabulary was missing, so a bundle modelling releases got
one
infoline per shipped work item.Worth noting this repo already has a release axis on the worklog side:
milestoneis a core work-item field andbin/ia_graph.pyturns it intoedge(key, "targets", "release/" + milestone). Whether the two should beunified under one name is a design question I have not assumed an answer to.
The rel list is duplicated in three prose files, so those move together and the
new test pins them to the frozenset.
Verification
Both new tests fail on the old regex (27/28) and pass on the new one.
Closes #48
Closes #49