Skip to content

feat(recording): capture meeting audio over a WebSocket - #5738

Open
kaizawa97 wants to merge 1 commit into
kirodotdev:mainfrom
kaizawa97:pr/meetings-recording-core
Open

kaizawa97 wants to merge 1 commit into
kirodotdev:mainfrom
kaizawa97:pr/meetings-recording-core

Conversation

@kaizawa97

@kaizawa97 kaizawa97 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Record the whole meeting — the local microphone and the far side — to a plain WAV file in the user's own data directory.

The Meetings app transcribes a meeting but keeps no audio. Once the meeting ends, the transcript is the only record — a misheard sentence, a number the STT mangled, or a dispute about what was actually said cannot be checked against anything. And transcription only hears the local microphone: the other participants of a call (the audio the conferencing app plays back) never reach the app at all.

Why it matters

For any real meeting the far side is most of the content. Without capture of both sides and a durable recording, the notes are only as good as one microphone plus the recognizer's first guess, with no way to recover from either.

Not a goal

What changed (motivation → approach → change)

A meeting can now be recorded to audio.wav beside its notes, and a second recording in the same meeting gets its own file instead of erasing the first.

Area Change
Core socket src/kiro_crew/recording/ adds /api/ws/recording: audio in; only ready, level and error out. It refuses anything but a direct local request by default (recording.require_local_gateway, a new core config key), and config and storage work run off the event loop.
Files Each recording opens a new file — audio.wav, then the first free audio-<n>.wav — with exclusive create, so an existing recording is never opened for writing. One recording is capped at four hours of audio (about 461 MB); at the cap the file is finalized and the client is told why. A failure while finalizing the WAV is reported to the client and the audit trail.
App seam backend/recording_store.py is registered from register_routes, so core finds the per-meeting directory without importing the app; an id core cannot place is refused.
Browser useMeetingTranscription owns the one audio pipeline and tees each PCM block to the recording. The far side comes from audio/systemAudio.ts; the worklet sums the two inputs before main's polyphase resampler, so the mix is anti-alias filtered once and mic-only output is unchanged. Stop drains the worklet first, so the last moment of audio is kept.
UI Record and Stop recording live in the meeting toolbar's overflow menu. Record is enabled only while the capture pipeline is live; its item says, in visible text, that it opens a screen-share picker, or why it is disabled. A failed start releases the display share. Failures stay on screen in an ErrorNotice with an ask-the-agent hand-off.

Why a separate socket: /api/ws/stt caps a stream at 300 s, right for dictation and far too short for a meeting; the recording socket's only bound is its own size cap. Why local-only by default: raw room audio is the most sensitive artifact this app produces.

Wiring: the socket is registered in dashboard/routes/memory.py beside /api/ws/stt. The recording section lives in config/sections.py and is loaded by config/loader.py; config-baseline.json gains its two entries. The app manifest (appManifest.ts) adds the /api/ws/recording permission and one highlight (highlight_7). The recording strings are added to every catalog under website/src/i18n/locales/ (for example locales/en.json, locales/ja.json). The spec (docs/system-specs/modules/meetings.md) describes the socket contract, one file per recording, and the mixing.

Backwards compatibility

Compatible: the socket, the config section and the files are new; nothing main accepts today is rejected or renamed.

Tests

  • test/test_recording.py — WAV writer (exclusive create, header finalized) and the session state machine; next_audio_path numbering; name probing runs off the event loop.
  • test/test_recording_storage.py — the MeetingStore seam, and two sequential sockets for one meeting keep the first file byte-identical.
  • test/test_recording_ws.py — socket protocol, a forwarded request refused while local-only is on, config and store resolution off the event loop, no transcript on the wire, one concurrency cap, no STT-derived deadline, and the size cap (stops on a whole sample and keeps what fit).
  • website/src/test/pcmWorklet.test.ts — two-input mixing through the real processor: sum not average, clipping, mic-only identical, short blocks, a tone mixed through the FIR.
  • website/src/test/MeetingsRecording.test.ts, UseMeetingSessionCoverage.test.tsx, UseMeetingTranscriptionCoverage.test.tsx — the socket lifecycle, Record gated on live capture, system-audio release on every pre-ready failure, the persistent error notice.

