Skip to content

Add a frontend zero-tolerance TypeDoc documentation gate#156

Open
leynos wants to merge 2 commits into
mainfrom
typedoc-rollout
Open

Add a frontend zero-tolerance TypeDoc documentation gate#156
leynos wants to merge 2 commits into
mainfrom
typedoc-rollout

Conversation

@leynos

@leynos leynos commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

This branch adds a zero-tolerance TypeDoc documentation gate for the
frontend PWA. TypeDoc's notDocumented validation runs over
frontend-pwa/src (entryPointStrategy: "expand") with
emit: "none" and validation warnings treated as errors: every
exported declaration must carry a JSDoc comment. The gate reports the
qualified name of each undocumented declaration, writes no
documentation artefacts, and fails on a single omission. It is exposed
as make frontend-docs-check and runs in the frontend CI path after
frontend-typecheck; the Rust documentation gate is unaffected.

The first commit documents the frontend surface (131 initial
warnings); the second wires the gate.

Review walkthrough

Validation

  • Frontend gates run sequentially, all green: make frontend-lint,
    make frontend-typecheck, make frontend-docs-check,
    make frontend-test, make frontend-test-a11y,
    make frontend-localizability, make frontend-semantic.
  • Mutation check: deleting the JSDoc block from the exported
    AppShell component makes bun run docs:check exit 4 naming the
    symbol; restoring it returns the gate to green.
  • A clean docs:check run emits no files and no output.

Notes

leynos added 2 commits July 18, 2026 00:29
Prepare for a zero-tolerance TypeDoc documentation gate over
`frontend-pwa/src`: add JSDoc to every exported declaration and
property across the task slice (domain, ports, application, adapters),
the app shell, router factory, route pages, and the i18n runtime. Tag
the `en-gb` message catalogue `@internal` — it is a data seam whose
keys need no per-entry documentation — and document the `MessageKey`
union that keeps `t()` calls checked against it.
Add `make frontend-docs-check`, wrapping `bun run docs:check` inside
`frontend-pwa`: TypeDoc's `notDocumented` validation over
`frontend-pwa/src` (`entryPointStrategy: "expand"`, `emit: "none"`,
validation warnings as errors), configured by
`frontend-pwa/typedoc.json`. The gate requires 100% documentation of
the frontend surface, reports the qualified name of each undocumented
declaration, and writes no documentation artefacts. The frontend CI
path runs it after `frontend-typecheck`; the Rust documentation gate
is unaffected.

@sourcery-ai sourcery-ai 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.

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Summary

  • Added a zero-tolerance TypeDoc gate for exported declarations under frontend-pwa/src, with warnings treated as errors and no documentation artefacts emitted.
  • Added make frontend-docs-check, frontend CI integration after type checking, and developer documentation.
  • Added JSDoc coverage across the app shell, routing, pages, i18n runtime, and task-slice domain, application, and adapter layers.
  • Extended task-slice contracts with TaskStateViewModel.tone, TaskGatewayError, and TaskSliceGateway.transitionTask.
  • Validation confirms all frontend gates pass, no artefacts are emitted, and removing AppShell documentation fails the gate.

Walkthrough

The change adds a strict, non-emitting TypeDoc gate for frontend-pwa/src, documents exported frontend declarations, extends task-related contracts, and runs the gate after frontend typechecking in CI.

Changes

Frontend TypeDoc gate

