Add a zero-tolerance TypeDoc documentation gate - #58
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Summary
Validation
WalkthroughAdd a TypeDoc documentation check, document exported APIs and fixture schemas, configure warning enforcement without artefacts, and include ChangesTypeDoc documentation gate
Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 3 warnings)
✅ Passed checks (16 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11ae114060
ℹ️ 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".
|
@coderabbitai review |
✅ Action performedReview finished.
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/store/entities/ref.ts (1)
66-83: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winKeep
qualifiedNameunqualified during normalization.When both values are supplied,
qualifiedNamebecomes the fullrefsuch as
refs/heads/main.refStoreKey()and the derivednode_idthen use that prefixed
value, so equivalent branch fixtures can receive different identities. Normalize the
prefix intorefonly and retainmain/v1.2.3asqualifiedName.Proposed normalization
- const qualifiedName = ref.ref ?? ref.qualifiedName; - const fullRef = qualifiedName.startsWith('refs/') - ? qualifiedName - : `${defaultRefPrefix(ref.object.type)}${qualifiedName}`; + const rawRef = ref.ref ?? ref.qualifiedName; + const fullRef = rawRef.startsWith('refs/') + ? rawRef + : `${defaultRefPrefix(ref.object.type)}${rawRef}`; + const qualifiedName = fullRef.replace(/^refs\/(?:heads|tags)\//, '');Add regression tests covering both branch and tag inputs.
🤖 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/store/entities/ref.ts` around lines 66 - 83, Update the normalization transform around rawRef, fullRef, and qualifiedName so qualifiedName remains the unqualified branch or tag name while ref receives the fully prefixed path. Ensure refStoreKey and derived node_id use the unqualified qualifiedName, and add regression tests for both branch and tag inputs.
🤖 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 `@docs/development.md`:
- Around line 36-39: Update the documentation-gate description in
docs/development.md to identify src/index.ts as TypeDoc’s package entry point,
while referring to typedoc.json only as the configuration that selects it.
Preserve the existing notDocumented validation, zero-tolerance warning behavior,
and no-artifact details.
- Around line 33-35: Update the contributor workflow guidance in
docs/development.md so the documented manual gate includes bun run docs:check,
or replace it with make all as the sole contributor gate. Keep the documented
command order and existing workflow description consistent with the new TypeDoc
check.
In `@Makefile`:
- Around line 22-34: The Makefile currently documents a serial order that is not
preserved by parallel Make execution. Add an explicit typecheck prerequisite to
docs-check, encode any required downstream ordering such as lint, and update
docs/development.md to describe the guaranteed dependency rather than relying on
prerequisite-list order; apply the Makefile change at Makefile lines 22-34 and
the documentation clarification at docs/development.md lines 33-35.
In `@src/index.ts`:
- Around line 22-41: The exported TypeScript API lacks compile-time coverage.
Add a type-only test covering GitHubSimulatorArgs.extend.extendRouter in
src/index.ts, plus the exported GitHubBranch alias in
src/store/entities/branch.ts, GitHubCommit in src/store/entities/commit.ts, and
GitHubPullRequest in src/store/entities/pull-request.ts; verify these symbols
can be imported and used with their intended types without runtime tests.
In `@src/store/entities.ts`:
- Around line 56-61: Update the documentation comment for the minimal GitHub
user fixture validator to state that name is derived from login only when
missing, then a missing contact email is derived from the normalized name;
clarify that a caller-provided name is preserved.
In `@src/store/entities/blob.ts`:
- Around line 34-41: Add executable JSDoc examples to both exported key helpers:
in src/store/entities/blob.ts lines 34-41, document blob coordinates and the
resulting canonical key; in src/store/entities/branch.ts lines 50-55, document
branch coordinates and the resulting key. Keep the examples consistent with each
helper’s documented input and output format.
In `@src/store/entities/branch.ts`:
- Line 48: Add a concise JSDoc description immediately above the GitHubBranch
interface declaration, documenting its public API purpose while leaving the
interface and githubBranchSchema unchanged.
In `@src/store/entities/issue.ts`:
- Around line 76-81: The timestamp fields in both schemas accept arbitrary
strings despite documenting ISO 8601 values. Update issue.ts fields created_at,
updated_at, and closed_at, and repository.ts fields pushed_at, updated_at, and
created_at to enforce Zod datetime validation while preserving optional/default
and nullable behavior; add malformed-input tests covering these fields in both
schemas.
In `@src/store/entities/repository.ts`:
- Around line 32-39: Update the documentation comment for the repository fixture
normalization schema to accurately state that REST URL fields are accepted when
provided, rather than claiming omitted fields are filled in. Keep the
descriptions of generated id, node_id, and derived full_name unchanged.
- Around line 220-249: Replace the z.string() validators for the four security
status fields in the repository schema with z.enum(['enabled', 'disabled']) so
only documented values are accepted. Update the schema tests to cover both
allowed statuses and rejection of other strings, preserving the existing
defaults of {status: 'enabled'}.
---
Outside diff comments:
In `@src/store/entities/ref.ts`:
- Around line 66-83: Update the normalization transform around rawRef, fullRef,
and qualifiedName so qualifiedName remains the unqualified branch or tag name
while ref receives the fully prefixed path. Ensure refStoreKey and derived
node_id use the unqualified qualifiedName, and add regression tests for both
branch and tag inputs.
🪄 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: 5f87d8ba-055b-4843-94c2-faae450af742
⛔ Files ignored due to path filters (2)
bun.lockis excluded by!**/*.locksrc/__generated__/resolvers-types.tsis excluded by!**/__generated__/**
📒 Files selected for processing (17)
Makefiledocs/development.mdpackage.jsonsrc/index.tssrc/store/builders.tssrc/store/entities.tssrc/store/entities/blob.tssrc/store/entities/branch.tssrc/store/entities/commit.tssrc/store/entities/installation.tssrc/store/entities/issue.tssrc/store/entities/organization.tssrc/store/entities/pull-request.tssrc/store/entities/ref.tssrc/store/entities/repository.tssrc/store/entities/shared.tstypedoc.json
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/development.md (1)
26-31: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winInclude the TypeDoc gate in the normal contributor gate.
The listed manual gate still runs only formatting, linting, typechecking, and tests. Add
bun run docs:checkafter typechecking, or makemake allthe sole documented contributor gate.Triage: [type:docstyle]
🤖 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 `@docs/development.md` around lines 26 - 31, Update the “normal contributor gate” in the development documentation to include the TypeDoc validation command `bun run docs:check` immediately after `bun check:types`, while preserving the existing formatting, linting, typechecking, and test steps.
♻️ Duplicate comments (5)
docs/development.md (1)
35-38: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winName
src/index.tsas the package entry point.
typedoc.jsonconfigures TypeDoc; it is not the package entry point. Rewrite the sentence to identifysrc/index.tsas the entry point and retaintypedoc.jsonas its configuration.Triage: [type:docstyle]
🤖 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 `@docs/development.md` around lines 35 - 38, Update the documentation gate description to identify src/index.ts as the package entry point, while retaining typedoc.json solely as the TypeDoc configuration reference. Preserve the existing explanation of notDocumented validation and public-surface JSDoc requirements.src/store/entities/issue.ts (1)
76-81: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winEnforce the documented timestamp contract across both schemas.
The fields are documented as ISO 8601 timestamps, but arbitrary strings still pass validation. Apply
.datetime()while preserving each field’s existing optional, default, and nullable semantics, then add malformed-input tests.
src/store/entities/issue.ts#L76-L81: validatecreated_at,updated_at, andclosed_at.src/store/entities/repository.ts#L57-L71: validatepushed_at,updated_at, andcreated_at.As per coding guidelines, validate I/O boundaries with Zod.
🤖 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/store/entities/issue.ts` around lines 76 - 81, Apply Zod .datetime() validation to created_at, updated_at, and closed_at in src/store/entities/issue.ts:76-81, preserving their current optional, default, and nullable behavior. Apply the same validation to pushed_at, updated_at, and created_at in src/store/entities/repository.ts:57-71, then add tests confirming malformed timestamps are rejected at both schema boundaries.Source: Coding guidelines
src/store/entities/repository.ts (2)
220-249: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winEnforce the documented security-status values.
Replace all four
status: z.string()validators withz.enum(['enabled', 'disabled']), preserve the existing defaults, and add acceptance/rejection tests.As per coding guidelines, validate I/O boundaries with Zod.
🤖 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/store/entities/repository.ts` around lines 220 - 249, In the repository schema, update the status validators for advanced_security, secret_scanning, secret_scanning_push_protection, and secret_scanning_non_provider_patterns from unrestricted strings to z.enum(['enabled', 'disabled']). Preserve each existing enabled default and add tests confirming both values are accepted and any other status is rejected at the Zod I/O boundary.Source: Coding guidelines
32-39: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winStop claiming that omitted URLs are filled.
Only counters and security settings receive defaults; the URL fields remain optional and absent when omitted. Rewrite this description to state that caller-supplied URLs are accepted, or implement actual URL defaults.
🤖 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/store/entities/repository.ts` around lines 32 - 39, Update the documentation for the repository fixture normalizer near its exported function or class to remove the claim that omitted GitHub REST URLs are populated. State that caller-supplied URL fields are preserved or accepted as optional, while retaining the documented defaults for counters and security settings.Makefile (1)
22-34: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winEncode the TypeDoc execution dependency.
The documented order is not guaranteed under
make -j. Makedocs-checkdepend ontypecheck, and make downstream lint ordering explicit if TypeDoc must complete before lint. Update the documentation to describe the guaranteed dependency rather than prerequisite-list order.
Makefile#L22-L34: add the required Make dependency chain.docs/development.md#L33-L35: document the enforced dependency, not merely the preferred order.As per coding guidelines, changes involving ordering or parallelism must make the execution model explicit.
🤖 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 `@Makefile` around lines 22 - 34, Make the Makefile dependency graph explicit: update docs-check to depend on typecheck, and add any required dependency ensuring lint runs only after docs-check completes. In docs/development.md, describe this enforced dependency chain rather than relying on prerequisite-list order. Apply the Makefile change at Makefile lines 22-34 and update the corresponding documentation at docs/development.md lines 33-35.Source: Coding guidelines
🤖 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 `@src/store/entities.ts`:
- Around line 93-101: Update the full seeded store description in the
documentation above the validation/normalization implementation to include
issues alongside commits and pull requests, accurately reflecting the schemas
parsed by the full-store flow.
In `@src/store/entities/issue.ts`:
- Around line 56-61: The fallback issue ID generation using
ENTITY_ID_OFFSETS.ISSUE plus issue.number is not instance-wide unique across
repositories. Replace it with a repository-aware or global allocator, or require
callers to supply unique IDs, while preserving the documented uniqueness
contract for id. Add a regression test covering identical issue numbers in
different repositories.
In `@src/store/entities/pull-request.ts`:
- Around line 173-176: Update the JSDoc comments for the base and head fields in
the pull request entity mapping to state that missing owner and repo values
default to the owning repository, rather than claiming normalization to it.
Leave the normalizePullRequestRef calls unchanged.
- Around line 115-116: Update the documentation for the pull-request `id` field
in the entity schema to describe the current deterministic fallback as the
configured pull-request offset plus `number`; do not claim uniqueness across
repositories unless store-wide allocation and duplicate validation are
implemented.
In `@src/store/entities/ref.ts`:
- Around line 60-61: The sha schema in the ref entity must enforce the
documented SHA-1 format rather than accepting arbitrary non-empty strings.
Update the Zod validation for sha to require exactly 40 hexadecimal characters,
and add fixture tests covering valid and invalid hashes at the I/O boundary.
In `@src/store/entities/repository.ts`:
- Around line 52-53: Update the full_name field documentation and normalization
contract in the repository entity schema to accurately reflect that the
transform always derives it from owner and name, or change the transform to
preserve a caller-supplied value. Ensure tests cover the selected behavior and
reference the full_name normalization logic.
---
Outside diff comments:
In `@docs/development.md`:
- Around line 26-31: Update the “normal contributor gate” in the development
documentation to include the TypeDoc validation command `bun run docs:check`
immediately after `bun check:types`, while preserving the existing formatting,
linting, typechecking, and test steps.
---
Duplicate comments:
In `@docs/development.md`:
- Around line 35-38: Update the documentation gate description to identify
src/index.ts as the package entry point, while retaining typedoc.json solely as
the TypeDoc configuration reference. Preserve the existing explanation of
notDocumented validation and public-surface JSDoc requirements.
In `@Makefile`:
- Around line 22-34: Make the Makefile dependency graph explicit: update
docs-check to depend on typecheck, and add any required dependency ensuring lint
runs only after docs-check completes. In docs/development.md, describe this
enforced dependency chain rather than relying on prerequisite-list order. Apply
the Makefile change at Makefile lines 22-34 and update the corresponding
documentation at docs/development.md lines 33-35.
In `@src/store/entities/issue.ts`:
- Around line 76-81: Apply Zod .datetime() validation to created_at, updated_at,
and closed_at in src/store/entities/issue.ts:76-81, preserving their current
optional, default, and nullable behavior. Apply the same validation to
pushed_at, updated_at, and created_at in src/store/entities/repository.ts:57-71,
then add tests confirming malformed timestamps are rejected at both schema
boundaries.
In `@src/store/entities/repository.ts`:
- Around line 220-249: In the repository schema, update the status validators
for advanced_security, secret_scanning, secret_scanning_push_protection, and
secret_scanning_non_provider_patterns from unrestricted strings to
z.enum(['enabled', 'disabled']). Preserve each existing enabled default and add
tests confirming both values are accepted and any other status is rejected at
the Zod I/O boundary.
- Around line 32-39: Update the documentation for the repository fixture
normalizer near its exported function or class to remove the claim that omitted
GitHub REST URLs are populated. State that caller-supplied URL fields are
preserved or accepted as optional, while retaining the documented defaults for
counters and security settings.
🪄 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: 5f87d8ba-055b-4843-94c2-faae450af742
⛔ Files ignored due to path filters (2)
bun.lockis excluded by!**/*.locksrc/__generated__/resolvers-types.tsis excluded by!**/__generated__/**
📒 Files selected for processing (17)
Makefiledocs/development.mdpackage.jsonsrc/index.tssrc/store/builders.tssrc/store/entities.tssrc/store/entities/blob.tssrc/store/entities/branch.tssrc/store/entities/commit.tssrc/store/entities/installation.tssrc/store/entities/issue.tssrc/store/entities/organization.tssrc/store/entities/pull-request.tssrc/store/entities/ref.tssrc/store/entities/repository.tssrc/store/entities/shared.tstypedoc.json
11ae114 to
ceebfd2
Compare
Prepare for a zero-tolerance TypeDoc documentation gate: document every
declaration reachable from the package entry point, including one-line
JSDoc on each zod schema field surfaced through the fixture builders
and the transform-derived fields at their `return { … }` sites.
Tag the zod schema constants with documented `/** … @internal */`
blocks — they are validation seams whose meaning is carried by the
named output types. Convert the `GitHub*` output aliases from
`type … = z.infer<…>` to `interface … extends z.infer<…> {}` so
TypeDoc renders builder return types as references to the documented
interfaces instead of expanding the inferred structural type (the type
is unchanged; TypeDoc cannot preserve `z.infer` alias references), and
give each `build*Fixture` an explicit return-type annotation.
Add `docs-check` to `make all` between `typecheck` and `lint` (after `typecheck` so the generated GraphQL types exist): TypeDoc's `notDocumented` validation over the package entry point (`src/index.ts`, `resolve` strategy, `emit: "none"`, validation warnings as errors), configured by `typedoc.json` and run through `bun run docs:check`. The gate requires 100% documentation of the public surface, reports the qualified name of each undocumented declaration, and writes no documentation artefacts. CI already runs `make all`, so the gate needs no workflow changes.
Rebasing the gate onto main brought the shared domain-write slice into the documented surface, and its exported object types carry undocumented fields. Document each at its field site, the way the fixture surface already is: the domain action arguments and the built-in action, the repository update command, the update result union, and the REST patch input. Clear the nine cosmetic "unused @PARAM" warnings in `src/store/keys.ts` so the gate finishes with none at all. They came from a genuine conflict: Oxlint's df12/require-public-jsdoc wants one @PARAM per bound name, while TypeDoc binds a destructured parameter to a single name and reports the rest as unused. Taking the parameter whole and using nested `@param parts.owner` tags satisfies both. The parameter type, the call sites, and the behaviour are unchanged.
Turn on TypeDoc's `invalidLink`, `invalidPath` and `unusedMergeModuleWith`
validation, so an unresolvable `{@link}` fails the gate alongside a missing
JSDoc block. That exposed one broken reference: `{@link FoundationSimulator}`
on `simulation` names a type from `@simulacrum/foundation-simulator`, which
cannot resolve into this package's documentation. Map it through
`externalSymbolLinkMappings` to the upstream package page rather than
weakening the comment.
Add `tests/docs-gate.contract.test.ts`, which asserts the chain that makes
this a gate rather than a script nobody runs: the CI `verify` job runs
`make all` unconditionally and without `continue-on-error`, `make all`
lists `docs-check` among its prerequisites and after `typecheck`, the
`docs-check` recipe runs `bun run docs:check`, that script invokes typedoc
with `typedoc.json`, and `typedoc.json` still validates and still treats
validation warnings as errors. Each assertion matches the command or the
option, never a step name or a comment, so deleting any one link turns the
test red; all eight were mutation-tested.
Document the gate in the developers' guide: what it checks, how to run it
locally, and the three conventions for documenting an export that follow
from how TypeDoc and the Oxlint JSDoc rules interact.
Make `docs-check` depend on `typecheck` rather than merely follow it in
`all`. Ordering inside a prerequisite list is not ordering: `make -j all`
may start the gate before the GraphQL types are generated, and a bare
`make docs-check` after `make clean` skipped generation entirely. Assert
the prerequisite in the contract test.
Correct the new JSDoc where it promised more than the schemas deliver.
The timestamp, `sha` and security-status fields document conventions, not
validators, and now say so; the issue and pull-request `id` fallbacks are
unique within a repository, not across an instance, and now say so; the
user schema preserves a caller-supplied name; the repository schema
accepts REST URL fields rather than filling them in, and always re-derives
`full_name`; the pull-request base and head references default their
missing owner and repo rather than rewriting them; and the full-store
description lists issues. Tightening the validators instead would change
fixture-parsing behaviour, which is outside a documentation change.
Add the missing examples on `blobStoreKey` and `branchStoreKey`, and
JSDoc on `GitHubBlob` and `GitHubBranch`.
Add `tests/documented-surface.test-d.ts`, a compile-time test for the
type-level change this branch makes. The gate is satisfied by comments, so
nothing in it would notice if the `interface … extends z.infer<…> {}`
conversion or the builders' explicit return annotations drifted from the
inferred types. The exported extension hooks are covered too.
Update the developers' guide for the prerequisite and the local command.
8761492 to
fdc9556
Compare
Assert schema parity, builder return type, and builder input type for `GitHubBranch` and `GitHubRepository` alongside the four already covered. Neither type is re-exported from the package entry point, but `buildBranchFixture` and `buildRepositoryFixture` are, so their return types are public and the interface conversion applies to them too. Widening `GitHubBranch` by one optional member fails the parity assertion. Name `src/index.ts` as the package entry point in the guide rather than letting `typedoc.json` stand in for it, and add the documentation check to the numbered contributor gate, which otherwise omitted the one gate this change adds.
|
@coderabbitai The two documentation findings from the review body are addressed in 8a1cd95.
The duplicate rows for the Makefile dependency, the repository URL wording, the |
There was a problem hiding this comment.
Gates Passed
6 Quality Gates Passed
See analysis details in CodeScene
Absence of Expected Change Pattern
- simulacat-core/src/index.ts is usually changed with: simulacat-core/src/graphql/converters/repository.ts, simulacat-core/tests/graphql.test.ts, simulacat-core/src/rest/index.ts, simulacat-core/src/rest/utils.ts, simulacat-core/src/store/index.ts
Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
git show --stat --oneline --decorate --no-renames 8a1cd95
git show --format=fuller --no-ext-diff --unified=12 8a1cd95 -- docs/development.mdLength of output: 3465
The guide now identifies 🧠 Learnings usedYou are interacting with an AI system. |
|
The nine validator tightenings from this review are tracked in #77 so they survive the merge. Each item there carries the reviewer's rationale, the files and fields, and the Also tracked: the remaining threads whose findings were resolved by correcting |
Summary
This branch adds a zero-tolerance TypeDoc documentation gate to
make all.TypeDoc's validation runs over the package entry point (
src/index.ts,resolvestrategy) withemit: "none"and validation warnings treated aserrors: every declaration in the public surface must carry a JSDoc comment,
and every
{@link}must resolve. The gate reports the qualified name of eachundocumented declaration, writes no documentation artefacts, and fails on a
single omission. CI already runs
make all, so it reaches the gate with noworkflow changes.
Base and rebase
Rebased from
11ae114060e07ccdb6132c23b61904e30bacac96(the pre-rebase head)onto
main, now ate633725, the merge of #74. It was briefly based on thatpull request's branch because
mainwas red; #74 has since landed, so this isa plain rebase onto
main. The author's two commits are preserved, and thethree that follow are new work on top:
Document the public fixture surface to declaration level(author's)Add a zero-tolerance TypeDoc documentation gate(author's)Document the shared write surface the gate now reachesValidate references and contract the documentation gateAddress the July review of the documentation gateWhat the rebase exposed
maingained the shared domain-write slice (#18) after this branch wasopened, and its exported object types carry undocumented fields. Commit 3
documents them at their field sites: the domain action arguments and the
built-in
updateRepositoryaction, the repository update command, the updateresult union, and the REST patch input.
Commit 3 also clears the nine cosmetic "unused
@param" warnings insrc/store/keys.tsthat the original body noted as accepted. They came from areal conflict: the Oxlint
df12/require-public-jsdocrule wants one@paramper bound name, while TypeDoc binds a destructured parameter to a single name
and reports the rest as unused. Taking the parameter whole and using nested
@param parts.ownertags satisfies both tools. The parameter types, the callsites, and the behaviour are unchanged. The gate now finishes with no warnings
at all, not merely with no errors.
Reference validation and the contract
Commit 4 turns on TypeDoc's
invalidLink,invalidPathandunusedMergeModuleWithvalidation, so an unresolvable reference fails the gatealongside a missing JSDoc block. That exposed one broken reference:
{@link FoundationSimulator}onsimulationnames a type from@simulacrum/foundation-simulator, which cannot resolve into this package'sdocumentation. It is mapped through
externalSymbolLinkMappingsto theupstream package page rather than weakened in the comment.
tests/docs-gate.contract.test.tsasserts the chain that makes this a gaterather than a script nobody runs:
verifyjob runsmake allrun: make allreplaced withecho skippingdocs-checkrequirestypecheckcontinue-on-error: trueadded to itmake allrequiresdocs-checkdocs-checkremoved from the prerequisitesdocs-checkruns the gate@truedocs:checkpassestypedoc.json--options typedoc.jsondroppednotDocumentedvalidation onfalseinvalidLinkset tofalsetreatValidationWarningsAsErrorsset tofalseEach assertion matches the command or the option, never a step name or the
comment above it. All nine mutations were run and each failed exactly one
test; the restored tree passes all fourteen.
Pins
typedocis resolved to exactly0.28.20inbun.lock, with its integrityhash, and CI installs with
bun install --frozen-lockfile. There is no TypeDocplugin. The
package.jsonrange stays a caret, per this repository's stateddependency policy.
Documentation
docs/development.mdgains a "The documentation gate" section covering whatthe gate checks, how to run it locally, and the three conventions for
documenting an export that follow from how TypeDoc and the Oxlint JSDoc rules
interact.
The July review
All fourteen threads from the July review are addressed and answered.
The Makefile finding was correct and is fixed at the mechanism:
docs-checknow declares
typecheckas a prerequisite rather than merely following it inall, somake -j allcannot start the gate before generation finishes and abare
make docs-checkgenerates first. The contract test asserts it.Nine threads pointed at new JSDoc that promised more than the schemas deliver:
ISO 8601 timestamps, a SHA-1
sha,enabled/disabledsecurity statuses,instance-wide unique issue and pull-request ids, a repository schema that
"fills in" URL fields, a preserved
full_name, normalized pull-request refs,and a user schema that overwrites a supplied name. Each is fixed by correcting
the documentation rather than tightening the validator: adding
.datetime(),z.enum, a hash pattern or a global id allocator would reject or changefixtures that parse today, which is a fixture-parsing behaviour change and
outside a documentation gate. Every one of those remains a reasonable separate
change and is flagged as such in its thread.
Those nine tightenings are recorded in #77 with each reviewer's rationale, so
they survive this merge. That issue also corrects one claim made in these
threads: measured one at a time against
bun test tests, the timestamp andsecurity-status tightenings break no existing test, and only the 40-hex
sharule does, failing twenty-two. They remain consumer-visible narrowings of what
initialStateaccepts, which is why they are versioned work rather than partof a documentation change, but the suite does not block three of the four.
The remaining four are additions: examples on
blobStoreKeyandbranchStoreKey, JSDoc onGitHubBlobandGitHubBranch, and a compile-timetest.
tests/documented-surface.test-d.tsanswers the request for a type-level testand guards the part of this branch that a documentation gate cannot see. It
asserts with a strict
Equalthatinterface GitHub* extends z.infer<schema> {}is exactlyz.infer<schema>, that eachbuild*Fixturereturn type is thenamed interface rather than a structurally expanded copy, and that the exported
extension hooks keep their shape.
Validation
Every gate below was run on the pushed tree, bare and unfiltered:
make allmake docs-checkmake markdownlintmake nixiemake buildbun auditbun test tests/docs-gate.contract.test.tsGate mutation checks: removing the JSDoc from
UpdateRepositoryCommand.ownermakes
make docs-checkexit 4 naming the symbol; changing{@link FoundationSimulator}to an unresolvable name makes it exit 4 reportingthe failed link; restoring each returns the gate to green with no output.
Notes
Replace docstring-coverage with a zero-tolerance TypeDoc gate df12-build#62, Replace the docstring audit with a zero-tolerance TypeDoc gate dakar#5, and Add a zero-tolerance TypeDoc documentation gate digitalpuddle#47).
Summary by Sourcery
Enforce complete, link-valid public API documentation as a required build gate.
New Features:
Enhancements:
Build:
Documentation:
Tests: