Skip to content

test(lint): add AST-based bare print() detection test for engine/memo…#440

Open
borjamoskv wants to merge 10 commits into
mainfrom
borjamoskv-patch-6
Open

test(lint): add AST-based bare print() detection test for engine/memo…#440
borjamoskv wants to merge 10 commits into
mainfrom
borjamoskv-patch-6

Conversation

@borjamoskv

Copy link
Copy Markdown
Owner

Summary

Adds tests/test_no_bare_print.py — an AST-based parametric lint test that enforces zero bare print() calls in production Python code.

What it does

  • Walks all .py files under cortex/engine/, cortex/memory/, cortex/guards/, cortex/core/, cortex/agents/, cortex/database/
  • For each file, parses the AST and searches for Expr(Call(Name('print'))) nodes (bare call statements only — not those inside strings/docstrings)
  • test_no_bare_print_in_production_code is parametrized per file and fails with exact line numbers
  • test_audit_covers_at_least_one_file is a sanity guard to prevent the audit from silently covering zero files
  • CLI directories (cortex/cli/) and __pycache__/.venv are exempt

Closes #394

…ry/guards/core

This test ensures that there are no bare print() calls in production code across specified directories, enforcing the use of logging instead.
@github-actions github-actions Bot added the tests label Jun 6, 2026
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

∞ MÖBIUS — PR Analysis

Metric Value
Files changed 1
Total changes 143 (+/-)
Complexity medium
Est. review time 15 min
Has tests?
Has Rust changes? No

Labels applied: tests


Generated by MÖBIUS (Clojure/Babashka) — where code IS data

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

∞ MÖBIUS — PR Analysis

Metric Value
Files changed 2
Total changes 166 (+/-)
Complexity medium
Est. review time 15 min
Has tests?
Has Rust changes? No

Labels applied: tests


Generated by MÖBIUS (Clojure/Babashka) — where code IS data

- SystemStateVector: event-sourced causal state with SHA-256 hash chain
- Orchestrator: rule-based controller connecting EventBus → State → Supervisor
- HealthMonitorAgent (daemon) + TaskWorkerAgent (reactive)
- 24/24 integration tests passing (E2E boot→submit→error→recovery→shutdown)
- Fixed handler dispatch: class-level unbound → instance-level bound methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(logging): migrate remaining print() → logging in core modules

1 participant