Repository navigation
fix(catalog): path-missing skips code spans in URL link labels (#1089) - #1092
vchamarthi merged 12 commits into
Conversation
…#1089) A code span used as the label of a link to a URL, such as [`examples/a.py`](https://...), was read as a bundled file and reported as path-missing. link_pieces now leaves such labels out of the spans; labels of local links and spans outside links are checked as before. Refs intel#1089 Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1092 +/- ##
==========================================
+ Coverage 96.07% 96.10% +0.02%
==========================================
Files 475 481 +6
Lines 62973 63839 +866
Branches 10903 11072 +169
==========================================
+ Hits 60500 61350 +850
- Misses 1525 1532 +7
- Partials 948 957 +9
🚀 New features to boost your workflow:
|
- notes.md:42 is a local file with a line, not a URL scheme - a defined [x] or [x][] inside a label counts as a link, so the label is text - a definition with trailing text is not a definition Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
Ready for re-review: 1 commit on Changes:
Checked on the new head: 3 of 3 tests fail before the fix and pass after; full suite with main merged in: 24678 passed, 1 failure that main has too. What each test shows
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved link-classification and reference-definition bugs suppress genuine missing-path warnings or retain false ones, while nested-link detection introduces quadratic processing costs.
4 open issues
What changed in this PR
4 new findings.
This PR addresses #1089 by excluding code spans in external URL link labels from catalog path checks, so upstream example names are not treated as bundled files.
Changes:
- Detects URL labels in inline and full reference links and filters their code spans.
- Adds regression cases for URL labels, local links, reference definitions, and nested links.
- Documents the behavior and adds a changelog entry.
| File | Description |
|---|---|
dokimi/tests/test_catalog_path_missing.py |
Adds regression coverage for link-label filtering. |
dokimi/dokimi/external/skill_markdown.py |
Detects external link labels and excludes their code spans. |
dokimi/docs/external-content.md |
Documents the URL-label exception to path checks. |
dokimi/changelog.d/20261121_120000_path-missing-url-label.md |
Records the catalog warning fix. |
Review effort: Balanced
|
OpenCodeReview: Commit 2a902a5 was not reviewed. This PR has reached its review limit (6 reviews). CI at `2a902a5`: 5 still running, 16 passing, 3 skipped
To review this commit: re-request review from exai-bot in the Reviewers list. Last review (2296544): 1 mediumOpen threads from the bot: 0 |
- A destination is a URL by the rule `_file_ref` uses (`is_uri`), so `notes.md:main` stays a local file and `x:example` is a URI. - A definition counts only at the start of a block, and a title that never closes makes it no definition. A thematic break between blocks does not hide the definition after it. - A defined shortcut after an undefined full reference is a link. - Link-shaped text in a destination or title is literal, and an escaped `!` is no image marker. - Nesting and label lookups use one bracket pass and bisect, not a scan of every link per label. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
Ready for re-review: 1 commit on Changes:
Threads and comments:
Checked on the new head:
What each test shows
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: LOCAL (head f7f7eb1)
- Contract: none
- Responsibility: none
- Dependency: none
- Review depth: skim: local change, check diff + tests
- Coverage gaps: none
A valid nested link with an empty destination can hide a missing script. I also reproduced the three existing findings for malformed reference syntax and escaped labels.
Ran 148 catalog path tests. Compared the new empty-destination case on both trees and checked its link structure with the CommonMark parser.
…1089) - A reference definition whose bare destination has unbalanced parentheses defines nothing. - A defined shortcut after an invalid inline destination is a link. - An escaped bracket in a reference label no longer reads as a space, so [g\]] is not [g]. - An empty inline destination, [notes](), counts as a link for nesting. - A definition's destination, not its label, gets its escaped brackets back, so [g]: references/a\[b\].md names the file that exists and [g\]]: references/missing.md keeps its target. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
Ready for re-review, @napetrov: 1 commit on Changes:
Threads and comments:
Checked on the new head:
What each test shows
|
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…el#1089) Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
intel#1089) Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟢 LGTM · checked 406961b · nothing required from @vchamarthi
🔀 Merge: safe now · merges cleanly into current main, 34 commits behind, its tests pass on the merge · after it, #1118 needs a rebase (external/skill_markdown.py)
✅ make ci-local --offline: 24,490 passed · schema_compat fails from the base (novelty, repo_event), not from this PR · ✅ both new tests fail at a12ffab · ✅ "---\n[x\n" * 8000: 0.06 s, was 0.98 s
Inline and full-reference URL labels are skipped, and every earlier bot and reviewer case keeps its test.
Fixed in this branch, up to 406961b:
- Unclosed labels after
---were parsed in quadratic time: d901862 caps a definition label at 999 characters, as CommonMark does. - Labels that are only code spans shared one key: bdf1a19 reads reference keys from the paragraph as written.
- The docs promised every link to a URL: 2a35120 names the inline and full-reference forms; shortcut and collapsed ones are still checked.
napetrov
left a comment
There was a problem hiding this comment.
Change class: LOCAL (head 406961b)
- Contract: none
- Responsibility: none
- Dependency: none
- Review depth: skim: local change, check diff + tests
- Coverage gaps: none
The empty inner link now prevents an enclosing URL from hiding a missing script. Checked the prior malformed-destination, shortcut-fallback and escaped-label cases in the implementation and focused path tests. Complexity checks were reviewed statically.
Coverage: 59 passed, 102 deselected in 1.07s. CI reported no failing or pending jobs on 406961be7.
The reviewed change passes its focused checks. This branch conflicts with current main in dokimi/dokimi/external/skill_markdown.py. Please resolve the conflict so the combined change can be reviewed.
Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
_bracket_pairs walked every character of a paragraph in Python, so link_pieces grew faster than the code span scan on texts of long runs (test_runs_with_no_closer_are_read_in_linear_time[skill_markdown-*]). It now visits only the brackets. Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
|
🟢 Ready for re-review · 2 commits on Next: @napetrov, @vlad-perevezentsev: re-review the new head. Changes
Verified on the new head: ✅ 1/1 tests fail before the fix, pass after · ✅ full suite with main merged in: 30801 passed · ✅ second reader: nothing raised · What each test shows
|
…does (intel#1089) A reference label with an unescaped bracket or only spaces, and a definition title with an escaped delimiter, were misread as URL links or definitions. A thematic break now ends the paragraph, so a label cannot close across it. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
Ready for re-review: 1 commit on Threads and comments:
Checked on the new head: 2 of 2 tests fail before the fix and pass after; full suite with main merged in: 31407 passed, 1 failure that main has too. What each test shows
|
…intel#1089) A '[ ]: url' line was skipped as a rejected definition but the scan went on as at a block start, so a following '[g]: url' registered and hid a missing script in '[`scripts/deploy.sh`][g]'. Take the ordinary-line branch. Tests also pin the line-suffix, nested shortcut and trailing-text inputs. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
Ready for re-review: 1 commit on Changes:
Threads and comments:
Checked on the new head: 1 of 1 tests fail before the fix and pass after; full suite with main merged in: 31511 passed, 1 failure that main has too. What each test shows
|

Summary
path-missingwas reported for[examples/a.py](https://...): the label is the link's text, not a bundled file.link_piecesnow skips code spans in the label of a link whose destination has a URL scheme. Refs #1089.Changes
_external_labelsinskill_markdown.pyfinds the labels of inline links, and of full reference links whose definition is a URL, with a URL destination. A label that holds another link is not one.link_piecesleaves code spans inside them out ofspans.tests/test_catalog_path_missing.pyand a changelog fragment.docs/external-content.mdsays a code span in a URL link label is not checked.Risk
Only code spans in labels of URL links change. Labels of local links and spans outside links are checked as before.
path-escapes-skillreads the same spans and gets the same change.Testing
python -m pytest -q -p no:cacheprovider tests/test_catalog_path_missing.py tests/test_growth_ratchet.py tests/test_catalog_bundle_unreferenced.py tests/test_catalog_validate.py: 354 passed.python -m ruff checkon the two changed.pyfiles: passed. Cases cover inline and reference URL labels, a label holding a link, and local links, which are still reported.Open questions
link_piecesover Filtering inpath_missing:docs/external-content.mdsays a link is judged by its destination; one place fixes every span-based check. Is that the behaviour you want?[a][ref]whose definition is a URL over Also collapsed[a][]and shortcut[a]: Their key is the label text, blanked when it holds a code span; smallest change. Is that the behaviour you want?Revert
Plain revert of the commit. Nothing is stored.
Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)Checklist evidence
pytestpasses: 1 test file(s) changed; suite: 24535 passed; 1 failing test(s) fail on the base branch too: tests/test_repo_compare_interval.py::test_the_row_p_places_zero_where_large_deltas_round_p_at_zero_apart; 1 of 1 proof(s) fail before the changeruff,mypy, and schema checks pass: passed: ci.yml:static / ruff check, ci.yml:typecheck / mypy, ci.yml:static / schema-check, ci.yml:static / schema_compat vs the PR basedokimi/docs/external-content.mdAGENTS.md: nothing left open; mutation of changed lines ranraise/exit and test names the doc, contract or issue it traces to: every new error path and test names a doc, contract or issue.github/.licenserc.yaml): no new source fileRefs #1089.