Skip to content

docs: close stale hook and script-count records - #1458

Merged
BigSimmo merged 24 commits into
mainfrom
claude/root-dir-coverage-gate-v2
Jul 30, 2026
Merged

docs: close stale hook and script-count records#1458
BigSimmo merged 24 commits into
mainfrom
claude/root-dir-coverage-gate-v2

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

RAG impact: no retrieval behaviour change — this is documentation and issue-ledger maintenance only.

Verification

  • npm run check:outstanding-issues — passed (146 rows, unique IDs, no merge driver).
  • npm run check:branch-review-ledger — passed (205 live + 1206 archived records).
  • npm run docs:check-index — passed (49 roots/modules/routes and schema tables indexed).
  • npm run docs:check-links — passed (1413 references).
  • npx prettier --check CLAUDE.md docs/outstanding-issues.md docs/branch-review-ledger.md — passed.
  • git diff --check origin/main — passed.

Not run

No provider-backed, Supabase, OpenAI, browser, build, or deployment checks were run; this final diff is documentation-only.

Risk

Low. The issue-ledger table is temporarily re-padded by the repository formatter; PR #1479 is the separate queued change that removes that conflict-prone padding.

BigSimmo and others added 14 commits July 30, 2026 18:40
Organisation pass over the documentation surface and the orientation maps.
No product code, schema, or retrieval/ranking surface is touched.

Five dated point-in-time docs were sitting loose at the docs/ top level even
though docs/README.md documents where they belong:

- audit-handover-2026-07-14.md, audit-remediation-plan-2026-07-14.md and
  design-audit-2026-07-17.md move to docs/audit/
