Skip to content

docs: full designs for Phase 3b (maintainability), 3c (QoL/DX), and 3d (power/performance) - #10

Merged
cursor[bot] merged 1 commit into
masterfrom
cursor/maintainability-qol-performance-design-48a4
Jun 30, 2026
Merged

docs: full designs for Phase 3b (maintainability), 3c (QoL/DX), and 3d (power/performance)#10
cursor[bot] merged 1 commit into
masterfrom
cursor/maintainability-qol-performance-design-48a4

Conversation

@qkal

@qkal qkal commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

Brainstorming/design deliverable only — no source code changes. Follow-up to the Public Release Readiness design, which left Phases 3b/3c/3d as backlog outlines. This PR expands each into its own fully specified, independently implementable design, per the maintainer's request to fully design "3c, 3d, and other similar ideas" — interpreted as all three remaining phases, since 3b (maintainability) was the very first thing requested in the original brainstorming ask.

Stacked on top of #9 (this branch builds on cursor/public-release-readiness-design-48a4) since these specs reference and build on that roadmap doc; the diff here is scoped to just the three new specs plus the roadmap update.

New documents

  • docs/superpowers/specs/2026-06-30-agent-quality-mcp-maintainability-refactor-design.md (Phase 3b)
  • docs/superpowers/specs/2026-06-30-agent-quality-mcp-quality-of-life-dx-design.md (Phase 3c)
  • docs/superpowers/specs/2026-06-30-agent-quality-mcp-power-performance-design.md (Phase 3d)
  • Updated: docs/superpowers/specs/2026-06-30-agent-quality-mcp-public-release-readiness-design.md (roadmap doc now links to all three)

Highlights per phase

