docs: backfill docstrings on 55 public functions#5
Merged
Conversation
Public-API docstring coverage was 29% (22/77). Now 100% (77/77). Backfilled across 12 files: - jobs.py (7): registry + JobContext API - living_docs_store.py (11): scan, queue, quality, get_store - routes/living_docs.py (11): all REST endpoints - routes/cowork_pages.py (9): every Cowork dashboard page handler - routes/cowork_files.py (4): read/render/write/pin - routes/jobs.py (5): commands, list/start/get/cancel jobs - commands.py (2): get_command, list_commands - routes/profile.py (2): get/set profile - app.py (1): create_app - main.py (1): main CLI entry - routes/system.py (1): health - routes/cowork_templates.py (1): list_templates One-liners where the function name + signature carry the meaning; multi-line for endpoints with non-obvious error semantics. 124 tests pass, ruff clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 8, 2026
silversurfer562
added a commit
that referenced
this pull request
May 8, 2026
…27) Phase D4 of the architecture-realignment spec — final phase. Closes findings #5 (private cross-route _get_pipeline import) and #7 (inconsistent error envelopes). #5 — RagPipeline cache moved to attune_gui.services.rag_pipeline with public ``pipeline_for(workspace)`` / ``invalidate(workspace)``. routes.rag, routes.search, routes.living_docs, and the _author_proxy invalidate path all import from the canonical owner. routes.rag keeps backwards-compat aliases (_get_pipeline, _PIPELINES, etc.) so existing in-tree code that referenced the old private surface keeps working. #7 — attune_gui.errors registers three handlers at app construction: HTTPException (normalizes string + dict detail to the envelope shape), RequestValidationError (renders 422s with a ``validation_error`` code and the original error list as a sibling key), and bare Exception (catches anything else, logs the traceback, returns the canonical 500 envelope without leaking the exception message). Every ``/api/*`` response now renders through one shape: 4xx → {"detail": {"message": str, "code": str | null}} 5xx → {"detail": {"message": "internal error", "code": "internal_error"}} 422 → {"detail": {"message": "Request validation failed.", "code": "validation_error", "errors": [...]}} Routes raising HTTPException(detail="some string") get normalized into the dict shape automatically — no per-route migration needed. Routes already using detail={"code": ..., "message": ...} flow through unchanged. 17 new tests (9 services + 8 envelope). Existing tests updated to assert against detail["message"] instead of bare detail string. Bumps to 0.7.0. Stop saying "internal_error" leaks an exception detail to clients is a behavior change worth a minor bump even if the shape itself is mostly compatible. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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
Public-API docstring coverage was 29% (22/77) per the deep-review pass. Now 100% (77/77).
Backfilled across 12 files:
One-liners where the function name + signature carry the meaning; multi-line for endpoints with non-obvious error semantics.
Test plan
🤖 Generated with Claude Code