-
Notifications
You must be signed in to change notification settings - Fork 1
Documentation tooling, docstring coverage & staleness, Makefile #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Cross-referenced todo-unified-query-exploration.md and todo-adr-201-graph-accel.md against actual code to identify what was already documented and what still needed JSDoc. - SearchBar.tsx: add JSDoc to 5 undocumented handlers - graph_facade.py: enhance module docstring with connection architecture and caching tier cross-references - queries.py: document generation-aware cache in _build_connection_paths - Mark Phase 3 (editor integration) complete in exploration todo — all 3 items verified implemented - Mark Phase 5 code docstrings complete (5 of 7 items; remaining 2 are user-facing manual docs, not docstrings) - Mark ADR-201 5f docstring item complete
Adds scripts/development/diagnostics/docstring_coverage.py — a unified reporter for Python, TypeScript, and Rust docstring coverage. Python delegates to interrogate (AST-based) when available, falls back to ast.parse. TypeScript and Rust use built-in regex scanners since no standalone coverage tools exist for those languages. Supports --verbose (show each undocumented item with file:line), --fail-under N (CI gate), and per-language filters.
Add --staleness flag to docstring_coverage.py: extracts @verified <commit-hash> tags from docstrings across Python/TypeScript/Rust and compares against git history to report a tristate (current/stale/ unverified). All three scanners use a shared _extract_verified() function for consistent tag parsing. Move static analysis tools (docstring_coverage.py, lint_queries.py) from scripts/development/diagnostics/ to scripts/development/lint/ — diagnostics/ is for runtime platform inspection, lint/ is for static analysis that needs no running services. Add docs/guides/DOCSTRING_COVERAGE.md, development practices section in CLAUDE.md (docstrings, testing, tools, operator.sh), and remove completed todo-test-suite-cleanup.md tracker.
Provides discoverable targets for all project verbs: testing, static analysis, doc generation, publishing, platform management, and container builds. Run `make help` to see everything available.
The API moved from src/api to api/app but the query linter's default path was never updated, causing make lint to fail.
The project restructured from src/api/ to api/app/ but many references were left behind. Fixes active scripts (CI, test runners, linters), source code comments, READMEs, and testing documentation.
Code Review: Documentation tooling, docstring coverage & staleness, MakefilePR size: 1785 additions / 361 deletions across 76 files. Bulk of the additions is the new What this changes
Assessment: Sound overall, a few items worth addressingIssue: Logic bug in Rust
|
| Category | Finding |
|---|---|
| Bug (minor) | Rust #[cfg(test)] brace tracking is fragile for edge cases |
| Clarity | StalenessEntry.status prefix match has a tautological branch |
| Performance (minor) | _is_method is O(N*M) per file, could be O(N+M) |
| No issues | src/api path replacements are all correct |
| No issues | Makefile conventions are solid |
| No issues | Tool architecture, CLAUDE.md, SearchBar docstrings |
None of these are merge blockers. The cfg(test) brace tracking and the prefix match clarity are the most worth addressing.
Bulk replacement of src/api → api/app across 37 ADR files and 8 remaining guide/manual/reference docs. Preserved valid cli/src/api and web/src/api TypeScript paths. Left examples/use-cases/ archival conversation logs untouched as historical records.
d145aea to
a3f7803
Compare
The dot-separated Python module paths (imports, uvicorn targets, logger names) were missed by the earlier slash-based path cleanup. Fixes active source code (main.py, logging_config.py), operator admin scripts, diagnostic scripts, and documentation.
The venv-based test runner scripts (all.sh, api.sh, lint.sh, client.sh, webapp.sh) predate containerization and fail immediately because there's no local venv. Tests run inside kg-api-dev via docker exec. - Remove stale scripts from scripts/development/test/ and operator/development/test/ (duplicates, never called from anywhere) - Fix make test to use docker exec instead of shelling to all.sh - Replace test-quick with test-verbose (more useful) - Rewrite test README to point at Makefile targets - Fix 3 code review items in docstring_coverage.py: - Replace quadratic _is_method with single-pass parent map - Simplify tautological prefix match in StalenessEntry.status - Document Rust #[cfg(test)] brace tracking limitation
Summary
scripts/development/lint/docstring_coverage.py) — reports documentation coverage across Python (via interrogate or AST fallback), TypeScript (regex scanner), and Rust (regex scanner)--staleness) — extracts@verified <commit-hash>tags from docstrings and compares against git history to produce a tristate: current, stale (with drift in days), or unverifiedmake helpshows all project verbs: testing, static analysis, doc generation, publishing, platform management, container buildslint/, removed stale venv-based test runners (tests run in Docker now)src/api→api/appandsrc.api.→api.app.across ~80 files (scripts, tests, CI config, READMEs, guides, ADRs, source code)scripts/andoperator/) that predate containerization and fail immediatelyCommits
0ab02c5b— docstring pass: verify plans against code, fill gaps3f251817— cross-language docstring coverage tool53aaeb91— docstring staleness tracking, reorganize dev scripts6658bdd4— Makefile as unified developer entry point13652aef— fix stale src/api default path in query linterdd6ae29d— fix stale src/api paths in scripts, tests, and docsa3f78034— fix stale src/api paths in ADRs and remaining docsc8185313— fix stale src.api module paths to api.app11b28776— remove stale venv test scripts, fix Makefile test targetsTest plan
make lint-queriespasses with corrected pathpython3 api/testing/linters/datetime_linter.pyscans api/app/ correctlypython3 scripts/development/lint/docstring_coverage.pyproduces coverage reportmake helpshows all targets with section headersmake testruns via docker exec (requires running container)src/apiorsrc.api.references outside of archival examples/