Skip to content

docs: documentation standards + party golden module (handoff hardening) - #472

Merged
naasanov merged 14 commits into
mainfrom
docs/handoff-documentation
Jun 26, 2026
Merged

docs: documentation standards + party golden module (handoff hardening)#472
naasanov merged 14 commits into
mainfrom
docs/handoff-documentation

Conversation

@naasanov

Copy link
Copy Markdown
Collaborator

Robust documentation for the IT handoff: IT is unfamiliar with the stack and will delegate fixes to AI agents, so we're standardizing docstrings, OpenAPI, and agent guidance. This is Session 1 of 4 (foundations + the golden reference module); the remaining sessions fan out the standard across all modules, then update the READMEs and Notion TDD.

Changes:

  • Backend docstring linter: enabled Ruff D rules (Google convention) repo-wide, with a shrinking per-file-ignores rollout list — undocumented areas are exempt until done, then removed one-by-one.
  • Structured OpenAPI errors: added ErrorResponse model + error_response() helper and a shared PAGINATED_QUERY_RESPONSES constant so error responses aren't re-typed per route.
  • Backend golden module: fully documented the party module (router/service/entity/model) — Google docstrings, summary on every route, reachable-only error responses, request examples on create_party.
  • Frontend docstring linter: added eslint-plugin-jsdoc (exports only, no type tags since the stack is typed) with an opt-in rollout allowlist.
  • Frontend golden module: fully documented the party API domain + the useServerTableState hook.
  • Agent files: nested AGENTS.md (root/backend/frontend) with CLAUDE.md symlinks; migrated .claude/CLAUDE.md. Documents the strict layering, naming conventions, docstring standards (with examples + skip rules), and verification.

All 10 pre-commit hooks pass repo-wide; the OpenAPI schema was verified to generate with the new summaries, examples, and error schemas.

Draft because this is the foundation for the multi-session rollout — subsequent commits will document the remaining modules behind the same linters.

🤖 Generated with Claude Code

Establish the documentation foundations for the IT handoff. Arms docstring
linters repo-wide and fully documents the party module in both stacks as the
golden reference that the remaining modules will mirror.

- Backend: enable Ruff `D` (Google convention) with a shrinking per-file-ignore
  rollout list; add `ErrorResponse` model + `error_response()` and
  `PAGINATED_QUERY_RESPONSES` helpers; fully docstring + OpenAPI the party module
  (summary, reachable error responses, request examples).
- Frontend: add eslint-plugin-jsdoc (exports only, no type tags) with an opt-in
  rollout allowlist; fully document the party API domain + useServerTableState.
- Agents: nested AGENTS.md (root/backend/frontend) with CLAUDE.md symlinks;
  migrate .claude/CLAUDE.md; document layering, naming, docstring conventions,
  and verification.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

Test Results Summary

870 tests  ±0   870 ✅ ±0   1m 5s ⏱️ -7s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit f9287a0. ± Comparison against base commit bd6594c.

♻️ This comment has been updated with latest results.

naasanov and others added 5 commits June 22, 2026 23:06
Fan out the golden-module standard across account, auth, student, police,
incident, location, and notification — Google docstrings on every public
symbol, summary on every route, reachable-only error responses via the shared
error_response()/PAGINATED_QUERY_RESPONSES helpers. Removes each module's
per-file-ignore from the Ruff D rollout list; D is now enforced on all modules
(only main.py and core/** remain pending). All 60 routes now have summaries.

Note: the location router's autocomplete/place-details endpoints had a catch-all
`except Exception` that re-wrapped typed exceptions (incl. 404/400) as a generic
500. Removed it so the typed exceptions propagate correctly and the documented
responses are accurate — a small behavior fix (404/400 were previously masked).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Docstring all of src/core (auth, config, database, exceptions, types, and the
utils: query, email, date, excel, phone, bcrypt) plus main.py. Removes the last
rollout exemptions, so Ruff D now enforces docstrings across all of backend/src
(only tests, migrations, and scripts remain exempt).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add TSDoc to every exported function/class/component/hook across the frontend:
the remaining lib/api domains, lib utils/auth/config, components, contexts, and
the staff/police/student route groups. Flip eslint-plugin-jsdoc from the opt-in
allowlist to enforce on all of src/** (components/ui exempt).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- backend/README.md: architecture, module pattern, API docs (/docs, /redoc),
  common tasks (tests, migrations, dev scripts), verification.
- frontend/README.md: App Router layout, the service/queries/types trio,
  route-access model, scripts, conventions.
- Root README: new "Documentation & Architecture" section linking the sub-READMEs,
  AGENTS.md, the live API docs, the layer diagram, and a Notion TDD placeholder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@naasanov
naasanov marked this pull request as ready for review June 24, 2026 19:40
@naasanov
naasanov merged commit 390d000 into main Jun 26, 2026
3 checks passed
@naasanov
naasanov deleted the docs/handoff-documentation branch June 26, 2026 18:37
@naasanov naasanov mentioned this pull request Jun 26, 2026
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