Repository navigation
Carry TypeScript @param text into the docs and number ADRs after the highest existing one - #4
Merged
naresh-FD merged 2 commits intoOct 17, 2026
Conversation
getParamDescription looked for a tag whose text started with the parameter name, but ts-morph returns the comment without the name, so no description was ever found and `docgen validate` listed every documented parameter as undocumented. Match the tag by its own name instead, read the JSDoc from the node that carries it (the variable statement for const arrow functions), and strip the hyphen and line breaks. Eight tests, five deliberate breakages each caught. Self-validation: 567 -> 557 violations, none added. CHANGE_ID: AUDIT-001 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`docgen adr new` took the file count plus one, so a gap or a deleted ADR made it reuse a number (ADR-001 and ADR-003 present produced a second ADR-003). Use the highest `ADR-<n>` found instead, ignore files that are not numbered ADRs, and keep counting past three digits. The it.todo from the audit becomes six real tests; five deliberate breakages are each caught. CHANGE_ID: AUDIT-001 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
naresh-FD
marked this pull request as ready for review
October 17, 2026 11:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3
This PR is based on
change/AUDIT-001-reposcribe-tests-and-fixes(PR #3), so it shows only its own two commits. It needs #3 first: the ADR change replaces theit.todothat #3 added inadr.test.ts. When #3 merges, GitHub should retarget this PR tomain; if it does not, change the base by hand.What
Two defects that the AUDIT-001 audit found and left open, now fixed:
@paramdescriptions (a83576e).getParamDescriptionlooked for a tag whose text started with the parameter name, but ts-morph returns a tag's comment without its name, so no description was ever found. Every documented parameter came out empty, anddocgen validatelisted it as undocumented. It now matches the tag by its own name, reads the JSDoc from the node that carries it (the variable statement forconstarrow functions), and strips the optional{type}, a leading hyphen and line breaks. Names that share a prefix (id/idx) no longer pick up each other's text.5b42242).docgen adr newused the file count plus one, so ADR-001 and ADR-003 present produced a second ADR-003, and a deleted ADR's number was reused. It now takes the highestADR-<n>plus one, ignores files that are not numbered ADRs (README.md,ADR-template.md) and keeps counting past three digits.docs/technical/parser-typescript.mdanddocs/technical/cli.mddescribe the new behaviour.Tests
Written first and seen failing for the right reason (empty descriptions; duplicate or reused numbers):
param-docs.test.ts: 8 tests (hyphen, no hyphen,{type}, shared prefix, undocumented parameter, multi-line, arrow function, class method). Five deliberate breakages of the parser were each caught.adr.test.ts: theit.todobecomes 6 tests (gap, deletion, four-digit numbers, non-ADR files, empty folder, no overwrite). Five deliberate breakages were each caught.Checks run locally
pnpm buildpnpm test --forcepnpm test:e2enode scripts/run-docgen.cjs validate --jsonpassed: false, but self-documentation coverage rose from 35% (main) to 37%, and violations fell from 562 to 557 with none addedCI
No CI runs on this PR while its base is the PR #3 branch: the repository's "Build, test, and validate documentation" workflow only triggers for pull requests into
main. It will run once #3 merges and this PR is retargeted tomain. Until then the local results above are the only evidence.Behaviour changes to review
@paramtext now appears inParamNode.description, in generated docs and in coverage. Documented parameters that were counted as undocumented now count as documented, so coverage can only go up.adr newmay pick a higher number than before when there are gaps. For folders with no gaps nothing changes.CHANGE_ID: AUDIT-001
🤖 Generated with Claude Code