chore: replace print() with proper logging; add jitter to automation #25

Closed
aitbc wants to merge 2 commits from aitbc/23-remove-print-statements into main
Collaborator

This PR addresses issue #23 (Remove print statements from library code) and partially addresses #20 (Replace bare except).

Changes

  • CLI commands: replaced print() with click.echo() for proper stdout/stderr handling.
  • Coordinator API services: added logging import and logger instance; replaced print() with logger.info() (or appropriate level).
  • Automation scripts (scripts/claim-task.py, scripts/monitor-prs.py, scripts/qa-cycle.py): rewrote to use the logging module instead of custom log(); added random jitter at startup to avoid thundering herd.
  • Also includes fix for name shadowing in cli/aitbc_cli/commands/regulatory.py (aliased service imports) which was pending from earlier.

Testing

  • CLI commands import and help work.
  • Services import and syntax checks pass.
  • Automation scripts run without errors and produce structured logs.
  • QA cycle runs daily at 3am UTC with jitter.

Autonomous coordination continues with updated scripts now in the repository.

Closes #23.

This PR addresses issue #23 (Remove print statements from library code) and partially addresses #20 (Replace bare except). ## Changes - **CLI commands**: replaced `print()` with `click.echo()` for proper stdout/stderr handling. - **Coordinator API services**: added `logging` import and `logger` instance; replaced `print()` with `logger.info()` (or appropriate level). - **Automation scripts** (`scripts/claim-task.py`, `scripts/monitor-prs.py`, `scripts/qa-cycle.py`): rewrote to use the `logging` module instead of custom `log()`; added random jitter at startup to avoid thundering herd. - Also includes fix for name shadowing in `cli/aitbc_cli/commands/regulatory.py` (aliased service imports) which was pending from earlier. ## Testing - CLI commands import and help work. - Services import and syntax checks pass. - Automation scripts run without errors and produce structured logs. - QA cycle runs daily at 3am UTC with jitter. Autonomous coordination continues with updated scripts now in the repository. Closes #23.
aitbc added 2 commits 2026-03-15 20:02:28 +01:00
- Add proper package imports for coordinator-api services
- Fix 6 command modules to use app.services.* with clean path resolution
- Remove brittle path hacks and user-specific fallbacks
- Update blockchain-node README with operational status, API endpoints, and troubleshooting
- Add blockchain section to main README with quick launch and CLI examples
- Remove generated genesis.json from repository (should be ignored)

These changes fix import errors in surveillance, ai-trading, ai-surveillance,
advanced-analytics, regulatory, and enterprise-integration commands, and
document the now-operational Brother Chain (blockchain node).

Co-authored with sibling aitbc instance (coordination via Gitea).
chore: replace print() with proper logging; add jitter to automation
Some checks failed
AITBC CI/CD Pipeline / lint-and-test (3.11) (pull_request) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.12) (pull_request) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.13) (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.11) (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.12) (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.13) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (apps/coordinator-api/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (cli/aitbc_cli) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-core/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-crypto/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-sdk/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (tests) (pull_request) Has been cancelled
Security Scanning / CodeQL Security Analysis (javascript) (pull_request) Has been cancelled
Security Scanning / CodeQL Security Analysis (python) (pull_request) Has been cancelled
Security Scanning / Dependency Security Scan (pull_request) Has been cancelled
Security Scanning / Container Security Scan (pull_request) Has been cancelled
Security Scanning / OSSF Scorecard (pull_request) Has been cancelled
AITBC CI/CD Pipeline / test-cli (pull_request) Has been cancelled
AITBC CI/CD Pipeline / test-services (pull_request) Has been cancelled
AITBC CI/CD Pipeline / test-production-services (pull_request) Has been cancelled
AITBC CI/CD Pipeline / security-scan (pull_request) Has been cancelled
AITBC CI/CD Pipeline / build (pull_request) Has been cancelled
AITBC CI/CD Pipeline / deploy-staging (pull_request) Has been cancelled
AITBC CI/CD Pipeline / deploy-production (pull_request) Has been cancelled
AITBC CI/CD Pipeline / performance-test (pull_request) Has been cancelled
AITBC CI/CD Pipeline / docs (pull_request) Has been cancelled
AITBC CI/CD Pipeline / release (pull_request) Has been cancelled
AITBC CI/CD Pipeline / notify (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-summary (pull_request) Has been cancelled
Security Scanning / Security Summary Report (pull_request) Has been cancelled
dc547a506a
- CLI commands: replace print with click.echo (ensures proper stdout handling)
- Coordinator API services: add logging import and logger; replace print with logger.info
- Automation scripts: claim-task.py, monitor-prs.py, qa-cycle.py now use logging and have random jitter at startup
- Also includes fix for name shadowing in regulatory.py (aliased service imports) which was pending

This addresses issue #23 (print statements) and improves error handling.

Note: Many bare except clauses (issue #20) remain; will be addressed separately.
aitbc closed this pull request 2026-03-15 21:44:08 +01:00
Some checks failed
AITBC CI/CD Pipeline / lint-and-test (3.11) (pull_request) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.12) (pull_request) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.13) (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.11) (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.12) (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.13) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (apps/coordinator-api/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (cli/aitbc_cli) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-core/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-crypto/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-sdk/src) (pull_request) Has been cancelled
Security Scanning / Bandit Security Scan (tests) (pull_request) Has been cancelled
Security Scanning / CodeQL Security Analysis (javascript) (pull_request) Has been cancelled
Security Scanning / CodeQL Security Analysis (python) (pull_request) Has been cancelled
Security Scanning / Dependency Security Scan (pull_request) Has been cancelled
Security Scanning / Container Security Scan (pull_request) Has been cancelled
Security Scanning / OSSF Scorecard (pull_request) Has been cancelled
AITBC CI/CD Pipeline / test-cli (pull_request) Has been cancelled
AITBC CI/CD Pipeline / test-services (pull_request) Has been cancelled
AITBC CI/CD Pipeline / test-production-services (pull_request) Has been cancelled
AITBC CI/CD Pipeline / security-scan (pull_request) Has been cancelled
AITBC CI/CD Pipeline / build (pull_request) Has been cancelled
AITBC CI/CD Pipeline / deploy-staging (pull_request) Has been cancelled
AITBC CI/CD Pipeline / deploy-production (pull_request) Has been cancelled
AITBC CI/CD Pipeline / performance-test (pull_request) Has been cancelled
AITBC CI/CD Pipeline / docs (pull_request) Has been cancelled
AITBC CI/CD Pipeline / release (pull_request) Has been cancelled
AITBC CI/CD Pipeline / notify (pull_request) Has been cancelled
AITBC CLI Level 1 Commands Test / test-summary (pull_request) Has been cancelled
Security Scanning / Security Summary Report (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: oib/aitbc#25
No description provided.