Repository navigation
Conversation
|
Summary: The placeholder conversions are correct, but the PR leaves one printf placeholder unconverted (%ds), and the new regression test passes anyway because of a regex bug. The guard doesn't catch Review groups:
The PR is small (+87/−24), so I reviewed both groups myself instead of spawning reviewers. Limitations: the gh tokens on this machine are invalid (401), and unauthenticated API calls were rate-limited. That meant I couldn't read the PR description, comments or review history. I fetched Strengths:
Issues:
Reusability:
Decision: REQUEST CHANGES. Fix %ds at codex_cli_provider.py:699, fix the test regex and the log argument index so the guard actually catches leftovers, and clean up the ruff findings. |
VakninAriel
left a comment
There was a problem hiding this comment.
Code Review — PR #472
Verdict: ✅ Approve
Summary
Several Loguru calls used printf-style placeholders, causing logs to omit the diagnostic values passed as arguments. This PR replaces those placeholders with brace formatting across provider, indexing and search code and adds an AST-based regression guard.
What's good
- The conversions restore concrete diagnostic context for Codex request/transport failures and multi-hop result limits, including {!r} where a representation-formatted value is intended.
- The guard derives logger names from actual from-loguru imports, including aliases, so it does not apply Loguru placeholder rules indiscriminately to stdlib logger calls.
Freshness warning: Package freshness checked 2026-11-11T15:38:58.574960+00:00: STALE: included heads/eligibility changed; see overview and freshness audit before posting. This report applies only to its pinned SHA.
| Severity | Count |
|---|---|
| 🔴 Critical | 0 |
| 🟠 High | 0 |
| 🟡 Medium | 0 |
| 🟢 Minor | 0 |
Findings
No retained findings. This is not a guarantee that the code is defect-free.
Review metadata and audit
Draft review for human approval. Nothing has been posted to GitHub.
Pinned head SHA: 35eea333ac310072e91ec2efbc6a81d49f1a47ae
Package freshness checked 2026-11-11T15:38:58.574960+00:00: STALE: included heads/eligibility changed; see overview and freshness audit before posting. This report applies only to its pinned SHA.
PR: #472
Title: fix(logging): use Loguru placeholders and prevent printf regressions
Author: shizwan · Branches: fix/loguru-printf-placeholders → main
Diff merge base: f4d5b85
Review scope: Full merge-base f4d5b85 to pinned head 35eea33 diff against main: five production files and tests/unit/test_loguru_formatting.py. Both complete reports and entire pinned diff inspected. This independently overlaps PR #479 logging conversions; coordinate the alternatives rather than stacking duplicate fixes.
Eligibility: Bug fix addressing existing behavior; no new feature.
Overall assessment (audit only)
No substantiated introduced user-facing regression remains. Production interpolation improves; the new guard misses an existing unit-suffixed placeholder, but this is incomplete coverage of preexisting logging debt rather than a newly broken runtime or enforced CI contract. Preserve the concrete counterexample as optional nonblocking cleanup, not a ready-to-post bug.
Strength evidence
- {"strength_index": 0, "path": "chunkhound/providers/llm/codex_cli_provider.py; chunkhound/services/diff_aware_search_service.py; chunkhound/services/search/multi_hop_strategy.py", "source": "pr-472.pinned.diff", "detail": "Request/transport/result-limit strings use brace placeholders, and the Codex model warning and diff-aware vector_source diagnostic use {!r}. The remaining %ds timeout fragment is intentionally not praised as repaired."}
- {"strength_index": 1, "path": "tests/unit/test_loguru_formatting.py", "source": "pr-472.pinned.diff", "detail": "logger_names is built from ast.ImportFrom nodes with module == 'loguru' and alias.asname or alias.name, and calls are checked against that set. This scoped import handling does not make the placeholder regex exhaustive."}
Verification
- Astra: timeout 120s env UV_PROJECT_ENVIRONMENT=/home/e119870/views/g/my_chunkhound/.venv PYTHONDONTWRITEBYTECODE=1 uv run --no-sync mypy chunkhound --cache-dir=/tmp/chunkhound-pr-472-astra-a1-af3b_6m5/mypy-cache: exit 1, 994 errors in 90 files. Repeated with all five changed production files exported from merge base via --shadow-file and --cache-dir=/tmp/chunkhound-pr-472-astra-a1-af3b_6m5/mypy-base-cache: byte-identical diagnostics (cmp exit 0). Exact shell baseline command retained in Astra report/provenance.
- Astra: timeout 60s env UV_PROJECT_ENVIRONMENT=/home/e119870/views/g/my_chunkhound/.venv PYTHONDONTWRITEBYTECODE=1 uv run --no-sync pytest -p no:cacheprovider --basetemp=/tmp/chunkhound-pr-472-astra-a1-af3b_6m5/pytest-guard tests/unit/test_loguru_formatting.py: exit 1, one setup error due to missing chunkhound_native.chunkhound_native; body not executed. Sonnet likewise could not execute the test normally.
- Astra: timeout 60s env UV_PROJECT_ENVIRONMENT=/home/e119870/views/g/my_chunkhound/.venv PYTHONDONTWRITEBYTECODE=1 uv run --no-sync pytest --noconftest -p no:cacheprovider --basetemp=/tmp/chunkhound-pr-472-astra-a1-af3b_6m5/pytest-guard-isolated tests/unit/test_loguru_formatting.py: exit 0, 1 passed in 0.57s; only self-contained AST guard verified.
- Reconciler independently executed the self-contained guard body and regex/Loguru probe described in finding evidence, exit 0; read the complete pinned diff and both reports.
- Reconciler verified both runner jobs succeeded; provenance valid=true, clean successful completion, pinned head/merge base, raw-report SHA256, and every assistant_messages provider/model/responseModel identity; two distinct backend models confirmed. Worktree HEAD matches manifest.
Limitations
- Normal test setup is blocked by the absent native module; isolated guard execution bypasses that fixture and is not application integration validation. No full suite was run.
- Mypy remains failing at baseline; Astra demonstrated no new diagnostics. Sonnet piped output through tail, so its shell exit 0 was not a passing typecheck.
- CI is a captured snapshot, not a fresh run or a guarantee of current branch status.
- Model identities are verified declarations supplied by the reconciler; the renderer does not inspect raw reports or provenance events.
Disposition of discarded / merged findings
- Final audit reclassifies the merged guard-gap candidate as a nonblocking observation and preserves its complete counterexample/evidence above. A newly written internal test missing an already-broken printf token does not by itself introduce a user/caller/CI failure. The timeout placeholder predates the PR and the changed call improves attempt interpolation. This is optional coverage cleanup, not grounds for Needs Work under meaningful-actionable-bug scope; consistent with rejecting #479 guard-policy nits.
- Rejected Sonnet separate Medium runtime finding at codex_cli_provider.py:699 as introduced-bug attribution: %ds is unchanged from merge base; the PR improves attempt interpolation but does not newly lose the timeout. Mentioned only as evidence and associated fix for the new guard.
- Discarded additional proposed guard expansion (all conversion types, logger.log positional handling, f-strings/percent expressions) as speculative follow-up without another concrete missed supported call in the current tree; no separate findings.
Nonblocking observations (audit only)
- {"title": "Recognize unit-suffixed printf tokens in the new regression guard", "severity": "Minor", "path": "tests/unit/test_loguru_formatting.py", "line_start": 13, "line_end": 13, "description": "The trailing word-boundary requirement after [sdrf] makes the new guard miss %ds, %dms and similar unit-suffixed conversions. This is not merely hypothetical: codex_cli_provider.py:699 still contains \"Codex CLI timeout on attempt {} after %ds\" and the new package-wide test passes while Loguru renders a literal %ds instead of the timeout value. When CHUNKHOUND_CODEX_DEBUG is enabled and execution times out, that existing missing diagnostic remains undetected. The introduced defect is the guard false negative; the unconverted runtime %ds predates this PR.", "suggested_fix": "Parse printf conversion tokens without requiring a word boundary after the conversion letter. Cover %ds and %dms with focused guard cases, and finish the timeout message conversion to {}s so the strengthened guard passes.", "evidence": ["Reconciler loaded tests/unit/test_loguru_formatting.py with runpy and executed the actual test body: passed. _PRINTF_PLACEHOLDER.search(\"%ds\") returned no match; installed Loguru emitted \"Codex CLI timeout on attempt 1 after %ds\" for arguments 1,30. UV_PROJECT_ENVIRONMENT=/home/e119870/views/g/my_chunkhound/.venv PYTHONDONTWRITEBYTECODE=1 uv run --no-sync python inline probe exited 0.", "Pinned diff shows the regex newly introduced at line 13 and the timeout changing from \"attempt %d after %ds\" to \"attempt {} after %ds\" at line 699. Thus runtime suffix defect is preexisting, while guard coverage failure is new.", "Astra independently reproduced the exact false negative and ran the guard with --noconftest: 1 passed. Sonnet independently reproduced unit/precision/flag regex misses."], "reviewers": ["sonnet", "astra"], "id": 1}
Independent reviewer provenance
- sonnet — provider: amat-tfy; requested model: standard-chat-dev/claude-sonnet-5.5; verified response model: aws-aidev-models/us.anthropic.claude-sonnet-5-5. Identity evidence · Raw report
- astra — provider: amat-tfy; requested model: frontier-chat-dev/gpt-6-astra; verified response model: gpt-6-astra. Identity evidence · Raw report
CI snapshot
Captured: 2026-11-11T14:18:23.581921+00:00. Eligibility green: True. Counts: {"SKIPPED": 2, "SUCCESS": 23}
- site-build: SUCCESS (COMPLETED)
- site-build-validation (ubuntu-latest): SUCCESS (COMPLETED)
- site-build-validation (macos-latest): SUCCESS (COMPLETED)
- site-build-validation (windows-latest): SUCCESS (COMPLETED)
- rust-checks (ubuntu-latest): SUCCESS (COMPLETED)
- rust-checks (macos-latest): SUCCESS (COMPLETED)
- rust-checks (windows-latest): SUCCESS (COMPLETED)
- native-wheel-smoke-arm64: SUCCESS (COMPLETED)
- native-dev-macos: SUCCESS (COMPLETED)
- watchman-runtime-validation (ubuntu-latest, 3.14): SUCCESS (COMPLETED)
- watchman-runtime-validation (windows-latest, 3.14): SUCCESS (COMPLETED)
- tests (ubuntu-latest, 3.14, 1): SUCCESS (COMPLETED)
- tests (ubuntu-latest, 3.14, 2): SUCCESS (COMPLETED)
- tests (ubuntu-latest, 3.14, 3): SUCCESS (COMPLETED)
- tests (macos-latest, 3.14, 1): SUCCESS (COMPLETED)
- tests (macos-latest, 3.14, 2): SUCCESS (COMPLETED)
- tests (macos-latest, 3.14, 3): SUCCESS (COMPLETED)
- tests (windows-latest, 3.14, 1): SUCCESS (COMPLETED)
- tests (windows-latest, 3.14, 2): SUCCESS (COMPLETED)
- tests (windows-latest, 3.14, 3): SUCCESS (COMPLETED)
- old-linux-wheel-smoke (Ubuntu 20.04 (glibc 2.31), UBUNTU_20_04_IMAGE, ca-certificates curl, 3.12): SUCCESS (COMPLETED)
- old-linux-wheel-smoke (Ubuntu 22.04 + Python 3.10, UBUNTU_22_04_IMAGE, ca-certificates curl pytho...: SUCCESS (COMPLETED)
- watchman-rollout-gate: SUCCESS (COMPLETED)
- pages-artifact: SKIPPED (COMPLETED)
- deploy: SKIPPED (COMPLETED)
Reviewed by Ariel Vaknin via pi.dev
|
Please resolve the merge conflicts so we can merge this 🙏 @VakninAriel next time, please merge with your approval so the PR doesn't drift 🙏 |
No description provided.