Skip to content

feat(cli): add rich + progress protocol/renderer skeleton (JCIRAG_PROGRESS)#326

Merged
HumanBean17 merged 5 commits into
masterfrom
feat/index-progress-protocol
Jun 15, 2026
Merged

feat(cli): add rich + progress protocol/renderer skeleton (JCIRAG_PROGRESS)#326
HumanBean17 merged 5 commits into
masterfrom
feat/index-progress-protocol

Conversation

@HumanBean17

Copy link
Copy Markdown
Owner

What

Foundation for unified index-build progress (INDEX-OUTPUT-REWORK):

  • Adds rich>=14,<15 (cocoindex[lancedb] requires rich>=14; a <14 cap is unsatisfiable).
  • New java_codebase_rag/progress.py: ProgressEvent, parse_progress_line, IndexProgressRenderer (rich Live + non-TTY concise fallback), ProgressRelay (parse-first, single-writer, noise-continuation suppression, survives renderer exceptions).
  • 14 light unit tests in tests/test_progress.py.
  • Lands the planning artifacts: propose/active/INDEX-OUTPUT-REWORK-PROPOSE.md, plans/active/PLAN-INDEX-OUTPUT-REWORK.md, plans/active/AGENT-PROMPTS-INDEX-OUTPUT-REWORK.md.

No production caller yet — PR-2/3/4 wire it in.

Stack

Base master. PR-2 feat/index-graph-progress, PR-3 feat/index-vectors-progress, PR-4 feat/index-installer-progress stack on top — review/merge in order.

Why

The five lifecycle commands (init/increment/install/reprocess/update) build the index through the same two subprocesses but emit inconsistent output and show no real progress (only an elapsed spinner). This effort unifies the output and adds a real progress bar. Gating spike passed: print(file=sys.stderr) inside a CocoIndex flow function reaches the parent (130/130 lines relayed; pre-walk divergence 0).

Ontology / reindex / env

  • Ontology bump: none (stays 17). Pure output/UX.
  • Re-index: not required.
  • New dependency: rich>=14,<15.

Tests

.venv/bin/ruff check . clean; .venv/bin/python -m pytest tests -v -> 818 passed, 13 skipped (heavy cocoindex/torch tests gated).

🤖 Generated with Claude Code

HumanBean17 and others added 5 commits June 14, 2026 23:15
Propose (propose/active/INDEX-OUTPUT-REWORK-PROPOSE.md), plan
(plans/active/PLAN-INDEX-OUTPUT-REWORK.md), and per-PR agent prompts
(plans/active/AGENT-PROMPTS-INDEX-OUTPUT-REWORK.md) for unifying the
index-build output across init/increment/install/reprocess/update and
adding a real progress bar (rich + JCIRAG_PROGRESS protocol).

Gating spike passed 2026-06-14: a print(file=sys.stderr) inside a
CocoIndex flow function reaches the parent's captured stderr (130/130
lines relayed; pre-walk divergence 0 on the fixture). PR-1 unblocked.

Planning only; no production code changed.

Co-Authored-By: Claude <noreply@anthropic.com>
rich>=14,<15 (cocoindex[lancedb] requires rich>=14). New
java_codebase_rag/progress.py: ProgressEvent, parse_progress_line,
IndexProgressRenderer (rich Live + non-TTY fallback), ProgressRelay
(parse-first, single-writer). 13 light unit tests. No production
caller yet; PR-2+ wire it in.

Co-Authored-By: Claude <noreply@anthropic.com>
cocoindex[lancedb]>=1.0.0a43 transitively requires rich>=14, so the
originally-suggested rich>=13.7,<14 cap is unsatisfiable (pip install -e .
fails). Corrected in propose Open Q5 + risk row, plan Resolved decisions +
PR-1 step + DoD, and the PR-1 agent prompt. Verified compatible on rich
14.3.4.

Co-Authored-By: Claude <noreply@anthropic.com>
…ne, carry-forward totals

- ProgressRelay now mirrors _LineFilter's noise-continuation suppression
  (_suppress_next) + new test_progress_relay_suppresses_noise_continuation
- remove dead _is_partial param from _route_line
- clamp completed→total on status=done both directions (over-count safe)
- monotonic completed (max with current) so a stray smaller done can't rewind
- non-TTY done concise line carries forward last-seen total/elapsed_s

Minor #6 (apply/stop atomicity) deferred to PR-2 (drain-thread wiring).

Co-Authored-By: Claude <noreply@anthropic.com>
PR-1 code-quality review Minor #6: apply() issues several locked rich
calls not atomic vs. a concurrent stop() from the main thread. Only
matters once PR-2 wires the drain thread. Added as cross-PR risk #10
with the PR-2 mitigation (gate apply on _started, or hold the Live
lock across the sequence).

Co-Authored-By: Claude <noreply@anthropic.com>
@HumanBean17 HumanBean17 merged commit 1c6653d into master Jun 15, 2026
1 check passed
HumanBean17 added a commit that referenced this pull request Jun 15, 2026
Catch-up: master advanced (#322 installer cross_service_resolution,
#323 config embedding.model resolution, #325 version 0.6.2, #326 PR-1
progress.py) while the index-output-rework stack was based on #320.
This merges those in so the catch-up PR (#330) carries only PR-2/3/4.

Conflicts resolved (both add/add, feature branch is the superset):
- java_codebase_rag/progress.py  (master had PR-1 state; branch has
  PR-1 + CallbackRenderer/make_relay/build_index_progress_context)
- tests/test_progress.py         (master had PR-1's 14 tests; branch
  adds PR-2/3/4 tests)

Auto-merged cleanly: installer.py (#322 + PR-4), pyproject.toml
(version 0.6.2 + rich>=14,<15), tests/test_installer.py.

Verified: ruff clean; full suite 833 passed, 13 skipped (heavy-gated).

Co-Authored-By: Claude <noreply@anthropic.com>
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