- rag-scalability-wip-remediation-2026-07-17.md (self-labelled "Superseded
  historical record") and rag-scalability-wip-review-handover-2026-07-15.md
  move to docs/archive/

Relative links inside the moved files are re-anchored to ../, and the two
inbound references are updated in docs/operator-backlog.md and
docs/archive/design-qa-2026-07-15.md. Contents are otherwise unchanged apart
from Prettier's table reflow.

The root codex-cloud-review/ directory moves to docs/prompts/codex-cloud-review/,
where review prompts already live; .prettierignore and .cursorindexingignore are
repointed so those verbatim inputs stay unformatted and unindexed.

docs/README.md gains the seventeen docs it never listed — including
search-chrome-behaviour.md, which AGENTS.md requires reading before search-chrome
work — plus a subdirectory map for rag-behaviour/, prompts/, codex/, evidence/,
audit/, redesign/, superpowers/ and archive/.

CLAUDE.md and docs/codebase-index.md now document the top-level directories they
omitted. Root data/ is the notable one: seven src/lib modules load it at runtime
and it is easily confused with src/data/.

scripts/check-docs-links.mjs gains a VERBATIM_DIRS skip for codex-cloud-review/.
Relocating that directory under docs/ brought it into the default scan, where two
of its internal references point at a path that never existed; the files are kept
byte-for-byte as provided, so the reference cannot be corrected. This mirrors the
existing archive/ and audit/ skip, and --all still sweeps them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…docs, and the cross-worktree pre-commit hook

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…e counts

The index claimed ~135 files and ~166 npm entries against an actual 188 and 203,
and 53 top-level scripts were unnamed — including ones AGENTS.md tells agents to
run by name: branch-review-ledger.mjs (the only sanctioned way to read or write
the review ledger), reconciliation-preflight.mjs, test-focused.mjs,
check-hosted-migration-role.mjs and sync-open-pr-branches.mjs.

Every one of the 168 top-level .mjs/.ts/.cjs scripts is now named, grouped by
purpose in the doc's existing style rather than itemised per file, with new
subsections for the review ledger/branch/skill tooling, live and staging
verification, and browser and performance capture.

The headline counts keep the exact '(N files)' / '(N entries)' shape and use the
recursive scripts/ file count, because in-flight tooling in the primary checkout
rewrites that sentence by regex; a note above the sentence records that contract
so it is not reworded back into prose.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… open

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Resolve docs/scripts-index.md by keeping this branch's gate-set
listing and main's Codex Cloud setup notes.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
check-codebase-index-coverage.mjs exists to catch "a module that never gets
added to the map, silently staling it", but it only looked inside src/ and at
supabase/schema.sql. Nothing looked at repo-root directories, which is how root
data/ came to be loaded at runtime by seven src/lib modules while appearing in
neither CLAUDE.md nor docs/codebase-index.md — and how it stayed easy to confuse
with the unrelated src/data/.

The new root pass discovers directories from `git ls-files`, not the filesystem:
the index documents the repository rather than one machine, so an untracked local
scratch directory or node_modules can never fail the gate.

Run red-then-green: the gate first reported .cursor, .design-sync and .vscode as
unindexed — three real gaps — and passes once documented, covering 49 top-level
entries where it previously covered 31.

Also corrects two stale counts. docs/scripts-index.md said 188 files and 203 npm
entries against an actual 191 and 206, having drifted within the hour as main
merged new scripts. CLAUDE.md's hardcoded "~160 files backing 194 npm scripts"
is removed rather than restated, because a hand-maintained count in a second
place is what produced the drift; it now points at the scripts index.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…:path check lied

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@supabase

supabase Bot commented Jul 30, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 23 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cc9df437-beb9-43f0-8dbb-a6a70889d5b4

📥 Commits

Reviewing files that changed from the base of the PR and between b100657 and 3986601.

📒 Files selected for processing (3)
  • CLAUDE.md
  • docs/branch-review-ledger.md
  • docs/outstanding-issues.md
📝 Walkthrough

Walkthrough

The coverage checker now includes tracked repository-root directories, validates their documentation, supports root-specific allowlisting, and has expanded tests. Related index, script-count, repository-layout, review-ledger, and issue-ledger documentation were updated.

Changes

Repository index coverage

Layer / File(s) Summary
Root coverage discovery and gap reporting
scripts/check-codebase-index-coverage.mjs
The checker discovers tracked root directories, adds root coverage candidates and section bounds, distinguishes root identifiers, and updates missing-coverage output.
Root coverage test coverage
tests/codebase-index-coverage.test.ts
Tests cover missing root directories, documented roots, module-name collisions, and allowlisted root gaps.
Index and script documentation alignment
CLAUDE.md, docs/codebase-index.md, docs/scripts-index.md, docs/branch-review-ledger.md
Repository layout, top-level directory guidance, script counts, and the coverage review record were updated.

Outstanding issue record correction

Layer / File(s) Summary
Issue 143 ledger correction
docs/outstanding-issues.md
The issue record now reflects the committed fail-open change, its undistributed branch state, and corrected path-mangling details.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Git
  participant CoverageChecker
  participant CodebaseIndex
  participant Allowlist
  Git->>CoverageChecker: provide tracked repository paths
  CoverageChecker->>CoverageChecker: discover root, module, and route groups
  CoverageChecker->>CodebaseIndex: extract documented coverage spans
  CodebaseIndex-->>CoverageChecker: documented entries
  CoverageChecker->>Allowlist: check suppressed gaps
  CoverageChecker-->>CodebaseIndex: report remaining missing entries
Loading

Possibly related PRs

Suggested reviewers: cursoragent

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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
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.
Title check ✅ Passed The title matches the docs-only cleanup theme and mentions real parts of the change, though it omits the root-coverage update.
Description check ✅ Passed The description covers Summary, Verification, Not run, and Risk; only non-critical template sections are missing for this docs-only PR.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

BigSimmo and others added 2 commits July 30, 2026 21:50
…1458

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ocs content

The three conflicts were all the squash-merge ancestry break: this branch was
stacked on the pre-merge #1436 head, so its copies of docs/codebase-index.md,
docs/scripts-index.md and docs/outstanding-issues.md collided with main's
squashed version.

Resolutions: kept this branch's corrected scripts-index counts (191/206 against
main's stale 188/203) and its three new root-directory rows; took main's
outstanding-issues wholesale because main renumbered the rows on merge (#135
became #144, next-id 145) and its ids are authoritative, then re-applied the
#143 correction on top.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@BigSimmo
BigSimmo enabled auto-merge (squash) July 30, 2026 14:06
@BigSimmo

Copy link
Copy Markdown
Owner Author

@cursoragent resolve merge conflict

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Merge conflict on PR #1458 is resolved and pushed.

Commit: b1006572 — merged origin/main into claude/root-dir-coverage-gate-v2

Conflicts resolved:

  • docs/codebase-index.md — kept the new .cursor/ / .design-sync/ / .vscode/ rows, and kept main’s rag-coverage-gate entry
  • docs/scripts-index.md — kept the corrected 191/206 counts
  • docs/outstanding-issues.md — took main’s #144 renumber and #135#137 status updates; kept this PR’s MSYS-corrected #143 text

Verified: docs:check-index (49 covered), check:outstanding-issues, docs:check-scripts, ledger guard, and the 10 coverage unit tests all pass. git merge-tree against origin/main is clean (16 ahead, 0 behind).

PR: #1458

Open in Web Open in Cursor 

Resolve conflicts in docs/codebase-index.md (keep root-dir rows +
main's rag-coverage-gate entry), docs/scripts-index.md (keep corrected
191/206 counts), and docs/outstanding-issues.md (take main's #144/#135#137
updates; keep this PR's MSYS-corrected #143 text).

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo disabled auto-merge July 30, 2026 14:11

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/check-codebase-index-coverage.mjs (1)

135-145: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the success message for root coverage.

discoverGroups() now adds kind: "root" groups, but the success path at Line 163 still describes the total as “top-level modules/routes.” Use “top-level directories/modules/routes” or “coverage groups” so successful output accurately reflects the new scope.

Proposed fix
-    `${INDEX_PATH} coverage OK: all ${groups.length} top-level modules/routes and ${tables.missing.length + tables.stale.length === 0 ? "all" : "checked"} schema tables are indexed.`,
+    `${INDEX_PATH} coverage OK: all ${groups.length} top-level directories/modules/routes and ${tables.missing.length + tables.stale.length === 0 ? "all" : "checked"} schema tables are indexed.`,
🤖 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 `@scripts/check-codebase-index-coverage.mjs` around lines 135 - 145, Update the
success message in the coverage reporting path that consumes discoverGroups() so
it no longer describes the total only as “top-level modules/routes”; refer to
“top-level directories/modules/routes” or “coverage groups,” while preserving
the existing success behavior and formatting.
🤖 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/outstanding-issues.md`:
- Line 163: The issue description redundantly repeats the primary-checkout state
and does not identify the affected artifact. Update issue `#143`’s “Why this is
not a fix” text to state clearly that the fail-open hook copy used by the shared
core.hooksPath is untracked in the primary checkout, so the mitigation is not
version-controlled or distributed. Remove the duplicated sentence while
preserving the surrounding distribution and merge-status details.

---

Outside diff comments:
In `@scripts/check-codebase-index-coverage.mjs`:
- Around line 135-145: Update the success message in the coverage reporting path
that consumes discoverGroups() so it no longer describes the total only as
“top-level modules/routes”; refer to “top-level directories/modules/routes” or
“coverage groups,” while preserving the existing success behavior and
formatting.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 32c5d0ac-2329-48a3-adc6-19dfa883d0f5

📥 Commits

Reviewing files that changed from the base of the PR and between 9e1d9cf and b100657.

📒 Files selected for processing (7)
  • CLAUDE.md
  • docs/branch-review-ledger.md
  • docs/codebase-index.md
  • docs/outstanding-issues.md
  • docs/scripts-index.md
  • scripts/check-codebase-index-coverage.mjs
  • tests/codebase-index-coverage.test.ts

Comment thread docs/outstanding-issues.md Outdated
BigSimmo and others added 2 commits July 30, 2026 22:23
…ording

Another session merged main into this branch and reworded #143 concurrently.
Both revisions carry the MSYS ref:path correction; this keeps the local wording,
which additionally records that copying the primary checkout's untracked hook
over that branch's version would have silently reverted its mixed-inputs guard.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@BigSimmo BigSimmo changed the title feat(gates): make docs:check-index cover tracked repo-root directories docs: close stale hook and script-count records Jul 30, 2026
@BigSimmo BigSimmo added the skip-branch-sync Opt out of hosted pr-branch-sync / update-branch on this PR label Jul 30, 2026
@BigSimmo
BigSimmo merged commit 907fd9f into main Jul 30, 2026
23 checks passed
@BigSimmo
BigSimmo deleted the claude/root-dir-coverage-gate-v2 branch July 30, 2026 18:57
BigSimmo added a commit that referenced this pull request Jul 31, 2026
…esson (#1511)

Two gaps: work was done and not recorded.

- docs/branch-review-ledger.md had no row for claude/root-dir-coverage-gate-v2
  (#1458), claude/pre-commit-fail-open (#1494) or claude/ledger-relanding
  (#1508). AGENTS.md requires one per reviewed branch; appended retrospectively
  with the merged heads.
- #154 records why three separate "did it land" checks returned false answers
  this session: title greps (reworded concurrently), id greps (ids reallocated
  in parallel branches), and PR state fields (squash merges, and a MERGED PR
  whose content had not reached the fetched ref). Resolve the blob and grep for
  distinctive prose instead.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-branch-sync Opt out of hosted pr-branch-sync / update-branch on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants