Skip to content

fix(CODEWIKI-009-2): CU-86akbhhru 4 review findings across 4 files - #53

Merged
michaelassraf merged 4 commits into
mainfrom
ai-fix/codewiki-009-2-c687b5ea-2cc7a212
Sep 8, 2026
Merged

michaelassraf merged 4 commits into
mainfrom
ai-fix/codewiki-009-2-c687b5ea-2cc7a212

Conversation

@flamingo

@flamingo flamingo Bot commented Sep 7, 2026

Copy link
Copy Markdown

Closes 4 review findings across 4 files.

Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.

# Fix confidence Finding Location
1 🟡 85 medium test_clustering_proof.py hardcodes a developer's local absolute filesystem path test_clustering_proof.py:13
2 🟡 85 medium test_clustering_real.py hardcodes a developer's local absolute filesystem path test_clustering_real.py:19
3 🟡 85 medium test_clustering_simple.py hardcodes a developer's local absolute filesystem path test_clustering_simple.py:21
4 🔴 40 low — review closely test_clustering_validation.py does not add repo root to sys.path before codewiki imports test_clustering_validation.py:1

What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.


Run: https://product-hub.flamingo.so/admin/code-review
Run id: 2cc7a212-e9ac-481a-a76e-5f03d762c00c

Merging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.

ClickUp task: CU-86akbhhru CodeWiki backend and CLI review findings (12 PRs)

@flamingo flamingo Bot left a comment

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.

🦩 What this fix changed, finding by finding

4 finding(s) fixed in this draft — 4 explained inline on the diff; 1 low-confidence hunk(s) need close review before merging.

Comment thread test_clustering_proof.py
from codewiki.src.be.dependency_analyzer.models.core import Node
from codewiki.src.config import Config

test_repo = "/Users/michaelassraf/Documents/GitHub/openframe-oss-tenant"

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.

🦩 🟠 test_clustering_proof.py hardcodes a developer's local absolute filesystem path

Replaced the hardcoded absolute path /Users/michaelassraf/Documents/GitHub/openframe-oss-tenant on the test_repo assignment with os.getenv("TEST_REPO_PATH", os.path.dirname(os.path.abspath(__file__))), mirroring the file's existing dynamic-path convention used for sys.path.insert(0, ...). This makes the script portable across machines by default (falling back to the script's own directory) while still allowing an explicit override via the TEST_REPO_PATH environment variable. Since test_repo is only used to build synthetic, non-existent file paths for Node objects (not read from disk), this substitution does not change runtime behavior on any machine.

🤖 Prompt for AI agents
In test_clustering_proof.py around line 13, review and complete this code-review fix: test_clustering_proof.py hardcodes a developer's local absolute filesystem path.
What the draft fix changed: Replaced the hardcoded absolute path `/Users/michaelassraf/Documents/GitHub/openframe-oss-tenant` on the `test_repo` assignment with `os.getenv("TEST_REPO_PATH", os.path.dirname(os.path.abspath(__file__)))`, mirroring the file's existing dynamic-path convention used for `sys.path.insert(0, ...)`. This makes the script portable across machines by default (falling back to the script's own directory) while still allowing an explicit override via the `TEST_REPO_PATH` environment variable. Since `test_repo` is only used to build synthetic, non-existent file paths for `Node` objects (not read from disk), this substitution does not change runtime behavior on any machine.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟡 85 medium — react 👍/👎 to teach the reviewer

Comment thread test_clustering_real.py
from codewiki.src.be.dependency_analyzer.models.core import Node
from codewiki.src.config import Config

test_repo = "/Users/michaelassraf/Documents/GitHub/openframe-oss-tenant"

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.

🦩 🟠 test_clustering_real.py hardcodes a developer's local absolute filesystem path

Changed test_repo in the module-level script body from the hardcoded absolute path "/Users/michaelassraf/Documents/GitHub/openframe-oss-tenant" to os.getenv("TEST_REPO_PATH", os.path.dirname(os.path.abspath(__file__))), so the path is now configurable via an environment variable and defaults to a portable, machine-independent location (the script's own directory) rather than a developer's local filesystem path.

🤖 Prompt for AI agents
In test_clustering_real.py around line 19, review and complete this code-review fix: test_clustering_real.py hardcodes a developer's local absolute filesystem path.
What the draft fix changed: Changed `test_repo` in the module-level script body from the hardcoded absolute path `"/Users/michaelassraf/Documents/GitHub/openframe-oss-tenant"` to `os.getenv("TEST_REPO_PATH", os.path.dirname(os.path.abspath(__file__)))`, so the path is now configurable via an environment variable and defaults to a portable, machine-independent location (the script's own directory) rather than a developer's local filesystem path.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟡 85 medium — react 👍/👎 to teach the reviewer

Comment thread test_clustering_simple.py
from codewiki.src.config import Config

# Test repo
test_repo = "/Users/michaelassraf/Documents/GitHub/openframe-oss-tenant"

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.

🦩 🟠 test_clustering_simple.py hardcodes a developer's local absolute filesystem path

Changed the test_repo assignment in the module-level script body (around line 21) from the hardcoded absolute path "/Users/michaelassraf/Documents/GitHub/openframe-oss-tenant" to os.getenv("TEST_REPO_PATH", os.path.join(os.path.dirname(os.path.abspath(__file__)), "openframe-oss-tenant")), allowing an environment variable override while falling back to a path relative to the script's own location instead of a developer-specific home directory, so the script no longer fails immediately for other users or CI runners.

🤖 Prompt for AI agents
In test_clustering_simple.py around line 21, review and complete this code-review fix: test_clustering_simple.py hardcodes a developer's local absolute filesystem path.
What the draft fix changed: Changed the `test_repo` assignment in the module-level script body (around line 21) from the hardcoded absolute path `"/Users/michaelassraf/Documents/GitHub/openframe-oss-tenant"` to `os.getenv("TEST_REPO_PATH", os.path.join(os.path.dirname(os.path.abspath(__file__)), "openframe-oss-tenant"))`, allowing an environment variable override while falling back to a path relative to the script's own location instead of a developer-specific home directory, so the script no longer fails immediately for other users or CI runners.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟡 85 medium — react 👍/👎 to teach the reviewer

Comment on lines 6 to 15

import json
import logging
import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).parent))

# Setup logging
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')

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.

🦩 🟠 test_clustering_validation.py does not add repo root to sys.path before codewiki imports

Added import sys, from pathlib import Path, and sys.path.insert(0, str(Path(__file__).parent)) near the top of test_clustering_validation.py, as literally requested by the finding. This makes repo-root-relative imports work regardless of CWD, but the finding's deeper suggestion — replacing simulate_validation() with a live import of the actual validation function from cluster_modules.py — was NOT done, since that function isn't currently extracted/exposed as an importable unit in cluster_modules.py (it's inline lines 338-369 per the finding text), and refactoring that file is out of scope for a single-file fix. This remains a real risk: the test can still silently drift from the real implementation. A complete fix requires extracting the validation logic into a standalone function in cluster_modules.py and importing it here.

🤖 Prompt for AI agents
In test_clustering_validation.py around line 1, review and complete this code-review fix: test_clustering_validation.py does not add repo root to sys.path before codewiki imports.
What the draft fix changed: Added `import sys`, `from pathlib import Path`, and `sys.path.insert(0, str(Path(__file__).parent))` near the top of test_clustering_validation.py, as literally requested by the finding. This makes repo-root-relative imports work regardless of CWD, but the finding's deeper suggestion — replacing `simulate_validation()` with a live import of the actual validation function from `cluster_modules.py` — was NOT done, since that function isn't currently extracted/exposed as an importable unit in `cluster_modules.py` (it's inline lines 338-369 per the finding text), and refactoring that file is out of scope for a single-file fix. This remains a real risk: the test can still silently drift from the real implementation. A complete fix requires extracting the validation logic into a standalone function in `cluster_modules.py` and importing it here.
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

@flamingo flamingo Bot changed the title fix(CODEWIKI-009-2): 4 review findings across 4 files fix(CODEWIKI-009-2): CU-86akbhhru 4 review findings across 4 files Sep 7, 2026
@michaelassraf
michaelassraf marked this pull request as ready for review September 8, 2026 02:40
@michaelassraf
michaelassraf merged commit 3f49696 into main Sep 8, 2026
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

Conflicts were competing module docstrings in cpp.py, csharp.py and
javascript.py, added by both this branch and #55. Resolved in favour of the
wording already on main; this branch's _get_component_id changes are
unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

Conflicts:
- deps.py, typescript.py: competing module docstrings added by both this
  branch and #55; resolved in favour of the wording on main.
- config.py: this branch's new module docstring kept, layered on top of
  #49's widened dataclasses import (fields, asdict).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

Conflict in test_clustering_simple.py: both this branch and #53 replaced the
hardcoded test repo path with a TEST_REPO_PATH env lookup, differing only in
the fallback. Resolved in favour of main's fallback, which #53 applied
consistently across the other clustering test scripts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michaelassraf added a commit that referenced this pull request Sep 8, 2026
Bring the branch up to date with main (PRs #48, #49, #52, #53, #54, #55).

flamingo_guidelines.py is fully superseded by #52, which has merged: this
branch's changes to that file are dropped and the file is taken from main
wholesale. Resolving the conflict hunk-by-hunk instead left a duplicate
'import logging', since main already has one.

What remains is the part of this PR #52 did not cover: the analysis_service.py
dead-code cleanup and the background_worker.py print -> logging conversion.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@michaelassraf
michaelassraf deleted the ai-fix/codewiki-009-2-c687b5ea-2cc7a212 branch September 8, 2026 02:50
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.

1 participant