Skip to content

docs(guides): trim the guides and load docs/testing.md only for test work - #314

Merged
Ardnived merged 1 commit into
mainfrom
docs/doctor-trim
Oct 20, 2026
Merged

Ardnived merged 1 commit into
mainfrom
docs/doctor-trim

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

  • Always-loaded guidance, root plus imports, falls from 76,236 to 14,559 chars. docs/testing.md now loads only for test work.
  • Fixes the stale claims the guidance audit found. Docs-only: every non-Markdown edit is a comment.

Change outline

What every session loads

The root AGENTS.md no longer @-imports docs/testing.md. In its place, a 1,099-char ## Testing block holds the validation policy (the per-edit hook selection, the lean gate before a PR, the rest left to CI) and the never-rules: no Testing Library or default jsdom, no assertion counted until it has failed, no bare-200 smoke assertion, no wrangler preview.

docs/rules/code-comments.md still loads unconditionally (2,814 chars). With it, the always-loaded total is about 17.4k.

docs/testing.md becomes a path-scoped rule, at its own path

It gains a paths: list (**/*.test.ts(x), tests/**, src/test-support/**, both vitest configs, select-unit-specs.mjs, assert-preview-host.mjs, the unit-test hook, ci.yml, production-smoke.yml). It loads through a new .claude/rules/testing.md symlink. The file stays at docs/testing.md because about 60 specs, scripts and workflow comments cite that path, so none of them needed a repoint. The repo has no Playwright config, so none is listed.

The content trim was conservative (43,811 → 43,177 chars, after adding about 750 chars of front matter and header). It removed the lanes table and the CI gate list (package.json and ci.yml show both), the tsconfig split, an inventory of what the unit lane covers, and a parenthetical that repeated the portal ⚠. Every gotcha, measurement, flake record and never-rule stays.

Trims and moves (already approved, committed here)

File Chars before → after
AGENTS.md 32,425 → 14,559
docs/testing.md 43,811 → 43,177
src/components/AGENTS.md 39,728 → 39,414
src/AGENTS.md 8,090 → 6,509
docs/rules/data-layer.md 28,983 → 25,738
docs/rules/code-comments.md 2,756 → 2,814
docs/rules/deployment.md (new, + .claude/rules/ symlink) 0 → 8,459
scripts/AGENTS.md (new, + CLAUDE.md symlink) 0 → 1,907
  • Deploy topology, the public/ deploy files, the source-map policy, and the Dependency Review and check:wrangler gates moved from root to docs/rules/deployment.md.
  • The pnpm size budget and the per-graph Sentry gap moved to scripts/AGENTS.md.
  • Every pointer to the moved sections was repointed: README, docs/architecture.md, docs/environment.md, docs/mcp-setup.md, docs/testing.md, plus comments in ci.yml, wrangler.jsonc and check-bundle-size.mjs.

src/components/AGENTS.md is not split

It does not divide cleanly by subdirectory. The compact-card section, the best candidate, spans src/App.tsx (AppShell), src/views/, src/lib/ and src/hooks/. It is also interleaved with the shadow-DOM patch notes, which apply to every Radix primitive in atoms/.

Stale fixes

Each claim was checked against the code. The docs were changed to match, never the code.

  • Fixed: the "per-edit hook checks the file you touched" claim (src/AGENTS.md); no typecheck hook exists. The provider stack (providers.tsx is StrictMode + Query + Helmet + MotionConfig; BrandTheme mounts in App). "Not the Dialog atom" → "not an atom". The fetcher list in data-layer.md (getCountry, getArea and getVenue do not exist). The .env comment saying the Sentry build vars go "on the Pages project only". The jsx-sort-props duplicate, merged into code-comments.md's carve-out.
  • Already gone with the approved cuts: root items 1–8 and data-layer items 2–4 (tech-stack rows, the file tree, the env list, the getClient and getAtlasConfig entries, the src/types/payload/ line), and the no-explicit-any claim.
  • Also fixed: mapIsContained, a name that no longer exists, now reads mapMode in the guide and in the embed-slot.ts docblock. lib/embed-slot.ts is mentioned again in the compact-card section, as the home of resolveDestination, embedLayout and SLOT_GAIN.

Preview

None: this PR changes only docs and comments.

Test results

  • Targeted specs: embed-slot, slot-decision, wrangler-config, ci-workflows, select-unit-specs and brand: 6 files, 103 passed.
  • eslint --max-warnings 0 on the two touched code files: clean.
  • pnpm sync:atlas-contract: byte-identical to SahajCloud. pnpm sync:translations was not run, because it needs ATLAS_API_KEY.
  • Docs checks: every code fence is balanced, every paths: glob matches at least one file, every symlink resolves, every relative Markdown link resolves.
  • Lean gate: not run. This PR changes only docs and comments.

Notes for reviewer

  • The .claude/rules/testing.md and .claude/rules/deployment.md symlinks are Protected-Path writes.
  • .env matches the security-review trigger, but its change here is one comment.
  • No CHANGELOG.md or docs/embedding.md entry: a host sees no change.
  • No Claude-Session: trailer: this local session's attribution supplied none.

🤖 Generated with Claude Code

…work

Cut what a session can rebuild from the code (the tech-stack table, the
package.json scripts, the file tree, the env list, restated configs) and
move single-scope blocks next to the files they govern: the deploy
topology to docs/rules/deployment.md, the bundle-size budget to
scripts/AGENTS.md.

The root guide no longer imports docs/testing.md into every session. A
short Testing block keeps the validation policy and the never-rules;
docs/testing.md gains a paths: list and loads through a
.claude/rules/testing.md symlink when a spec, a vitest config or the
test tooling is read. It stays at its own path because the specs cite it
there.

Fix the stale claims the audit found: the retired typecheck hook, the
providers stack, the Dialog atom, the fetchers that no longer exist, the
renamed mapIsContained, and where the Sentry build vars go. Point the
compact-card section back at lib/embed-slot.ts. Non-Markdown edits are
comment-only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sahajatlas with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9d9d671
Status: ✅  Deploy successful!
Preview URL: https://bc2182a7.sahajatlas.pages.dev
Branch Preview URL: https://docs-doctor-trim.sahajatlas.pages.dev

View logs

@Ardnived
Ardnived merged commit 406e6a7 into main Oct 20, 2026
11 checks passed
@Ardnived
Ardnived deleted the docs/doctor-trim branch October 20, 2026 23:02
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant