Skip to content

docs(audit): verify I-api-design println! finding; conversion set is empty - #109

Closed
KooshaPari wants to merge 1 commit into
masterfrom
refactor/i-println-to-tracing
Closed

KooshaPari wants to merge 1 commit into
masterfrom
refactor/i-println-to-tracing

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

Verifies the I-api-design audit finding that cited "~366 println! calls" as candidates for conversion to tracing::info! / tracing::warn!. After triaging every match in crates/ and src/, the genuine conversion-eligible set is zero in this worktree (refactor/i-println-to-tracing branched off 748eeaa1e).

Inventory breakdown

Bucket Count
Total println! matches in .rs files 1391
eprintln! (skipped per task) 715
Net real println! invocations 676
terminal_println! macro invocations (wrapper, not raw) 3
build.rs cargo directives (cargo:rustc-env=...) ~28
src/cli/** (CLI command formatters) ~298
src/bin/** (CLI binaries) ~150
tests/ or examples/ directories ~210
Remaining after all skips 59

The 59 remaining matches all fall into one of three buckets, all of which are excluded by the task constraints:

  1. CLI user-facing output (31 lines) -- interactive TUI prompt loop, print_tool_summary, print_centered, browser-setup wizard, permission UI. Converting to tracing::info! would route stdout through tracing's subscriber and break the live TUI display.
  2. Test code (26 lines) -- #[test] fn bodies, *_tests.rs files, tests/, examples/, agent_tests/, ui_tests/, harness_api_tests/ directories, println! substrings inside test fixtures.
  3. Macro definitions / doc comments (2 lines) -- body of terminal_println! macro and //! println! example in SDK docs.

Conversions made

0. The task constraints ("if the line is in a CLI argument handler, command output formatter, progress bar, or interactive prompt -- keep as println!") exclude every non-test match that survives the build.rs / CLI / bin filters.

cargo check result

Not run to completion. The build host is at 99% disk (~16 GiB free), and the prior session in this directory recorded release builds failing under that pressure. The cargo check --bin jcode baseline probe was cancelled at the 8-minute mark to avoid disk churn on a no-conversion worktree. No source code changed, so no compile-validation is required.

Files changed

  • docs/sessions/2026-10-16-println-to-tracing/00_SESSION_OVERVIEW.md -- full triage with line numbers and rationale per match.

Follow-up

If the operator wants tracing::info! for the TUI prompt-loop messages in turn_loops.rs / turn_execution.rs, that requires adding a dedicated "user-facing status" subscriber sink alongside stdout -- a larger architectural change than a mechanical println! -> tracing::info! rewrite. Flagged in the session doc.


tx-agent: jcode
tx-validated: manual
tx-scope: docs
tx-intent: record the println!-to-tracing audit verification (scope mismatch)


CodeAnt-AI Description

Documents why existing terminal output should not be converted to logging messages.

What Changed

  • Records that the audit found no eligible conversions after excluding CLI output, tests, documentation, and build directives.
  • Explains that redirecting interactive prompts and status messages to logs would remove them from the live terminal display.
  • No application code or runtime behavior changed.

Impact

✅ Keeps interactive prompts visible in the terminal
✅ Prevents CLI status output from being routed to logs
✅ Gives future reviewers a documented audit inventory

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…empty

The I-api-design audit cited ~366 println! calls as candidates for
conversion to tracing::info!/warn!. After triaging every match:

  - 1391 total println! occurrences in .rs files
  - 715 are eprintln! (deliberately skipped per task)
  - 3 are terminal_println! macro invocations
  - ~28 are cargo:rustc-env directives in build.rs
  - ~298 are in src/cli/** (CLI command formatters)
  - ~150 are in src/bin/** (CLI binaries)
  - ~210 are in tests/ or examples/ directories
  - 59 remaining matches are all: (a) macro_rules! bodies, (b) test
    code (incl. #[test] fns, *_tests.rs, *_test_*.rs fixtures), (c)
    CLI user-facing output in the interactive TUI prompt loop,
    print_tool_summary, print_centered, browser setup wizard, or
    permission UI. None are eligible for conversion: converting
    the TUI prompt-loop output would route stdout messages through
    tracing and break the live TUI display.

No source code is changed. The audit finding is verified as having
an over-broad scope; future work to thread CLI status messages
through tracing requires a dedicated 'user-facing status' subscriber
sink, which is an architectural change beyond this task.

tx-agent: jcode
tx-validated: manual
tx-scope: docs
tx-intent: record the println!-to-tracing audit verification (scope mismatch)
Copilot AI balanced review requested due to automatic review settings October 17, 2026 06:49
@codeant-ai

codeant-ai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 039d8e1 Oct 17, 2026 · 06:49 06:53

@codeant-ai

codeant-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4879c068-eaf1-464e-926e-694e157d2c51
📥 Commits

Reviewing files that changed from the base of the PR and between 6cf71ed and 039d8e1.

📒 Files selected for processing: 1
  • docs/sessions/2026-10-16-println-to-tracing/00_SESSION_OVERVIEW.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Oct 17, 2026
@codeant-ai

codeant-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. The listed CLI/TUI/setup line references total 35, not 31, so the verification understates this bucket.

Code quality · docs/sessions/2026-10-16-println-to-tracing/00_SESSION_OVERVIEW.md:101-102

@codeant-ai

codeant-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Medium Risk

  • The PR needs a manual documentation check before merging because the claimed 59-match strict filter excludes CLI and test code, yet the listed results include both.
  • The listed CLI entries total 35, not the stated 31, which undermines the document's audit summary.

Assessed commit: 039d8e194e49

KooshaPari added a commit that referenced this pull request Oct 17, 2026
…empty (#109)

Squash-merged from origin/refactor/i-println-to-tracing. See PR #109 for the per-commit history.

tx-agent:     jcode
tx-validated: manual
tx-scope:     refactor/i-println-to-tracing
tx-intent:    forward-path 2026-10-17 batch merge
tx-pr:        109
(cherry picked from commit 365d0a13a2ea96949f476f45b471c0dd34aa08cb)
@KooshaPari

Copy link
Copy Markdown
Owner Author

Squash-merged into master via the forward-path 2026-10-17 batch (see commit on master). Closing as completed.

@KooshaPari KooshaPari closed this Oct 17, 2026
@kilo-code-bot

kilo-code-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

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

SUGGESTION

File Line Issue
docs/sessions/2026-10-16-println-to-tracing/00_SESSION_OVERVIEW.md 101 CLI/TUI count inconsistency (31 stated vs 35 actual)
Files Reviewed (1 file)
  • docs/sessions/2026-10-16-println-to-tracing/00_SESSION_OVERVIEW.md - 1 issue

Fix these issues in Kilo Cloud: Fix these issues in Kilo Cloud


Reviewed by free · Input: 49.7K · Output: 4.4K · Cached: 208.7K

- Final strict filter (excludes `eprintln`, `terminal_println`, `tests/`,
`examples/`, `src/cli/`, `src/bin/`, `build.rs`, `*_tests.rs`,
`agent_tests/`, `ui_tests/`, `harness_api_tests/`): **59 matches**, of
which 31 are CLI-loop / TUI-status / setup-wizard output, 26 are test

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[SUGGESTION]: CLI/TUI count inconsistency (31 stated vs 35 actual)

The table "CLI interactive prompt loop / TUI status — keep as println!" lists 8 files/entries totaling 35 line references (turn_loops.rs: 8 lines, turn_execution.rs: 11 lines, tools.rs: 4 lines, update.rs: 2 lines, model_names.rs: 1 line, tui-permissions: 4 lines, browser.rs: 5 lines = 35). The summary text says "31 are CLI-loop / TUI-status / setup-wizard output" which is off by 4.

Consider correcting the count to match the actual inventory for accuracy.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

KooshaPari added a commit that referenced this pull request Oct 17, 2026
…ash commits)

5 of 6 audited forward-path PRs squash-merged into master via the
2026-10-17 batch (security, PR94 blockers, cherry-picks, stdin, println,
docs in priority order). 30 files / +2,900 / -78 LOC across the batch.

Master pre-batch:  3f4746e
Master post-batch: 521c66e

Per-PR squash SHAs:
  #108 -> 827ff9d  (cherry-pick from 17632a2b0)
  #109 -> 2f29ed0  (cherry-pick from 365d0a13a)
  #111 -> a1e19e5  (1 add/add conflict resolved: docs/GOOGLE_GUIDED_SETUP.md)
  #112 -> no-op      (rustls patch already in master; PR closed)
  #113 -> 7fdbe2f  (landed at cycle start; file-level cherry-pick of
                       update_product.rs only)
  #114 -> 521c66e

Source artifacts (canonical): phenotype-registry/audits/kcode-fork-forward-path-2026-10-17/
This directory: docs/audits/2026-10-17-forward-path-batch/  (HTML + PDF + README)

tx-agent:     jcode
tx-validated: manual
tx-scope:     docs/audits/2026-10-17-forward-path-batch/
tx-intent:    persist forward-path batch deliverables in source repo
tx-pr:        115
@KooshaPari KooshaPari reopened this Nov 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@KooshaPari

Copy link
Copy Markdown
Owner Author

Closing under the host-ops closure audit (2026-11-11): the same change already landed on master (matching commit subject); this PR is the leftover branch. The branch refactor/i-println-to-tracing is preserved on the remote, so the work is recoverable with git fetch origin refactor/i-println-to-tracing or by reopening this PR. Nothing was deleted.

@KooshaPari KooshaPari closed this Nov 11, 2026
@KooshaPari
KooshaPari deleted the refactor/i-println-to-tracing branch November 26, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants