Adopt the canonical pm-ops docstring gate - #30
Conversation
Adopt pm-ops/docstrings (analyzeDocstringCoverage) as the single fleet-wide docstring policy behind a thin launcher, mirroring the pm-linear adoption (pm-linear#58). - Add pm-ops ^2026.8.8 as a devDependency (the exact pin pm-linear uses). - Add scripts/docstring-gate.ts: a self-contained launcher over analyzeDocstringCoverage (runGate / main / isMainInvocation), matching this repo's existing coverage-gate.ts style rather than introducing a shared launcher helper module. - Add test/docstring-gate.test.ts covering the clean path, the violation path, main()'s stream/exit wiring, and the main-invocation guard. - Wire `npm run docstring` into release:check (immediately before coverage) and add a "Verify complete docstring coverage" CI step after build, before the coverage step. No existing CI job or step is renamed. - Write real JSDoc for every flagged declaration: 72 violations (62 in index.ts, 10 in projects.ts) reduced to 0 — 85 declarations documented across 4 files. The analyzer is never vendored, copied, or reimplemented; this is adoption only. pm: pm-github-pbxd
|
Warning Review limit reached
Next review available in: 29 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
Summary by CodeRabbit
WalkthroughThe pull request adds a ChangesDocstring coverage gate
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CI
participant main
participant runGate
participant analyzeDocstringCoverage
CI->>main: run npm run docstring
main->>runGate: analyze repository
runGate->>analyzeDocstringCoverage: check docstring coverage
analyzeDocstringCoverage-->>runGate: violations or documented count
runGate-->>main: return GateResult
main-->>CI: write output and set exit code
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideAdopts the canonical pm-ops docstring coverage analyzer as a fleet-wide docstring gate for this repo, wiring it into npm scripts and CI via a thin launcher script, adding behavioral tests for the gate, and bringing existing source files up to full JSDoc coverage so the gate passes cleanly. Sequence diagram for the new docstring gate executionsequenceDiagram
actor Developer
participant npm as npm_script
participant DocGate as scripts_docstring_gate_ts
participant Ops as pm_ops_docstrings
Developer->>npm: npm run docstring
npm->>DocGate: node scripts/docstring-gate.ts
DocGate->>DocGate: isMainInvocation(process.argv, import.meta.url)
DocGate->>DocGate: main(repoRoot)
DocGate->>Ops: analyzeDocstringCoverage({ root })
Ops-->>DocGate: report
alt report.violations.length > 0
DocGate->>DocGate: runGate(root) returns GateResult(exitCode=1, stderr)
DocGate->>Developer: write stderr, set process.exitCode=1
else no violations
DocGate->>DocGate: runGate(root) returns GateResult(exitCode=0, stdout)
DocGate->>Developer: write stdout, set process.exitCode=0
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Greptile SummaryThe PR adopts the canonical
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| scripts/docstring-gate.ts | Adds the pm-ops analyzer launcher, stream and exit-code wiring, and a fail-closed direct-invocation guard. |
| test/docstring-gate.test.ts | Covers successful and failing scans, CLI output wiring, invocation detection, and the self-resolution regression. |
| package.json | Adds the locked pm-ops-backed docstring command and inserts it into the release-check sequence. |
| .github/workflows/ci.yml | Runs the docstring gate after compilation and before the coverage gate. |
| index.ts | Adds JSDoc to existing GitHub issue integration declarations without changing executable behavior. |
| projects.ts | Adds JSDoc to existing Projects V2 declarations without changing executable behavior. |
Reviews (5): Last reviewed commit: "fix(docstring-gate): fail closed when th..." | Re-trigger Greptile
`runGate` returns newline-free strings on purpose, so a test can compare whole strings without a trailing newline getting in the way; `main` appends the newline as it writes each non-empty stream. The docstring said the opposite — that the struct holds "the exact stdout/stderr bytes the CLI emits" — which is the one detail a caller would get wrong. Raised by CodeRabbit on pm-jira#56. The same wording came from the shared reference implementation, so it is corrected here in every repository adopting the gate in this round rather than in one.
|
@coderabbitai full review @greptileai review |
|
|
main appends the newline so the next release:check step starts on its own line rather than butting against this gate's output, but the failure-path test accepted output without it. Raised by CodeRabbit on pm-beads#63; applied across this round's repositories rather than one, since they share the test.
|
@coderabbitai full review @greptileai review |
|
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai full review |
|
|
@coderabbitai full review |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
… path isMainInvocation resolved this module's own path inside a try block that swallowed every failure and returned false. Returning false leaves main() unreached and process.exitCode at zero, so a release could pass the mandatory docstring gate having scanned nothing - the silent no-op the docstring itself called worse than throwing. The two resolutions fail for opposite reasons and are now treated differently: an unresolvable argv[1] still answers false, because that is the ordinary imported-by-a-test case, while an unresolvable own module path throws. Adds a regression test for the throw, plus one for the unresolvable-argv[1] case, and asserts the newline-free GateResult contract that the violation test previously accepted a trailing newline against. The throw test was mutation-checked: reverting the split resolution makes it fail.
|
@coderabbitai full review |
|
|
Summary
Adopts the canonical
pm-opsdocstring coverage analyzer as the single fleet-wide docstring gate, mirroring the pm-linear adoption (pm-linear#58). The analyzer is never vendored, copied, or reimplemented — this is adoption only (pm-opsdevDependency + a thin launcher overanalyzeDocstringCoverage).Changes
pm-ops^2026.8.8 added as a devDependency — the exact pin pm-linear uses.scripts/docstring-gate.ts— a self-contained launcher overpm-ops/docstringsanalyzeDocstringCoverage, exposing a purerunGate+ thinmain+isMainInvocationguard. It intentionally matches this repo's existingscripts/coverage-gate.tsstyle (no shared launcher helper module introduced), rather than copying pm-linear'sscript-launcher.tsabstraction.test/docstring-gate.test.ts— behavioral coverage of the clean path, the violation path,main()'s stream/exit wiring, and the main-invocation guard.package.json—"docstring": "node scripts/docstring-gate.ts", inserted intorelease:checkimmediately before the coverage step..github/workflows/ci.yml— aVerify complete docstring coveragestep added afterBuild, before the coverage step. No existing CI job or step is renamed.index.ts, 10 inprojects.ts); 85 declarations documented across 4 files.Verification
Full
npm run release:checkis green end to end:typecheck✓build✓docstring→4 file(s), 85 declaration(s) documented.(0 violations) ✓coverage→ thresholds met (88/79/89) ✓audit:prod✓pack:dry-run✓changelog:check✓pm
FORBIDDEN compliance
No PR merged, no review-bot triggers posted, nothing pushed to
unbraind/pm-cli, the analyzer is not vendored, and no AI attribution is present in the commit.Summary by Sourcery
Adopt a shared docstring coverage gate and wire it into local scripts and CI while fully documenting the GitHub integration surfaces.
New Features:
Enhancements:
CI:
Documentation:
Tests:
Chores:
Summary by cubic
Adopted the canonical
pm-opsdocstring coverage gate and wired it into CI to enforce real JSDoc across the repo. Fixed all violations (72 → 0) and hardened the launcher to fail closed on self-resolution errors.New Features
pm-ops^2026.8.8 devDependency and a thinscripts/docstring-gate.tslauncher (runGate/main/isMainInvocation).test/docstring-gate.test.ts.docstring; inserted intorelease:checkand added a CI step “Verify complete docstring coverage” after Build.Bug Fixes
GateResultdocs (newline-free strings) and ensuredmain()writes newline-terminated stderr.isMainInvocationnow throws when this module’s own path cannot be resolved, preventing the mandatory gate from skipping its scan and exiting zero; added regression tests.Written for commit 7ec5dcd. Summary will update on new commits.