Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
05f08b3
[grok/vc-justdo] land operator overlay 12pt resize band
div0-space Aug 20, 2026
45e1c05
[grok/vc-justdo] kielbasa named-agent follower on the transcript bus
div0-space Aug 20, 2026
9a8c58e
[grok/vc-skillaunch] add foundation skill codescribe for bus attach
div0-space Aug 20, 2026
b8c4d15
[grok/vc-skillaunch] complete skills/codescribe foundation pack
div0-space Aug 20, 2026
192d2b4
[codex/vc-justdo] lexicon: teach only after 3 identical human correct…
div0-space Aug 20, 2026
cce2859
[grok/vc-justdo] paste latch never stores Codescribe; restore clipboa…
div0-space Aug 21, 2026
54a7251
[grok/vc-justdo] Lab mode no longer steals the dictation overlay
div0-space Aug 21, 2026
3d2f38b
[grok/vc-justdo] sync UniFFI Swift bindings for N=3 lexicon teach gate
div0-space Aug 21, 2026
d3780f7
[grok/vc-justdo] clippy: decode_pcm_f32le uses as_chunks instead of c…
div0-space Aug 21, 2026
bcb7eaf
[grok/vc-justdo] drop unused overlay_float import from controller lib
div0-space Aug 21, 2026
4e99d32
Merge branch 'fix/whisper-fp16-runtime' into fix/p0-p2-before-release
div0-space Aug 21, 2026
380474b
[codex/vc-implement] fix(stt): fail close unproven Layer 1 mutation
div0-space Aug 21, 2026
9681c0e
[codex/vc-implement] chore(clippy): simplify gateway transport guard
div0-space Aug 21, 2026
0aa1780
[codex/vc-implement] fix(stt): fence Layer 1 by PCM identity
div0-space Aug 21, 2026
361ece4
Merge branch 'fix/whisper-fp16-runtime' into fix/p0-p2-before-release
div0-space Aug 21, 2026
5ec1f1f
[codex/vc-workflow] docs: restore layered engine contract
div0-space Aug 21, 2026
00397ee
[codex/vc-delegate] fix(settings): expose local Whisper runtime truth
div0-space Aug 21, 2026
ab45e39
[codex/vc-delegate] fix(settings): reflect layered armed default
div0-space Aug 21, 2026
6b9a647
[codex/vc-delegate] fix(stt): arm local live tail patching
div0-space Aug 21, 2026
ad1052d
[codex/vc-delegate] test(stt): enforce layered delivery receipts
div0-space Aug 21, 2026
11b6b70
[codex/vc-ownership] test(stt): assert receipt emission seam
div0-space Aug 21, 2026
e9b1332
[codex/vc-ownership] docs(stt): align Local Power runtime truth
div0-space Aug 21, 2026
53f2e90
Merge branch 'fix/whisper-fp16-runtime' into fix/p0-p2-before-release
div0-space Aug 21, 2026
2e19b36
[codex/vc-dispatch] docs: normalize Vetcoders charter name
div0-space Aug 22, 2026
e851e14
[codex/vc-dispatch] fix(lexicon): follow active data directory
div0-space Aug 22, 2026
6557d12
[codex/vc-dispatch] style: restore non-Rust format gate
div0-space Aug 22, 2026
42c105b
[codex/vc-implement] [W2-01-formatter] feat(stt): finish contextual i…
div0-space Aug 22, 2026
3cdaf98
[codex/vc-implement] [W1-01-runtime] refactor(runtime): own async exe…
div0-space Aug 22, 2026
5977917
[codex/vc-implement] [W0-01-contract] docs(stt): canonicalize four-la…
div0-space Aug 22, 2026
0f89ae2
[codex/vc-implement] [W2-03-foundation] integrate: prove parallel fou…
div0-space Aug 22, 2026
bb0cd9f
Merge branch 'fix/whisper-fp16-runtime' into fix/p0-p2-before-release
div0-space Aug 22, 2026
95d939b
[codex/vc-implement] [W2-02-paralingual] feat(stt): emit paralingual …
div0-space Aug 22, 2026
feed91a
[codex/vc-implement] [W2-04-session-bridge] feat(onboarding): install…
div0-space Aug 22, 2026
895300e
[codex/vc-workflow] feat(stt): enforce acoustic transcript provenance
div0-space Aug 22, 2026
a95e127
[codex/vc-workflow] test(macos): isolate clipboard writes
div0-space Aug 22, 2026
9e8f7c4
[grok/vc-justdo] admit L1 spans by PCM identity, not text overlap
div0-space Aug 22, 2026
1f9cf68
[grok/vc-justdo] wire occurrence/observation/receipt into Apple, L1, …
div0-space Aug 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.debug.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
# Runtime precedence: process env / ~/.codescribe/.env > settings.json > defaults.
# Secrets belong in Settings / macOS Keychain; placeholders are never real keys.

