Skip to content

fix(logging): allowlist rag_core/audit.py for RAG001 - #37

Merged
officialCodeWork merged 1 commit into
mainfrom
fix/rag001-audit-allowlist
May 23, 2026
Merged

fix(logging): allowlist rag_core/audit.py for RAG001#37
officialCodeWork merged 1 commit into
mainfrom
fix/rag001-audit-allowlist

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Summary

  • uv run python scripts/check_logging.py currently exits 1 on main, reporting packages/core/src/rag_core/audit.py:15 for logging.getLogger("rag.audit"). This is a pre-existing miss in the RAG001 allowlist, not a bug introduced by step 0.10.
  • audit.py legitimately needs stdlib logging: rag_observability depends on rag_core.types (packages/observability/src/rag_observability/events.py:27), so any import path rag_core.auditrag_observability.logging (direct or via the rag_core.logging shim) is a circular import. CLAUDE.md already calls this file out as explicitly allowlisted; the allowlist in scripts/check_logging.py just didn't reflect it.
  • Fix: add packages/core/src/rag_core/audit.py to _ALLOWLIST in scripts/check_logging.py with a comment explaining the circular-import reason.

Documentation

Out-of-scope follow-up

RAG001 isn't currently wired into .github/workflows/ci.yml — it only runs via the pre-commit hook and task lint:logging. That's why this slipped to main. Worth adding as a CI step in a separate PR (CLAUDE.md lists RAG001 among the blocking gates, so CI should enforce it).

Test plan

  • uv run python scripts/check_logging.py exits 0 on this branch
  • Confirmed audit.py still imports cleanly (no behavior change — only the allowlist was edited)
  • CI green (lint, mypy, pytest on ubuntu/macos/windows)

🤖 Generated with Claude Code

audit.py uses stdlib `logging.getLogger("rag.audit")` because rag_observability
depends on rag_core.types, so any import from rag_core.audit into
rag_observability.logging (directly or via the rag_core.logging shim) would
create a circular import. This matches the policy described in CLAUDE.md.

Also document the policy in docs/guides/logging-policy.md, including the full
allowlist table and instructions for extending it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@officialCodeWork
officialCodeWork merged commit 91608dd into main May 23, 2026
8 checks passed
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