Skip to content

Replace the docstring audit with a zero-tolerance TypeDoc gate#5

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

Replace the docstring audit with a zero-tolerance TypeDoc gate#5
leynos wants to merge 6 commits into
mainfrom
typedoc-rollout

Conversation

@leynos

@leynos leynos commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

This branch replaces Dakar's threshold-based docstring audit
(scripts/check-docstrings.mjs, 80% minimum) with a zero-tolerance
TypeDoc documentation gate. TypeDoc's notDocumented validation now
runs over bin, scripts, and src/workflows/dakar-review with
entryPointStrategy: "expand", emit: "none", and warnings treated as
errors: every module must open with a /** … @module */ block and every
exported declaration must carry a JSDoc comment. The gate reports the
qualified name of each undocumented declaration, writes no documentation
artefacts, and fails the build on a single omission.

The branch lands in two commits: the first documents every exported
declaration in the review surface while the old audit still gates it;
the second swaps the gate, converts the @file headers to TypeDoc's
@module form (preserving the module-header rule rather than retiring
it), and deletes the custom AST-counting audit.

Review walkthrough

  • Start with typedoc.json
    and tsconfig.typedoc.json
    for the gate's configuration: the documentation surface, the exclusions
    (generated workflows/dakar-review.js, ambient *.d.ts, meta.js,
    tests), and the JavaScript-inclusion compiler settings (allowJs with
    checkJs false — this adds a documentation gate, not a new JS
    type-checking policy).
  • Then review the Makefile
    and package.json
    for the wiring: docs-check replaces docstrings inside make lint,
    so make check reaches it, and
    .github/workflows/ci.yml
    gains an npm ci + make docs-check step.
  • The documentation pass itself is best sampled via
    src/workflows/dakar-review/types.ts
    (the bulk of the property documentation) and
    scripts/review-state.mjs,
    where inline @returns {{ … }} shapes became named, documented
    @typedefs so their properties can carry genuine descriptions.
  • src/workflows/dakar-review/schemas.ts
    shows the *_SCHEMA treatment: each constant carries a documented
    /** … @internal */ block, so TypeDoc does not recurse into the JSON
    Schema literals — their description fields remain the per-field
    documentation.
  • Finish with AGENTS.md
    and docs/developers-guide.md
    for the updated conventions.

Validation

  • make check (full aggregate: check-fmt, lint including the new
    docs-check, typecheck with the ODW dry run, workflow freshness,
    tests, spelling): exit 0 on both commits.
  • Mutation check: deleting the JSDoc block from a documented function
    makes npm run docs:check exit 4 with
    scripts/review-state.slug (CallSignature) … does not have any documentation; restoring it returns the gate to green.
  • A clean docs:check run emits no files and no output.

Notes

  • The old audit also counted unexported internal functions; the TypeDoc
    gate deliberately treats exports as the documentation boundary, so
    unexported local helpers are no longer counted. Existing internal-helper
    documentation is untouched.
  • The historical execplan
    docs/execplans/compile-dakar-review-workflow.md
    still describes the retired npm run docstrings audit; it is a
    completed plan and has been left as a historical record.

References

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

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

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

Walkthrough

Replace the docstring coverage audit with strict TypeDoc validation, document Dakar workflow contracts and JavaScript helpers, add two typed fields, update check wiring, and run ODW build and repository gates in CI.

Changes

Documentation gate