# =============================================================================
# APPLICATION RUNTIME
# =============================================================================
# CODESCRIBE_APP_RUNTIME_WORKERS=4 # Default: 4 — Named Tokio async workers owned by Codescribe.app (1-16; restart required)

# =============================================================================
# STT / WHISPER
# =============================================================================
Expand Down
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
# Runtime precedence: process env / ~/.codescribe/.env > settings.json > defaults.
# Prefer Settings for user-facing options and macOS Keychain for secrets.

# =============================================================================
# APPLICATION RUNTIME
# =============================================================================
# CODESCRIBE_APP_RUNTIME_WORKERS=4 # Default: 4 — Named Tokio async workers owned by Codescribe.app (1-16; restart required)

# =============================================================================
# STT / WHISPER
# =============================================================================
Expand All @@ -26,7 +31,7 @@
# CODESCRIBE_ONNX_REPO=onnx-community/whisper-large-v3-turbo # Default: onnx-community/whisper-large-v3-turbo — HuggingFace repo for ONNX model download
# CODESCRIBE_SILERO_FUSION=0 # Default: 0 — W13-3B Silero-identity conservative fusion lane (Supervisor edges + time-sliced Apple finals). Default OFF.
# CODESCRIBE_SILERO_FUSION_CONTEXT=utterance # Default: utterance — Bounded-context A/B: utterance | left_pad | stable_prompt. Never crosses a long-silence fence.
# CODESCRIBE_SPAN_IDEMPOTENCE=0 # Default: 0W13-4 sealed-span replay refusal + in-span loop fence (range identity, never content). Default OFF.
# CODESCRIBE_SPAN_IDEMPOTENCE=1 # Default: 1PCM-range replay refusal + in-span loop fence; 0 is diagnostic only.
# CODESCRIBE_STT_COMMIT_MIN_INTERVAL_MS=180 # Default: 180 — Minimum interval between committed/final STT inference jobs in milliseconds
# CODESCRIBE_STT_ENGINE=auto # Default: auto — STT engine: auto (Apple on supported macOS, Candle fallback), candle, onnx, or apple
# CODESCRIBE_STT_INITIAL_PROMPT_ENABLED=0 # Default: 0 — Opt-in gate for Candle Whisper runtime-lexicon initial_prompt. Default OFF after W2-F measured a 100% WER regression with the active prompt.
Expand Down
20 changes: 20 additions & 0 deletions .grok/skills/bus-demux/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: bus-demux
description: >
Run scripts/bus-demux.py against codescribe.transcript.v1. Flags: --become,
--name, --follow, --once. Use when the operator says bus-demux flags, kielbasa
follower, or needs the CLI. Session attach and naming live in the codescribe
skill — do not reimplement them here.
---

# Bus demux — CLI

Session attach lives in `codescribe`. This file is flags only.

```bash
python3 scripts/bus-demux.py --become --follow
python3 scripts/bus-demux.py --name james --follow
python3 scripts/bus-demux.py --name james --once
```

Unnamed agents do not pass (exit 2). No microphone. No Lab.
1 change: 1 addition & 0 deletions .grok/skills/codescribe
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codescribe Local Agent Contract

The VetCoders Global Agent Charter is authoritative in this repository. This
The Vetcoders Global Agent Charter is authoritative in this repository. This
file adds only Codescribe-specific runtime laws and pointers; it does not create
a second workflow, dispatch plane, or worktree policy.

Expand Down
15 changes: 15 additions & 0 deletions AGENT_BUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,18 @@ ours).
5. **Overlay Timer:** Dodanie widocznego licznika sekundowego do ekranu transkrypcji live.

Authored-By: antigravity <agents@vetcoders.io>

---

## SIGNAL · LAYER1_FAIL_CLOSED · 2026-08-21

**Od:** codex → wszyscy agenci / operator

Field falsification supersedes `POLARIZE_LAYER1_DEFAULT_AND_LBRX_BENCH` on one
point only: `CODESCRIBE_LAYERED_TRANSCRIPTION` is now **OFF by default**.
Unset preserves Apple live + lexicon; explicit `phase1` remains an experimental
operator path. Do not restore stock Layer 1 until PCM/span identity reaches one
rewrite fence, gap append is structurally idempotent, deliberate repetition
survives, and bounded stop-drain emits complete receipts.

