feat(docs): forge docs impact — reusable documentation-impact graph#101
Merged
Conversation
Answers the question: "I changed X — which documented surfaces mention
X and are now stale?"
Implemented as a three-stage pipeline:
1. A typed-entity extractor registry pulls named surfaces (commands,
flags, env vars, config keys, etc.) out of the source tree.
2. Those entities are compiled into an inverted doc index mapping
each entity to the documentation locations that mention it.
3. A diff-to-impact query takes a set of changed files/entities and
looks up the doc index to report which documented surfaces are
now potentially stale.
The command is advisory by default (prints findings, exits 0) and
gains a --strict flag for CI enforcement (nonzero exit on stale docs).
'forge docs check' now prints a one-line pointer to 'forge docs impact'
so users discover the deeper analysis.
Adds src/docs_impact.js (extractor registry, inverted index, diff
query) with test/docs_impact.test.js, wires the new command into
src/cli.js and src/commands.js, and updates README.md, docs/GUIDE.md,
and CHANGELOG.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tion dependabot #91 bumped gitleaks/gitleaks-action v2→v3, whose breaking update requires a paid GITLEAKS_LICENSE for org-associated accounts and HARD-FAILS when its license-validation server is unreachable ("License key validation will be enforced") — turning the secret-scan gate red on master and every PR for reasons unrelated to the code. Replace the action with the pinned gitleaks binary (8.21.2). `gitleaks detect` walks the full commit history (fetch-depth:0) exactly as before, with no network license dependency, so the gate stays deterministic and blocking. set -euo pipefail keeps it fail-closed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…suite Running the gitleaks binary (prior commit) surfaced 2 findings the licensed action never reached — it was erroring on license validation before scanning, so the gate was effectively blind. Both are false positives: synthetic PEM private-key literals in test/secrets.test.js, the suite whose whole job is to assert forge redacts secret-shaped strings. They are committed, so a full-history scan always matches them. Add test/secrets.test.js to the .gitleaks.toml path allowlist (alongside the existing bibliography-key exceptions); every other path stays fully scanned. Verified locally: gitleaks 8.21.2 → 'no leaks found', exit 0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…graph # Conflicts: # CHANGELOG.md
CodeWithJuber
marked this pull request as ready for review
July 20, 2026 01:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
docs checkreconciles a fixed list of registries anddocs syncsweeps a diff for raw identifiers.forge docs impactis the general, reusable version of the same idea: it answers "I changed X — which documented surfaces mention X and are now potentially stale?" as a proper documentation-reference graph instead of a per-file rule.Built as a three-stage pipeline:
FORGE_*env vars, MCP tool names, exported symbols, brand tokens, the version,package.jsonfields) from their canonical sources, reusingdocs_check'senvVarsRead/srcFilesscanning and theCOMMANDS/TOOLSregistries. Adding a new entity type is one record in the registry.*.md,CITATION.cff, plugin manifests, the landing page,package.json) builds an inverted index: entity → everyfile:linethat names it. Bare English-word-shaped entities only count inside backticks/fenced code so prose doesn't false-positive.New command:
forge docs impact--strictexits non-zero for CI enforcement--since <ref>sets the diff base (default: session baseline, thenHEAD)--stagedreads the index instead of the working tree--min-confidence <n>drops low-signal hits--jsonfor tooling/CI consumptiondocs checknow prints a one-line pointer todocs impactwhen the working tree touches a documented entityHonest limits (documented in
docs/GUIDE.md): a token index catches a doc that names a changed entity — it can't see a paraphrase with no textual anchor, a screenshot/diagram, or a pure wording choice.This PR also folds in an unrelated CI fix cherry-picked from
claude/parallel-solving-3dc0ji(5e4fa79):.github/workflows/security.ymlnow runs the gitleaks binary directly instead of the licensedgitleaks-action@v3, which flakily fails CI. Included so this PR's own secret-scan check is green.Adds
src/docs_impact.js(~600 lines: extractor registry, inverted index, diff query) andtest/docs_impact.test.js(~257 lines), and wires the command intosrc/cli.js/src/commands.js/src/docs_check.js, plusREADME.md,docs/GUIDE.md,CHANGELOG.md.Checklist
npm testpasses (1068 passed, 0 failed, 2 skipped)npm run checkpasses (Biome lint + format — 0 errors, pre-existing unrelated warnings only)feat:/fix:/docs:…)CHANGELOG.mdupdated under## [Unreleased]forge docs impactis new — README, GUIDE, CHANGELOG all updated)Risk & rollback
docs checkoutput.Extra checks (tick if applicable)
npm run typecheckpassesTest plan
npm test— 1068/1068 passing (2 pre-existing skips)npx biome check— clean (0 errors)npm run typecheck— cleannode src/cli.js docs check— reports docs and code agreeCo-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Generated by Claude Code