Skip to content

docs: fact-check sweep — align docs and CLI help with shipped behavior#145

Merged
SutuSebastian merged 11 commits into
mainfrom
docs/fact-check-sweep
May 26, 2026
Merged

docs: fact-check sweep — align docs and CLI help with shipped behavior#145
SutuSebastian merged 11 commits into
mainfrom
docs/fact-check-sweep

Conversation

@SutuSebastian

@SutuSebastian SutuSebastian commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Nine adversarial doc-sweep passes fact-checking user-facing strings against the codebase (post–#144). No runtime behavior changes — docs, CLI/MCP help, agent-content templates, and a few src comments only.

  • Retire completed P1 plans (agent-surface-delivery.md, agent-surface-and-ops.md) and fix cross-refs
  • Index path: .codemap/index.db (not .codemap.db); state-dir vs hardcoded audit-cache/ documented
  • Audit --base: git archive | tar -x + cached index at sha (not temp DB / worktree)
  • MCP/HTTP: 17 tools, per-tool JSON envelopes (not uniform query --json), no-CLI-verb tools on MCP + HTTP (query_batch, trace, explore, node)
  • Resources: GET /resources shipped; skill/rule assembled from templates/agent-content/
  • query --ci includes quiet; audit --ci does not; validate statuses stale | missing | unindexed
  • Recipe catalog = bundled + project-local; watch default-ON on mcp/serve

45 files, net −131 lines.

Test plan

  • Pre-commit on each commit (format, lint, typecheck on touched TS)
  • Pass 19 adversarial explore sweep returned zero errors in scope
  • CI green on PR

Summary by CodeRabbit

Release Notes

  • Documentation

    • Clarified CLI command behavior for --base, --ci, and recipe catalog handling
    • Updated descriptions of MCP tools, HTTP resources, and caching behavior
    • Refined agent initialization and template documentation
    • Consolidated roadmap references and plan tracking
    • Corrected index database path references throughout
  • Plans

    • Removed outdated plan documents and consolidated roadmap structure

Review Change Stack

…erences

P1 agent-surface plans are complete; lift status to roadmap and fix stale
schema, MCP, validate, and index-path claims across docs and agent templates.
Add type_heritage to served rule and roadmap substrate inventory, align MCP
tool/resource descriptions and CLI help with index.db paths and validate behavior.
Align agent templates, README, packaging, glossary, and MCP metadata with
recipes-loader behavior; fix Tier 11 glossary anchor suffix.
Fix MCP tool/resource descriptions, CLI help/JSDoc, audit cache comments,
research doc relative paths, and non-goals MCP resource citation.
List all 17 tools and mcp-instructions in cmd-mcp/cmd-serve help, fix schema
cache wording, recipe_recency write-path docs, and skill assembly cache notes.
Fix bundled-only recipe help text, audit --ci exit behavior, default-ON
watch wording, and skill resource freshness contract.
Align README quick-start comments and schema.gen fallback with 17-tool
MCP surface and codemap://schema lazy-cache behavior.
Replace stale worktree/co-process wording with git archive + tar -x audit
cache semantics and in-process chokidar watch behavior.
Fix architecture audit wiring cross-ref, non-goals transport wording,
stale MCP-only HTTP JSDoc, and user-facing audit error messages.
Fact-check passes 9–19: per-tool JSON shapes (not uniform query --json),
no-CLI-verb tools on MCP+HTTP, audit-cache vs state-dir, query --ci quiet
split, assembled resources, and related CLI/help string fixes.
@changeset-bot

changeset-bot Bot commented May 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 21c6076

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@SutuSebastian, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 53 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b36eec66-f4b0-4c4f-b019-858093fe9186

📥 Commits

Reviewing files that changed from the base of the PR and between 6006974 and 21c6076.

📒 Files selected for processing (4)
  • docs/architecture.md
  • docs/glossary.md
  • templates/agent-content/rule/00-full.md
  • templates/agent-content/skill/00-overview.md
📝 Walkthrough

Walkthrough

This PR comprehensively updates documentation across the Codemap codebase to reflect the current system state: clarifying database paths (.codemap/index.db), documenting in-process watcher behavior, detailing MCP/HTTP tool and resource semantics, explaining updated audit materialization, and consolidating outdated plan documents with restructured roadmap references.

Changes

Documentation Consolidation and Clarification

Layer / File(s) Summary
Database path and infrastructure consolidation
src/api.ts, scripts/benchmark-query-output.ts, src/application/audit-engine.ts, src/application/http-server.ts, src/application/index-engine.ts, src/application/watcher.ts, src/benchmark-config.ts, src/cli/cmd-audit.ts, src/cli/cmd-validate.ts
All references updated from .codemap.db to .codemap/index.db across JSDoc, error messages, comments, and CLI help text.
Watcher behavior and transport documentation
src/cli/bootstrap.ts, src/cli/cmd-mcp.ts, src/cli/cmd-serve.ts, src/cli/cmd-watch.ts, src/application/http-server.ts
Documents in-process watcher (chokidar-based), default-ON since 2026-05, opt-out mechanisms (--no-watch/CODEMAP_WATCH=0), and interaction with audit prelude optimization.
MCP/HTTP tool and resource semantics
src/application/mcp-server.ts, src/application/resource-handlers.ts, README.md, docs/glossary.md, docs/architecture.md
Clarifies tool availability (query_batch as MCP+HTTP only, no CLI verb), resource caching (lazy-cached per process vs live-read), updated tool descriptions, and HTTP/MCP output envelope differences.
Audit base materialization and cache documentation
src/cli/cmd-audit.ts, docs/agents.md, docs/architecture.md, docs/glossary.md
Documents updated audit --base (git archive + tar extraction + reindex), hardcoded .codemap/audit-cache/ path, and related error message wording.
Query CLI flag behavior and baseline semantics
src/cli/cmd-query.ts, docs/glossary.md, docs/plans/github-marketplace-action.md
Clarifies query --ci suppression of "no-locatable-rows" warning (distinct from audit), --baseline/--base mutual exclusivity with per-delta composition, recipe catalog expansion (bundled + project-local), and structured output shapes.
Schema version, plan consolidation, and roadmap restructuring
docs/architecture.md, docs/plans/agent-surface-and-ops.md (deleted), docs/plans/agent-surface-delivery.md (deleted), docs/plans/callback-dispatch-synthesis.md, docs/plans/cross-project-mcp-root.md, docs/plans/fts-default-on-evaluation.md, docs/plans/github-marketplace-action.md, docs/plans/perf-triangulation-rollout.md, docs/plans/substrate-extraction.md, docs/plans/unresolved-calls-staging.md, docs/roadmap.md
Schema version bumped 34 → 35, two outdated agent-surface plan documents removed, plan roadmap references consolidated to "Agent & indexing ops — P2", plan status indicators updated.
Documentation index, research updates, and cross-linking
docs/README.md, docs/research/agent-eval-findings-2026-05.md, docs/research/non-goals-reassessment-2026-05.md
Updated docs/README.md index table (agents.md entry, auto-flows memoization, non-goals reframing), research notes (fixtures path correction, non-goals reassessment), and cross-document link references.
Agent instruction and template updates
templates/agent-content/mcp-instructions.md, templates/agent-content/rule/00-full.md, templates/agent-content/skill/00-overview.md, templates/agent-content/skill/10-recipes-context.md, templates/agent-content/skill/30-schema.gen.md, templates/agent-content/skill/40-query-patterns.md, templates/agent-content/skill/50-maintenance.md
Updates MCP agent instructions, rule/skill templates, and maintenance docs to reflect current tool availability, output contracts, caching semantics, field-qualified search patterns, and TypeScript config paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • stainless-code/codemap#89: Updates audit base (codemap audit --base) documentation to reflect the git archive | tar -x materialization approach and audit-cache metadata behavior.
  • stainless-code/codemap#73: Both PRs modify docs/plans/github-marketplace-action.md to clarify query/audit --ci + SARIF exit semantics and related Action behavior.
  • stainless-code/codemap#35: Updates MCP server/resource handler documentation and tool descriptions to align with the MCP transport surface.

Suggested labels

documentation

🐰 Documentation dreams take shape,
Paths align and helpers map,
Watcher watches, tools revealed,
Audit base now truth unsealed,
Plans consolidated—moat assured. 🗺️

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 59.38% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'docs: fact-check sweep — align docs and CLI help with shipped behavior' accurately and concisely summarizes the primary change: a comprehensive documentation and help text alignment pass across 45 files with no runtime behavior changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/fact-check-sweep

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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: 5

🤖 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 `@docs/architecture.md`:
- Around line 148-149: Update the "MCP wiring" doc to match the code: replace
the claim that src/cli/cmd-mcp.ts only accepts --help/--root/--config with the
current CLI flags (include --watch, --no-watch and --debounce), and change the
description that query_batch calls executeQueryBatch to state that
src/application/tool-handlers.ts's handleQueryBatch runs each item by calling
executeQuery(...) directly (so remove/replace references to executeQueryBatch
and adjust wording about batching behavior and per-item error isolation
accordingly).

In `@docs/glossary.md`:
- Line 40: The glossary link uses a broken fragment
`#audit--base-ref--git-ref-baseline`; update that fragment to match the actual
heading slug for the "audit --base <ref>" anchor (i.e., find the heading for the
audit --base <ref> section and replace `#audit--base-ref--git-ref-baseline` with
the exact slug it generates so the cross-reference resolves correctly). Ensure
the replacement appears in the Two-snapshot structural-drift paragraph
referencing `audit --base <ref>`.
- Line 112: Replace the lowercase "github" with the official capitalization
"GitHub" in the sentence that explains the CI-aggregate flag for `codemap query`
and `codemap audit` (mentions `--ci`, `--format sarif`, `process.exitCode = 1`,
mutual exclusivity with `--json`/`--format <other>`) so the user-facing
documentation uses the correct trademarked casing.

In `@templates/agent-content/rule/00-full.md`:
- Line 43: The table row mixes a bare recipe id and a --recipe flag (it shows
`type-descendants` without the flag while other cells use `--recipe`), so update
the entry to use the consistent invocation syntax `--recipe type-descendants`;
locate the table row containing `type_heritage`, `--recipe type-ancestors` and
`type-descendants` and replace the bare `type-descendants` with `--recipe
type-descendants` so it matches the rest of the examples and copy/paste
behavior.

In `@templates/agent-content/skill/00-overview.md`:
- Line 25: The output contract example contains invalid JSON for the --group-by
example; replace the current `{"group_by", "groups"}` token with a valid JSON
object example such as `{"group_by": "field_name", "groups": [{"key": "...",
"count": N}]}` and update the composed shapes line (the `--group-by` entry) so
the docs show a valid object-shape example matching the surrounding contract
language (`--summary`, `--baseline` remain unchanged).
🪄 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: ec48b7d0-6d9f-4510-af32-be2a3db0f8f4

📥 Commits

Reviewing files that changed from the base of the PR and between 1dd422d and 6006974.

📒 Files selected for processing (45)
  • README.md
  • docs/README.md
  • docs/agents.md
  • docs/architecture.md
  • docs/glossary.md
  • docs/packaging.md
  • docs/plans/agent-surface-and-ops.md
  • docs/plans/agent-surface-delivery.md
  • docs/plans/callback-dispatch-synthesis.md
  • docs/plans/cross-project-mcp-root.md
  • docs/plans/fts-default-on-evaluation.md
  • docs/plans/github-marketplace-action.md
  • docs/plans/perf-triangulation-rollout.md
  • docs/plans/substrate-extraction.md
  • docs/plans/unresolved-calls-staging.md
  • docs/research/agent-eval-findings-2026-05.md
  • docs/research/non-goals-reassessment-2026-05.md
  • docs/roadmap.md
  • scripts/benchmark-query-output.ts
  • src/api.ts
  • src/application/agent-content.ts
  • src/application/audit-engine.ts
  • src/application/audit-worktree.ts
  • src/application/http-server.ts
  • src/application/index-engine.ts
  • src/application/mcp-server.ts
  • src/application/resource-handlers.ts
  • src/application/tool-handlers.ts
  • src/application/watcher.ts
  • src/benchmark-config.ts
  • src/cli/bootstrap.ts
  • src/cli/cmd-audit.ts
  • src/cli/cmd-context.ts
  • src/cli/cmd-mcp.ts
  • src/cli/cmd-query.ts
  • src/cli/cmd-serve.ts
  • src/cli/cmd-validate.ts
  • src/cli/cmd-watch.ts
  • templates/agent-content/mcp-instructions.md
  • templates/agent-content/rule/00-full.md
  • templates/agent-content/skill/00-overview.md
  • templates/agent-content/skill/10-recipes-context.md
  • templates/agent-content/skill/30-schema.gen.md
  • templates/agent-content/skill/40-query-patterns.md
  • templates/agent-content/skill/50-maintenance.md
💤 Files with no reviewable changes (2)
  • docs/plans/agent-surface-delivery.md
  • docs/plans/agent-surface-and-ops.md

Comment thread docs/architecture.md Outdated
Comment thread docs/glossary.md Outdated
Comment thread docs/glossary.md
### `--ci` (CLI flag)

CI-aggregate flag on `codemap query` and `codemap audit`. Aliases `--format sarif` + `process.exitCode = 1` on findings/additions + suppresses the no-locatable-rows stderr warning (CI templates would surface it as red noise; the row-set is the gating signal). Mutually exclusive with `--json` (different format aliases) and with `--format <other>` (contradicts the alias); `--ci --format sarif` redundant but accepted. Designed for the GitHub Marketplace Action's headline default (`audit --base ${{ github.base_ref }} --ci`); independently useful for any non-Action CI consumer.
CI-aggregate flag on `codemap query` and `codemap audit`. Aliases `--format sarif` + `process.exitCode = 1` on findings (`query`) or delta additions (`audit`). On **`query` only**, also suppresses the no-locatable-rows stderr warning (CI templates would surface it as red noise; the row-set is the gating signal). Mutually exclusive with `--json` (different format aliases) and with `--format <other>` (contradicts the alias); `--ci --format sarif` redundant but accepted. Designed for the GitHub Marketplace Action's headline default (`audit --base ${{ github.base_ref }} --ci`); independently useful for any non-Action CI consumer.

@coderabbitai coderabbitai Bot May 26, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use official capitalization for GitHub.

Line 112 uses “github” in a user-facing sentence; this should be “GitHub” for consistency and correctness.

Suggested wording tweak
- ... Designed for the github Marketplace Action's headline default ...
+ ... Designed for the GitHub Marketplace Action's headline default ...

As per coding guidelines: "Documentation should be written in clear, concise English".

🧰 Tools
🪛 LanguageTool

[uncategorized] ~112-~112: The official name of this software platform is spelled with a capital “H”.
Context: ... Marketplace Action's headline default (audit --base ${{ github.base_ref }} --ci); independently usefu...

(GITHUB)

🤖 Prompt for 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.

In `@docs/glossary.md` at line 112, Replace the lowercase "github" with the
official capitalization "GitHub" in the sentence that explains the CI-aggregate
flag for `codemap query` and `codemap audit` (mentions `--ci`, `--format sarif`,
`process.exitCode = 1`, mutual exclusivity with `--json`/`--format <other>`) so
the user-facing documentation uses the correct trademarked casing.

✅ Addressed in commit 21c6076

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The prose already uses GitHub Marketplace Action. The lowercase github in the same sentence is inside the GitHub Actions expression `${{ github.base_ref }}` — that context name is defined by GitHub and must stay lowercase per Actions syntax. No change needed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Resolve the CodeRabbit comment on this PR
gh pr view 145 --repo stainless-code/codemap --json number

# List bot comments on the PR to find the one to resolve
gh api graphql -f query='
{
  repository(owner: "stainless-code", name: "codemap") {
    pullRequest(number: 145) {
      reviewThreads(first: 50) {
        nodes {
          id
          isResolved
          comments(first: 1) {
            nodes {
              id
              author { login }
              body
            }
          }
        }
      }
    }
  }
}'

Length of output: 10490



@SutuSebastian, you're absolutely right. The lowercase github is part of the GitHub Actions expression `${{ github.base_ref }}` — a case-sensitive context name defined by GitHub's Actions spec — and must stay lowercase. The prose "GitHub Marketplace Action" earlier in the same sentence is already correctly capitalized. This was a false positive from the LanguageTool static analyzer. The review thread is already resolved. Apologies for the noise!

🐇 (noted for good!)


✏️ Learnings added
Learnt from: SutuSebastian
Repo: stainless-code/codemap PR: 145
File: docs/glossary.md:112-112
Timestamp: 2026-05-26T13:43:04.136Z
Learning: In stainless-code/codemap documentation (and generally), the token `github` inside a GitHub Actions expression such as `${{ github.base_ref }}` or `${{ github.sha }}` is intentionally lowercase — it is the GitHub Actions context name defined by GitHub's spec and must NOT be capitalized. LanguageTool's GITHUB rule will falsely flag this as a capitalization error. Do not raise a review comment on `github` when it appears inside a `${{ ... }}` expression, even within otherwise-prose documentation sentences.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: SutuSebastian
Repo: stainless-code/codemap PR: 77
File: docs/plans/codemap-apply.md:0-0
Timestamp: 2026-05-06T09:08:52.852Z
Learning: In the codemap project, ensure MCP/HTTP transport examples in documentation use MCP-spec snake_case keys for tool arguments: use dry_run (not --dry-run) and yes (not --yes), aligning with existing tools like query_recipe (see architecture.md, MCP wiring). For non-TTY transports, require yes: true unconditionally since there is no interactive prompt fallback (per the apply plan). Apply this in docs/plans/codemap-apply.md and related architecture docs, making sure examples reflect these keys rather than CLI-style flags.

Learnt from: SutuSebastian
Repo: stainless-code/codemap PR: 77
File: docs/plans/codemap-apply.md:0-0
Timestamp: 2026-05-06T09:08:52.048Z
Learning: In stainless-code/codemap, Markdown linting with markdownlint is not enforced. There is no .markdownlint* config file, and oxfmt does not check MD040 (fenced code block language). Files such as architecture.md and benchmark.md have untagged fences. Future MD040 warnings should be treated as non-blocking review information and must not block PRs. This pattern applies to all Markdown files in the repository. If you later enable linting, add a .markdownlint config and gate changes in CI, and adjust the enriched guidance accordingly.

Learnt from: SutuSebastian
Repo: stainless-code/codemap PR: 80
File: docs/glossary.md:0-0
Timestamp: 2026-05-15T13:33:07.225Z
Learning: When documenting MCP/HTTP resource caching behavior in stainless-code/codemap, reflect the intended per-process caching split: only `codemap://schema`, `codemap://skill`, and `codemap://rule` are lazy-cached (constant for the server lifetime); `codemap://recipes` and `codemap://recipes/{id}` must be documented as deliberately NOT cached and instead fetched live per call to keep `last_run_at`/`run_count` recency fields fresh. Ensure this distinction is consistent across all docs (e.g., `docs/glossary.md`, `docs/architecture.md`, etc.) and stays aligned with the implementation in `src/application/resource-handlers.ts`.

Comment thread templates/agent-content/rule/00-full.md Outdated
Comment thread templates/agent-content/skill/00-overview.md Outdated
Fact-checked 4/5 bot comments; push back on false-positive GitHub
capitalization (Actions expression github.base_ref is correct).
@SutuSebastian SutuSebastian merged commit 0323a1f into main May 26, 2026
11 checks passed
@SutuSebastian SutuSebastian deleted the docs/fact-check-sweep branch May 26, 2026 13:49
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.

1 participant