Authored-By: codex <agents@vetcoders.io>
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- **The signed app can install the live named-agent bridge.** Agentic Readiness
keeps the 13-step Setup Wizard intact while letting the operator explicitly
select Codex and/or Claude Code. A checksumed bundle payload installs to the
stable `~/.codescribe/agent-bridge/` runtime with one receipt and managed
markers; foreign skill folders are visible conflicts. The demux follows live
drafts, waits for `transcript_sealed` before state changes, and persists a
provider-session lease/cursor plus active names across provider recovery.

### Fixed

- **`make install-app` accepts keys from Get license.** A keyed local
Expand Down
14 changes: 0 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -648,21 +648,20 @@ engine-auth: $(ENGINE_BRIDGE)
# until streaming bridge v2 lands — that is the point, not a flake. Every run
# prints token similarity + a word-level diff for the grinding loop.
#
# LANE PINNED, not inherited. `CODESCRIBE_LAYERED_TRANSCRIPTION` is a power-user
# key (not promoted to settings.json), so `Config::inject_file_env_for_runtime`
# copies it out of ~/.codescribe/.env into the process environment. An operator
# running their daily dictation on `phase1` therefore armed Layer 1 *inside this
# Layer-0 target* — and Layer 1 is supposed to diverge from Apple, so the bar
# went red for doing its job. Measured 2026-08-08, one binary, consecutive runs:
# LANE PINNED, not inherited. This key is now promoted to settings.json, but a
# test process still accepts an explicit env override. Before promotion, an
# operator's `phase1` leaked into this Layer-0 target — and Layer 1 is supposed
# to diverge from Apple, so the bar went red for doing its job. Measured
# 2026-08-08, one binary, consecutive runs:
# `Other: 1` → 0.931 PASS, then `Other: 22` → 0.833 FAIL. Explicit `off` also
# blocks the injection at source (it only fills keys absent from the env).
# pins the intended measurement at the process boundary.

