CLI: empty-result diagnostics, documented count clamp, structured JSON reads#1359
Merged
Merged
Conversation
The context commands failed silently: empty results printed nothing and
exited 0, --count was clamped to 1-50 without saying so, and
context-search --speaker quietly dropped dictation results. The read
commands also threw away parsed structure in --json mode.
- context-recent, context-search, and list-dictations now print
"No results. Searched: <dirs>" to stderr in text mode; --json emits
{"results": [], "searched_directories": [...], "hint": "..."} instead
of a bare empty array. Non-empty output shapes are unchanged.
- --count help text documents the 1-50 clamp on all three commands.
- context-search with --speaker and a non-meeting kind notes the
dictation skip on stderr (text) or in a "notes" array (--json).
Filtering behavior itself is unchanged.
- read-meeting --json adds recording/speakers/utterances and
read-dictation --json adds date/entries alongside the existing
markdown field, reusing the parse ContextStore already does.
Directory resolution and markdown parsing stay in TranscriptedCaptureKit;
diarize/batch are untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GuGZaFRmNrqfGPpqf7WH4n
11 tasks
Owner
Author
|
Merge-room hold: draft plus required Mac Swift proof is missing. Live state checked 2026-07-02: head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
transcripted-cli's context commands had three agent-hostile behaviors found in the agent-surface audit:context-recent,context-search, andlist-dictationsprinted nothing and exited 0 when directory resolution landed somewhere empty or wrong — an agent can't tell "no data" from "wrong folder" and confidently reports "you have no meetings".--countsilently clamps to 1–50 with no mention in help.--speakersilently drops all dictation results; andread-meeting/read-dictation --jsonthrew away the structureContextStorehad already parsed, returning just a raw-markdown blob an agent has to re-parse.Product Impact
agent artifactsagent workflowWhat changed
ContextCommands.swift: empty results now say so — text mode printsNo results. Searched: <dirs>to stderr (stdout stays clean for piping);--jsonemits{"results": [], "searched_directories": [...], "hint": "..."}.context-searchwith--speakeron non-meeting kinds emitsNote: --speaker only matches meetings; dictations skipped.(stderr in text,notesarray in JSON). All three--counthelps document the 1–50 clamp. Searched-directory reporting is--kind-aware and deduped.ContextModels.swift:CLIReadMarkdownDocumentgains optionalrecording/speakers/utterances(meetings) anddate/entries(dictations) alongside the unchangedmarkdownfield; newCLIContextResultsDocumentwrapper for the empty/notes cases.ContextStore.swift: extractedmeetingTranscript(fromMarkdown:)andreadDictationDocument(...)so reads can return parsed structure;--entry-idnarrowsentriesto the one entry.ContextStoreTests.swift: 11 new command-level tests (empty text/JSON shapes, kind-scoped searched dirs, speaker note on both streams, bare-array compatibility preserved for non-empty output, structured read JSON incl. entry narrowing) with an fd-level stderr capture helper mirroring the existing stdout one.Tools/TranscriptedCLI/CLAUDE.md: new Output Shapes section + stderr-diagnostics gotcha.Backward compatibility: non-empty list/search output is still a bare JSON array (unless a note applies), and
markdownis unchanged in reads.How I checked it
scripts/dev/agent-preflight.sh.agents/test-matrix.yml— matrix rule forTools/TranscriptedCLI/**isswift test --package-path Tools/TranscriptedCLIswift test --package-path Tools/TranscriptedCLI— run by Swift CI on macOS at this exact head (f6e6c65), green: https://github.com/r3dbars/transcripted/actions/runs/28621353693 (the Tools package tests step runs all four package suites)bash build.sh --no-open/bash run-tests.sh/ smokes — also executed green in the same Swift CI run (required merge gate)Authoring context: written in a Linux session with no local Swift toolchain; verification is the green macOS Swift CI run above, which enforces the same matrix as local runs.
Risk Review
.agent-review/visuals/evidence — n/aNotes
Part of the agent-surface audit series (#1356, #1357, #1358). Deliberately does not touch
TranscriptedCaptureKit— #1362 owns resolver changes.Agent handoff
COORD_DONE: GREEN | (this PR) | CLI diagnostics + structured JSON reads | none | none | Swift CI green at head f6e6c65 (full matrix incl. CLI package tests) | human review + mark ready + merge🤖 Generated with Claude Code
https://claude.ai/code/session_01GuGZaFRmNrqfGPpqf7WH4n