Repository navigation
π docs: check-docs-citations --fix re-anchors drifted citations by Go declaration - #14784
Conversation
β¦ declaration Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Looks correct to me; read the script at head ec67370 and ran it.
src/scripts/test-check-docs-citations.shpasses at head (14/14 incl. the eight new--fixcases), andpython3 src/scripts/check-docs-citations.pyon the tree still reports1281 ... verifiedβ so the refactor intoverify_citations()did not change the non-fix path.reanchor_go_citation(check-docs-citations.py:236-258) only ever acts on citations thatcitation_anchors()(:122-138) already produces, which requires a cue word after the citation β so prose with unrelated backticks stays range-only and is never rewritten. That is the right fail-closed boundary.apply_spec_rewrites(:261-276) rewrites right-to-left per line and re-checksline[s0:s1] == citation.line_specbefore touching anything, so two citations on one line can't corrupt each other.- The body's caveat is accurate: the motivating
scale-envelope.mdline anchors onlyAgeMinutes(a field, not a top-level decl), so it still reportsUNRESOLVEDβ worth a follow-up, not a blocker.
One low note, not a defect: apply_spec_rewrites reads docs with strict read_text(encoding="utf-8") while iter_citations (:171) opens them with errors="ignore"; a doc with a stray invalid byte would raise in --fix mode. The slice guard means offsets can't silently drift, so this is cosmetic.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Why
The same
RankActionableIssuescitation insrc/docs/scale-envelope.mdhas needed seven hand-typed docs PRs (#11740, #11908, #12477, #12623, #12636, #13294, #14712), each with a[shared-ci]incident.check-docs-citations.pycould already detect this drift through backticked symbol anchors, but--fixonly delegated to theapi-reference.mdroute fixer. This PR makes--fixrepair what the checker can already diagnose, following the approved Option A (amended).What
src/scripts/check-docs-citations.py --fixstill runscheck-api-reference-citations.sh --fixforapi-reference.mdfirst. It then re-anchors drifted citations by Go declaration:citation_anchors()anchor to a top-level declaration (func X(,func (recv) X(,type X,const X,var X) that appears exactly once.DRIFT(plus anUNRESOLVED β¦ (reason)line), and--fixexits non-zero:.go;--fixonly handles api-reference). When the check fails outside--fix, it now printsRun: python3 src/scripts/check-docs-citations.py --fix.src/scripts/test-check-docs-citations.shcover:.gotarget, each left untouched withDRIFT;AGENTS.mddrift guidance now says to runpython3 src/scripts/check-docs-citations.py --fixfirst and edit by hand only for what it still reports.changelog.d/added-14713.md.Note: on the motivating
scale-envelope.mdline,RankActionableIssuescomes before the citation, socitation_anchors()returns onlyAgeMinutes. That is a struct field, not a top-level declaration, so--fixfails closed there until the doc line puts the function anchor after the citation. Rewording that citation was out of scope for the decision.Needs human: workflow hint
The hive App token cannot push
.github/workflows/*. Please apply this one-line change to theCheck src/docs file:line citationsstep in.github/workflows/docs-link-check.yml:Fixes #14713 (needs-human: the CI step hint text in .github/workflows cannot be pushed by the hive App; everything else from the approved decision is in this PR)
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88