feat(14.1-04): browse rows carry topics+analysis_status+is_stale; StorageBrowser parity slots

- CloudItemOut gains lightweight row fields: topics (List[str]), analysis_status
  (Optional[str]), is_stale (bool) — allowlisted, no extracted_text (T-14.1-10)
- browse.py _item_out populates status/is_stale from CloudItem; batched topic-name
  load via _batch_load_topics (single JOIN query; no N+1) for file rows only
- StorageBrowser imports cloudConnections store; translateStatus delegates to
  store.translateAnalysisStatus (D-06 single-source rule)
- cloudRowActionKind() drives single analysis action slot: Analyze (pending) /
  Re-analyze (indexed/stale) / Retry (failed) — one renders at a time (D-08/D-10)
- Inline analysis_status badge added for cloud file rows (green/amber/blue/red per UI-SPEC)
- TopicBadge rendering handles both string[] (cloud) and object[] (local) topics
- All 489 frontend tests pass; all 52 backend cloud tests pass

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curo1305
2026-06-26 22:21:30 +02:00
co-authored by Claude Sonnet 4.6
parent 14d7a47d4d
commit 935accc91f
3 changed files with 208 additions and 35 deletions
+17 -1
View File
@@ -98,7 +98,18 @@ class CloudCapabilityOut(BaseModel):
class CloudItemOut(BaseModel):
"""Normalized cloud item metadata. No credentials or byte content."""
"""Normalized cloud item metadata. No credentials or byte content.
Phase 14.1 (Plan 04) adds lightweight row fields for browser parity:
topics: List of topic-name strings (empty list for unanalyzed/folders).
analysis_status: Internal status string ("pending"|"indexed"|"stale"|"failed"|…)
— None for folder rows.
is_stale: True when analysis_status == "stale" (D-07 convenience flag).
Strict allowlist: extracted_text, object_key, credentials_enc, version_key, and
raw provider URLs are absent by design (T-14.1-10 — row payload must stay lightweight
and free of sensitive internal fields).
"""
id: str # DocuVault stable UUID
provider_item_id: str
@@ -111,6 +122,11 @@ class CloudItemOut(BaseModel):
etag: Optional[str] = None
capabilities: dict[str, CloudCapabilityOut] = {}
# Phase 14.1 row-parity fields (T-14.1-10 allowlist — no extracted_text)
topics: List[str] = [] # topic names; empty for folders/unanalyzed
analysis_status: Optional[str] = None # None for folder rows
is_stale: bool = False # True when analysis_status == "stale" (D-07)
# ── Freshness / folder state schemas ─────────────────────────────────────────