Skip to content

chore(docs): correct false claims in CLAUDE.md and ARCHITECTURE.md (#1235) - #1238

Merged
alfredo1996 merged 3 commits into
release/1.4from
chore/issue-1235-docs-accuracy
Jul 25, 2026
Merged

chore(docs): correct false claims in CLAUDE.md and ARCHITECTURE.md (#1235)#1238
alfredo1996 merged 3 commits into
release/1.4from
chore/issue-1235-docs-accuracy

Conversation

@alfredo1996

@alfredo1996 alfredo1996 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Closes #1235. Part of the v1.4 documentation-audit findings.

Problem

An internal docs audit cross-checked the repo's own documentation against the code and found load-bearing statements that are simply false. This matters more than ordinary drift because CLAUDE.md is loaded as ground truth by every agent session — a wrong claim there propagates into generated code.

Fixed

Location Was Now
CLAUDE.md testing table chart-registry chart-plugin-registryapp/src/lib/chart-registry.ts does not exist
CLAUDE.md multi-tenancy "tenant filter at ORM/middleware level" the actual per-query reality, with the missing-guard risk spelled out and #1226 linked
CLAUDE.md migrations "--skip-migrations flag exists" MIGRATE_ON_START=0 — no such flag exists
ARCHITECTURE.md "33 shadcn/ui primitives" 38
ARCHITECTURE.md "BaseChart + 12 types" BaseChart + 14

The tenancy wording is the important one: an agent reading "enforced at ORM level" will confidently write a route with no tenant filter.

Guard against recurrence

app/src/lib/__tests__/docs-accuracy.test.ts:

  • every backticked repo path in both docs must resolve on disk
  • stated component/chart counts must match the filesystem
  • a reworded claim fails the test rather than silently going unchecked
  • MIGRATE_ON_START must be documented, and the flag must not be asserted to exist (naming it to debunk it is allowed — readers search for it)

Verified RED before the fix (3 failures: 33≠38, 12≠14, flag claim) and GREEN after (6/6).

Tests

npm -w app run test -- src/lib/__tests__/docs-accuracy.test.ts — 6 passed. Docs-only change otherwise; no runtime code touched.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated architecture documentation with current chart and UI component counts.
    • Clarified testing boundaries, tenant filtering requirements, and migration startup configuration.
  • Tests

    • Added automated checks to detect outdated documentation paths, component counts, and migration guidance.

…1235)

CLAUDE.md is loaded as ground truth by agent sessions, so stale claims there
become wrong assumptions in generated code.

- chart-registry -> chart-plugin-registry (app/src/lib/chart-registry.ts does
  not exist; the registry is lib/plugin/chart-plugin-registry.ts + plugins/)
- multi-tenancy: describe the actual per-query enforcement instead of claiming
  ORM/middleware-level enforcement that does not exist; link #1226
- migrations: MIGRATE_ON_START=0, not a nonexistent --skip-migrations flag
- ARCHITECTURE.md counts: 38 ui primitives (was 33), BaseChart + 14 chart
  modules (was 12)

Adds app/src/lib/__tests__/docs-accuracy.test.ts to guard against recurrence:
path references must resolve, stated counts must match the filesystem, and a
reworded claim fails loudly rather than silently going unchecked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d6c4c58-0718-485b-8e2a-1c7608501055

📥 Commits

Reviewing files that changed from the base of the PR and between 123515c and b56c97d.

📒 Files selected for processing (2)
  • CLAUDE.md
  • app/src/lib/__tests__/docs-accuracy.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/lib/tests/docs-accuracy.test.ts
  • CLAUDE.md

Walkthrough

Updates CLAUDE.md and ARCHITECTURE.md to match repository conventions and current counts, then adds Vitest checks for documented paths, counts, and migration guidance.

Changes

Documentation accuracy

Layer / File(s) Summary
Repository documentation corrections
ARCHITECTURE.md, CLAUDE.md
Updates chart and UI primitive counts, pure-utils naming, per-query tenancy guidance, and MIGRATE_ON_START migration guidance.
Documentation drift validation
app/src/lib/__tests__/docs-accuracy.test.ts
Adds tests that verify referenced paths exist, documented counts match filesystem data, and migration guidance contains the expected configuration terms.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • alfredo1996/neoboard#675: Also updates migration-related guidance and is directly coupled to the new documentation assertions.

Suggested labels: documentation

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and accurately summarizes the docs corrections in CLAUDE.md and ARCHITECTURE.md.
Linked Issues check ✅ Passed The PR corrects the false claims, adds the docs-accuracy guard test, and updates the tenancy and migration guidance required by #1235.
Out of Scope Changes check ✅ Passed The changes stay focused on documentation fixes and a recurrence-guard test, with no clear unrelated scope added.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/issue-1235-docs-accuracy

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.

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

🤖 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 @.claude/launch.json:
- Around line 9-11: Update the Storybook launch command in the launch
configuration to remove the developer-specific hardcoded nvm Node path and align
Node selection with the repository’s supported Node version/source. Ensure the
command validates or selects a supported Node executable before running npm run
storybook, rather than silently falling back to another PATH version.

In `@app/src/lib/__tests__/docs-accuracy.test.ts`:
- Around line 90-95: Strengthen the assertion in the “CLAUDE.md documents
MIGRATE_ON_START, not a --skip-migrations flag” test so it requires the
canonical statement that no `--skip-migrations` CLI flag exists, rather than
only rejecting one exact phrase. Keep the existing MIGRATE_ON_START assertion
and ensure guidance recommending that flag cannot satisfy the test.

In `@CLAUDE.md`:
- Line 128: The documented database-client reference and documentation scanner
resolve different paths. Update CLAUDE.md to reference app/src/lib/db/index.ts,
and update docs-accuracy.test.ts to resolve supported app-local paths such as
lib/ under app/src/ or require repository-relative paths; apply the
corresponding changes at both listed sites.
🪄 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 Plus

Run ID: e463fc92-7d7e-4d61-988e-b1f5fcee6dae

📥 Commits

Reviewing files that changed from the base of the PR and between 1ec8b2f and 123515c.

📒 Files selected for processing (4)
  • .claude/launch.json
  • ARCHITECTURE.md
  • CLAUDE.md
  • app/src/lib/__tests__/docs-accuracy.test.ts

Comment thread .claude/launch.json Outdated
Comment on lines +9 to +11
"export PATH=\"$HOME/.nvm/versions/node/v22.21.1/bin:$PATH\"; exec npm run storybook"
],
"port": 6006

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== tracked launch.json =="
fd -a 'launch\.json$' .claude || true
if [ -f .claude/launch.json ]; then
  nl -ba .claude/launch.json | sed -n '1,120p'