Phase 3b — Maintainability: splits lsp/pyright.py (1,064 lines; contains 3 of the repo's 9 C901 complexity hits) into a lsp/pyright/ subpackage along its five existing concerns; deletes the dead wrap_uv_result/wrap_ruff_result code per Phase 3a's Resolved Decision 2; extracts inspect_workspace_service into its own module; dedupes the safe-diff-preview validator out of cli/ruff.py; adds a scoped complexity gate and a file-length CI guardrail.

Phase 3c — Quality-of-Life & DX: fixes audit logging being completely inert by default — empirically verified in this session (logging.getLogger("agent_quality_mcp.audit").getEffectiveLevel()30 / WARNING, zero handlers anywhere), so every existing audit event is silently dropped today. Adds --check-tools/--selftest/--print-schema CLI commands, a test-enforced diagnostics/decision reference table in the README, richer inspect_workspace config-override metadata, broader MCP-client quickstart coverage, and an explicit deferred-decision process for adding new validator tools (no new tool is chosen here).

Phase 3d — Power & Performance: parallelizes uv/Ruff/Pyright execution with a bounded thread pool, shared-deadline timeout accounting, and deterministic post-hoc response reordering (directly answering the original Pyright-LSP spec's deferral reasons rather than ignoring them); an opt-in streamable-http transport that fails closed without a mandatory bearer token; scoped informational-only project-layout detection; and explicit, reasoned decisions not to build response caching or incremental shadow-copy mechanisms now, with the safety/correctness concerns recorded so they aren't silently re-proposed later.

Verification performed during self-review

Every proposed script/config in Phase 3b was actually executed against this repository, not just described — which caught and fixed three real mistakes before they could reach an implementation plan:

  1. A git ls-files glob pathspec that silently skipped 22 of 32 tracked Python files (missing :(glob) magic).
  2. A claim that the file-length guardrail's allowlist would be empty — running the corrected script found patching.py also needed allowlisting, not just service.py.
  3. A max-complexity threshold that was off by one (12 instead of 13) — verified by actually running ruff check --select C901 with the proposed config.

Phase 3c/3d claims about current behavior (logging silence, wheel contents excluding test fixtures, mcp SDK transport/auth capabilities via TokenVerifier/TransportSecuritySettings) were each verified by running code or reading source in this session rather than assumed.

Hard gate

Per the brainstorming workflow, no implementation happens until each design is reviewed and approved — these are independent specs; the maintainer can approve/adjust each separately before any is turned into an implementation plan.

Test plan

  • No source code touched.
  • All four spec docs checked for balanced code fences and zero git diff --check whitespace issues.
Open in Web Open in Cursor 

…d (power/performance)

Expands the three backlog outlines from the public-release-readiness
roadmap into fully specified, independently implementable designs, each
with its own spec file matching this repository's one-spec-per-phase
convention:

- Phase 3b (maintainability refactor): splits lsp/pyright.py (1064 lines,
  3 of the repo's 9 C901 complexity hits) into a lsp/pyright/ subpackage
  along its five existing concerns, deletes the dead
  wrap_uv_result/wrap_ruff_result code per Phase 3a's Resolved Decision 2,
  extracts inspect_workspace_service into its own module, deduplicates the
  safe-diff-preview validator out of cli/ruff.py, and adds a scoped
  complexity gate plus a file-length CI guardrail.
- Phase 3c (quality-of-life & DX): fixes audit logging being completely
  inert by default (empirically verified: WARNING level, zero handlers,
  every existing audit event silently dropped), adds --check-tools/
  --selftest/--print-schema CLI commands, a test-enforced diagnostics/
  decision reference table in the README, richer inspect_workspace
  config-override metadata, broader MCP-client quickstart coverage, and an
  explicit deferred-decision process for adding new validator tools.
- Phase 3d (power & performance): parallelizes uv/Ruff/Pyright execution
  with a bounded thread pool, shared-deadline timeout accounting, and
  deterministic post-hoc response reordering; an opt-in streamable-http
  transport that fails closed without a mandatory bearer token; scoped
  informational-only project-layout detection; and explicit, reasoned
  decisions not to build response caching or incremental shadow-copy
  mechanisms now.

Every proposed script/config snippet in Phase 3b was actually executed
against this repository during self-review, which caught and fixed three
real mistakes before they could reach an implementation plan: a git
ls-files glob pathspec that silently skipped 22 of 32 tracked files, a
file-length allowlist that incorrectly assumed it would be empty, and a
complexity threshold that was off by one. Phase 3c and 3d claims about
current behavior (logging silence, wheel contents, mcp SDK transport/auth
capabilities) were each verified by running code or reading source in this
session rather than assumed.

Updates the public-release-readiness roadmap doc to link to all three new
specs and replace its backlog-outline language accordingly.

No source code changes; this is a brainstorming/design deliverable only.

Co-authored-by: Qkal <qkal@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cursor[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b1e6070b-c850-45ad-98d4-38cf8ed2be3a

📥 Commits

Reviewing files that changed from the base of the PR and between 6c832ac and d4ed362.

📒 Files selected for processing (4)
  • docs/superpowers/specs/2026-06-30-agent-quality-mcp-maintainability-refactor-design.md
  • docs/superpowers/specs/2026-06-30-agent-quality-mcp-power-performance-design.md
  • docs/superpowers/specs/2026-06-30-agent-quality-mcp-public-release-readiness-design.md
  • docs/superpowers/specs/2026-06-30-agent-quality-mcp-quality-of-life-dx-design.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/maintainability-qol-performance-design-48a4

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor
cursor Bot deleted the branch master June 30, 2026 20:51
@cursor
cursor Bot changed the base branch from cursor/public-release-readiness-design-48a4 to master June 30, 2026 20:52
@cursor
cursor Bot marked this pull request as ready for review June 30, 2026 20:52
@cursor
cursor Bot merged commit f89ea48 into master Jun 30, 2026
3 checks passed
@cursor
cursor Bot deleted the cursor/maintainability-qol-performance-design-48a4 branch June 30, 2026 20:52

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +519 to +522
- Ambiguity check: the `max-complexity = 12` threshold's rationale (lowest
value under which the three split-out functions pass without further
rewriting) is stated explicitly so a future reader cannot mistake it for
an arbitrary number.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Design spec's self-review note references the wrong complexity threshold, contradicting the rest of the document

The self-review ambiguity-check note states the threshold is 12 (max-complexity = 12 at docs/superpowers/specs/2026-06-30-agent-quality-mcp-maintainability-refactor-design.md:519) even though the document corrected this to 13 everywhere else (lines 234, 246, 256–262, 471), and even documents catching and fixing this exact mistake in a prior self-review note (lines 500–507).

Impact: An implementer reading the self-review notes may be confused about which threshold value is correct, since the "ambiguity check" note — whose purpose is to prevent exactly this confusion — itself contains the stale value.

Stale value left over from pre-fix draft

The self-review at lines 500-507 documents catching the 12 → 13 fix in the main body. But the later "Ambiguity check" bullet at line 519 still says max-complexity = 12. The correct value used in the Complexity Gate section (docs/superpowers/specs/2026-06-30-agent-quality-mcp-maintainability-refactor-design.md:234), the TOML example (docs/superpowers/specs/2026-06-30-agent-quality-mcp-maintainability-refactor-design.md:246), and the acceptance criteria (docs/superpowers/specs/2026-06-30-agent-quality-mcp-maintainability-refactor-design.md:471) is 13.

Suggested change
- Ambiguity check: the `max-complexity = 12` threshold's rationale (lowest
value under which the three split-out functions pass without further
rewriting) is stated explicitly so a future reader cannot mistake it for
an arbitrary number.
- Ambiguity check: the `max-complexity = 13` threshold's rationale (lowest
value under which the three split-out functions pass without further
rewriting) is stated explicitly so a future reader cannot mistake it for
an arbitrary number.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants