Skip to content

Move every index diagnostic to standard error - #1238

Merged
jviotti merged 1 commit into
mainfrom
stderr-cleanup
Aug 18, 2026
Merged

Move every index diagnostic to standard error#1238
jviotti merged 1 commit into
mainfrom
stderr-cleanup

Conversation

@jviotti

@jviotti jviotti commented Aug 18, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode

augmentcode Bot commented Aug 18, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR separates CLI diagnostics from program-result output.

Changes:

  • Moves indexer failure usage text and startup banners to standard error.
  • Moves the indexer's caught configuration, schema, I/O, and generic errors to standard error.
  • Moves server startup, usage, and argument-validation messages to standard error.
  • Retains successful help, resolved configuration, and schema-resolution values on standard output.
  • Updates index and server CLI fixtures to expect descriptor 2> for diagnostics.
  • Refines failure-test filtering to retain error output while removing expected progress logs.
  • Adds separate expected output for help versus missing-argument usage flows.
Technical notes:
The CLI test harness captures stdout and stderr independently, so fixtures now assert the intended stream contract.
Successful command results remain available for shell redirection and composition.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot 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.

Review completed. 1 suggestion posted.

Fix All in Augment

Items Reviewed
  • ✅ CLI diagnostic stream handling
  • ✅ CLI test expectations

Comment augment review to trigger a new review at any time.

Comment thread src/index/index.cc
std::println(stderr, "Usage: {} <one.json> <path/to/output/directory>",
std::filesystem::path{program}.filename().string());
std::print("{}", USAGE_DETAILS);
std::print(stderr, "{}", USAGE_DETAILS);

@augmentcode augmentcode Bot Aug 18, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This stream migration remains incomplete: the --profile and --time reports still write to standard output at src/index/index.cc:735-738 and src/index/index.cc:746. Those are diagnostic option outputs, so callers redirecting standard output still receive diagnostics despite the PR's stated separation.

Severity: medium

Other Locations
  • src/index/index.cc:735
  • src/index/index.cc:746

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 112 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/index/index.cc">

<violation number="1" location="src/index/index.cc:311">
P2: Route the `--profile` and `--time` reports to `stderr` as well. They still write to `stdout`, so callers redirecting standard output continue receiving diagnostic output.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/index/index.cc
std::println(stderr, "Usage: {} <one.json> <path/to/output/directory>",
std::filesystem::path{program}.filename().string());
std::print("{}", USAGE_DETAILS);
std::print(stderr, "{}", USAGE_DETAILS);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Route the --profile and --time reports to stderr as well. They still write to stdout, so callers redirecting standard output continue receiving diagnostic output.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/index/index.cc, line 311:

<comment>Route the `--profile` and `--time` reports to `stderr` as well. They still write to `stdout`, so callers redirecting standard output continue receiving diagnostic output.</comment>

<file context>
@@ -302,13 +302,13 @@ static auto index_main(const std::string_view &program,
+    std::println(stderr, "Usage: {} <one.json> <path/to/output/directory>",
                  std::filesystem::path{program}.filename().string());
-    std::print("{}", USAGE_DETAILS);
+    std::print(stderr, "{}", USAGE_DETAILS);
     return EXIT_FAILURE;
   }
</file context>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Benchmark Index (community)

Details
Benchmark suite Current: 1bca70f Previous: 47f7daf Ratio
Add one schema (0 existing) 316 ms 297 ms 1.06
Add one schema (100 existing) 35 ms 121 ms 0.29
Add one schema (1000 existing) 89 ms 92 ms 0.97
Add one schema (10000 existing) 1118 ms 766 ms 1.46
Update one schema (1 existing) 28 ms 23 ms 1.22
Update one schema (101 existing) 38 ms 35 ms 1.09
Update one schema (1001 existing) 91 ms 106 ms 0.86
Update one schema (10001 existing) 778 ms 775 ms 1.00
Cached rebuild (1 existing) 10 ms 7 ms 1.43
Cached rebuild (101 existing) 12 ms 11 ms 1.09
Cached rebuild (1001 existing) 43 ms 24 ms 1.79
Cached rebuild (10001 existing) 354 ms 212 ms 1.67
Index 100 schemas 656 ms 517 ms 1.27
Index 1000 schemas 1458 ms 1581 ms 0.92
Index 10000 schemas 13053 ms 12042 ms 1.08
Index 10000 schemas (custom meta-schema) 15151 ms 13180 ms 1.15
Index 10000 schemas ($ref fan-out) 15301 ms 12793 ms 1.20

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Benchmark Index (enterprise)

Details
Benchmark suite Current: 1bca70f Previous: 47f7daf Ratio
Add one schema (0 existing) 379 ms 372 ms 1.02
Add one schema (100 existing) 115 ms 121 ms 0.95
Add one schema (1000 existing) 166 ms 176 ms 0.94
Add one schema (10000 existing) 763 ms 785 ms 0.97
Update one schema (1 existing) 119 ms 112 ms 1.06
Update one schema (101 existing) 113 ms 121 ms 0.93
Update one schema (1001 existing) 165 ms 176 ms 0.94
Update one schema (10001 existing) 794 ms 1109 ms 0.72
Cached rebuild (1 existing) 11 ms 11 ms 1
Cached rebuild (101 existing) 14 ms 15 ms 0.93
Cached rebuild (1001 existing) 39 ms 51 ms 0.76
Cached rebuild (10001 existing) 318 ms 341 ms 0.93
Index 100 schemas 574 ms 471 ms 1.22
Index 1000 schemas 1524 ms 1589 ms 0.96
Index 10000 schemas 13142 ms 12676 ms 1.04
Index 10000 schemas (custom meta-schema) 15641 ms 14535 ms 1.08
Index 10000 schemas ($ref fan-out) 15941 ms 15254 ms 1.05

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti jviotti changed the title Move every diagnostic to standard error Move every index diagnostic to standard error Aug 18, 2026
@jviotti
jviotti merged commit 385c0e1 into main Aug 18, 2026
6 checks passed
@jviotti
jviotti deleted the stderr-cleanup branch August 18, 2026 22:40
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