fi

echo
echo "== node version declarations =="
for f in package.json .nvmrc .node-version; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    sed -n '1,160p' "$f"
  fi
done

echo
echo "== node-related scripts/config files =="
rg -n '"node"|"engines"|nvm|v22\.21\.1|`@nextcloud`' -S package.json .claude . (glob:!node_modules) || true

echo
echo "== Bash fallback semantics probe =="
tmpdir="$(mktemp -d)"
cat > "$tmpdir/make_path_scenario.sh" <<'BASH'
#!/usr/bin/env bash
HOME="$TMPDIR" PATH="$TMPDIR/bin:$TMPDIR/missing-subdir:$TMPDIR/lib:$PATH" sh -c 'export PATH="$HOME/.nvm/versions/node/v22.21.1/bin:$PATH"; type -a npm; [ -x "$(command -v npm 2>/dev/null || true)" ] && npm --help >/dev/null 2>&1'
BASH
TMPDIR="$tmpdir" bash "$tmpdir/make_path_scenario.sh"

Repository: alfredo1996/neoboard

Length of output: 263


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== .claude/launch.json =="
python3 - <<'PYTHON'
from pathlib import Path
p=Path('.claude/launch.json')
if p.exists():
    for i,line in enumerate(p.read_text().splitlines(),1):
        if 0 < i < 140:
            print(f"{i:4d}: {line}")
else:
    print("missing")
PYTHON

echo
echo "== node version declarations =="
for f in package.json .nvmrc .node-version; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    python3 -c "from pathlib import Path; print(Path('$f').read_text())"
  fi
  true
done

echo
echo "== node-related mentions =="
python3 - <<'PYTHON'
from pathlib import Path
for p in Path('.').rglob('*'):
    if p.is_file() and p not in (Path('.git'), Path('.github'), Path('node_modules'), Path('.claude')) and any(part in ('node_modules','.git') for part in p.parts):
        pass
    if p.is_file() and p != Path('.claude/launch.json'):
        txt = p.read_text(errors='ignore')
        if any(s in txt for s in ['"node"', 'nvm', 'v22.21.1', '.claude/launch.json']):
            print(f"\n--- {p} ---")
            for i,line in enumerate(txt.splitlines(),1):
                if any(s in line for s in ['"node"', 'nvm', 'v22.21.1']):
                    print(f"{i:4d}: {line}")
PYTHON

echo
echo "== Bash export fallback semantics probe =="
tmpdir="$(mktemp -ด)"
mkdir -p "$tmpdir/bin"
cat > "$tmpdir/bin/npm" <<'BASH'
#!/usr/bin/env bash
printf 'npm-version-fallback\n'
BASH
chmod +x "$tmpdir/bin/npm"

(
  HOME="$tmpdir" PATH="$tmpdir/bin" bash -c 'export PATH="$HOME/.nvm/versions/node/v22.21.1/bin:$PATH"; printf "npm: "; command -v npm; command -v npm >/dev/null && npm'
)

rm -rf "$tmpdir"

Repository: alfredo1996/neoboard

Length of output: 50377


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== .claude/launch.json =="
python3 - <<'PYTHON'
from pathlib import Path
p=Path('.claude/launch.json')
if p.exists():
    for i,line in enumerate(p.read_text().splitlines(),1):
        if 0 < i < 140:
            print(f"{i:4d}: {line}")
else:
    print("missing")
PYTHON

echo
echo "== node version declarations =="
for f in package.json .nvmrc .node-version; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    python3 -c "from pathlib import Path; print(Path('$f').read_text())"
  fi
  true
done

echo
echo "== node-related mentions =="
python3 - <<'PYTHON'
from pathlib import Path
for p in Path('.').rglob('*'):
    if p.is_file() and p != Path('.claude/launch.json') and any(part in ('node_modules','.git') for part in p.parts) == False:
        txt = p.read_text(errors='ignore')
        if any(s in txt for s in ['"node"', 'nvm', 'v22.21.1']):
            print(f"\n--- {p} ---")
            for i,line in enumerate(txt.splitlines(),1):
                if any(s in line for s in ['"node"', 'nvm', 'v22.21.1']):
                    print(f"{i:4d}: {line}")
PYTHON

echo
echo "== Bash export fallback semantics probe =="
tmpdir="$(mktemp -d)"
mkdir -p "$tmpdir/bin"
cat > "$tmpdir/bin/npm" <<'BASH'
#!/usr/bin/env bash
printf 'npm-version-fallback\n'
BASH
chmod +x "$tmpdir/bin/npm"

(
  HOME="$tmpdir" PATH="$tmpdir/bin" bash -c 'export PATH="$HOME/.nvm/versions/node/v22.21.1/bin:$PATH"; printf "npm: "; command -v npm; command -v npm >/dev/null && npm'
)

rm -rf "$tmpdir"

Repository: alfredo1996/neoboard

Length of output: 41181


Avoid hardcoding the Storybook Node version in .claude/launch.json.

NODE is currently 20, not 22.21.1, and the path is developer-specific. If that directory is missing, npm falls back to whatever is found next on PATH, so Storybook may start with the wrong node. Align this with the repo’s Node source or check a supported node version before exec npm run storybook.

🤖 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 @.claude/launch.json around lines 9 - 11, Update the Storybook launch command
in the launch configuration to remove the developer-specific hardcoded nvm Node
path and align Node selection with the repository’s supported Node
version/source. Ensure the command validates or selects a supported Node
executable before running npm run storybook, rather than silently falling back
to another PATH version.

Comment thread app/src/lib/__tests__/docs-accuracy.test.ts Outdated
Comment thread CLAUDE.md Outdated
alfredorubin96 and others added 2 commits July 25, 2026 03:38
Local editor config swept in by git add -A; unrelated to the docs fix and
not previously tracked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- CLAUDE.md: use the repo-relative `app/src/lib/db/index.ts` so the new
  path scanner actually validates it (bare `lib/` is outside the checked
  prefixes — the guard was silently skipping its own reference)
- docs-accuracy: assert the canonical debunk wording is present instead of
  blocklisting one phrasing; "use --skip-migrations" would have slipped past
  the negative regex

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@alfredo1996
alfredo1996 merged commit d2851f4 into release/1.4 Jul 25, 2026
25 of 26 checks passed
@alfredo1996
alfredo1996 deleted the chore/issue-1235-docs-accuracy branch July 25, 2026 11:30
alfredo1996 added a commit that referenced this pull request Jul 25, 2026
…) (#1242)

The TypeScript incremental-build cache was tracked, so every build dirtied
the working tree and got swept into unrelated commits by git add -A (it
polluted both #1238 and #1239 and had to be reverted by hand).

- ignore *.tsbuildinfo and untrack app/tsconfig.tsbuildinfo
- ignore .claude/launch.json (per-developer local config, previously
  untracked-but-not-ignored, i.e. the same accident waiting to happen)
- app/next-env.d.ts stays TRACKED on purpose: the CI typecheck job runs
  tsc --noEmit with no prior next build, so nothing regenerates it there.
  Documented inline so it does not get 'tidied' away later.

Verified: tsc --noEmit passes for app and component, and the working tree
stays clean after a type-check run.

Co-authored-by: alfredorubin96 <alfredo.rubin@neotechnology.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants