Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions codewiki/cli/config_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🟠 config_manager.py module docstring is a one-liner despite implementing complex keyring/file persistence logic

Replaced the one-line module docstring at the top of codewiki/cli/config_manager.py with a multi-line docstring enumerating ConfigManager's responsibilities (config file persistence, per-role keyring-backed API key storage, validation, clear/delete operations) and its role as the integration point for the CLI config commands, matching the suggested fix exactly. No functional code was changed.

πŸ€– Prompt for AI agents
In codewiki/cli/config_manager.py around line 1, review and complete this code-review fix: config_manager.py module docstring is a one-liner despite implementing complex keyring/file persistence logic.
What the draft fix changed: Replaced the one-line module docstring at the top of `codewiki/cli/config_manager.py` with a multi-line docstring enumerating ConfigManager's responsibilities (config file persistence, per-role keyring-backed API key storage, validation, clear/delete operations) and its role as the integration point for the CLI config commands, matching the suggested fix exactly. No functional code was changed.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 95 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Configuration manager with keyring integration for secure credential storage.

Responsibilities:
- Load and save non-sensitive CLI configuration (models, base URLs, API
versions, max tokens, temperature settings) to ~/.codewiki/config.json
- Store and retrieve per-role (cluster/main/fallback) API keys exclusively
through the system keyring, never persisting them to disk
- Validate configuration completeness before allowing pipeline execution
- Provide clear/delete operations that remove both file and keyring state

This module is the single integration point between the CLI's config
commands and the underlying Configuration dataclass and system keyring.
"""

import json
Expand Down
5 changes: 5 additions & 0 deletions codewiki/cli/utils/logging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🟠 cli/utils/logging.py docstring is minimal relative to module's actual responsibility scope

Expanded the module docstring at the top of codewiki/cli/utils/logging.py from a single line to a multi-line docstring enumerating CLILogger's responsibilities (debug/info/success/warning/error/step helpers for CLI output) and quiet_third_party_loggers()'s purpose (capping httpx/openai/anthropic loggers at WARNING), matching the suggested fix text exactly. No other code was changed.

πŸ€– Prompt for AI agents
In codewiki/cli/utils/logging.py around line 1, review and complete this code-review fix: cli/utils/logging.py docstring is minimal relative to module's actual responsibility scope.
What the draft fix changed: Expanded the module docstring at the top of codewiki/cli/utils/logging.py from a single line to a multi-line docstring enumerating CLILogger's responsibilities (debug/info/success/warning/error/step helpers for CLI output) and quiet_third_party_loggers()'s purpose (capping httpx/openai/anthropic loggers at WARNING), matching the suggested fix text exactly. No other code was changed.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 95 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Logging utilities for CLI with colored output and progress tracking.

Provides CLILogger, a lightweight click-based logger with debug/info/success/
warning/error/step helpers for user-facing CLI output, plus
quiet_third_party_loggers(), which caps noisy third-party HTTP/SDK loggers
(httpx, openai, anthropic) at WARNING so CLI runs stay readable.
"""

import logging
Expand Down
10 changes: 9 additions & 1 deletion codewiki/src/be/agent_tools/read_code_components.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
"""Agent tool for reading the source code of specific CodeWiki components by id."""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🟠 security.py docstring present but validation.py and topo_sort.py inconsistently apply the same standard elsewhere in repo (spot check on read_code_components.py)

Expanded the one-line module docstring at the top of codewiki/src/be/agent_tools/read_code_components.py into a multi-sentence docstring describing the module's role in the agent pipeline, its exported read_code_components_tool, and how it relies on CodeWikiDeps.components, matching the suggested fix in the finding. No functional code was changed.

πŸ€– Prompt for AI agents
In codewiki/src/be/agent_tools/read_code_components.py around line 1, review and complete this code-review fix: security.py docstring present but validation.py and topo_sort.py inconsistently apply the same standard elsewhere in repo (spot check on read_code_components.py).
What the draft fix changed: Expanded the one-line module docstring at the top of `codewiki/src/be/agent_tools/read_code_components.py` into a multi-sentence docstring describing the module's role in the agent pipeline, its exported `read_code_components_tool`, and how it relies on `CodeWikiDeps.components`, matching the suggested fix in the finding. No functional code was changed.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 90 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

"""Agent tool for reading the source code of specific CodeWiki components by id.

This module exposes `read_code_components_tool`, a pydantic-ai Tool that the
documentation-generation agent calls to fetch the verbatim source code of one
or more components by their fully-qualified component id (module.path::Name).
It looks up components from the shared `CodeWikiDeps.components` map built
earlier in the pipeline and is used by the agent to ground its explanations
in actual source rather than hallucinated code.
"""

from pydantic_ai import RunContext, Tool
from codewiki.src.be.agent_tools.deps import CodeWikiDeps
Expand Down
10 changes: 10 additions & 0 deletions codewiki/src/be/dependency_analyzer/models/analysis.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
"""
Analysis result models for the dependency analyzer.

Defines the Pydantic models used to represent the outcome of analyzing a
repository (functions, call relationships, file tree, and summary data) as
well as the NodeSelection model used for partial export of selected nodes.
These models are the primary data contract passed from the dependency
analysis stage to downstream documentation-generation and export stages.
"""

from pydantic import BaseModel

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🟠 analysis.py has no module docstring at all

Added a triple-quoted module docstring at the very top of codewiki/src/be/dependency_analyzer/models/analysis.py, before the existing imports, describing the module's purpose (analysis result models) and role in the pipeline, exactly as suggested in the finding. No other lines were changed.

πŸ€– Prompt for AI agents
In codewiki/src/be/dependency_analyzer/models/analysis.py around line 1, review and complete this code-review fix: analysis.py has no module docstring at all.
What the draft fix changed: Added a triple-quoted module docstring at the very top of codewiki/src/be/dependency_analyzer/models/analysis.py, before the existing imports, describing the module's purpose (analysis result models) and role in the pipeline, exactly as suggested in the finding. No other lines were changed.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 95 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

from typing import List, Dict, Any, Optional
from codewiki.src.be.dependency_analyzer.models.core import Node, CallRelationship, Repository
Expand Down
12 changes: 11 additions & 1 deletion codewiki/src/be/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
"""Backend utility helpers for the CodeWiki documentation pipeline.

Responsibilities:
- Complexity heuristics for module clustering (is_complex_module)
- Token counting via tiktoken for LLM context budgeting
- Extraction, validation, and persistence of Mermaid diagrams embedded in
generated markdown documentation, including error-window rendering for
diagnosing parser failures.
"""

import re

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🟠 codewiki/src/be/utils.py lacks a module-level docstring

Added a triple-quoted module-level docstring at the very top of codewiki/src/be/utils.py, before the import re statement, describing the file's role (complexity heuristics, token counting, mermaid diagram extraction/validation/persistence) in the backend documentation pipeline, exactly as suggested in the finding. No other code was modified.

πŸ€– Prompt for AI agents
In codewiki/src/be/utils.py around line 1, review and complete this code-review fix: codewiki/src/be/utils.py lacks a module-level docstring.
What the draft fix changed: Added a triple-quoted module-level docstring at the very top of codewiki/src/be/utils.py, before the `import re` statement, describing the file's role (complexity heuristics, token counting, mermaid diagram extraction/validation/persistence) in the backend documentation pipeline, exactly as suggested in the finding. No other code was modified.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 95 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

from pathlib import Path
from typing import List, Tuple
Expand Down Expand Up @@ -402,4 +412,4 @@ def create_diagrams_readme(diagrams_dir: str, diagram_files: list) -> str:
import asyncio
test_file = "output/docs/SWE_agent-docs/agent_hooks.md"
result = asyncio.run(validate_mermaid_diagrams(test_file, "agent_hooks.md"))
print(result)
print(result)
8 changes: 8 additions & 0 deletions codewiki/src/fe/cache_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/usr/bin/env python3

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🟠 cache_manager.py module docstring is a one-liner and does not describe pipeline role

Replaced the one-line module docstring at the top of codewiki/src/fe/cache_manager.py with a multi-line docstring describing the module's responsibilities (index load/save, expiry, corruption recovery) and its role in the frontend/webapp pipeline, exactly matching the suggested fix in the finding. No other code was changed.

πŸ€– Prompt for AI agents
In codewiki/src/fe/cache_manager.py around line 1, review and complete this code-review fix: cache_manager.py module docstring is a one-liner and does not describe pipeline role.
What the draft fix changed: Replaced the one-line module docstring at the top of `codewiki/src/fe/cache_manager.py` with a multi-line docstring describing the module's responsibilities (index load/save, expiry, corruption recovery) and its role in the frontend/webapp pipeline, exactly matching the suggested fix in the finding. No other code was changed.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 95 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

"""
Cache management for documentation generation results.

This module maintains an on-disk index (cache_index.json) mapping repository
URLs to previously generated documentation output paths. It is used by the
web-app layer (codewiki/src/fe) to avoid regenerating documentation for a
repository that was already processed within the configured expiry window,
including cache lookup, insertion, expiry cleanup, and recovery from a
corrupted index file.
"""

import hashlib
Expand Down Expand Up @@ -126,3 +133,4 @@ def cleanup_expired_cache(self):

if expired_entries:
self.save_cache_index()