Layer / File(s) Summary
TypeDoc configuration and command wiring
.github/workflows/ci.yml, Makefile, frontend-pwa/package.json, frontend-pwa/typedoc.json, docs/developers-guide.md
Configure strict TypeDoc validation, add the docs:check and Make targets, document the gate, and run it in CI.
Frontend declaration documentation
frontend-pwa/src/app/*, frontend-pwa/src/i18n/*, frontend-pwa/src/routes/*, frontend-pwa/src/task_slice/domain/*
Add JSDoc for application, routing, internationalisation, form, view-model, and task domain declarations; add tone to TaskStateViewModel.
Task gateway and query contracts
frontend-pwa/src/task_slice/ports/task-slice-gateway.ts, frontend-pwa/src/task_slice/adapters/http/http-task-gateway.ts, frontend-pwa/src/task_slice/application/task-queries.ts
Document gateway and query exports, define gateway error categories, and add transitionTask to the gateway interface.

Possibly related PRs

  • leynos/dakar#5: Introduces a similarly wired zero-tolerance TypeDoc documentation gate.

Poem

TypeDoc watches, strict and bright,
JSDoc guides each exported flight.
Make and CI join the tune,
No artefacts left beneath the moon.
Contracts gain a clearer tone.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 2 warnings)

Check name Status Explanation Resolution
Testing (Overall) ❌ Error The PR adds a new frontend-docs-check gate and CI step, but no test exercises it; validation is only described manually, not automated. Add a substantive automated regression test for docs:check (positive and negative cases) or equivalent coverage that fails when exported docs are removed.
Testing (Unit And Behavioural) ⚠️ Warning The PR adds a new docs gate and CI/Makefile entry, but no test exercises docs:check or the new workflow boundary; existing tests only cover task routes and gateways. Add a behavioural smoke test for bun run docs:check/make frontend-docs-check with both pass and fail cases, and extend coverage for any newly exposed frontend workflow.
Testing (Compile-Time / Ui) ⚠️ Warning The PR adds the TypeDoc gate, but frontend-pwa/tests contains only unit/a11y/e2e files and no trybuild-equivalent or snapshot test for docs:check. Add a focused trybuild-style test or equivalent fixture that proves an undocumented export makes docs:check fail with the symbol name.
✅ Passed checks (17 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: a zero-tolerance TypeDoc documentation gate for the frontend.
Description check ✅ Passed The description directly matches the documented frontend TypeDoc gate, CI wiring, Makefile target, and JSDoc rollout.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
User-Facing Documentation ✅ Passed The PR is developer-facing only: it adds TypeDoc gates/JSDoc comments, while the user guide already documents the frontend PWA routes and behaviour and no user-facing flow changed.
Developer Documentation ✅ Passed docs/developers-guide.md documents make frontend-docs-check; roadmap 4.4.2 is checked off, the execplan is current, and only en-gb exists so locale sync is moot.
Module-Level Documentation ✅ Passed PASS: every touched frontend module starts with a top-level JSDoc block stating its purpose and links to surrounding shell, router, i18n, route, and task-slice modules.
Testing (Property / Proof) ✅ Passed No new runtime invariant or state transition is introduced; the PR only adds TypeDoc docs/CI wiring and JSDoc, so property/proof testing is not warranted.
Unit Architecture ✅ Passed Docs-only changes; query reads stay in useQuery and mutations stay behind injected TaskSliceGateway, so separation stays explicit.
Domain Architecture ✅ Passed PASS: boundary stays explicit—domain files add docs and a UI view-model, while HTTP error mapping and route/framework coupling remain in adapters and presentation.
Observability ✅ Passed PASS: the PR only adds documentation, TypeDoc config, and CI wiring; no production observability gaps arise from a runtime behaviour change.
Security And Privacy ✅ Passed Approve the change: it adds docs/CI plumbing only, with no secrets, auth changes, permission broadening, or unsafe input sinks.
Performance And Resource Use ✅ Passed Diff is docs/config-only: source edits are JSDoc/type-only, and the new docs gate is CI-only over finite frontend-pwa/src with emit: none and excludes.
Concurrency And State ✅ Passed No new shared mutable state or async control flow was introduced; the diff is docs/config only, and the existing fixture gateway already serializes concurrent state.
Architectural Complexity And Maintainability ✅ Passed Gateway error class and transitionTask are used immediately by fixture, HTTP adapter, and route, and the execplan documents the seam.
Rust Compiler Lint Integrity ✅ Passed No Rust files or Cargo manifests changed in the PR diff, and no lint suppressions or artificial clone anchors appear in changed files.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch typedoc-rollout
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch typedoc-rollout

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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 050e808281

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +27 to +29
/**
* Render an issue origin as `provider/repository/#number` for display.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add usage examples to the new function documentation

This JSDoc block, like the other function documentation added in this commit, only summarizes the function and does not demonstrate a call and its resulting output. The repository explicitly requires every function’s documentation to contain a clear usage-and-outcome example, so add an @example section here and to the other newly documented functions.

AGENTS.md reference: AGENTS.md:L27-L30

Useful? React with 👍 / 👎.

Comment thread frontend-pwa/typedoc.json
Comment on lines +12 to +14
"**/tests/**",
"**/test/**",
"**/fixtures/**"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude co-located test filenames from TypeDoc

With the expand entry-point strategy rooted at src, these patterns exclude only directories named test or tests; they do not match the eight existing co-located files such as src/routes/task-routes.test.tsx. Consequently those test modules are part of the documentation gate, and exporting a shared fixture or helper from one will unexpectedly require production API documentation and fail CI. Add filename exclusions such as **/*.test.* and **/*.spec.*.

Useful? React with 👍 / 👎.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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

🤖 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 `@frontend-pwa/src/task_slice/application/task-queries.ts`:
- Around line 12-15: The documentation above the task creation flow inaccurately
promises that seeding the detail cache avoids a redundant fetch. Update the
comment to state that cached data is rendered while the detail query revalidates
under React Query defaults, or modify useTaskDetailQuery with an explicit
staleTime/refetchOnMount policy only if avoiding the immediate request is
required.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 53fb3405-b0fc-44a0-aec8-510184eeb34b

📥 Commits

Reviewing files that changed from the base of the PR and between 8847938 and 050e808.

⛔ Files ignored due to path filters (1)
  • frontend-pwa/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • .github/workflows/ci.yml
  • Makefile
  • docs/developers-guide.md
  • frontend-pwa/package.json
  • frontend-pwa/src/app/app-shell.tsx
  • frontend-pwa/src/app/router.tsx
  • frontend-pwa/src/i18n/en-gb.ts
  • frontend-pwa/src/i18n/runtime.tsx
  • frontend-pwa/src/routes/task-create-page.tsx
  • frontend-pwa/src/routes/task-detail-page.tsx
  • frontend-pwa/src/task_slice/adapters/http/http-task-gateway.ts
  • frontend-pwa/src/task_slice/application/task-queries.ts
  • frontend-pwa/src/task_slice/domain/task-form.ts
  • frontend-pwa/src/task_slice/domain/task-view-model.ts
  • frontend-pwa/src/task_slice/domain/task.ts
  • frontend-pwa/src/task_slice/ports/task-slice-gateway.ts
  • frontend-pwa/typedoc.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/whitaker (auto-detected)
  • leynos/podbot (auto-detected)
  • leynos/frankie (auto-detected)
  • leynos/weaver (auto-detected)
  • leynos/rstest-bdd (auto-detected)

Comment on lines +12 to +15
/**
* Create a task through the gateway and seed the detail query cache with
* the result so the next detail view avoids a redundant fetch.
*/

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.

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

git ls-files frontend-pwa/src/task_slice/application/task-queries.ts frontend-pwa/src/task_slice -z | tr '\0' '\n'

printf '\n--- task-queries.ts ---\n'
cat -n frontend-pwa/src/task_slice/application/task-queries.ts

printf '\n--- search for useTaskDetailQuery ---\n'
rg -n "useTaskDetailQuery|staleTime|refetchOnMount|setQueryData|queryKey" frontend-pwa/src/task_slice -S

Repository: leynos/corbusier

Length of output: 3069


Clarify the cache behaviour in frontend-pwa/src/task_slice/application/task-queries.ts:12-15. setQueryData primes ['task', task.id], but useTaskDetailQuery still uses React Query defaults, so a mounted detail view can refetch immediately. Rewrite this to say it renders cached data while revalidating, or set an explicit staleTime/refetchOnMount policy if skipping that request is required.

🤖 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 `@frontend-pwa/src/task_slice/application/task-queries.ts` around lines 12 -
15, The documentation above the task creation flow inaccurately promises that
seeding the detail cache avoids a redundant fetch. Update the comment to state
that cached data is rendered while the detail query revalidates under React
Query defaults, or modify useTaskDetailQuery with an explicit
staleTime/refetchOnMount policy only if avoiding the immediate request is
required.

Source: MCP tools

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