Skip to content

Fix root-token boundaries in doc citation scanning - #309

Merged
tzhouam merged 1 commit into
mainfrom
fix/doc-citation-root-boundary-20261006
Oct 5, 2026
Merged

tzhouam merged 1 commit into
mainfrom
fix/doc-citation-root-boundary-20261006

Conversation

@tzhouam

@tzhouam tzhouam commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

The doc citation scanner interprets an upstream path such as component-doc/scripts/validator.py as a repository-root citation to doc/scripts/validator.py. This produces 15 false missing-file reports for the JiuwenSwarm catalog and blocks its data-only PR.

Require a real root-token boundary before doc/, excluding preceding word, slash, backslash, dot, and hyphen characters. Bare local citations and ROOT/REPO path-segment checks retain their existing behavior.

Validation: 15 scanner regression cases pass, covering embedded upstream and URL paths, genuine missing local references, valid references, and valid/missing ROOT segments. Both whole-repository doc linters pass. A byte-identical temporary copy of the actual 173-feature catalog changes from 15 false positives to zero; adding a genuine missing root citation still fails. Catalog and checkpoint bytes remain unchanged.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T19:48:42.615768Z 01aec83 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01aec83867

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# false positives. This repo's own `docs/` directory was dissolved by the doc
# refactor, after which `doc/` is the sole owned prefix.
CITATION = re.compile(r"\b(doc/[A-Za-z0-9_][A-Za-z0-9_./-]*\.(?:md|toml|json|yaml|yml|tsv|txt|py))")
CITATION = re.compile(r"(?<![\w./\\-])(doc/[A-Za-z0-9_][A-Za-z0-9_./-]*\.(?:md|toml|json|yaml|yml|tsv|txt|py))")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep ./doc citations in the scan

When a repository-root citation is written in the common shell-style form ./doc/missing.md, the new negative lookbehind rejects it because doc/ is preceded by a dot. The scanner then reports zero citations and allows a dangling in-repository reference to pass, contrary to its stated repo-root citation contract. Exclude dots only when they belong to a preceding path component, while continuing to recognize an explicit ./doc/... prefix.

Useful? React with 👍 / 👎.

@tzhouam
tzhouam merged commit 4f84584 into main Oct 5, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant