feat(enrichment): doc-comment vs signature drift analyzer (#1519)#1622
Closed
dale053 wants to merge 7 commits into
Closed
feat(enrichment): doc-comment vs signature drift analyzer (#1519)#1622dale053 wants to merge 7 commits into
dale053 wants to merge 7 commits into
Conversation
…1519) Adds a REES analyzer that flags JSDoc @param tags that don't match the adjacent function signature when the PR touches those lines — stale tags referencing removed params and missing tags for newly added params. Pure compute, no network calls. Operates on unified diff patches only: reconstructs the new-file view from hunk lines, slides a window over JSDoc-to-function pairs, and checks for drift only when at least one line in the window is a PR-added line (so pre-existing drift is not flagged). Destructured top-level params are skipped to avoid false positives from wrapper-name conventions. Caps at 20 findings per PR. Supports JS/TS/JSX/TSX/MJS/CJS. Handles bare @param, {Type} @param, [optional] bracket notation, rest params, and the TS `this` pseudo-param. Closes JSONbored#1519.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review — held for maintainer review
⏸️ Held for maintainer review — Large change — held for manual review
Nits — 2 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Signed-off-by: dale053 <[email protected]>
…d remove orphaned JSDoc comment
Signed-off-by: dale053 <[email protected]>
JSONbored
reviewed
Jun 29, 2026
Owner
There was a problem hiding this comment.
merge conflicts, please fix and resubmit.
This branch has conflicts that must be resolved
Use the web editor or the command line to resolve conflicts before continuing.
- review-enrichment/src/brief.ts
- review-enrichment/src/render.ts
- review-enrichment/src/types.ts
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.
Summary
Adds a doc-comment drift analyzer to the enrichment brief. It flags JSDoc
@paramtags that don'tmatch the adjacent function signature when the PR touches those lines — specifically:
stale-param: a@param fooin the JSDoc wherefoois no longer a parameter of the functionmissing-param: a parameter in the function signature with no corresponding@paramin the JSDocThe analyzer is pure compute (no network calls). It reconstructs the new-file view from unified diff
patches, slides a window over JSDoc-to-function pairs, and only flags when at least one line in that
window is a PR-added line — so pre-existing drift in untouched code is never reported. Destructured
top-level params are skipped to avoid false positives from wrapper-name conventions (e.g.
@param optionsvs
{ host, port }: Options). Caps at 20 findings per PR.Scope: JS/TS/JSX/TSX/MJS/CJS. Handles bare
@param,{Type}prefix,[optional]bracket notation,@param [name=default], rest params (...name), and the TSthispseudo-param.Closes #1519.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typecheck— fails on pre-existing missing optional self-host deps (pg,ioredis,@sentry/node,@cloudflare/puppeteer,pixelmatch,pngjs) that are absent in the dev environment but present in CI vianpm ci. No new type errors introduced.npm run test:coveragelocally — 71/71 enrichment package tests pass; 3,837/3,837 main-suite assertions pass; pre-existing failures are all optional-dep import errors unrelated to this change.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run typecheck,npm run test:workers,npm run test:mcp-pack,npm run ui:*— dev environment is missing optional selfhost packages (pg,ioredis, etc.) and UI tooling. The enrichment package itself builds and tests clean (npm run build+ all 71 tests pass). CI runsnpm ciwhich installs all deps and will exercise these steps.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. (N/A — no visible UI changes)UI Evidence
N/A — no visible UI changes.
Notes
Files changed:
review-enrichment/src/types.tsDocCommentFindinginterface +docComment?key inBriefFindingsreview-enrichment/src/analyzers/doc-comment.tsreview-enrichment/src/brief.tsscanDocCommentinANALYZERSregistryreview-enrichment/src/render.tsdocCommentfindings as a markdown brief sectionreview-enrichment/test/enrichment.test.ts