Skip to content

fix: add three-tier fallback health state (healthy/partial/degraded) for Issue #682#685

Closed
jununfly wants to merge 1 commit into
mainfrom
fix/issue-682-partial-fallback-state
Closed

fix: add three-tier fallback health state (healthy/partial/degraded) for Issue #682#685
jununfly wants to merge 1 commit into
mainfrom
fix/issue-682-partial-fallback-state

Conversation

@jununfly

Copy link
Copy Markdown
Owner

Summary

Distinguish expected fallbacks (non-Rust-owned languages like YAML) from unexpected gaps (Rust-owned parse/extraction failures, missing files).

Problem

Issue #682 reported that indexing a TypeScript-heavy project (ZAgenticLoop) showed Fallback health: degraded for 58 YAML files — but these are expected fallbacks, not problems. The degraded label caused unnecessary user concern.

Solution

Three-tier fallback health state:

State Condition
healthy Zero fallbacks, zero gaps
partial Only language-level-typescript-fallback (non-Rust-owned languages, successfully indexed)
degraded Any rust-owned-* gap or language-level-fallback-missing-file

Key changes

  • RustHybridFallbackState type: add 'partial'
  • rustHybridFallbackStateFor(): three-tier logic checking taxonomy keys
  • formatRustHybridFallbackHealthLines(): partial output with info line + language breakdown (no "need review")
  • formatRustHybridFallbackDoctorHint(): partial returns hint without "Run diagnostic bundle"
  • clack.log: conditional info (partial) / warn (degraded)
  • statusFallbackDiagnostics: returns data for partial (empty doctorCommand)
  • classifyGraphHealth: partial treated as healthy graph health
  • diagnostics/index.ts: fallbackState override handles partial

Before (Issue #682 scenario)

Fallback health: degraded
The index is usable; fallback-degraded files or diagnostics are the only parts that need review.
Top fallback reasons:
  58 non-Rust-owned files via TypeScript fallback

After

Fallback health: partial
Index is complete; some files were indexed via TypeScript fallback for non-Rust-owned languages.
58 files indexed via TypeScript fallback (non-Rust-owned languages)
Fallback by source language: yaml (58)

Test plan

  • 11 new TDD tests in issue-682-partial-fallback-state.test.ts
  • 7 existing tests updated (rust-hybrid-fallback-summary, issue-680-messaging, rust-index-engine-cli-fallback)
  • tsc --noEmit zero errors
  • 19/19 unit tests pass
  • CLI integration tests require cargo (not available in this environment)

Closes #682

…for Issue #682

Distinguish expected fallbacks (non-Rust-owned languages like YAML) from
unexpected gaps (Rust-owned parse/extraction failures, missing files).

State logic:
- healthy: zero fallbacks, zero gaps
- partial: only language-level-typescript-fallback (expected, non-Rust-owned)
- degraded: any rust-owned-* gap or language-level-fallback-missing-file

Changes:
- RustHybridFallbackState type: add 'partial'
- rustHybridFallbackStateFor(): three-tier logic
- formatRustHybridFallbackHealthLines(): partial output with info line + lang breakdown
- formatRustHybridFallbackDoctorHint(): partial returns hint without doctor command
- clack.log: conditional info (partial) / warn (degraded)
- statusFallbackDiagnostics: returns data for partial (empty doctorCommand)
- classifyGraphHealth: partial treated as healthy graph health
- diagnostics/index.ts: fallbackState override handles partial
- 11 new TDD tests + 7 existing tests updated

Closes #682
@jununfly jununfly closed this Jul 13, 2026
@jununfly
jununfly deleted the fix/issue-682-partial-fallback-state branch July 13, 2026 16:41
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.

Feedback: rust-hybrid index usable but fallback health degraded on ZAgenticLoop

1 participant