Manual verification

Earlier end-to-end run against a harness gateway: opened the socket, received ready, streamed 2 s of 16 kHz mono PCM, stopped, and got a well-formed audio.wav (32000 frames) under the meeting's own data directory. Not yet re-run on this head. A real conferencing call's far-side audio is not verified here; that path is Electron-dependent and covered by #7196.

Screenshots / video

The frames below predate this head: Record and Stop recording have since moved from the toolbar into its overflow menu (main's two-buttons-per-row layout), and a recording failure now shows an inline error notice. A fresh capture from this head is still to come.

Meeting live, Record control shown

Recording in progress: Recording badge, level meter, Pause

Related Issues

no linked issue: part of the Meetings feature stack; the Electron system-audio capture in #7196 is stacked on this PR.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@kaizawa97
kaizawa97 requested review from a team and hoang-phan98 August 25, 2026 01:32
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Aug 25, 2026
@chenmingwei23 chenmingwei23 added the needs-pr-triage PR scanner: awaiting automated triage label Aug 29, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: bolichen97#bb3ad1ca]: This PR has been inactive for 7+ days with failing CI. I reviewed the blockers but they require your input:

  • This PR introduces a new core subsystem (src/kiro_crew/recording/, +5212 lines across 41 files), which is beyond the scope our automation will modify safely — per pipeline policy, PRs over 3000 lines adding a new subsystem are handed back to the author.
  • CI has real failures that need your attention: Backend Tests red on 3.10 and 3.12 (shards 1+2) and Windows (shard 2), plus Coverage Gate, Loop-Bound Locks Gate, and Cross-Platform Portability.
  • The branch also has a merge conflict with main and needs a rebase.

When you've addressed these, the pipeline will re-assess on its next cycle.

@bolichen97 bolichen97 added needs-author-decision PR blocked on author input and removed needs-pr-triage PR scanner: awaiting automated triage labels Aug 29, 2026
@bolichen97
bolichen97 enabled auto-merge August 30, 2026 00:01

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description / code mismatch

The Description, the spec, the module docstring, and the Manual verification section all describe the recording socket emitting redacted transcript events, but nothing on the socket's request path can produce one.

1. The recording socket never emits the redacted transcript events the Description says it emits

The Description says —

Interim/final transcript events emitted back to the browser are redacted first (recording/ws.py is a registered redaction sink in security_posture.py).

and, under Manual verification:

Confirmed interim level/transcript events were emitted back over the socket and passed through redaction.

The code does — _emit_transcript is the only place a partial/final transcript event is built and the only place the redactor is called, and api_ws_recording never calls it. No transcription is wired into this socket at all, so the redactor call is dead and no transcript event can reach the browser: src/kiro_crew/recording/ws.py:199. The PR's own frontend documentation agrees with the code rather than with the prose — the wire-protocol header in website/src/apps/meetings/hooks/useMeetingRecording.ts ("Wire protocol — conforms to kiro_crew/recording/ws.py:api_ws_recording") lists only ready and level coming back, while the backend module docstring claims the socket "emits ready, partial, final, level, and error events".

Risk — Four separate surfaces tell a reader that live transcription with credential/exfil redaction happens on this socket: the Description bullet, the spec's Recording section in docs/system-specs/modules/meetings.md, the recording/ws.py module docstring, and the Security Posture row. The panel therefore counts an egress boundary that no request can reach, and the drift guard cannot catch it — test/test_security_posture.py's TestRedactionSinkRegistry only checks that the named module contains a redactor call, so a dead one satisfies it. The sink registration is itself a consequence of the dead call rather than an independent problem: the guard forces any module calling a redactor into either _REDACTION_SINKS or NON_EGRESS_REDACTION_MODULES, so the entry had to be added once the unreachable call existed. What blocks is that the Manual verification bullet reports an observed outcome the code cannot produce, which leaves the rest of that section unreliable for a reviewer trying to decide what was actually exercised.

Required change — Either wire transcription into api_ws_recording so _emit_transcript is reached on the live path, or drop the claim: remove _emit_transcript and the now-unreachable persister path, remove the security_posture.py sink row with it, and correct the Description bullet, the spec's Recording section, the recording/ws.py module docstring, the test module docstring, and the Manual verification bullet to state that the socket carries audio in and ready/level/error out.

@bolichen97

Copy link
Copy Markdown
Contributor

Audit note — this PR and #7196 are one branch stack, not duplicates

A duplicate-detection sweep flagged these two as near-identical because they share a large block of added lines. They are not duplicates: one branch contains the other's commits, so the shared lines are inherited, and the review diff overstates what this PR actually authored.

This is the textbook stacked-branch artifact, provable by SHA rather than by reading code: git rev-parse pr/5738 = 4bb2f16 and git rev-parse pr/7196^ is the SAME sha, off the same merge base abc8222. git log <mb>..pr/7196 is exactly two commits (4bb2f16 then 375f708) while git log <mb>..pr/5738 is exactly one (4bb2f16). So #5738's entire 41-file/+5212 diff appears verbatim inside #7196's three-dot diff, and the 41 shared files are a STRICT SUBSET of #7196's 47 (comm -23 on the two files.tsv is empty). Only #7196's own commit -- 22 files, +597/-15, none of them backend -- is its own work, and it is strictly additive: it never rewrites a line #5738 wrote, it extends #5738's systemAudio.ts, SYSTEM_AUDIO_KEY and meetings.md Recording section on top. Neither PR duplicates the other's behaviour: #5738 is the backend recording subsystem plus browser capture, #7196 is the Electron main-process loopback grant, and #5738 touches no file under website/electron/ at all.

What is genuinely each PR's own

If #5738 merges, #7196 still carries all of its own work and loses nothing: 6 files #5738 never touches (website/electron/display-media.js +102, main.js +35, preload.js +27, electron/test/display-media.test.js +95, website/src/apps/meetings/audio/captureTier.ts +95, website/src/test/MeetingsCaptureTier.test.ts +171), plus its 35-line extension of systemAudio.ts, the 3-line no-loopback row in SYSTEM_AUDIO_KEY, one catalog key in 13 locales and 36 lines of spec. That is the whole capability of granting real system audio in the desktop shell and degrading to mic-only where the platform cannot -- unlanded and unduplicated. The dependency runs one way only: #7196's own commit CANNOT apply to main alone, because website/src/apps/meetings/audio/ does not exist on origin/main (git ls-tree empty) and SYSTEM_AUDIO_KEY/sysAudioUnsupported have zero hits there, so the files it modifies are created by #5738. Correct sequencing is #5738 first, then #7196 rebases; #7196 merging as-is would simply carry #5738's commit in with it, which is not redundancy but the base of the stack.

Suggested action

This is the base of the stack — it can go first on its own. #7196 should rebase after it lands.


From a repository-wide duplicate/overlap audit of every pull request open against main (2026-09-02, 330 PRs, one reviewer per PR). Each PR was read as its full merge-base diff plus its description and every comment and review, then compared against each candidate PR's own diff and against origin/main at 1a765b88ceb7. This PR is not being closed — the note is informational. If the reading is wrong, please correct the reasoning rather than just the conclusion.

@bolichen97

Copy link
Copy Markdown
Contributor

Open PR relationship audit

This is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion.

Relationship findings

  • This PR is OVERLAPPING with PR #5741. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #5738: CONTINUE_DEVELOPMENT. Complementary halves of meeting-audio support with no behavioural duplication; the only interaction is a mechanical co-edit of security_posture.py, register_routes and the meetings spec. Files: src/kiro_crew/security_posture.py, src/kiro_crew/apps/builtins/meetings/backend/routes/__init__.py, src/kiro_crew/recording/writer.py.
  • This PR is OVERLAPPING with PR #7194. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #5738: CONTINUE_DEVELOPMENT. Independent Meetings features that collide only on shared surfaces (the toolbar, the session return object, the manifest highlight numbering and 13 locale catalogs). Both should land; the second to land renumbers its highlight and resolves the toolbar conflict. Worth noting for the author because the app.json/appManifest.ts collision auto-merges without a conflict marker and would ship a mismatched App Store highlight list. Files: src/kiro_crew/apps/builtins/meetings/app.json, website/src/apps/meetings/MeetingView.tsx, website/src/apps/meetings/hooks/useMeetingSession.ts.
  • This PR is OVERLAPPING with PR #7196. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #5738: CONTINUE_DEVELOPMENT. A branch stack, not a duplicate: PR #5738 is the base and PR #7196 is the dependent. Land PR #5738 first and have PR #7196 rebase onto it. Closing PR #5738 in favour of PR #7196 would be closing the base in favour of the tip and would silently make the whole 5212-line backend subsystem land under the wrong review. Files: src/kiro_crew/recording/ws.py, website/src/apps/meetings/audio/systemAudio.ts, website/src/apps/meetings/hooks/useMeetingSession.ts.

No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit.

@bolichen97

Copy link
Copy Markdown
Contributor

@kaizawa97 We audited every open PR against main today, and this one is worth finishing rather than closing.

Nothing on main covers it: no src/kiro_crew/recording/ package, no /api/ws/recording route, no recording.require_local_gateway config key, no website/src/apps/meetings/audio/ directory, and no Recording row in security_posture.py. Merged #5741 added the opposite direction (backend/routes/audio_import.py ingests an audio file someone else already made) and captures nothing. #7196 is stacked directly on this head, so closing this would strand it.

Four things are outstanding:

  1. The CHANGES_REQUESTED review is unaddressed. _emit_transcript in src/kiro_crew/recording/ws.py is never called by api_ws_recording, so the redaction claim in the PR body, docs/system-specs/modules/meetings.md, the module docstring and security_posture.py describes a boundary no request can reach.
  2. Rebase. The branch is 2066 commits behind and conflicted. The non-trivial hunks are src/kiro_crew/apps/builtins/meetings/backend/routes/__init__.py (rewritten by merged feat(meetings): import a recording into a meeting #5741), src/kiro_crew/dashboard/routes/memory.py (its /api/stt/install anchor no longer exists on main), and website/src/apps/meetings/MeetingView.tsx.
  3. The manifest highlight needs to become highlight_8: main already carries six, and feat(meetings): add a per-meeting note the user owns #7194 claims highlight_7. app.json's permissions.api array also conflicts textually with feat(meetings): add a per-meeting note the user owns #7194, since both add a line right after /api/ws/stt.
  4. fix(voice): preserve dictation and stream local speech reliably #9246 replaces website/public/pcm-worklet.js with a polyphase FIR resampler that reads only inputs[0], and it sits at main's tip. Your two-input mix will need re-implementing on top of it, not rebasing.

One smaller item: MAX_CONCURRENT_SESSIONS has two sources of truth, session.py and ws.py's own _MAX_CONCURRENT_SESSIONS.

Audited at 4bb2f16.

Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: recording a second time in a meeting erases the first recording's audio.wav

Every recording in a meeting writes to the same file, and the writer opens it in truncating mode:

  • src/kiro_crew/recording/session.py:130-132: audio_path = self.storage_dir / "audio.wav", then WavWriter(audio_path) and await self._writer.open(). The name is fixed and nothing checks whether the file already exists.
  • src/kiro_crew/recording/writer.py:68: self._wf = wave.open(str(self._path), "wb"). This truncates the file.
  • src/kiro_crew/recording/ws.py:377: every start on a new socket resolves meeting_id to the same meeting directory. The only guards are the per-socket "already started" check and the concurrency cap of one. Neither applies once the first socket has closed.

The UI offers Record again as soon as a recording ends. website/src/apps/meetings/MeetingView.tsx:190 shows it whenever status === 'active' && !recording.active. The paths that reach it:

  1. The socket drops (laptop sleep, network blip, 30 s heartbeat). The user sees "Recording stopped: the connection dropped." and clicks Record. If they click within about 30 s, the start can be refused with a 503 while the old session is still registered. The next click then succeeds and truncates the file.
  2. Stop recording, then Record.
  3. Close to review, go back to active, then Record. Or End, Restart, then Record. useMeetingSession.ts:560 calls rec.stop() in both cases.
  4. With stt.provider = "transcribe", the socket closes at 300 s and the toast says "The audio up to that point is saved." Clicking Record to continue deletes that audio.

The PR already knows about this for pause. useMeetingSession.ts:538 says "the next start would open audio.wav in the same directory again". But only a meeting pause is protected. The comment at useMeetingRecording.ts:222 says a new socket writes "a second file", but it actually reopens the same one. Checkers reproduced the problem end to end with the real api_ws_recording and MeetingsRecordingStore. They recorded 3.0 s, then recorded again on a second socket with the same meeting_id, and audio.wav ended up 0.5 s long.

This affects anyone who enables the Meetings app and records more than once in a meeting. There is no warning, and the lost audio can't be recovered.

Smallest fix: never open an existing recording with "wb". Either give each recording its own file (update AUDIO_FILENAME in recovery.py:34 and the spec's file table to match), or refuse start when audio.wav exists and hide Record in that case. Add a test that runs two sequential sockets with the same meeting_id and checks that the first recording is still intact.

From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong.

auto-merge was automatically disabled September 30, 2026 09:59

Head branch was pushed to by a user without write access

@kaizawa97
kaizawa97 force-pushed the pr/meetings-recording-core branch from 4bb2f16 to fc8f7c6 Compare September 30, 2026 09:59
@kaizawa97
kaizawa97 requested a review from a team as a code owner September 30, 2026 09:59
@kaizawa97

Copy link
Copy Markdown
Contributor Author

Re: a second Record erases audio.wav (review of 2026-09-25) — fixed in fc8f7c6.

Every recording now gets its own file: audio.wav for the first, then the first free audio-<n>.wav. WavWriter.open creates the path exclusively ("xb"), so nothing existing is ever opened for writing, and a name race fails the start with an error frame instead of truncating. ready reports audio_file, and recovery scans audio*.wav.

Regression: test/test_recording_storage.py::test_a_second_recording_of_the_same_meeting_keeps_the_first runs two sequential sockets for the same meeting (3.0 s, then 0.5 s) and asserts the first file is byte-identical with 48000 frames; writer, session and recovery unit tests pin the rest.

@kaizawa97

Copy link
Copy Markdown
Contributor Author

Re: _emit_transcript is never called, so the redaction claim is false (review of 2026-09-02) — fixed in fc8f7c6 by dropping the claim rather than wiring it.

The socket now carries audio in and emits only ready / level / error. Transcription belongs to /api/ws/stt, which already receives the same PCM from the same pipeline, so a second recognizer here would duplicate the work (and Transcribe billing) for an identical result. Removed _emit_transcript, the live-transcript persister, transcript_local.json and the security_posture.py sink row; the module docstrings, the spec's Recording section and the PR description say the same. test_recording_ws.py::TestNoTranscriptOnTheWire pins that no transcript or redactor exists on this path.

@kaizawa97

Copy link
Copy Markdown
Contributor Author

Re: the manifest highlight should be highlight_8 — kept at highlight_7, with evidence.

website/scripts/check-app-manifest-sync.mjs requires highlight keys to be 1-indexed with no gaps and to match app.json's bullet count. main carries six highlights today and #7194 (which would take the seventh) has not merged, so highlight_8 fails that gate on current main. Whichever of #5738 / #7194 lands second renumbers its key.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • Transcribe-gated 300 s cap on a non-transcribing socket span=ae670801efd5

fixed in 7ca088a.
/api/ws/recording no longer reads stt.provider or carries any duration deadline; a recording's only bound is its own size cap (four hours of audio), independent of the STT choice.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • Ship only the MeetingStore registry, not the dead recovery flow span=8351b922f999

fixed in 7ca088a.
The detect/resume/discard recovery API, its terminal states, title field, exports, spec text and tests are removed; recording/recovery.py keeps only the storage resolver registry the socket uses.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • The 5-minute cap ends a recording with only a toast span=d2506fc3ff36

fixed in 7ca088a.
The five-minute cap is gone. The one remaining bound, four hours, finalizes the file and reports recording size limit reached as a server error, which the meeting view keeps on screen in its error notice.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • Record never says it opens a screen-share picker span=88801bcb1122

fixed in 7ca088a.
The Record menu item shows the hint as visible secondary text, so the picker is announced before the click.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • Disabled Record gives no reason span=0e83f62e9313

fixed in 7ca088a.
When disabled, the item shows why (capture not supported, or transcription not live) as visible text and as its hover title.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • System-audio icon is icon-only span=837e35b8095b

fixed in 7ca088a.
The icon carries a localized hover title (meetingAudioOn) in addition to its accessible label.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • Recovery surface with zero consumers span=b1a2847e110c

fixed in 7ca088a.
Deleted: the zero-caller recovery functions, adapter methods, states and their tests. Only the registry ws.py reads remains.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • Duration cap inherited from stt_stream.py span=180eedb422e8

fixed in 7ca088a.
Removed; this socket bills nothing to Transcribe. The replacement bound is a size cap derived from the longest meeting the app allows.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • Dead crash-recovery surface span=91c60cd26b6f

fixed in 7ca088a.
Removed with the recovery API above; grep finds no remaining caller or export of the deleted names.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • Transcribe duration cap on a non-transcribing socket span=edc0556b7715

fixed in 7ca088a.
Removed; the description no longer claims a per-provider cap.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • STT selection truncates recordings at five minutes span=88bd4e171396

fixed in 7ca088a.
The provider-derived deadline is removed (TestNoDurationCap pins that ws.py no longer reads cfg.stt.provider).
A recording is bounded instead by _MAX_RECORDING_BYTES (four hours of 16 kHz Int16 mono, ~461 MB, under the RIFF 4 GiB limit): at the cap the socket writes what fits on a whole sample, finalizes, and reports why.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • Stop drops the final partial PCM batch span=58cc89c3ca4c

fixed in 7ca088a.
The PCM worklet gains a non-terminal drain message; recording stop awaits it before closing, so the last partial batch reaches the socket. Covered in pcmWorklet.test.ts and MeetingsRecording.test.ts.

@kaizawa97

Copy link
Copy Markdown
Contributor Author
  • WAV finalization failures are swallowed span=6547768c8fe9

fixed in 7ca088a.
WavWriter.close keeps the first finalization error and re-raises it after cleanup; the socket reports recording finalization failed to the client and records the failed outcome in the audit trail.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 30, 2026
Adds a recording package that owns an audio session: a state machine
per session, a WAV writer, and recovery scaffolding for a session whose
process died mid-recording. The dashboard exposes it at
/api/ws/recording, and the Meetings app resolves where a recording lands
through its own recording store.

The socket carries audio IN and emits only ready / level / error back.
It does not transcribe: the browser already streams the same PCM to
/api/ws/stt and the Meetings app persists that transcript, so the
never-reached transcript path (_emit_transcript, the live-transcript
persister and its security-posture sink row) is removed rather than
kept as a claim no request could satisfy.

Every recording of a meeting gets its own file -- audio.wav, then
audio-2.wav, ... -- and the writer creates it exclusively ("xb"). The
previous fixed name opened with "wb" truncated the earlier recording
the moment a user recorded a second time (stop then Record, a dropped
socket, the Transcribe duration cap). `ready` names the file so a client
can tell recordings apart.

The frontend captures both the microphone and the system output and
sums them inside the PCM worklet's two inputs ahead of main's polyphase
resampler, so the mix is anti-alias filtered once; a single-input node
(dashboard dictation) is unaffected. A meter shows input level so a
user can see the capture is live.

The session registry lock is a LoopBoundLock and the concurrency cap
has a single definition in session.py.
@kaizawa97
kaizawa97 force-pushed the pr/meetings-recording-core branch from 7ca088a to ce2db28 Compare September 30, 2026 13:10
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 30, 2026

Copy link
Copy Markdown
Contributor

Open-PR triage (2026-10-05): rebase needed, plus one blocking config bug

I checked the full diff of this PR (ce2db2833c, merge base aec81410e) against origin/main (af1eb612da) and the merged PRs.

Relationship: DISTINCT from main. Not covered by anything merged. main still has no src/kiro_crew/recording/, no /api/ws/recording, no recording.require_local_gateway and no website/src/apps/meetings/audio/. Merged PR #5741 imports an existing audio file. It captures nothing. Merged PR #9246 is the polyphase worklet this head already builds on. Recommendation: REBASE + CONTINUE-DEVELOPMENT. Do not close.

Rebase

  • The branch is 721 commits behind main. git merge-tree shows one textual conflict: config-baseline.json. All other files, including loader.py, sections.py, routes/memory.py, the meetings routes/__init__.py and the 13 locale catalogs, auto-merge.

Blocking bug (independently confirmed; same as the GPT review's F1, so no separate change request)

  • src/kiro_crew/config/loader.py:4476 has to_dict() emit "recording": asdict(self.recording). But load() (around loader.py:4193, next to stt=_build_stt_config(stt_data)) never builds recording=. Also, "recording" is missing from _KNOWN_CONFIG_SECTIONS (src/kiro_crew/config/resolution.py:40-90). The result:
    • The operator's recording.require_local_gateway: false is never applied.
    • The next save() overwrites it with true. The _extra_sections restore only fills keys that are missing, and this one is not missing.
    • test/test_config_extra_sections.py::test_known_sections_equals_emitted_sections fails, because emitted keys ≠ known keys.
    • The failure is fail-closed: remote capture stays refused. So this is not a security P0, but the opt-out is broken and the user's config value is lost.
  • Fix: add "recording" to _KNOWN_CONFIG_SECTIONS. Then parse and construct RecordingConfig in load(), with a round-trip test.

Overlap (merge-order discussion, not duplicates)

Still outstanding from the bots: Design/UX BLOCK because the description has no screenshots from the current head.

@dodgeblaster

Copy link
Copy Markdown
Contributor

Steward review (no merge). This PR is the canonical implementation attempt for #2814 but, as written, conflicts with two premises stated in that issue, and the three maintainer questions behind it are still unruled:

  1. On-disk retention. The PR persists the mixed audio to disk as audio.wav in the meeting directory (src/kiro_crew/recording/session.py:54, written via WavWriter at session.py:160). Issue feat(meetings): capture computer audio alongside the microphone #2814 explicitly asks that raw audio not be retained.
  2. Silent mic-only fallback. A cancelled picker / denied permission / missing audio track is swallowed in website/src/apps/meetings/audio/systemAudio.ts (returns reason: 'cancelled' etc.) and surfaced as an info notice while the recording continues microphone-only (website/src/apps/meetings/hooks/useMeetingSession.ts). feat(meetings): capture computer audio alongside the microphone #2814 says it must not silently continue mic-only after the user selected both sources — it should move to idle/paused with an actionable explanation.

Also mechanical: the branch is currently CONFLICTING with main.

These are design decisions the issue flags as a maintainer call (platforms, consent UX, recording-others policy, retention). Leaving as-is pending that ruling — not merging.

@bolichen97

Copy link
Copy Markdown
Contributor

Thanks for this PR. It now conflicts with main. Could you rebase onto the latest main and resolve the conflicts? We will review it again once it is rebased and CI is green.

This branch has had no activity for over 30 days. If there is no further activity in the next 14 days, we may close it. You can always reopen it or open a new PR later.

gbrunoo pushed a commit to gbrunoo/KiroCrew that referenced this pull request Nov 9, 2026
Proposes answers to the three maintainer questions left open in kirodotdev#2814
(platform scope, capability reporting, consent boundary), backed by
measurements of getDisplayMedia system audio in Chrome and in the
Electron shell, and a phased plan whose first phase mixes the computer
audio with the microphone ahead of the existing worklet so the STT
protocol and the server stay unchanged. Records the Electron-on-macOS
gap (electron/electron#47490) as out of scope and names the two open
PRs (kirodotdev#5738, kirodotdev#7196) that conflict with the issue's premises.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge needs-author-decision PR blocked on author input readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants