Skip to content

fix(cli): stop reprocess dumping full result JSON on success#444

Merged
HumanBean17 merged 1 commit into
masterfrom
fix/reprocess-success-output
Jul 12, 2026
Merged

fix(cli): stop reprocess dumping full result JSON on success#444
HumanBean17 merged 1 commit into
masterfrom
fix/reprocess-success-output

Conversation

@HumanBean17

Copy link
Copy Markdown
Owner

Problem

java-codebase-rag reprocess printed the entire pipeline result as a giant JSON blob to stdout on success:

{"exit_code": 0, "graph_exit_code": 0, "graph_stderr": "...~4KB of graph-builder logs...", "stderr": "...vectors subprocess logs...", "stdout": "...cocoindex stats...", "phases_run": [...], "success": true}

Those graph_stderr / stderr / stdout fields hold captured subprocess logs that were already rendered as progress bars (and relayed to stderr) — re-emitting them as a single-line JSON payload was pure noise. This was inconsistent with init / increment, which emit a one-line {"message": "...", "success": true} on success.

Root cause: the default full-reprocess path did payload = result.model_dump()_emit(payload) unconditionally on success.

Fix

_emit_reprocess_outcome now:

  • Success → concise {"success": true, "message": "reprocess completed"} (matches init/increment). Partial modes get "(vectors only; ...)" / "(graph only; ...)"; the graph-only-install note from run_refresh_pipeline is preserved. TTY partial modes still print the "Rebuilt:/Skipped:" summary.
  • Failure → unchanged: full payload with captured logs for debugging.

Result:

{"message": "reprocess completed", "success": true}

Test changes

  • Updated the reprocess stdout baseline fixture + 3 stale assertions to the new contract (partial-mode success no longer carries phases_run; failure/preflight paths still emit the full payload).
  • Fixed a pre-existing stale assertion in the heavy lifecycle test: default increment already does Lance + graph ("increment completed (Lance + graph updated)"), but the test still expected the old Lance-only message — this was blocking the heavy test from validating the reprocess change.

Validation

  • 30 targeted tests pass, incl. both heavy cocoindex lifecycle tests (init/increment/reprocess success payloads verified end-to-end).
  • Failure + preflight-blocker paths confirmed to still emit the full payload.

🤖 Generated with Claude Code

`reprocess` emitted the entire pipeline result (model_dump, incl. ~4KB of
captured graph_stderr / vectors subprocess logs) on success — noise that was
already surfaced via the progress renderer. `init`/`increment` already emit a
one-line success payload; reprocess now matches.

- `_emit_reprocess_outcome`: emit a concise success payload (reuses the
  pipeline `message` when set, e.g. the graph-only-install note); keep the full
  payload only for failures, where captured stdout/stderr aid debugging.
  Partial-mode TTY "Rebuilt/Skipped" summary preserved.
- Update 3 stale test assertions + the reprocess stdout baseline fixture to
  the new contract.
- Also fix a pre-existing stale `increment` assertion in the heavy lifecycle
  test (default increment now does Lance + graph, not Lance-only).

Co-Authored-By: Claude <noreply@anthropic.com>
@HumanBean17 HumanBean17 merged commit 631ac03 into master Jul 12, 2026
4 checks passed
@HumanBean17 HumanBean17 deleted the fix/reprocess-success-output branch July 12, 2026 10:43
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