Fix false local references from slash-separated prose - #451
Conversation
Signed-off-by: Tomas <tomas.bitvinskas@copla.com>
|
End-to-end follow-up:
This confirms the parser change at the installed consumer boundary. |
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
The prose false positives are removed, but the new explicit-path branch also drops valid root-level extensionless references such as ./guide. Please retain that existing behavior and add the missing boundary regression. All required checks are green.
|
|
||
| _PLAIN_RELATIVE_PATH = re.compile( | ||
| r"(?<![\w:/.-])((?:\./)?(?:[A-Za-z0-9_.-]+/)+[A-Za-z0-9_.-]+(?:\.[A-Za-z0-9]{1,12})?)(?![\w/.-])" | ||
| r"(?<![\w:/.-])((?:\./(?:[A-Za-z0-9_.-]+/)+[A-Za-z0-9_.-]+|" |
There was a problem hiding this comment.
[P2] Preserve root-level extensionless ./ references. This branch requires at least one additional directory component after the ./ prefix, so ./guide no longer matches even though an explicit ./ is the syntax signal promised by the issue/PR (and the old regex did match it). Allow zero or more directory segments after ./ and add ./guide to the regression matrix.
Summary
reads/writesduring plain-text reference extraction../references/guide.references/guide.mdand existing Markdown destinations.Fixes #450.
Root cause
The plain relative-path pattern accepted a multi-segment token when both the explicit
./prefix and final file extension were absent. The resolver therefore could not distinguish ordinary prose from an extensionless local path.The patch requires one explicit path signal for unquoted plain-text references: an explicit
./prefix or a final extension.Verification
tests/nodes/test_security_remediation.py: 70 passed.ruff check: passed.ruff format --check: passed.git diff --check: passed.n8n-post-change-runtime-proofcompleted with 100% coverage, zero unresolved references, andanalysis_completeness.is_complete: true.Tradeoff
An unquoted extensionless token such as
references/guideis ambiguous with prose. Authors must use./references/guide, Markdown link syntax, or an extension-bearing path.AI assistance disclosure
Codex inspected the reference resolver, reproduced the defect, drafted the implementation and tests, and ran the verification commands. I reviewed the root cause, diff, behavior, tradeoff, and final pull-request text.