Layer / File(s) Summary
Configure the TypeDoc gate
typedoc.json, tsconfig.typedoc.json, package.json, Makefile, scripts/check-docstrings.mjs, tests/docstrings.test.mjs
Configure docs:check with TypeDoc validation, wire make docs-check into linting, and remove the former docstring audit path.
Document workflow contracts
src/workflows/dakar-review/*
Add module and declaration documentation, annotate schemas as internal, add reviewModels to TaskGraphConfig, and add status and repoRoot to shared contracts.
Annotate JavaScript helpers
bin/dakar-review.mjs, scripts/*.mjs
Expand module documentation, add named result typedefs and field-level return annotations, and persist WorkflowBuildError.code.
Wire documentation checks into authoring and CI
AGENTS.md, docs/developers-guide.md, .github/workflows/ci.yml
Document the TypeDoc requirements, pin the ODW revision, build and install its CLI, and run make check in CI.

Possibly related PRs

  • leynos/dakar#3: Replaces the same docstring audit flow with the TypeDoc-based documentation gate.
  • leynos/df12-build#62: Applies the same strict TypeDoc notDocumented gate pattern.
  • leynos/dakar#6: Extends related Dakar workflow contracts in the same review implementation.

Poem

TypeDoc guards the gate,
JSDoc lights each module’s way,
Contracts gain new names,
ODW builds in CI,
And commit checks march on.


Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error, 3 warnings)

Check name Status Explanation Resolution
Testing (Overall) ❌ Error No tests cover the new docs-check gate; searches found zero docs-check/typedoc references in tests, and the old docstrings suite was deleted. Add integration tests for npm run docs:check/make docs-check, with documented and undocumented fixtures proving pass/fail behaviour.
Developer Documentation ⚠️ Warning Fix docs/developers-guide.md: it still mandates /** @file … */ at lines 99-104 and never documents the new reviewModels task-graph API. Replace the stale module-header guidance with @module, and document TaskGraphConfig.reviewModels plus any other changed internal interfaces in the guide.
Testing (Unit And Behavioural) ⚠️ Warning Remove tests/docstrings.test.mjs and add no tests for docs:check or make docs-check; the current suite has no typedoc/doc-gate coverage. Add unit/behavioural coverage for the new documentation gate (npm run docs:check/make docs-check) and replace the deleted audit tests before merging.
Performance And Resource Use ⚠️ Warning The new CI step clones, builds, and globally installs a second ODW tree before make check; that extra copy and install are avoidable because PATH can point at /tmp/odw/node_modules/.bin. Export /tmp/odw/node_modules/.bin into PATH for make check, or use npm link, and remove npm install --global . while keeping the pinned checkout build.
✅ Passed checks (16 passed)
Check name Status Explanation
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 PASS: No user-facing functionality changed; the PR only adjusts CI, TypeDoc gating, and internal workflow docs, so docs/users-guide.md need not change.
Module-Level Documentation ✅ Passed Every scoped module has top-of-file JSDoc/@module docs; the only @file helper, meta.js, is also documented.
Testing (Property / Proof) ✅ Passed This commit only adjusts CI orchestration; it adds no new input/state invariant or proof obligation, so property/proof testing is not applicable.
Testing (Compile-Time / Ui) ✅ Passed PASS: TypeScript compile-time contract coverage already exists in tests/compile-time-contract.test.mjs and is wired through node --test; no UI snapshot gap is introduced.
Unit Architecture ✅ Passed PASS: the PR mainly adds documentation and edge wiring; the behaviour changes make dependencies explicit (repoRoot, reviewModels) and keep fallibility at boundaries.
Domain Architecture ✅ Passed PASS: The diff only adds documentation/TypeDoc gating and CI wiring; the workflow-layer changes stay at the adapter boundary and add no new domain coupling.
Observability ✅ Passed Pass this: the PR only changes docs/CI wiring and JSDoc/type surfaces; no new production behaviour or observability gap is introduced, and existing workflow metrics/logs stay in place.
Security And Privacy ✅ Passed No secrets, auth logic, or new over-broad permissions were introduced; the CI job stays read-only and the new CLI inputs are shell-quoted and pinned.
Concurrency And State ✅ Passed No new shared mutable state, locks, background tasks, or ordering-sensitive async logic were introduced; the review-state locking code is unchanged and the edits are docs/config only.
Architectural Complexity And Maintainability ✅ Passed Keep the change explicit: the new docs gate is config-only, and the only runtime shape addition (reviewModels) is threaded directly through config, main, and task-graph without new layers or cycles.
Rust Compiler Lint Integrity ✅ Passed No Rust files changed; the PR only touches .github/workflows/ci.yml, so the Rust lint and clone constraints are not implicated.
Title check ✅ Passed The title accurately summarises the switch from the docstring audit to a zero-tolerance TypeDoc gate.
Description check ✅ Passed The description directly matches the changeset and explains the new TypeDoc gate, wiring, and documentation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch typedoc-rollout

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

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

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

Please try again later or upgrade to continue using Sourcery

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

ℹ️ 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 thread typedoc.json Outdated
"entryPoints": ["bin", "scripts", "src/workflows/dakar-review"],
"entryPointStrategy": "expand",

"exclude": ["**/*.d.ts", "**/meta.js", "scripts/tests/**"],

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 Include the authored metadata module in the gate

Because this exclusion removes src/workflows/dakar-review/meta.js from TypeDoc entirely, changes to that authored JavaScript module can never be checked for either its module header or its exported meta declaration; the current file still uses the retired @file form, so make docs-check already passes despite violating the new zero-tolerance module contract. Include this module in the gate or add an equivalent explicit check rather than excluding it.

AGENTS.md reference: AGENTS.md:L19-L23

Useful? React with 👍 / 👎.

Comment thread src/workflows/dakar-review/schemas.ts Outdated
/**
* Validates structured configuration-resolution results from the Config phase.
*
* @internal

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 Validate schema descriptions before excluding schemas

When a schema property is added or changed without a description, this @internal tag combines with excludeInternal to remove the entire exported schema from notDocumented validation, so the gate passes with no per-field documentation; every property in the schemas introduced here currently has only structural keywords such as type and enum, despite the repository contract relying on description fields to justify this exemption. Add and validate those descriptions separately, or keep the schemas visible to the documentation gate.

AGENTS.md reference: AGENTS.md:L21-L24

Useful? React with 👍 / 👎.

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

🤖 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 @.github/workflows/ci.yml:
- Line 65: Remove the global npm install from the CI setup before make check.
Update the workflow to prepend /tmp/odw/node_modules/.bin to PATH, or use npm
link, so make check runs against the existing lockfile-verified dependency tree
rather than a separate global installation.

In `@scripts/review-config.mjs`:
- Around line 19-28: Update the ReviewConfigResolution typedef: document config
as the resolved or attempted configuration path without claiming it is empty on
failure, and replace the source descriptions with the actual literal values
explicit, repository, user, and example.

In `@src/workflows/dakar-review/types.ts`:
- Around line 15-23: Add a JSDoc block immediately before the exported ModelSpec
interface declaration in the types module, describing the interface’s purpose.
Preserve the existing member-level documentation and do not alter the interface
fields or behavior.

In `@typedoc.json`:
- Line 41: Add the TypeDoc configuration key treatWarningsAsErrors with a true
value alongside treatValidationWarningsAsErrors in typedoc.json, ensuring both
general warnings and validation warnings fail the documentation build.
🪄 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: 11b4b68e-fc3f-4480-85fc-48f207192a15

📥 Commits

Reviewing files that changed from the base of the PR and between 322d7f9 and bebc859.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (23)
  • .github/workflows/ci.yml
  • AGENTS.md
  • Makefile
  • bin/dakar-review.mjs
  • docs/developers-guide.md
  • package.json
  • scripts/build-workflow.mjs
  • scripts/check-docstrings.mjs
  • scripts/review-config.mjs
  • scripts/review-state.mjs
  • src/workflows/dakar-review/candidates.ts
  • src/workflows/dakar-review/config.ts
  • src/workflows/dakar-review/main.ts
  • src/workflows/dakar-review/model-routing.ts
  • src/workflows/dakar-review/odw-globals.d.ts
  • src/workflows/dakar-review/prompts.ts
  • src/workflows/dakar-review/schemas.ts
  • src/workflows/dakar-review/shell.ts
  • src/workflows/dakar-review/task-graph.ts
  • src/workflows/dakar-review/types.ts
  • tests/docstrings.test.mjs
  • tsconfig.typedoc.json
  • typedoc.json
💤 Files with no reviewable changes (2)
  • scripts/check-docstrings.mjs
  • tests/docstrings.test.mjs

Comment thread .github/workflows/ci.yml
cd /tmp/odw
npm ci
npm run build
npm install --global .

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the relevant workflow section with line numbers.
sed -n '1,140p' .github/workflows/ci.yml | nl -ba | sed -n '50,85p'

# Find any other install/link patterns in the repo for context.
rg -n "npm (install --global|link --global|ci|run build|make check)" .github/workflows . -g '!**/node_modules/**' || true

Repository: leynos/dakar

Length of output: 190


🏁 Script executed:

#!/bin/bash
set -euo pipefail

cat -n .github/workflows/ci.yml | sed -n '50,85p'

Repository: leynos/dakar

Length of output: 1008


🌐 Web query:

npm documentation local package install --global npm link behaviour global prefix package.json bin symlink

💡 Result:

The npm link command is a utility for testing local packages by creating symbolic links, allowing you to use a package under development in another local project without needing to publish it to the registry [1][2]. It is a two-step process that leverages the npm global prefix [1][3]. Step 1: Create a Global Link When you run npm link inside a package directory (with no arguments), npm creates a symbolic link in the global node_modules folder (located at {prefix}/lib/node_modules/) that points to your current directory [1][2][4]. It also links any executables defined in the bin field of your package.json file to the global bin directory ({prefix}/bin/) [2][3][5]. Step 2: Link to a Project In a separate project directory, you run npm link , where is the name specified in the package.json file of the package you linked globally [2][3][4]. This creates a symbolic link from that package in the global node_modules folder to the local node_modules folder of your project [2][3][4]. Key Considerations and Behaviors: - Global Prefix: The command uses the global prefix, which you can determine by running npm prefix -g [2][6]. Executables are typically placed in {prefix}/bin on Unix systems or directly in the {prefix} folder on Windows [7][5]. - No package.json Modification: Unlike npm install, npm link does not add dependencies to your project's package.json file [4][8]. - Package Identity: The link is created using the name defined in the package's package.json, not the name of the directory containing the package [2][3][4]. - Comparison with npm install: While npm install can also link a local directory, it behaves differently by modifying package.json and not involving the global node_modules folder [9][8]. Additionally, npm link does not execute lifecycle scripts (such as preinstall or postinstall) [8].

Citations:


Avoid the extra global install. Export /tmp/odw/node_modules/.bin into PATH for make check, or use npm link, so the gate runs the already lockfile-verified tree instead of creating a separate global copy.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 65-65: ad-hoc installation of packages (adhoc-packages): installs a package outside of a lockfile

(adhoc-packages)

🤖 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 @.github/workflows/ci.yml at line 65, Remove the global npm install from the
CI setup before make check. Update the workflow to prepend
/tmp/odw/node_modules/.bin to PATH, or use npm link, so make check runs against
the existing lockfile-verified dependency tree rather than a separate global
installation.

Source: Linters/SAST tools

Comment thread scripts/review-config.mjs
Comment on lines +19 to +28
/**
* @typedef {object} ReviewConfigResolution Outcome of a review-configuration
* search, retaining the full search trail so the workflow output stays
* auditable.
* @property {boolean} ok Whether a configuration file was found.
* @property {string} config Path of the resolved configuration file; empty when `ok` is false.
* @property {string} source Which search stage supplied the file (explicit argument, repository, XDG, bundled example).
* @property {string[]} checked Every path probed, in search order, including the winner.
* @property {string} [error] Reason the search failed; present only when `ok` is false.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Align the typedef with the returned failure shape.

The implementation returns the attempted path in config when ok is false (Lines 67–77 and 127–137), and uses the literal source value user, not XDG. Correct the documentation contract.

Proposed correction
- * `@property` {string} config Path of the resolved configuration file; empty when `ok` is false.
- * `@property` {string} source Which search stage supplied the file (explicit argument, repository, XDG, bundled example).
+ * `@property` {string} config Path of the resolved or attempted configuration file.
+ * `@property` {string} source Which search stage supplied the file (`explicit`, `repository`, `user`, or `example`).
🤖 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/review-config.mjs` around lines 19 - 28, Update the
ReviewConfigResolution typedef: document config as the resolved or attempted
configuration path without claiming it is empty on failure, and replace the
source descriptions with the actual literal values explicit, repository, user,
and example.

Comment on lines +15 to 23
/** Human-readable name surfaced in dry-run output and task metrics. */
label?: string
/** Base model identifier, with or without a `/reasoning` suffix. */
model: string
/** Reasoning level used to pick the adapter and, when absent, the model suffix. */
reasoning: Reasoning
/** Logical review role (e.g. `high`, `medium`, `mini`, `spark`) matched by `modelForRole`. */
role?: string
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add declaration JSDoc for ModelSpec.

