Files
kb/openspec/changes/archive/2026-04-02-fix-search-human-output/tasks.md
T
steve 2d179af557 Fix search human-mode output to match engine API response
The Go client struct expected a nested document object and top-level
page/section fields, but the engine returns flat results with metadata
in chunk_metadata. This caused empty display for title, type, tags,
page, and section in human output mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 16:17:35 +01:00

607 B

1. Fix search result struct

  • 1.1 Replace nested Document struct with flat fields (Title, DocType, Tags) matching engine JSON keys
  • 1.2 Add ChunkMetadata map[string]interface{} field to capture chunk_metadata

2. Fix display logic

  • 2.1 Update title/type/tags references in the display loop to use the new flat fields
  • 2.2 Extract page from ChunkMetadata map (replacing top-level Page field)
  • 2.3 Extract section_header from ChunkMetadata map (replacing top-level Section field)

3. Verify

  • 3.1 Build the client and verify it compiles cleanly