Skip to content

fix: clarify rust-hybrid fallback messaging for non-Rust-owned files (Issue #680)#684

Merged
jununfly merged 1 commit into
mainfrom
fix/issue-680-fallback-messaging
Jul 13, 2026
Merged

fix: clarify rust-hybrid fallback messaging for non-Rust-owned files (Issue #680)#684
jununfly merged 1 commit into
mainfrom
fix/issue-680-fallback-messaging

Conversation

@jununfly

Copy link
Copy Markdown
Owner

Issue

Fixes #680 — CLI says '30 TypeScript fallback files' but actual is 30 YAML files indexed via the TypeScript fallback path. The label conflated fallback implementation (TypeScript) with source file language.

Root Cause

FALLBACK_REASON_LABELS['language-level-typescript-fallback'] was set to 'TypeScript fallback files', which reads as '30 TypeScript source files' instead of '30 non-Rust-owned files handled by the TypeScript fallback path'.

Fix: Distinguish reason from source language (Q1=B, Q2=B)

Three CLI print locations updated:

  1. zcodegraph index summaryclack.log.warn reworded to 'non-Rust-owned files via TypeScript fallback'
  2. zcodegraph statusfallbackSummaryFromHybridMetadata() now extracts fallbackByLanguage from DB metadata
  3. zcodegraph doctorbuildDiagnosticBundleSummary() now passes fallbackByLanguage from aggregateTaxonomy

New output format:

Top fallback reasons:
  30 non-Rust-owned files via TypeScript fallback
Fallback by source language: yaml (30)

Data pipeline (Q3=A):
fallbackByLanguage flows from planRustHybridAssignments()typescriptFallbackAppend profile → RustHybridFallbackSummary → format layer.

Storage message unchanged (Q4=A): fallbackMessage() in rust-hybrid-contract.ts kept as-is for backward compatibility. Diagnostic bundle already has structured fallbackByLanguage field.

TDD Vertical Slices

Slice Tests Implementation
1-1 4 tests: label match, language breakdown line, multi-language, absent case fallback-summary.ts
1-2 (covered by 1-1) zcodegraph.tsfallbackSummaryFromHybridMetadata
1-3 (covered by 1-1) zcodegraph.ts — profile construction (3 sites)
1-4 (covered by CLI fallback tests) zcodegraph.tsclack.log.warn
1-5 (covered by 1-1) diagnostics/index.tsbuildDiagnosticBundleSummary

Files Changed

  • src/diagnostics/fallback-summary.ts — label, type, format function
  • src/bin/zcodegraph.ts — metadata extraction, profile (3 sites), warn message
  • src/diagnostics/index.ts — diagnostic bundle summary
  • __tests__/issue-680-fallback-messaging.test.ts — 4 new TDD tests
  • __tests__/rust-hybrid-fallback-summary.test.ts — update label assertion
  • __tests__/rust-index-engine-cli-fallback.test.ts — update label assertions

Tests

npx vitest run __tests__/issue-680-fallback-messaging.test.ts __tests__/rust-hybrid-fallback-summary.test.ts8/8 pass
npx tsc --noEmitzero errors

…(Issue #680)

CLI said '30 TypeScript fallback files' but actual is 30 YAML files
indexed via the TypeScript fallback path. The label conflated the
fallback implementation (TypeScript) with the source file language.

Fix: distinguish 'non-Rust-owned files via TypeScript fallback' (reason)
from source language breakdown (yaml: 30, css: 3, ...) in all three
CLI print locations.

Changes:
- FALLBACK_REASON_LABELS: 'TypeScript fallback files' -> 'non-Rust-owned files via TypeScript fallback'
- formatRustHybridFallbackHealthLines: append 'Fallback by source language' line
- RustHybridFallbackSummary + Profile: add fallbackByLanguage field
- fallbackSummaryFromHybridMetadata: extract fallbackByLanguage from DB metadata
- typescriptFallbackAppend profile: pass fallbackByLanguage from plan (3 construction sites)
- clack.log.warn: 'TypeScript fallback files' -> 'non-Rust-owned files via TypeScript fallback'
- buildDiagnosticBundleSummary: pass fallbackByLanguage from aggregateTaxonomy
- Update existing test assertions to new label

TDD: 4 new tests (issue-680-fallback-messaging.test.ts), 8/8 pass.
TypeScript: zero errors. Storage message (fallbackMessage) unchanged per Q4 decision.
@jununfly
jununfly merged commit 8be63ee into main Jul 13, 2026
3 checks passed
@jununfly
jununfly deleted the fix/issue-680-fallback-messaging branch July 14, 2026 03:25
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.

Clarify rust-hybrid fallback degraded summary for non-Rust-owned YAML files

1 participant