Add a JSDoc block immediately before export interface ModelSpec; the member comments document properties only, leaving this exported declaration undocumented and causing the zero-tolerance gate to fail. As per coding guidelines, “document every exported declaration with JSDoc”.

🤖 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 `@src/workflows/dakar-review/types.ts` around lines 15 - 23, Add a JSDoc block
immediately before the exported ModelSpec interface declaration in the types
module, describing the interface’s purpose. Preserve the existing member-level
documentation and do not alter the interface fields or behavior.

Source: Coding guidelines

Comment thread typedoc.json
"TypeAlias"
],

"treatValidationWarningsAsErrors": true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== typedoc.json ==\n'
cat -n typedoc.json | sed -n '1,120p'

printf '\n== package.json excerpts ==\n'
if [ -f package.json ]; then
  cat -n package.json | sed -n '1,220p'
fi

printf '\n== search for TypeDoc warning options ==\n'
rg -n '"treatWarningsAsErrors"|"treatValidationWarningsAsErrors"|typedoc' -S . --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**'

Repository: leynos/dakar

Length of output: 3358


🌐 Web query:

TypeDoc 0.28.20 treatWarningsAsErrors treatValidationWarningsAsErrors options Validation documentation

💡 Result:

In TypeDoc 0.28.20, the options treatWarningsAsErrors and treatValidationWarningsAsErrors are part of the configuration suite designed to manage how TypeDoc handles warnings emitted during project conversion and validation [1][2]. treatWarningsAsErrors: When enabled, this option causes TypeDoc to treat any reported warnings as fatal errors [3][4]. This effectively prevents documentation from being generated if any warnings occur [3][4]. treatValidationWarningsAsErrors: This is a specialized, limited version of treatWarningsAsErrors that applies exclusively to warnings emitted during the project validation phase [3][4]. It cannot be used to disable treatWarningsAsErrors for validation warnings; rather, it ensures that even if general warnings are not treated as errors, validation-specific warnings will be [3][4]. These options are categorized under Validation Options within the TypeDoc configuration [5][2]. The validation process itself may trigger warnings for several conditions, which can be configured via the validation option [2][6]. Common validation checks include: - notExported: Warnings when a symbol is referenced but not included in the documentation [2]. - invalidLink: Warnings about broken {@link} tags [2]. - invalidPath: Warnings about unresolvable relative paths [2]. - rewrittenLink: Warnings about {@link} tags that do not link directly to their target [2]. - notDocumented: Warnings about declarations missing doc comments [2]. - unusedMergeModuleWith: Warnings about unresolved @mergeModuleWith tags [2]. You can set these options either via the command line (e.g., --treatWarningsAsErrors) or within your TypeDoc configuration file [3][5][7].

Citations:


Add treatWarningsAsErrors in typedoc.json:41
Add "treatWarningsAsErrors": true alongside "treatValidationWarningsAsErrors": true. The current config only fails validation warnings; general TypeDoc warnings still pass.

🤖 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 `@typedoc.json` at line 41, Add the TypeDoc configuration key
treatWarningsAsErrors with a true value alongside
treatValidationWarningsAsErrors in typedoc.json, ensuring both general warnings
and validation warnings fail the documentation build.

leynos and others added 4 commits July 25, 2026 16:09
Bring the typed workflow modules under
`src/workflows/dakar-review/` and the authored helper scripts
(`review-state.mjs`, `review-config.mjs`, `build-workflow.mjs`) up to
declaration-level documentation ahead of replacing the threshold-based
docstring gate with a zero-tolerance TypeDoc gate: every exported
declaration and property now carries a JSDoc block.

Documentation is comment-only apart from reflowing a few single-line
type literals and return objects to multiline (shapes unchanged), which
TypeDoc requires to attach per-property comments. Inline
`@returns {{ … }}` shapes in the helper scripts become named, documented
`@typedef`s so their properties can carry genuine descriptions. The
`*_SCHEMA` constants are tagged `@internal` as machine seams — their
`description` fields remain the per-field documentation.
Swap the threshold-based `npm run docstrings` audit for `docs:check`:
TypeDoc's `notDocumented` validation over `bin`, `scripts`, and
`src/workflows/dakar-review` (`entryPointStrategy: "expand"`,
`emit: "none"`, warnings as errors), driven by `typedoc.json` with a
dedicated `tsconfig.typedoc.json` so the JavaScript helpers join the
typed workflow modules in one documentation surface. The gate requires
100% documentation of that surface, reports the qualified name of each
undocumented declaration, and writes no documentation artefacts.

- Convert every module's leading `/** @file … */` comment to TypeDoc's
  `/** … @module */` form and require `"Module"` documentation, so the
  existing module-header rule is preserved, not retired.
- Delete `scripts/check-docstrings.mjs` and its test — the custom
  AST-counting audit and its 80% threshold are superseded. Unexported
  local helpers are no longer counted; exports are the boundary.
- Exclude the generated `workflows/dakar-review.js` artefact, ambient
  `*.d.ts` declarations, `meta.js`, and tests from the surface.
- Wire `docs-check` into `make lint` (and therefore `make check`), and
  give CI an `npm ci` + `make docs-check` step.
- Update AGENTS.md and the developers' guide to name the new gate.

Verified: removing a JSDoc block from a documented function fails
`docs:check` with the symbol's qualified name and a non-zero exit;
restoring it returns the gate to green; a clean run emits no files.
Extend the CI job to run `make check` — the same aggregate used
locally — after the existing spelling and diagram steps, replacing the
narrower standalone `docs-check` step (now reached through
`make lint` inside the aggregate).

The typecheck stage includes an `odw run --args '{"dryRun":true}'`
contract check, and the ODW CLI is neither published to npm nor shipped
with a built `dist` in git, so CI builds it from a pinned upstream
commit and installs it globally before the gates run.
Rebasing onto main brought in the ADR-002 deterministic-tiered review
route, which added new workflow modules, scripts, and exported
declarations. The zero-tolerance TypeDoc gate now covers that surface,
so every new module and export must carry documentation.

- Convert the `@file` headers on the modules main added (config, main,
  admission, pricing, retry, sarif, policy, plus the deterministic-gates,
  odw-config, and live-review-harness scripts) to TypeDoc `@module`
  blocks.
- Document every exported declaration and property main introduced across
  types, config, sarif, admission, pricing, retry, task-graph,
  model-routing, policy, and candidates, and give the live-review-harness
  inline return shapes named `@typedef`s.
- Correct doc comments the entity merge misaligned by one property in
  `WorkflowConfig`, `WorkflowArgs`, `ReviewTask`, `Verdict`,
  `NormalizedCandidate`, and `PromptContext`.
- Rebuild `workflows/dakar-review.js` and `package-lock.json`.

`make check` passes end to end (check-fmt, lint including docs-check,
typecheck, workflow freshness, 301 tests, spelling).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lodyai
lodyai Bot force-pushed the typedoc-rollout branch from bebc859 to d5dedf8 Compare July 25, 2026 14:47
codescene-access[bot]

This comment was marked as outdated.

Two review-feedback fixes closing zero-tolerance gate escapes.

- typedoc.json excluded `src/workflows/dakar-review/meta.js`, so its
  module header and exported `meta` were never gated and the file still
  used the retired `@file` form. Drop the exclusion, convert the header
  to `@module`, and document `meta` and its fields so the whole module
  is covered.
- The `@internal` tag on each schema constant removes it from
  `notDocumented` validation, but AGENTS.md justifies that exemption by
  the schemas' per-field `description` values -- which were absent. Add a
  `description` to every field of `CANDIDATE_SCHEMA`, `VERDICT_SCHEMA`,
  `VERDICT_WITH_CLUSTER_SCHEMA`, and `AUDIT_SCHEMA` (via the shared
  `VERDICT_PROPERTIES`), making the exemption honest and enriching the
  agent-facing schema contract. Rebuild `workflows/dakar-review.js`.

`make check` passes end to end (301 tests).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
codescene-access[bot]

This comment was marked as outdated.

Two review-feedback fixes.

- typedoc.json only promoted `validation.*` warnings to errors via
  `treatValidationWarningsAsErrors`, so a general (non-validation)
  TypeDoc warning would log but not fail the build. Add
  `treatWarningsAsErrors: true` so every warning is fatal, matching the
  zero-tolerance intent the developers' guide already states. The gate
  stays green under the stricter setting.
- scripts/review-config.mjs: the `ReviewConfigResolution` typedef claimed
  `config` is empty when `ok` is false, but `resolveReviewConfig` returns
  the attempted path there; and it paraphrased `source` ("XDG", "bundled
  example") instead of the literal values. Document `config` as the
  resolved-or-attempted path and state the exact `source` literals
  `explicit`, `repository`, `user`, and `example`.

Two further review comments were verified and skipped as already
satisfied: the ODW CLI's global install does not touch the project's
lockfile-verified tree (and `odw` is absent from `node_modules/.bin`, so
the suggested PATH change would not expose it), and `ModelSpec` already
carries a describing JSDoc block.

`make check` passes end to end (301 tests).

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

1 participant