Skip to content

chore(hygiene): sweep local canonical drift#43

Merged
KooshaPari merged 1 commit into
mainfrom
hygiene/20260430-sweep-85a8660
Apr 30, 2026
Merged

chore(hygiene): sweep local canonical drift#43
KooshaPari merged 1 commit into
mainfrom
hygiene/20260430-sweep-85a8660

Conversation

@KooshaPari
Copy link
Copy Markdown
Owner

@KooshaPari KooshaPari commented Apr 30, 2026

Sweep.


Note

Low Risk
Changes are documentation-heavy and CI additions are non-blocking (continue-on-error: true), so they should not affect runtime behavior. Main risk is reviewer confusion/maintenance overhead from large spec/plan docs and placeholder workflows being mistaken for enforced gates.

Overview
Adds a large set of product/architecture documentation for TestingKit (charter, PRD, SPEC, SOTA research, ADRs, functional requirements, and an implementation plan), formalizing intended scope, APIs, and governance.

Introduces two new GitHub Actions workflows, fr-coverage and quality-gate, both implemented as placeholders and explicitly marked continue-on-error so they don’t gate merges yet.

Cleans up the README header by removing status badges/links, leaving a leaner landing page.

Reviewed by Cursor Bugbot for commit 82b4bde. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@KooshaPari has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 52 minutes and 21 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f6d00d54-b1ef-403b-942c-62b21608adde

📥 Commits

Reviewing files that changed from the base of the PR and between d25dba5 and 82b4bde.

📒 Files selected for processing (81)
  • .github/workflows/fr-coverage.yml
  • .github/workflows/quality-gate.yml
  • ADR.md
  • CHARTER.md
  • FUNCTIONAL_REQUIREMENTS.md
  • PLAN.md
  • PRD.md
  • README.md
  • SOTA.md
  • SPEC.md
  • docs/adr/ADR-001.md
  • docs/adr/ADR-002.md
  • docs/adr/ADR-003.md
  • docs/adr/ADR-004.md
  • docs/adr/ADR-005.md
  • docs/reference/fr_coverage_matrix.md
  • docs/research/SOTA-E2E-Testing.md
  • docs/research/SOTA-Testing-Frameworks.md
  • python/pheno-analysis-cli/README.md
  • python/pheno-analysis-cli/pyproject.toml
  • python/pheno-quality-cli/README.md
  • python/pheno-quality-cli/pyproject.toml
  • python/pheno-quality-cli/src/pheno_quality/__init__.py
  • python/pheno-quality-cli/src/pheno_quality/cli/__init__.py
  • python/pheno-quality-cli/src/pheno_quality/cli/main.py
  • python/pheno-quality-cli/src/pheno_quality/config.py
  • python/pheno-quality-cli/src/pheno_quality/core.py
  • python/pheno-quality-cli/src/pheno_quality/exporters.py
  • python/pheno-quality-cli/src/pheno_quality/importers.py
  • python/pheno-quality-cli/src/pheno_quality/manager.py
  • python/pheno-quality-cli/src/pheno_quality/plugins.py
  • python/pheno-quality-cli/src/pheno_quality/registry.py
  • python/pheno-quality-cli/src/pheno_quality/tools/__init__.py
  • python/pheno-quality-cli/src/pheno_quality/tools/architectural_validator.py
  • python/pheno-quality-cli/src/pheno_quality/tools/atlas_health.py
  • python/pheno-quality-cli/src/pheno_quality/tools/code_smell_detector.py
  • python/pheno-quality-cli/src/pheno_quality/tools/integration_gates.py
  • python/pheno-quality-cli/src/pheno_quality/tools/pattern_detector.py
  • python/pheno-quality-cli/src/pheno_quality/tools/performance_detector.py
  • python/pheno-quality-cli/src/pheno_quality/tools/security_scanner.py
  • python/pheno-quality-cli/src/pheno_quality/utils.py
  • python/pheno-quality-cli/tests/README.md
  • python/pheno-quality-cli/tests/test_quality.py
  • python/pheno-quality-tools/EXTRACTION_SUMMARY.md
  • python/pheno-quality-tools/README.md
  • python/pheno-quality-tools/pyproject.toml
  • python/pheno-quality-tools/src/pheno_quality_tools/__init__.py
  • python/pheno-quality-tools/src/pheno_quality_tools/architectural_validator.py
  • python/pheno-quality-tools/src/pheno_quality_tools/atlas_health.py
  • python/pheno-quality-tools/src/pheno_quality_tools/cli.py
  • python/pheno-quality-tools/src/pheno_quality_tools/code_smell_detector.py
  • python/pheno-quality-tools/src/pheno_quality_tools/config.py
  • python/pheno-quality-tools/src/pheno_quality_tools/core.py
  • python/pheno-quality-tools/src/pheno_quality_tools/export_import.py
  • python/pheno-quality-tools/src/pheno_quality_tools/exporters.py
  • python/pheno-quality-tools/src/pheno_quality_tools/importers.py
  • python/pheno-quality-tools/src/pheno_quality_tools/integration.py
  • python/pheno-quality-tools/src/pheno_quality_tools/integration_gates.py
  • python/pheno-quality-tools/src/pheno_quality_tools/manager.py
  • python/pheno-quality-tools/src/pheno_quality_tools/pattern_detector.py
  • python/pheno-quality-tools/src/pheno_quality_tools/performance_detector.py
  • python/pheno-quality-tools/src/pheno_quality_tools/plugins.py
  • python/pheno-quality-tools/src/pheno_quality_tools/registry.py
  • python/pheno-quality-tools/src/pheno_quality_tools/security_scanner.py
  • python/pheno-quality-tools/src/pheno_quality_tools/utils.py
  • python/pheno-testing-cli/README.md
  • python/pheno-testing-cli/pyproject.toml
  • python/pheno-testing-cli/src/pheno_testing_cli/__init__.py
  • python/pheno-testing-cli/src/pheno_testing_cli/__main__.py
  • python/pheno-testing-cli/src/pheno_testing_cli/automation_suite.py
  • python/pheno-testing-cli/src/pheno_testing_cli/cli.py
  • python/pheno-testing-cli/src/pheno_testing_cli/doc_tester.py
  • python/pheno-testing-cli/src/pheno_testing_cli/duration_tracker.py
  • python/pheno-testing-cli/src/pheno_testing_cli/package_tester.py
  • python/pheno-testing-cli/src/pheno_testing_cli/parallel_runner.py
  • python/pheno-testing-cli/src/pheno_testing_cli/perf_framework.py
  • python/pheno-testing-cli/src/pheno_testing_cli/performance_testing.py
  • python/pheno-testing-cli/src/pheno_testing_cli/security_testing.py
  • python/pheno-testing-cli/src/pheno_testing_cli/test_data_generator.py
  • python/pheno-testing-cli/src/pheno_testing_cli/test_enhancer.py
  • worklog.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hygiene/20260430-sweep-85a8660
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch hygiene/20260430-sweep-85a8660

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
Review rate limit: 0/1 reviews remaining, refill in 52 minutes and 21 seconds.

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

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
10 Security Hotspots
29.7% Duplication on New Code (required ≤ 3%)
D Security Rating on New Code (required ≥ A)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because on-demand usage is turned off. To enable Bugbot Autofix, turn on on-demand usage and set a spend limit in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 82b4bde. Configure here.

