Skip to content

docs: add source-backed reference gate - #679

Merged
flyingrobots merged 4 commits into
mainfrom
docs/source-backed-reference
Jun 25, 2026
Merged

docs: add source-backed reference gate#679
flyingrobots merged 4 commits into
mainfrom
docs/source-backed-reference

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • add a generated source-backed reference topic for package entrypoints, root API exports, CLI commands, structured CLI error payloads, and public error classes
  • add scripts/check-source-backed-reference.ts and wire it into npm run lint:docs-topology
  • link the generated reference from README and the topics index

Issue

Fixes #670

Test plan

  • npm run lint:source-backed-reference
  • npm run lint:docs-topology
  • npm run lint:md -- README.md CHANGELOG.md docs/topics/README.md docs/topics/reference.md
  • npm run lint:md:code
  • npm run lint -- --no-warn-ignored scripts/check-source-backed-reference.ts
  • npm run typecheck
  • npm run typecheck:policy
  • npm run test:local
  • npm run release:guard -- --stage prep-pr --tag v18.1.1
  • pre-push IRONCLAD M9 gates: link check, static gates, stable unit-test shards

ADR checks

  • This PR does not implement ADR 2 without satisfying ADR 3
  • This PR does not touch persisted op formats; no ADR 3 readiness issue is required
  • This PR does not touch wire compatibility; canonical-only wire behavior is unchanged
  • This PR does not touch schema constants; patch and checkpoint namespaces are unchanged

Summary by CodeRabbit

  • New Features

    • Added a generated, source-backed reference page covering package entrypoints/exports, public API exports, CLI commands, and public error payloads/classes.
    • Added automated tooling to generate and verify the reference stays in sync.
  • Documentation

    • Updated README and the topics “Operate” shelf to point to the generated reference.
    • Expanded the changelog with an entry describing the new reference coverage.
  • Chores

    • Added linting plus documentation topology and release gates that fail if the reference page is missing or out of date.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f318f9f1-c6ea-4b82-b432-a666d930fd9f

📥 Commits

Reviewing files that changed from the base of the PR and between 23e2f78 and 28048b3.

📒 Files selected for processing (2)
  • docs/topics/reference.md
  • scripts/check-source-backed-reference.ts
💤 Files with no reviewable changes (2)
  • scripts/check-source-backed-reference.ts
  • docs/topics/reference.md

📝 Walkthrough

Walkthrough

Adds a generated docs/topics/reference.md page sourced from package exports, CLI commands, and public error classes. It also adds a checker script and lint entry to regenerate or validate the page, and updates docs and release scripts to require it.

Changes

Source-backed reference docs

Layer / File(s) Summary
Source readers and inventory capture
scripts/check-source-backed-reference.ts
The script loads source files and parses package entrypoints, root exports, CLI commands, and public error classes into inventory items.
Markdown generation and lint wiring
scripts/check-source-backed-reference.ts, package.json
The script renders inventories into markdown, supports write-versus-stale-file behavior, and package.json adds a lint entry to run it.
Reference page content
docs/topics/reference.md
The generated page adds the title, regeneration note, package entrypoints, root API export modules, root value exports, root type exports, the CLI command registry, the CLI error payload shape, and public error classes.
Docs links and release gates
CHANGELOG.md, README.md, docs/topics/README.md, scripts/check-docs-topology.sh, scripts/release-guard.sh
The changelog, README, and topic index link the new reference page, and the docs-topology and release-guard scripts require it.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • git-stunts/git-warp#675 — Shares the release-gating path in scripts/release-guard.sh by updating the required-docs list.

Poem

A rabbit found a paper trail,
from exports down to CLI rail.
The burrow checks what source has said,
and regenerates the doc ahead.
Hop, hop — the reference stays well fed 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the new source-backed docs gate.
Description check ✅ Passed The description includes a summary, linked issue, test plan, and ADR checklist in the required template.
Linked Issues check ✅ Passed The changes satisfy #670 by adding a source-backed generator, cited reference output, docs-topology integration, and drift detection.
Out of Scope Changes check ✅ Passed The modified files all support the new reference doc and its gates, with no clear unrelated code changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/source-backed-reference

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.1.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Release Autotag will run final preflight and create v18.1.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/check-source-backed-reference.ts`:
- Line 227: The hardcoded CLI source reference in
SourceText('bin/warp-graph.ts') should not rely on a fixed line number for
cliSource.ref(129), since it can drift from the actual error payload. Update the
lookup in check-source-backed-reference.ts to derive the citation from the
expected payload text or verify the line content before creating the reference,
using the cliSource symbol so the docs always point to the correct error block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5b5a71c5-0309-490d-9a7d-fc33f08df8ab

📥 Commits

Reviewing files that changed from the base of the PR and between 615b974 and f508570.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • README.md
  • docs/topics/README.md
  • docs/topics/reference.md
  • package.json
  • scripts/check-docs-topology.sh
  • scripts/check-source-backed-reference.ts
  • scripts/release-guard.sh

Comment thread scripts/check-source-backed-reference.ts
@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.1.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Release Autotag will run final preflight and create v18.1.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@flyingrobots

Copy link
Copy Markdown
Member Author

Code Lawyer Self-Audit Finding

@codex please confirm this assessment while I apply the fix.

ID Severity Source File Lines Issue Mitigation
CL-001 P5 Nit Self docs/topics/reference.md EOF / line 316 git diff --check origin/main...HEAD reports new blank line at EOF; the generated reference currently emits an extra empty final line. Update scripts/check-source-backed-reference.ts so generated Markdown ends with exactly one trailing newline, regenerate docs/topics/reference.md, and verify git diff --check origin/main...HEAD plus docs/source-backed-reference lint gates.

@flyingrobots

Copy link
Copy Markdown
Member Author

Code Lawyer Activity Summary

ID Severity Source File Commit Outcome
CL-001 P5 Nit Self docs/topics/reference.md, scripts/check-source-backed-reference.ts 28048b3c Fixed generated Markdown EOF whitespace; generator now emits exactly one final newline; local diff check, reference lint, docs topology, script lint/source-size, Markdown lint, and pre-push stable test gates passed.

No unresolved PR review threads remain at the time of this summary. Proceeding to merge-gate verification.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.1.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Release Autotag will run final preflight and create v18.1.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@flyingrobots
flyingrobots merged commit 19c2066 into main Jun 25, 2026
18 checks passed
@flyingrobots
flyingrobots deleted the docs/source-backed-reference branch June 25, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate source-backed API, CLI, and error reference docs

1 participant