# The lane the CALLER asked for — and it is exactly what the recipe pins below
# throw away. `make` cannot see a recipe-level `VAR=x cmd` assignment, but it
# does see `VAR=x make …` / `make VAR=x`, so `origin` separates "the caller
# pinned a lane" from "nobody asked". The operator's own `~/.codescribe/.env` is
# injected in-process by the core, never into this shell, so a daily `phase1`
# dotenv leaves this empty and the guard below stays silent for daily runs.
# is no longer an unpromoted injection path; the guard still rejects a caller
# request that contradicts the recipe's explicit lane pin.
ifneq ($(origin CODESCRIBE_LAYERED_TRANSCRIPTION),undefined)
PARITY_LANE_REQUEST := $(CODESCRIBE_LAYERED_TRANSCRIPTION)
endif
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
[![CI](https://github.com/vetcoders/codescribe/actions/workflows/rust.yml/badge.svg)](https://github.com/vetcoders/codescribe/actions/workflows/rust.yml)
[![Landing](https://img.shields.io/badge/site-vetcoders.github.io%2Fcodescribe-788c5d)](https://vetcoders.github.io/codescribe/)

**Native macOS tray dictation and assistive voice overlay: instant Apple-neural live canvas, Whisper filling the gaps on the go, lexicon correction last — append-only, never rewritten — plus quality tooling.**
**Native macOS tray dictation and assistive voice overlay: instant Apple-neural live canvas, Whisper repairing the same PCM-bound spans on the go, lexicon correction last — plus quality tooling.**

## Overview

Codescribe is a native macOS menu-bar application that captures audio through global hotkeys, shows live local
transcription while you speak, and pastes or routes the final result into the focused application. The shipped product
in this repo is a tray app whose SwiftUI front-end has two explicit surfaces: settings and overlays.

The transcription shape is layered and append-only (see `AGENTS.md`, the one rule): Apple Speech is the instant
letter-level live canvas; local Whisper transcribes partials on the go to fill the canvas gaps — it is not the live
engine and not a stop-time authority; lexicon correction by dictionary substitution is the final automated layer, and
The transcription shape is layered and span-bound (see `docs/THE_ENGINE_CONTRACT.md`): Apple Speech is the instant
letter-level live canvas; in Local Power mode, local Whisper transcribes partials on the go to repair weaker wording
inside the same proven audio spans — it is not a stop-time authority; lexicon correction by dictionary substitution is the final automated layer, and
human corrections feed the lexicon. Cloud STT is optional and used as a post-capture transcript backend, not as live
cloud preview. AI formatting and assistive mode use OpenAI Responses API (`/v1/responses`) by default, configured in
Settings or `~/.codescribe/.env`.
Expand Down
6 changes: 3 additions & 3 deletions app/controller/final_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
//! adopted onto the committed words (`punctuation_transplant`; word sequence
//! invariant at THIS stage
//! because shape is the deficit here — live word corrections belong to the
//! Layer 1 tail patch, which is a core element, on by default). When
//! Local Power's exact-span Layer 1 tail-patch lane). When
//! incomplete, only the uncommitted audio tail (from the last committed
//! utterance end) is transcribed and **appended** to the committed streaming
//! text. The doctrine behind all of this forbids TRUNCATING overlay text and
//! DROPPING transcripts the user already saw (the pre-0.8.0 full-replace
//! failure) — it does not forbid live correction of committed words.
//! Pair with `CODESCRIBE_LAYERED_TRANSCRIPTION` (orthogonal toggle) for live
//! Whisper tail-patches during hold — Smart does not force layered on.
//! Local Power arms live Whisper tail-patches independently of this stop
//! policy; the compatibility override is not a final-pass switch.
//! - **Off**: hard off at stop — zero Whisper invocation on the stop path;
//! streaming (+ post-process) is final.
//!
Expand Down
4 changes: 4 additions & 0 deletions app/controller/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1963,6 +1963,7 @@ mod tests {
compression_ratio: None,
quality_gate_dropped: false,
confidence_flags: vec![],
acoustic: None,
});
let sealed = snapshot_session_telemetry(&shared);
assert!(!sealed.pending_tail);
Expand Down Expand Up @@ -2022,6 +2023,7 @@ mod tests {
compression_ratio: None,
quality_gate_dropped: false,
confidence_flags: vec![],
acoustic: None,
};

sink.on_event(&utterance_final(1, 0.0, 3.2));
Expand Down Expand Up @@ -2076,6 +2078,7 @@ mod tests {
compression_ratio: None,
quality_gate_dropped: false,
confidence_flags: vec![],
acoustic: None,
};

sink.on_event(&utterance_final(1, 0.0, 3.2));
Expand Down Expand Up @@ -2133,6 +2136,7 @@ mod tests {
compression_ratio: None,
quality_gate_dropped: false,
confidence_flags: vec![],
acoustic: None,
};

// Near misses: the sibling receipt code, a truncation, an extension, a
Expand Down
32 changes: 20 additions & 12 deletions app/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ use crate::os::hold_badge::BadgeMode;
use crate::os::hotkeys::{self, HoldMode};
use crate::os::selection::{
AssistiveContext, capture_assistive_context,
capture_assistive_context_with_image_with_prior_frontmost, capture_frontmost_app_only,
capture_assistive_context_with_image_with_prior_frontmost,
capture_frontmost_app_only_with_prior_frontmost,
};
use crate::os::shortcut_registry;
use codescribe_core::asr_session::gateway_session_availability;
Expand Down Expand Up @@ -994,7 +995,8 @@ impl RecordingController {
let mut deferred_insert_failure = None;
let delivery = match disposition {
OverlayPasteDisposition::Paste => {
clipboard::paste_text(&paste_text).context("Failed to paste overlay text")?;
clipboard::paste_and_restore(&paste_text)
.context("Failed to paste overlay text")?;
OverlayPasteDelivery::Pasted
}
OverlayPasteDisposition::CopyAccessibilityDenied => {
Expand Down Expand Up @@ -2168,9 +2170,12 @@ impl RecordingController {
.clone()
.unwrap_or_default()
} else {
tokio::task::spawn_blocking(capture_frontmost_app_only)
.await
.unwrap_or_default()
let prior = self.pre_overlay_frontmost_app.read().await.clone();
tokio::task::spawn_blocking(move || {
capture_frontmost_app_only_with_prior_frontmost(prior)
})
.await
.unwrap_or_default()
};
*self.pre_overlay_frontmost_app.write().await = trigger_context.frontmost_app.clone();
*self.assistive_context.write().await = Some(trigger_context);
Expand Down Expand Up @@ -2434,9 +2439,12 @@ impl RecordingController {
.await
.unwrap_or_default()
} else {
tokio::task::spawn_blocking(capture_frontmost_app_only)
.await
.unwrap_or_default()
let prior = self.pre_overlay_frontmost_app.read().await.clone();
tokio::task::spawn_blocking(move || {
capture_frontmost_app_only_with_prior_frontmost(prior)
})
.await
.unwrap_or_default()
};
*self.pre_overlay_frontmost_app.write().await = trigger_context.frontmost_app.clone();
*self.assistive_context.write().await = Some(trigger_context);
Expand Down Expand Up @@ -3969,8 +3977,8 @@ impl RecordingController {
{
let lang_str = language_opt.map(String::from);
// W13-1: consume the inline-format buffer when armed — stop
// pays only for the unformatted tail; falls back to the classic
// full-text format when the buffer cannot prove coverage.
// closes only the unformatted tail. An active ledger mismatch
// fails open to complete L2 text, never a hidden full-text call.
let result = codescribe_core::llm::inline_format::format_text_with_inline_buffer(
&clean_text,
lang_str.as_deref(),
Expand Down Expand Up @@ -4025,7 +4033,7 @@ impl RecordingController {
info!("Formatting mode (Left Option): correcting transcript via AI");

let lang_str = language_opt.map(String::from);
// W13-1: inline buffer first, classic full format as fallback.
// W13-1: span-keyed inline close; active failure keeps full L2.
let result = codescribe_core::llm::inline_format::format_text_with_inline_buffer(
&clean_text,
lang_str.as_deref(),
Expand Down Expand Up @@ -4071,7 +4079,7 @@ impl RecordingController {
info!("Formatting mode (Toggle): correcting transcript via AI");

let lang_str = language_opt.map(String::from);
// W13-1: inline buffer first, classic full format as fallback.
// W13-1: span-keyed inline close; active failure keeps full L2.
let result = codescribe_core::llm::inline_format::format_text_with_inline_buffer(
&clean_text,
lang_str.as_deref(),
Expand Down
30 changes: 24 additions & 6 deletions app/controller/overlay_paste.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,40 @@ pub(super) fn overlay_paste_disposition(
OverlayPasteDisposition::CopyTargetMismatch
}

/// Whether a successful `activate` still counts when `NSWorkspace` has not
/// flipped yet. The overlay panel can keep the process named Codescribe after
/// Alacritty/Chrome actually took the key window — requiring a name match here
/// parks every auto-paste as ⌘⌥V.
pub(super) fn overlay_float_still_confirms_activation(
wait_confirmed: bool,
frontmost_after_activate: Option<&str>,
) -> bool {
wait_confirmed
|| frontmost_after_activate
.map(str::trim)
.is_some_and(|name| !name.is_empty() && target_is_self_app(name))
}
Comment on lines +139 to +151

/// Activate the latched ambulance and confirm it owns focus.
///
/// Codescribe (Agent window) is already this process — no activate. A foreign
/// app must both activate and match `NSWorkspace` within the budget. The
/// floating overlay can leave workspace still naming Codescribe; callers pass
/// this bit into [`overlay_paste_disposition`] so a confirmed Alacritty is
/// not vetoed as "frontmost is Codescribe".
/// app must activate. Matching `NSWorkspace` within the budget is sufficient
/// but not required when the overlay still names this process.
pub(super) fn confirm_latched_paste_target(target_app: Option<&str>) -> bool {
let Some(name) = target_app.map(str::trim).filter(|n| !n.is_empty()) else {
return false;
};
if target_is_self_app(name) {
return true;
}
crate::os::selection::activate_app_by_name(name)
&& crate::os::selection::wait_for_frontmost_app(name, OVERLAY_PASTE_FOCUS_BUDGET)
if !crate::os::selection::activate_app_by_name(name) {
return false;
}
let waited = crate::os::selection::wait_for_frontmost_app(name, OVERLAY_PASTE_FOCUS_BUDGET);
overlay_float_still_confirms_activation(
waited,
crate::os::selection::current_frontmost_app_name().as_deref(),
)
}

/// Park a refused synthetic paste in the process-local Paste Here slot.
Expand Down
1 change: 1 addition & 0 deletions app/controller/production_replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ mod tests {
compression_ratio: None,
quality_gate_dropped: false,
confidence_flags: Vec::new(),
acoustic: None,
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/controller/quality_delivery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub(super) struct ClipboardDeliverySink;
impl AutomaticDeliverySink for ClipboardDeliverySink {
/// Paste delivery path: type/paste corrected text into the frontmost app.
fn paste(&self, text: &str) -> Result<()> {
clipboard::paste_text(text).context("Failed to paste text")
clipboard::paste_and_restore(text).context("Failed to paste text")
}
}

Expand Down
Loading
Loading