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
2 changes: 1 addition & 1 deletion test_clustering_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def print_summary(self):
)

# Create config via factory (not direct construction) to satisfy validation/env-resolution

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.

🦩 πŸ”΄ Direct Config(...) instantiation bypasses required classmethod factories

Changed the Config(...) direct instantiation at the config-creation block to Config.from_args(...), passing the same keyword arguments, so the comment claiming factory usage matches the actual call. This assumes Config.from_args exists in codewiki/src/config.py and accepts the same keyword arguments as the constructor (repo_path, output_dir, dependency_graph_dir, docs_dir, max_depth, main_model, cluster_model, fallback_model, and the api_key/base_url fields). I could not view codewiki/src/config.py to confirm the factory's exact signature or that it forwards these kwargs unchanged to validation/env-resolution logic β€” if from_args has a different signature (e.g. it parses argparse.Namespace rather than kwargs, or omits/renames some fields), this call will raise a TypeError at runtime. A complete fix requires inspecting config.py to confirm from_args's actual signature and adjusting the call accordingly, or using from_cli instead if that is the kwarg-based factory.

πŸ€– Prompt for AI agents
In test_clustering_debug.py around line 85, review and complete this code-review fix: Direct Config(...) instantiation bypasses required classmethod factories.
What the draft fix changed: Changed the `Config(...)` direct instantiation at the config-creation block to `Config.from_args(...)`, passing the same keyword arguments, so the comment claiming factory usage matches the actual call. This assumes `Config.from_args` exists in `codewiki/src/config.py` and accepts the same keyword arguments as the constructor (repo_path, output_dir, dependency_graph_dir, docs_dir, max_depth, main_model, cluster_model, fallback_model, and the api_key/base_url fields). I could not view `codewiki/src/config.py` to confirm the factory's exact signature or that it forwards these kwargs unchanged to validation/env-resolution logic β€” if `from_args` has a different signature (e.g. it parses `argparse.Namespace` rather than kwargs, or omits/renames some fields), this call will raise a `TypeError` at runtime. A complete fix requires inspecting `config.py` to confirm `from_args`'s actual signature and adjusting the call accordingly, or using `from_cli` instead if that is the kwarg-based factory.
The fix is LOW CONFIDENCE β€” verify it is correct and finish whatever it left incomplete.

fix confidence: πŸ”΄ 40 low β€” review closely β€” react πŸ‘/πŸ‘Ž to teach the reviewer

config = Config(
config = Config.from_args(
repo_path=test_repo,
output_dir="/tmp/codewiki_test",
dependency_graph_dir="/tmp/codewiki_test/deps",
Expand Down
2 changes: 1 addition & 1 deletion test_clustering_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_clustering(results):
print(f"\nπŸ“‚ Test repository: {test_repo}")

# Create minimal config via the required factory method
config = Config(

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.

🦩 πŸ”΄ Direct Config(...) instantiation bypasses required from_cli/from_args factory

In test_clustering (test_clustering_local.py), replaced the direct Config(...) keyword-argument instantiation with Config.from_args(...), passing the same keyword arguments through the mandated factory method per CODEWIKI-007. This assumes Config.from_args accepts the same keyword arguments as the direct constructor (repo_path, output_dir, dependency_graph_dir, docs_dir, max_depth, cluster_model, cluster_api_key, cluster_base_url, main_model, main_api_key, main_base_url, fallback_model, fallback_api_key, fallback_base_url); since codewiki/src/config.py was not provided, the exact signature of from_args could not be verified, and a complete fix would require confirming that signature matches or adjusting keyword names accordingly.

πŸ€– Prompt for AI agents
In test_clustering_local.py around line 62, review and complete this code-review fix: Direct Config(...) instantiation bypasses required from_cli/from_args factory.
What the draft fix changed: In `test_clustering` (test_clustering_local.py), replaced the direct `Config(...)` keyword-argument instantiation with `Config.from_args(...)`, passing the same keyword arguments through the mandated factory method per CODEWIKI-007. This assumes `Config.from_args` accepts the same keyword arguments as the direct constructor (repo_path, output_dir, dependency_graph_dir, docs_dir, max_depth, cluster_model, cluster_api_key, cluster_base_url, main_model, main_api_key, main_base_url, fallback_model, fallback_api_key, fallback_base_url); since `codewiki/src/config.py` was not provided, the exact signature of `from_args` could not be verified, and a complete fix would require confirming that signature matches or adjusting keyword names accordingly.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟑 65 medium β€” react πŸ‘/πŸ‘Ž to teach the reviewer

config = Config.from_args(
repo_path=test_repo,
output_dir="/tmp/codewiki_test_output",
dependency_graph_dir="/tmp/codewiki_test_output/deps",
Expand Down
5 changes: 3 additions & 2 deletions test_subdirectory_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
from codewiki.src.be.documentation_generator import DocumentationGenerator
from codewiki.src.config import Config

# Create minimal config
config = Config(

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 instantiated directly with positional/keyword args, bypassing from_args/from_cli factories

In test_subdirectory_fix.py, replaced the direct Config(...) positional/keyword instantiation with Config.from_args(...), keeping the same keyword arguments, so construction goes through the mandated factory. This assumes Config.from_args exists and accepts these same keyword argument names (visible in the original call but the factory's actual signature was not shown to me); if from_args uses a different parameter set or does additional required env resolution incompatible with passing explicit keys, the call will need adjustment β€” a complete fix would require inspecting codewiki/src/config.py to confirm from_args's exact signature.

πŸ€– Prompt for AI agents
In test_subdirectory_fix.py around line 16, review and complete this code-review fix: Config instantiated directly with positional/keyword args, bypassing from_args/from_cli factories.
What the draft fix changed: In `test_subdirectory_fix.py`, replaced the direct `Config(...)` positional/keyword instantiation with `Config.from_args(...)`, keeping the same keyword arguments, so construction goes through the mandated factory. This assumes `Config.from_args` exists and accepts these same keyword argument names (visible in the original call but the factory's actual signature was not shown to me); if `from_args` uses a different parameter set or does additional required env resolution incompatible with passing explicit keys, the call will need adjustment β€” a complete fix would require inspecting `codewiki/src/config.py` to confirm `from_args`'s exact signature.
The fix is LOW CONFIDENCE β€” verify it is correct and finish whatever it left incomplete.

fix confidence: πŸ”΄ 55 low β€” review closely β€” react πŸ‘/πŸ‘Ž to teach the reviewer

# Create minimal config via the from_args factory to preserve env-var
# resolution, defaulting, and validation guarantees (CODEWIKI-007).
config = Config.from_args(
cluster_api_key=os.getenv("CLUSTER_API_KEY", os.getenv("OPENAI_API_KEY", "")),
main_api_key=os.getenv("MAIN_API_KEY", os.getenv("OPENAI_API_KEY", "")),
fallback_api_key=os.getenv("FALLBACK_API_KEY", os.getenv("ANTHROPIC_API_KEY", "")),
Expand Down