← Back to Pull requests

fix(cheatsheets): point 9 in-page anchors at the heading IDs the site generates #2780

Closed
unknown closed this pull request without merging on Oct 15, 2026 11:43 UTC
View on GitHub
unknown unknown commented on Oct 12, 2026 21:09 UTC
Author

What this changes

Six in-page anchors whose target heading exists but whose fragment no longer matches it.
Every one of these is broken on both surfaces, which is the reason the other candidates
were dropped (see the last section):

| file:line | was | now | why it was dead everywhere |
|---|---|---|---|
| Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.md:52 | …Cryptographic_Storage_Cheat_Sheet.html#rule---use-cryptographically-secure-pseudo-random-number-generators-csprng | #secure-random-number-generation | absolute .html link; the site has id="secure-random-number-generation", and ### Rule - Use cryptographically… is no longer a heading in that file |
| Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.md:344 | …#use-of-custom-request-headers | #employing-custom-request-headers-for-ajaxapi | absolute .html link; the site has no use-of-custom-request-headers id |
| Network_Segmentation_Cheat_Sheet.md:48,49,50 | #FRONTEND, #MIDDLEWARE, #BACKEND | #frontend, #middleware, #backend | the headings are ### FRONTEND etc. (:52, :63, :75); both GitHub and Python-Markdown slug them lower-case, so the upper-case fragments never resolve |
| NodeJS_Docker_Cheat_Sheet.md:276 | …Docker_Security_Cheat_Sheet.html#rule-9-use-static-analysis-tools | #rule-9-integrate-container-scanning-tools-into-your-cicd-pipeline | absolute .html link; that rule was retitled to ### RULE \#9 - Integrate container scanning tools into your CI/CD pipeline. The link text still says "Use static analysis tools" — I only moved the target and left the prose. If it belongs under #rule-13-enhance-supply-chain-security, say so. |

Checked on this host

npm ci --ignore-scripts, python -m venv venv && pip install -r scripts/link_check/requirements.txt, LINK_CHECK_PYTHON pointed at the venv python, all on cb9fe01e5ddf:

| command | before | after |
|---|---|---|
| npm run link-check -- --local-only --fresh | rc=1, 12 blocking (11 missing-anchor + 1 missing-file) | rc=1, 6 blocking (5 missing-anchor + 1 missing-file) |
| npm run lint-markdown | rc=0 | rc=0 |
| npm run lint-terminology | rc=0 | rc=0 |

md-link-check.yml:82 runs the checker with --base "$PR_BASE_SHA", so only new occurrences
are blocking in PR mode. All 6 remaining findings are pre-existing on master, none is
introduced here, and this branch removes 6 of the 12.

The 6 findings I am deliberately not touching, and why

Three of them are the --- cases: GraphQL_Cheat_Sheet.md:186, Server_Side_Request_Forgery_Prevention_Cheat_Sheet.md:292 and Webhook_Security_Cheat_Sheet.md:122. My first version of this PR "fixed" those, and @mackowski correctly pointed out the link then stops working in the repo view. Measured, both of us were right, about different surfaces:

  • GitHub renders ### Case 2 - Application can send requests to ANY external IP address or domain name with id user-content-case-2---application-can-send-requests-to-any-external-ip-address-or-domain-name (three hyphens) — so the old fragment works there.

  • The published page puts id="case-2-application-can-send-requests-to-any-external-ip-address-or-domain-name" on that heading and rewrites the relative link to …Cheat_Sheet.html#case-2---application-… — so the old fragment is dead there.
  • CONTRIBUTING.md:143 says local anchors should follow the site's Python-Markdown ids, and
    npm run link-check agrees (it reports those three as missing-anchor). But markdownlint's
    MD051 validates fragments with GitHub's slug, which is why Docker_Security_Cheat_Sheet.md:52
    and :358 cannot be made site-correct without npm run lint-markdown exiting 1:

    cheatsheets/Docker_Security_Cheat_Sheet.md:52:221 error MD051/link-fragments [Context: "[Rule \#11](#rule-11-run-docker-in-rootless-mode)"]
    cheatsheets/Docker_Security_Cheat_Sheet.md:358:31 error MD051/link-fragments [Context: "[Rule \#9](#rule-9-integrate-container-scanning-tools-into-your-cicd-pipeline)"]
    

    So the two checkers encode two different conventions and no fragment can satisfy both for a
    heading whose title contains - . Making that call belongs to the project, not to a link
    fix, so this PR keeps only the anchors that are wrong under both rules. Happy to take the
    --- set in whichever direction you pick (relax MD051, retitle the headings so both slugs
    collapse, or declare the repo view authoritative and leave the site links as they are).

    The sixth, Secrets_Management_Cheat_Sheet.md:202, is a missing-file: the Multifactor
    Authentication cheat sheet is not part of the published site, so retargeting it would change
    what the sentence claims.

    One limitation

    npm run test:link-check fails on this Windows host with an identical set of 41 failing test
    names before and after this change, so it gave no signal. Narrowing it to one interpreter left
    local anchors follow the site's Python-Markdown heading IDs failing at cb9fe01e5ddf too.
    Nothing here is introduced by this PR, but I cannot claim that suite passes. The evidence above
    is the link-check CLI and markdownlint, run in both states.

    Scope and sourcing (required)

  • Focused: 3 files, 6 anchor fragments, and it is inside the three-cheat-sheet limit that

  • pr-scope-check.yml enforces (my first version touched 6 and failed that check).
  • Every claim above is backed by a source I read in this repo: the heading text of each

  • target file, the id sets from npm run link-check, and markdownlint output. No
    remembered slug rule and no outside citation.
  • I read each source I cite and confirmed it supports the claim.

  • New Cheat Sheet template — n/a, no new sheet.

  • No markdown validation violations — lint-markdown rc=0.

  • Format rules from CONTRIBUTING.md#markdown followed — only fragments changed.

  • Assets in assets/ — n/a. Images in PNG — n/a.

  • Website references formatted as [TEXT](URL).

  • Effectiveness verified/tested — before-and-after table above.

  • CI expected to pass: the scope check now sees 3 files and the link check's 6 remaining

  • findings are all pre-existing under --base. I will report the actual run.

    AI Tool Usage Disclosure (required for all PRs)

  • I have NOT used any AI tool to generate the contents of this PR.

  • AI-assisted, and every claim verified by me against the cited source. Tool: the Qoder

  • agentic coding environment, driven from this machine. I cannot give a model version: the
    product does not surface the underlying model identifier to the session, so any string I
    wrote would be invented — that is the honest answer to @copilot-pull-request-reviewer's
    second finding rather than a withheld value.
    Prompt used, verbatim: run this repo's own link checker, fix the missing-anchor
    findings whose target heading still exists, and stop at anything that needs a repo-level
    decision
    .

    The anchor ids quoted above are the output of npm run link-check and of the published pages,
    not of a slug rule recited from memory.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Adarsh-Me Review duration: 3754m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2780"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%