Skip to content

Fix README dead links + add relative-link-check CI (closes #7910 #7908 #7886 #7885 #7792) - #8112

Open
0wmz wants to merge 1 commit into
Scottcjn:mainfrom
0wmz:fix/readme-broken-links-16248
Open

Fix README dead links + add relative-link-check CI (closes #7910 #7908 #7886 #7885 #7792)#8112
0wmz wants to merge 1 commit into
Scottcjn:mainfrom
0wmz:fix/readme-broken-links-16248

Conversation

@0wmz

@0wmz 0wmz commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Fixes the dead links called out in the five referenced issues and adds a
deterministic link-check CI that enforces relative (internal) link
integrity
so links can't silently rot again.

Addresses RustChain bounty rustchain-bounties#16248.

Closes #7910, #7908, #7886, #7885, #7792.

What I actually found (honest audit)

I ran lychee against README.md (relative links only) and audited every
relative link. Most of the reported breakage was already fixed in current
main
, so I did not fabricate changes for them — I documented the state:

Issue Reported broken link Current state in main Action
#7792 docs/attestation-pipeline.md, docs/pay-out-ledger.md, docs/sprint/* README no longer references these paths (0 broken relative links in README, verified by lychee) Already resolved — documented
#7885 ./docs/mining.md README now links mining to existing docs (docs/BUILD.md etc.); docs/mining.md is not referenced Already resolved — documented
#7908 https://rustchain.org/bcos/ README's BCOS links now point to the in-repo BCOS.md (relative), not the dead external /bcos/ route Already resolved — documented
#7910 / #7908 https://rustchain.org/api/tokenomics (404) Still broken — the one genuine remaining dead link in README Fixed (see below)
#7886 actions/workflows/ci.yml, stargazers, zenodo badge 404s False positives: .github/workflows/ci.yml exists, the stargazers page is valid, and README uses img.shields.io DOI badges (not zenodo.org/badge/...) No change required — verified

Changes in this PR

  1. README.md — replaced the dead external https://rustchain.org/api/tokenomics
    link with the canonical in-repo tokenomics doc
    [WHITEPAPER §6 — Tokenomics](docs/WHITEPAPER.md), with a short note that the
    public /api/tokenomics endpoint is currently offline. No dead link remains.

  2. GHOST_IN_THE_MACHINE.md (top-level doc) — removed 3 dead ./evidence/*
    relative links (they point to runtime-generated artifacts that are never
    committed) and converted them to plain-text notes. Bonus cleanup beyond the
    five issues, since the bounty also covers top-level docs.

  3. .github/workflows/lychee.yml — reworked the existing link-check job to:

    • run on PRs that touch README.md (+ manual dispatch);
    • enforce relative/internal links on README.md;
    • skip external/network URLs (--exclude "https?://.+"), per the bounty's
      acceptance allowance, so CI stays deterministic and doesn't fail on 3rd-party
      site outages. A broken relative link fails the build.

Link-check demonstration (local lychee run)

PASS on the fixed README.md (relative links only):

🔍 116 Total 🔗 87 Unique ✅ 48 OK 🚫 0 Errors 👻 68 Excluded

FAIL when a broken relative link is injected (proves the guard works):

[README.md]:
[ERROR] file:///.../docs/THIS_FILE_DOES_NOT_EXIST_16248.md | File not found.
🔍 117 Total 🔗 88 Unique ✅ 48 OK 🚫 1 Error

After this PR, regressions like the originally-reported ones would be caught
automatically before merge.

 Scottcjn#7908 Scottcjn#7886 Scottcjn#7885 Scottcjn#7792)

- Replace broken external /api/tokenomics link in README.md with the
  canonical in-repo tokenomics doc (docs/WHITEPAPER.md).
- Remove 3 dead ./evidence/* relative links in GHOST_IN_THE_MACHINE.md
  (they point to runtime-generated artifacts that are not committed).
- Rework .github/workflows/lychee.yml to enforce internal/relative link
  integrity on README.md (external/network URLs skipped to keep CI
  deterministic, per bounty acceptance). The check fails the build on
  any broken relative link.
@0wmz
0wmz requested a review from Scottcjn as a code owner August 1, 2026 20:07
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Non-doc PRs have a BCOS-L1 or BCOS-L2 label
  • Doc-only PRs are exempt from BCOS tier labels when they only touch docs/**, *.md, or common image/PDF files
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions Bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) ci size/XS PR: 1-10 lines labels Aug 1, 2026

@qiann0512-gif qiann0512-gif left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This does fix the one README tokenomics link, but the new CI guard is narrower than the bounty requirement and narrower than this PR's own changed files. Bounty #16248 asks for fixing README.md and top-level docs, with CI so relative links cannot silently rot again. This PR also changes GHOST_IN_THE_MACHINE.md specifically because it had dead top-level relative links, but .github/workflows/lychee.yml now only triggers on README.md and only checks README.md.

That means a future PR can reintroduce GHOST_IN_THE_MACHINE.md or other top-level doc links like ./evidence/missing.png and the link-check job will not run at all. Even if manually dispatched, the command is still scoped to README.md, so top-level doc regressions stay invisible. The acceptance criterion is not just "README links are checked"; it says relative links must be enforced for the README/doc deliverable.

Please include top-level Markdown docs in both the workflow path filter and the lychee target set, or add an equivalent local script target that covers them. A quick negative demonstration against GHOST_IN_THE_MACHINE.md (or another top-level doc) would prove the guard actually covers the class of links this PR is removing.

@FlintLeng FlintLeng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Review: README Dead Links + Relative-Link CI

Reviewed on: 2026-08-04

Summary

Fixes five dead link issues and adds a deterministic lychee GitHub Actions workflow that enforces relative (internal) link integrity in README.md. The CI intentionally skips external URLs to keep it deterministic and avoid flaky third-party checks.

Changes

GHOST_IN_THE_MACHINE.md: Replaced three broken file references (photo.jpg, screenshot.png, attestation.log) with runtime-captured paths. The previous links pointed to non-existent files in a static evidence/ directory — this is a legitimate fix.

README.md: Replaced the /api/tokenomics URL (offline endpoint) with a reference to the authoritative whitepaper docs/WHITEPAPER.md §6 — Tokenomics. The comment explaining why (the public endpoint is currently offline) is honest.

lychee.yml: Refined CI scope from broad (**.md, **.html) to targeted (README.md only), changed --exclude patterns from specific domains to --exclude "https?://.+" (block all external), and narrowed the trigger to README.md changes only. The comment explaining the intentional allowlisting of external URLs per the bounty's acceptance criteria is a good artefact.

Minor Points

  1. GHOST_IN_THE_MACHINE.md changes are not backward-compatible. Changing a link to a comment removes the hyperlink entirely. Users who relied on Ctrl+Click to jump to evidence files now can't. If the files genuinely don't exist, removing the link is correct — but if they should exist, the fix is incomplete.

  2. CI trigger scope is narrow. The workflow only runs on changes to README.md. A broken link introduced in GHOST_IN_THE_MACHINE.md or any other .md file would not be caught. This is a deliberate choice per the bounty scope, but worth documenting.

  3. --include-fragments with --exclude "https?://.+": Fragment links (e.g., #section) within README.md should still resolve locally. The --include-fragments flag handles anchor links correctly.

Wallet: RTC019e78d600fb3131c29d7ba80aba8fe644be426e

✅ LGTM — clean, scoped fix with appropriate CI coverage for its stated scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) ci documentation Improvements or additions to documentation size/XS PR: 1-10 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Broken API endpoint link in documentation - /api/tokenomics returns 404

3 participants