Repository navigation
fix(ptt): retain source evidence across voice and chat - #13074
Conversation
Failure-Class: FC-split-mutation-authority
Retain sources through allowed slow journal writes, release abandoned captures, bind fallback voice sources to their producing rows, and never recapture an overlay under a frozen source identity. Validation: agent-logic-harness.sh --swift-only passed 777 tests. Named-app live positive recall remains blocked on protected Keychain authentication; no end-to-end success claim. Failure-Class: FC-realtime-context-evidence-ownership
There was a problem hiding this comment.
1 issue found across 61 files
Confidence score: 3/5
- In
desktop/macos/agent/src/runtime/backend-turn-projection.ts,conversationEvidenceForBackenddirectly validates legacy evidence, so malformed evidence can throw during journal delivery/sync and prevent affected turns from being processed — handle invalid evidence without aborting the sync path.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/agent/src/runtime/backend-turn-projection.ts">
<violation number="1" location="desktop/macos/agent/src/runtime/backend-turn-projection.ts:25">
P2: The journal delivery/sync path now throws on turns that carry malformed legacy evidence. `conversationEvidenceForBackend` calls `validateConversationEvidenceEnvelope(metadata.evidence)` directly, which throws for an unsupported schema or oversized/invalid envelope, and `backendTurnPayload` no longer guards it. Every other consumer of the same envelope in this module deliberately tolerates that shape: `conversation-journal.ts` wraps `parseConversationEvidenceMetadata` in try/catch ("Legacy or corrupt evidence must not fail the authorized read tool" and "A malformed legacy envelope must not abort search of later valid turns"), and `buildContextSnapshot` renders it as evidence-undefined with `evidenceReadRequired: true` rather than throwing. A stored legacy/corrupt evidence envelope now renders in context but aborts `backendTurnPayload` at the outbox/delivery boundary (sqlite-store.ts:1989), so the whole turn fails to sync. Wrap the evidence extraction/validation in a try/catch and fall back to the unstamped metadata (or skip evidence) so delivery matches the tolerate-and-continue behavior of the read and context paths.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Keep retained-body digests correct, represent empty or budget-limited content honestly, and revoke stale capture obligations at owner and journal-receipt boundaries. Validation: Swift agent logic harness passed 787 tests, including escaped aggregate metadata, digest, empty-file and rejected-receipt regressions. Failure-Class: FC-realtime-context-evidence-ownership
Retain journal idempotency after evidence attachments, redact malformed legacy evidence before sync, shape relay errors, and remove redundant prompt instructions. Page revision identities before loading search payloads using the constrained primary-key query. Validation: 867 runtime tests and 137 extension tests passed; official generated surfaces rebuilt. Ten interleaved synthetic 500-source samples measured search median 163ms before and 93ms after; this is local SQL/runtime work, not end-to-end voice latency. Failure-Class: FC-split-mutation-authority
Validation: gauntlet self-check and mocked production fixture-to-browser admission passed without browser or model calls. Failure-Class: none
Use the existing singular/plural convention for the answer-mode count. Reviewed the one-word branch; no behavior change beyond copy. Failure-Class: none
|
Resolved the Cubic thread on |
|
The cubic P2 finding is already addressed at this head by 8230771: |
PTT could acknowledge “remember this” while retaining only the spoken exchange. A later question could then be answered from that acknowledgement after the original screen context disappeared.
Retain bounded screen OCR and text attachments on their producing conversation-journal turns, with capture provenance and explicit pending/partial/unavailable states. Voice and typed chat share source read/search tools beyond the recent prompt window, and the existing operation ledger supplies action outcomes. Native capture runs alongside audio; cancelled turns release their reservations, slow admitted writes retain their source, and failed frozen captures cannot recapture an Omi overlay under the original app identity. Tool instructions distinguish retaining a source from creating a future task or reminder. Review fixes also bound the encoded envelope including JSON escaping, preserve record retries after evidence attachment, and omit malformed evidence during backend sync without leaking raw source data or blocking the rest of the turn.
Validation:
OMI_PR_BODY_FILE=… make preflight: all 31 selected checks passed (79 seconds)../scripts/agent-logic-harness.sh --swift-only: 787 tests passed after native lifecycle integration, including late OCR, cancellation capacity, slow/rejected admission, owner boundaries, and capture-selection spies.bash scripts/test-tool-surfaces.shpassed.Invariants: INV-AGENT-*, INV-AUTH-1, INV-CHAT-1, INV-VOICE-1. The existing journal remains the interaction/evidence owner; no new durable store or product-memory tier is introduced. Full source bodies are retained locally and redacted from backend journal sync; model-facing source data cannot grant tool authority. Owner and conversation-generation boundaries fence reads and operation receipts. Retrieval has bounded prompt overhead and may add a tool round trip; retaining evidence itself adds no model call. Native behavioral tests use the same terminal policy and producing-row identities as production, following the chat-continuity contract.
Failure-Class: FC-split-mutation-authority
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift | 5945 -> 5968 | Forward evidence through existing journal admission and bind fallback voice sources to the accepted producing row; evidence policy remains extracted
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/PushToTalkManager.swift | 4016 -> 4060 | Bind concurrent frozen capture and dictation admission to the existing native persistence lifecycle; evidence policy remains extracted
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/RealtimeHubController+SessionLifecycle.swift | 1683 -> 1734 | Carry frozen evidence through existing successful-terminal and fallback admission paths without introducing another transcript owner
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/RealtimeHubController.swift | 1578 -> 1583 | Add the bounded native evidence obligation tracker and revoke it at the existing owner-quiesce boundary
Line-Count-Exception: desktop/macos/Desktop/Sources/Providers/ChatProvider.swift | 7398 -> 7404 | Attach selected-file evidence at the existing typed-turn admission boundary; file extraction lives in ChatAttachmentEvidence