From 65c5f558c0bec1c25190b6540284c3b37e18a64c Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:39:21 -0700 Subject: [PATCH 1/3] Fail hosted quote audit when GitHub sources stay unchecked --- tools/check_doc_quotes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/check_doc_quotes.py b/tools/check_doc_quotes.py index 1e25a80ba..635505b48 100644 --- a/tools/check_doc_quotes.py +++ b/tools/check_doc_quotes.py @@ -187,14 +187,18 @@ def main(argv=None): parser.add_argument('documents', nargs='+') parser.add_argument('--root', default=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) parser.add_argument('--github', action='store_true', help='also check GitHub review/comment links (GITHUB_TOKEN)') + parser.add_argument('--require-online', action='store_true', help='fail if any linked GitHub/HTTP source is left unchecked offline') args = parser.parse_args(argv) token = os.environ.get('GITHUB_TOKEN') - report = {'root': os.path.realpath(args.root), 'github': args.github, 'documents': {}, 'passed': True} + report = {'root': os.path.realpath(args.root), 'github': args.github, 'require_online': args.require_online, 'documents': {}, 'passed': True} for doc in args.documents: result = check_document(doc, args.root, args.github, token) report['documents'][doc] = result if result['failures']: report['passed'] = False + if args.require_online and result['unchecked_offline']: + result['failures'].append(['unchecked-offline-required', '', str(result['unchecked_offline'])]) + report['passed'] = False print(json.dumps(report, indent=2, sort_keys=True)) return 0 if report['passed'] else 1 From 2cd223013d540aae8bd3c7d4010bda1ad4edf0d3 Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:39:23 -0700 Subject: [PATCH 2/3] Test required online quote verification --- tests/test_navigation_quotes.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test_navigation_quotes.py b/tests/test_navigation_quotes.py index 9063797e3..03f6fd8f4 100644 --- a/tests/test_navigation_quotes.py +++ b/tests/test_navigation_quotes.py @@ -89,6 +89,25 @@ def test_github_link_is_unchecked_offline_not_failed(self): self.assertEqual(report['failures'], []) self.assertEqual((report['checked'], report['unchecked_offline']), (0, 1)) + + def test_require_online_rejects_unchecked_github_link(self): + doc = self.root / 'docs' / 'nested' / 'a.md' + doc.write_text(HEADER + '| #1 | [c](https://github.com/o/r/pull/1#issuecomment-2) — “anything at all” |\n', encoding='utf-8') + rc = check_doc_quotes.main([str(doc), '--root', self.tmp, '--require-online']) + self.assertEqual(rc, 1) + + def test_github_transport_failure_is_not_counted_as_offline(self): + doc = self.root / 'docs' / 'nested' / 'a.md' + doc.write_text(HEADER + '| #1 | [c](https://github.com/o/r/pull/1#issuecomment-2) — “anything at all” |\n', encoding='utf-8') + original = check_doc_quotes.Sources._fetch + try: + check_doc_quotes.Sources._fetch = lambda self, match: (None, 'unreachable') + report = check_doc_quotes.check_document(str(doc), self.tmp, github=True, token='x') + finally: + check_doc_quotes.Sources._fetch = original + self.assertEqual(report['unchecked_offline'], 0) + self.assertEqual([f[0] for f in report['failures']], ['source-unreachable']) + def test_nearest_preceding_link_governs_each_passage(self): (self.root / 'reviews' / 's.md').write_text('Disposition: AMEND the ledger.\n', encoding='utf-8') row = ('| #1 | [r](../../reviews/r.md) — “No defect was found.”' From 30d92498ceb1bd207cb9a97af71f6983c768127e Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:39:26 -0700 Subject: [PATCH 3/3] Authenticate GitHub quotations in navigation CI --- .github/workflows/navigation-links.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/navigation-links.yml b/.github/workflows/navigation-links.yml index bc918f88d..aaa99e776 100644 --- a/.github/workflows/navigation-links.yml +++ b/.github/workflows/navigation-links.yml @@ -26,15 +26,16 @@ jobs: - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 with: python-version: '3.11.16' - - name: Resolve every link from the containing document and check every file-sourced quotation, in both interpreter modes + - name: Resolve every link from the containing document and authenticate every navigation quotation, in both interpreter modes env: PYTHONDONTWRITEBYTECODE: '1' + GITHUB_TOKEN: ${{ github.token }} run: | set -euo pipefail python -B -S tools/check_doc_links.py PROOF_INDEX.md docs/integration/*.md python -B -O -S tools/check_doc_links.py PROOF_INDEX.md docs/integration/*.md - python -B -S tools/check_doc_quotes.py PROOF_INDEX.md docs/integration/2026-09-29-navigation-refresh.md - python -B -O -S tools/check_doc_quotes.py PROOF_INDEX.md docs/integration/2026-09-29-navigation-refresh.md + python -B -S tools/check_doc_quotes.py --github --require-online PROOF_INDEX.md docs/integration/2026-09-29-navigation-refresh.md + python -B -O -S tools/check_doc_quotes.py --github --require-online PROOF_INDEX.md docs/integration/2026-09-29-navigation-refresh.md python -B -S -m unittest -v tests.test_navigation_links tests.test_navigation_quotes python -B -O -S -m unittest -v tests.test_navigation_links tests.test_navigation_quotes git diff --exit-code