Comment thread SPEC.md




Copy link
Copy Markdown

Choose a reason for hiding this comment

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

~200 trailing blank lines in SPEC.md

Low Severity

SPEC.md has approximately 200 trailing blank lines after the document's closing text on line 2319. This looks like accidentally committed filler content, which is ironic for a PR titled "sweep local canonical drift" — a hygiene pass that introduces its own drift.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 82b4bde. Configure here.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request establishes the "TestingKit" ecosystem, a multi-language testing framework for Rust, Python, and Go, complete with extensive architectural documentation and initial Python-based code quality analysis tools. The feedback identifies several critical logic issues and improvement opportunities within the Python AST analysis modules. Specifically, the loop detection logic incorrectly assumes the existence of parent pointers on AST nodes, and the detection of large object creation is incomplete. Additionally, the feature envy and duplicate code detection heuristics are currently too broad, likely leading to false positives, and the security scanner's string formatting detection needs expansion to cover f-strings and the ".format()" method for more robust SQL injection analysis.

Comment on lines +331 to +339
"""
Check if node is inside a loop.
"""
current = node
while hasattr(current, "parent"):
current = current.parent
if isinstance(current, ast.For) or isinstance(current, ast.While):
return True
return False
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The _is_in_loop method relies on a parent attribute on AST nodes, which is not provided by the standard ast module. This logic will fail to detect loops unless the AST is manually augmented with parent pointers before analysis.

Comment on lines +271 to +283
def _function_creates_large_objects(self, node: ast.FunctionDef) -> bool:
"""
Check if function creates large objects.
"""
large_object_patterns = ["[]", "{}", "set()", "list(", "dict(", "tuple("]

for child in ast.walk(node):
if isinstance(child, ast.Call):
call_str = self._get_call_string(child)
if any(pattern in call_str for pattern in large_object_patterns):
if self._is_in_loop(child):
return True
return False
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The _function_creates_large_objects method has several logic issues: it only inspects ast.Call nodes, missing list ([]) and dictionary ({}) literals. Additionally, the patterns like "set()" or "list(" will not match the function names returned by _get_call_string (e.g., "set").

Comment on lines +150 to +154

for call in ast.walk(node):
if isinstance(call, ast.Call):
if isinstance(call.func, ast.Attribute):
if isinstance(call.func.value, ast.Name):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The _detect_feature_envy method incorrectly identifies calls to self as external because self is an ast.Name node. This will lead to false positives for standard internal method calls.

                        if isinstance(call.func, ast.Attribute):
                            if isinstance(call.func.value, ast.Name) and call.func.value.id != "self":
                                external_calls += 1
                            else:
                                internal_calls += 1

Comment on lines +268 to +276
def _has_string_formatting(self, node: ast.Call) -> bool:
"""
Check if call has string formatting.
"""
for arg in node.args:
if isinstance(arg, ast.BinOp) and isinstance(arg.op, ast.Mod):
return True
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The _has_string_formatting method only detects the % operator. It should be expanded to include f-strings (ast.JoinedStr) and .format() calls to improve the detection of potential SQL injection vulnerabilities.

    def _has_string_formatting(self, node: ast.Call) -> bool:
        """
        Check if call has string formatting.
        """
        for arg in node.args:
            if isinstance(arg, ast.BinOp) and isinstance(arg.op, ast.Mod):
                return True
            if isinstance(arg, ast.JoinedStr):
                return True
            if isinstance(arg, ast.Call) and isinstance(arg.func, ast.Attribute) and arg.func.attr == "format":
                return True
        return False

Comment on lines +750 to +761
def _functions_similar(self, func1: ast.FunctionDef, func2: ast.FunctionDef) -> bool:
"""
Check if two functions are similar.
"""
if len(func1.body) != len(func2.body):
return False

for stmt1, stmt2 in zip(func1.body, func2.body, strict=False):
if type(stmt1) != type(stmt2):
return False

return True
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The _functions_similar method uses a very loose heuristic, considering any two functions with the same sequence of statement types as duplicates. This will result in many false positives where unrelated functions are flagged as duplicate code.

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​numpy@​2.4.47510010010070
Addedpypi/​hatchling@​1.29.096100100100100
Addedpypi/​typer@​0.25.099100100100100
Addedpypi/​typing-extensions@​4.15.0100100100100100

View full report

@socket-security
Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
License policy violation: pypi numpy under FSFAP

License: FSFAP - The applicable license policy does not permit this license (5) (numpy-2.4.4/vendored-meson/meson/test cases/frameworks/6 gettext/data3/metainfo.its)

From: python/pheno-testing-cli/pyproject.tomlpypi/numpy@2.4.4

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore pypi/numpy@2.4.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report


@classmethod
def from_dict(cls, data: dict[str, Any]) -> "QualityConfig":
"""
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Potential TypeError in from_dict method

The from_dict method uses cls(**data) which will fail if the input dictionary contains keys that don't correspond to fields in the QualityConfig dataclass. Consider filtering the input data to only include valid field names or using a safer approach like dataclasses.asdict() or manual field assignment.

Example of safer implementation:

@classmethod
def from_dict(cls, data: dict[str, Any]) -> "QualityConfig":
    # Get valid field names for the dataclass
    valid_fields = {f.name for f in dataclasses.fields(cls)}
    # Filter input data to only include valid fields
    filtered_data = {k: v for k, v in data.items() if k in valid_fields}
    return cls(**filtered_data)

Alternatively, you could explicitly handle each field to provide better error messages.

config_dict = base_config.to_dict()
config_dict.update(overrides)

return QualityConfig.from_dict(config_dict)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Same TypeError risk in create_custom_config function

The create_custom_config function calls QualityConfig.from_dict(config_dict) which has the same potential issue as noted in the core.py file. If the overrides dictionary contains keys that don't correspond to fields in the QualityConfig dataclass, it will raise a TypeError.

Consider applying the same fix here - either validate the overrides dictionary keys before updating config_dict, or fix the from_dict method in core.py to be more robust.

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented Apr 30, 2026

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
python/pheno-quality-cli/src/pheno_quality/core.py 144 Potential TypeError in from_dict method
python/pheno-quality-cli/src/pheno_quality/config.py 319 Same TypeError risk in create_custom_config function
Files Reviewed (2 files)
  • python/pheno-quality-cli/src/pheno_quality/core.py - 1 issue
  • python/pheno-quality-cli/src/pheno_quality/config.py - 1 issue

Reviewed by nemotron-3-super-120b-a12b-20230311:free · 542,922 tokens

@KooshaPari KooshaPari merged commit e0319bd into main Apr 30, 2026
11 of 13 checks passed
@KooshaPari KooshaPari deleted the hygiene/20260430-sweep-85a8660 branch April 30, 2026 16:04
@KooshaPari KooshaPari restored the hygiene/20260430-sweep-85a8660 branch May 3, 2026 21:22
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