Fix Layer 1 arming in corpus reports and enhance transcript handling - #77
Fix Layer 1 arming in corpus reports and enhance transcript handling#77div0-space wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
An organization admin can view or raise the cap at claude.ai/admin-settings/claude-code. The cap resets at the start of the next billing period.
Once the cap resets or is raised, reopen this pull request to trigger a review.
There was a problem hiding this comment.
Pull request overview
This PR consolidates recording/transcript ownership around RecordingController/PresentationEmitter, fixes Layer 1 arming observation in corpus reports, and adds a durable “clean transcript bus” (NDJSON) with accompanying docs, env registry updates, and a CLI live follower.
Changes:
- Add a clean transcript bus (
transcript-events.jsonl) that observes committed reducer drafts + a controller-owned product seal, pluscodescribe transcribe liveto follow it. - Remove the parallel “composer-owned” recording path and route Agent/Assistive/Dictation capture through the shared controller, adding Swift ownership/continuity tests and tightening overlay/tray reconciliation.
- Improve build/test workflow enforcement (regenerate Xcode project via
xcodegen), and fix corpus-layering observation to key off provider arming rather than tail-patch counts.
Reviewed changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/validate-gates.sh | Enforces test-swift regenerates the Xcode project via xcodegen generate. |
| Makefile | Updates test-swift to require xcodegen and regenerate the ignored Xcode project before xcodebuild test. |
| macos/CodescribeTests/OverlayStateTests.swift | Adds coverage for “product seal” behavior (reject machine rewrites, allow user edits). |
| macos/CodescribeTests/ComposerMicTests.swift | Removes composer-preview/voice-lane tests that no longer apply after unifying capture ownership. |
| macos/CodescribeTests/AgentVoiceLaneOwnershipTests.swift | New tests for thread-latched ownership, unconditional terminal releases, and routing target stability. |
| macos/CodescribeTests/AgentThreadContinuityTests.swift | Adds continuity regression coverage around queued refresh/summon seams and removes preview callback surfaces. |
| macos/CodescribeTests/AgentSummonTests.swift | Removes tests for the deleted “agent capture command” callback path. |
| macos/Codescribe/Screens/Tray/TrayViewModel.swift | Reconciles “Starting” state against controller truth; tracks tray-initiated starts in flight. |
| macos/Codescribe/Screens/Tray/TrayEngine.swift | Updates tray bridge description to reflect controller routing via CodescribeHotkeys. |
| macos/Codescribe/Screens/Tray/RealTrayEngine.swift | Clarifies “shared controller” recording routing contract in comments. |
| macos/Codescribe/Screens/Settings/SettingsViewModel.swift | Updates STT health commentary to reflect controller snapshot authority. |
| macos/Codescribe/Screens/Settings/EnginePanel.swift | Fixes SwiftUI modifier indentation (formatting-only change). |
| macos/Codescribe/Screens/Overlay/OverlayState.swift | Implements “product seal” semantics for final transcript handling and adjusts highlight formatting. |
| macos/Codescribe/Screens/Overlay/OverlayHighlight.swift | Formatting-only change to lexicon highlight local variable. |
| macos/Codescribe/Screens/AgentChat/Composer.swift | Removes editable dictation preview UI; mic affordance now reflects shared-controller, thread-latched ownership. |
| macos/Codescribe/Screens/AgentChat/AgentChatStore.swift | Adds dictation-thread latch + routing-target freeze/resync; removes composer preview buffers and delivery-source logic. |
| macos/Codescribe/Core/ComposerDictation.swift | Replaces independent dictation bridge with a thin gesture adapter over CodescribeHotkeys shared controller. |
| macos/Codescribe/Core/AppModel.swift | Adjusts overlay controller wiring; documents unified recording ownership across modes/surfaces. |
| macos/Codescribe/Bridge/codescribe_ffiFFI.h | Removes generated UniFFI surfaces related to the deleted CodescribeDictation and agent capture callback. |
| macos/Codescribe/Bridge/codescribe_ffi.swift | Removes generated Swift bindings for CodescribeDictation, CsAgentCaptureCommand, and setAgentCaptureActive. |
| macos/Codescribe/App.swift | Removes agent-capture callback plumbing; summon now fronts/focuses Agent without capture command routing. |
| docs/TRANSCRIPT_BUS.md | New contract doc for the clean transcript NDJSON bus schema and path resolution. |
| docs/STT_CONTRACT.md | Updates front-surface maps to reflect recording via CodescribeHotkeys (shared controller). |
| docs/HOTKEYS_CONTRACT.md | Updates Assistive routing model to shared-controller capture + Agent UI notification. |
| docs/ENV_REGISTRY.toml | Bumps registry version/date; adds CODESCRIBE_TRANSCRIPT_BUS_PATH and XDG_STATE_HOME. |
| docs/DELIVERY_ROUTE.md | Clarifies OverlayInsert routing (ClipboardPaste vs DeferredInsert) and telemetry scope. |
| core/quality/engine_contract.rs | Makes EngineContract serialize-only (removes Deserialize) to match 'static constant ownership. |
| core/config/default_env.txt | Documents CODESCRIBE_TRANSCRIPT_BUS_PATH in default env template. |
| bridge/src/recording.rs | Narrows the recording bridge to shared types; removes the old CodescribeDictation UniFFI surface. |
| bridge/src/lib.rs | Updates module documentation to reflect the new role of recording. |
| bridge/src/hotkeys.rs | Unifies capture gating for Dictation/Agent/Assistive through one controller path; removes agent-owned capture commands. |
| bin/codescribe.rs | Adds transcribe live subcommand that tails the clean transcript bus without opening a microphone. |
| bin/codescribe-corpus.rs | Fixes layered observation to read provider arming; adds unit tests for the new observation function. |
| app/presentation/transcript_bus.rs | Implements durable append-only transcript bus writer, path resolution, and event schema/types. |
| app/presentation/mod.rs | Exposes transcript bus types alongside PresentationEmitter. |
| app/presentation/emitter.rs | Publishes draft/revision events to the transcript bus from reducer mutations; adds parity tests across modes. |
| app/controller/tests.rs | Adds controller test for “first seal wins” behavior; updates event sink fixture construction. |
| app/controller/quality_delivery.rs | Scopes auto-paste policy types/functions for tests and preserves existing matrix coverage. |
| app/controller/mod.rs | Wires transcript bus lifecycle into recording start/stop; seals product transcript at the final truth boundary; updates overlay insert routing. |
| app/controller/delivery_route.rs | Adds explicit overlay-insert fact constructor + route logic to choose DeferredInsert when target is Codescribe. |
| AGENTS.md | Replaces previous long directive with a concise, Codescribe-specific local agent contract referencing canonical docs. |
| .env.example | Documents CODESCRIBE_TRANSCRIPT_BUS_PATH and XDG_STATE_HOME examples. |
| .env.debug.example | Documents CODESCRIBE_TRANSCRIPT_BUS_PATH and XDG_STATE_HOME examples. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Four UX laws from the parked overlay branch, rewritten on OverlayState from feat/overlay-assist-stack — not a cherry-pick: - Assistive stay on the live overlay; chrome language is RECORDING / AGENT / PROCESSING / READY. Copy is live from the first letter. - Action row whispers at 0.22 until hover. - Retranscribe: Full HQ + Cloud on last_session.wav (retained at stop). - Forest glass, chrome grab, panel non-key until FINAL is clicked. Screenshot chords rise to statusBar; SecurityAgent yields. Authored-By: grok <agents@vetcoders.io>
- derive profile observation from the replay provider signal instead of tail patch count - require every successful execution to match the requested profile - fail closed when no execution succeeds and cover mixed observations
- preserve the historical transcribe live command without opening a second microphone - stream committed app-owned transcript events to stdout - cover command parsing and append-only output semantics
- remove the obsolete worktree and swarm control-plane doctrine - codify the single microphone, transcript reducer, delivery, and thread owners - point agents at executable contracts and honest verification lanes
…onstructor The stop path already asked resolve_delivery_route. Overlay Insert and Paste Here still picked a destination on their own, which is why OverlayInsert and DeferredInsert were dead in the lib target. - paste_text_from_overlay and defer_text_from_overlay consult the throne - OverlayInsert + Codescribe (latched target or caret) → DeferredInsert - OverlayInsert + foreign app → ClipboardPaste; Orient vetoes do not apply - auto-paste policy matrix stays test-only; EngineContract is serialize-only Authored-By: grok <agents@vetcoders.io>
6c2c31e to
1706c61
Compare
This pull request introduces several documentation and configuration improvements, clarifies delivery route and intent enums, and enhances the Swift test workflow. The most important changes are summarized below.
Documentation and Contracts
AGENTS.mdto provide a concise, Codescribe-specific agent contract, clarifying runtime laws, canonical contracts, and working rules. The new version removes the previous lengthy doctrine and replaces it with direct, actionable guidelines and references to canonical contract files.Configuration and Observability
CODESCRIBE_TRANSCRIPT_BUS_PATHandXDG_STATE_HOMEenvironment variable examples to both.env.exampleand.env.debug.example, documenting options for transcript bus path and state root overrides. [1] [2]Build and Test Workflow
test-swiftMakefile target to regenerate the Xcode project usingxcodegenbefore running Swift tests, ensuring the project is always up-to-date and documenting the need forxcodegenas a dependency.Delivery Route and Intent Documentation
DeferredInsertvariant in theDeliveryRouteenum, specifying its use case when an overlay insert/defer click refuses a synthetic paste.OverlayInsertvariant in theDeliveryIntentenum, specifying that it is frozen at the click event rather than at stop.## Summary