Repository navigation
fix(library): a voice note's header heads a turn by the label a header that starts a block gives - #609
Conversation
…starts a block gives
A Word file of a voice note whose only empty paragraph stands before the
closing line ("Unknown 0:00", "Good morning.", "Unknown 0:09", "Shall we
start?", an empty paragraph, the closing line) reads as one turn, the
second header among the first turn's words. Its lines stand as those of a
one-turn export whose turn holds a line that ends in a time ("We meet at
10:30", "in the hall."), which must read as one turn, so the blank lines
cannot tell the two apart. The label can: Otter gives every header of a
voice note the same label, and a line of words gives one no header gives.
Read by a count of such lines against the blank lines, a note of two
turns whose first turn holds three lines that end in a time heads turns
said by "We meet at" and "Back by". In a Word file with no empty
paragraphs, "We meet at 10:30" straight before "Unknown 0:09" heads a turn
said by "We meet at" at 10:30, and the one-turn note's later lines head
one too. The test that pinned that reading as a limit now pins the
reading by labels, and pins the limit that comes with it: a second
speaker's header that starts no block reads as words.
…r that starts a block gives
A voice note's header was told from a line of words that ends in a time
by the blank lines alone: by a count of such lines against the blank
lines, and, where no blank line parts two lines of words, by the one
before the closing line. A Word file whose only empty paragraph stands
before the closing line read its second header into the first turn's
words, since its lines stand as a one-turn export's do; a note of two
turns whose first turn holds three lines that end in a time read them as
headers; and in a Word file with no empty paragraphs a line of words
straight before the next header headed a turn.
Otter gives every header of a voice note the same label: each public
export of one found gives "Unknown" on every header, a talk between two
people's too. A voice note's header now heads a turn where a block
starts, as before, and elsewhere, with words on the line straight after
it, when it gives a label a header that starts a block gives. A line of
words that ends in a time gives a label no header gives and is words. A
speaker Otter labels apart ("Speaker 2") still heads a turn where a
block starts; in a Word file with no empty paragraphs such a header
starts no block and reads as words, and the TSDoc states that limit
with its input. A time alone gives no label and is read by its blank
lines as before.
…at starts a block gives The library guide said a Word file whose only empty paragraph stands before the closing line reads as one turn, and that in a Word file with no empty paragraphs a line of words straight before the next header heads a turn said by "We meet at". It now gives the rule by labels with its inputs: both files read into their turns, a one-turn export of the same shape reads as one, and a later line of a turn that ends in a time is words with or without the blank lines. It states the limit that comes with it, a second speaker's header that starts no block reading as words in a Word file with no empty paragraphs, and that a text of times alone, which gives no label, is still read by its blank lines.
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Loose-header layout modes src/cognition/library/transcripts/otter.ts |
Layout definitions now distinguish placement-based headers, label-based headers, and layouts without loose headers. Helpers identify block starts and collect labels from headers at block starts. |
Turn recognition and transcript cases src/cognition/library/transcripts/otter.ts, src/cognition/library/__tests__/transcripts.test.ts, src/cognition/library/transcripts/word.ts, docs/features/LIBRARY_INDEX.md |
Turn recognition applies the layout rules and rejects headers immediately after another header. Tests and documentation cover time-like lines, repeated or unrecognized labels, and Word exports without blank paragraphs. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related PRs
- framerslab/agentos#553: Introduced the Otter header layouts and
turnsOfrules that this change extends.
Merge Risk: 
Minimal · up to ccc6d
-
The reviewed transcript changes are mergeable after normal checks.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title clearly identifies the main change: label-based detection of voice-note headers that start turns. It is somewhat long and grammatically awkward, but it is specific and related to the changeset.
Full details: Description check
-
Explanation
The description includes all template sections, explains the bug and fix, identifies linked issues, marks the change types, documents verification, and describes migration impact. Two checklist items remain unchecked, but the description is otherwise complete.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Reviewer's GuideFix Otter voice-note parsing by combining block detection with header-label continuity, ensuring time-shaped transcript lines remain words while recovering missing separators in text and Word exports; add comprehensive regression tests and document the resulting behavior and limits. Sequence diagram for parsing ambiguous Otter voice-note linessequenceDiagram
participant Input as Transcript
participant Parser as turnsOf
participant Blocks as startsBlock
participant Labels as blockLabels
participant Turns as HeadedTurns
Input->>Parser: Read lines with voice-note headers
Parser->>Blocks: startsBlock(lines, at)
Blocks-->>Parser: Block-start headers
Parser->>Labels: blockLabels(lines, voiceNoteLayout)
Labels-->>Parser: Labels from block-start headers
Parser->>Parser: Evaluate candidate header placement
alt Candidate starts a block or label is known
Parser->>Turns: Add headed turn
Parser->>Turns: Append following line as words
else Candidate has no matching block label
Parser->>Turns: Append line as words
end
Flow diagram for Otter voice-note header detectionflowchart TD
A[Read transcript lines] --> B[Identify candidate headers]
B --> C{Voice-note layout?}
C -->|No| D[Apply existing header rules]
C -->|Yes| E[Find headers that start blocks]
E --> F[Collect labels from block-start headers]
F --> G{Candidate starts a block?}
G -->|Yes| H[Start a turn]
G -->|No| I{Has label seen at a block start?}
I -->|Yes| H
I -->|No| J[Keep line as words]
H --> K[Next line remains header words]
J --> K
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
PR Summary by QodoFix Otter voice-note turn detection in text and Word transcripts
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR |
Summary
This follows up #553. Three kinds of voice note export still read wrong on master at e4aa628.
Unknown 0:00,Good morning.,Unknown 0:09,Shall we start?, an empty paragraph andTranscribed by https://otter.airead as one turn,Good morning. Unknown 0:09 Shall we start?. Before fix(library): an Otter export made without the speakers' names or without the times reads into its turns #553's last commit they read as two turns. The file's lines stand the same way as those of a one-turn export (Unknown 0:00,Good morning.,We meet at 10:30,in the hall., a blank line, the closing line), so the blank lines cannot tell the two apart.Unknown 0:00\nGood morning.\nWe meet at 10:30\nThen leave at 11:30\nBack by 12:30\nSee you there.\n\nUnknown 0:20\nGood.\n\nTranscribed by https://otter.ai\nread as four turns, two of them said byWe meet atandBack by. The reader counted such lines against the blank lines, and the count read the text as having no blocks. This is the failure from the review of fix(library): an Otter export made without the speakers' names or without the times reads into its turns #553 on its one-turn note, now in a text with a second turn.Unknown 0:00,Good morning.,We meet at 10:30,Unknown 0:09,Shall we start?and the closing line read as a turn byWe meet atat 630,000 ms, and fix(library): an Otter export made without the speakers' names or without the times reads into its turns #553 pinned that reading as a limit. The one-turn noteUnknown 0:00,Good morning.,We meet at 10:30,Then leave at 11:30,See you there.and the closing line read as two turns.The fix. Otter gives every header of a voice note the same label. Each public export of a voice note found gives
Unknownon every header, including a talk between two people (IceMan56/MET at 672354c9, Freda32/TalkMemo at d76a57c7). A voice note's header still heads a turn where a block starts. It now also heads one elsewhere when it gives the label of a header that starts a block, as long as words stand on the line straight after it. A line of words that ends in a time gives a label that no header gives, so it is words. The line straight after a header stays that header's words. A time alone gives no label, so a text of times alone is still read by its blank lines.Unknown, at 0 and 9,000 msWe meet at 10:30,in the hall.), as text and as a Word fileWe meet at 10:30straight beforeUnknown 0:09We meet atat 630,000 msUnknown, the firstGood morning. We meet at 10:30Unknown 10:30,The bus left at 9:09,Shall we start?Speaker 1andSpeaker 2with Otter's blank lines, as text and as a Word fileThe limit. The TSDoc and
docs/features/LIBRARY_INDEX.mdstate it, and a test pins it. If a speaker is labelled apart and their header starts no block, nothing tells that header from a line of words. In a Word file with no empty paragraphs,Speaker 1 0:00,Good morning.,Speaker 2 0:05,Hello.and the closing line now read as one turn bySpeaker 1; master read two. Otter labels a speaker it tells apart but cannot nameSpeaker 1orSpeaker 2(help centre), but no public export in a voice note's layout found gives any label butUnknown. With the blank lines Otter writes, each such header starts a block and heads its turn, and a test covers that. A time alone has the same limit because it gives no label: a Word file of0:04,Hello.,0:09,Good., an empty paragraph and the closing line reads as one turn, as a one-turn export of those lines does.Not changed here. Otter's own Word export does not write the layout of (1). It writes an empty paragraph after each turn's words except the last, and puts the closing line in the page footer. The export help article shows this in its example image, and so does a public export, the Brookings webcast transcript in JohnWBlack/fccps-ai-deliverables-governance at 810b9c92. mammoth 1.13.0 reads no footer (docx-reader.js). (1) is a Word file laid out from the text export.
Linked issues
Follows #553.
Type of change
How this was verified
I traced each input above through
turnsOfby hand.src/cognition/library/__tests__/transcripts.test.tspins every reading in the table and the limit. The test commit comes first and fails on master; the fix follows it. CI's Test & Lint job (type check, lint, tests) and the Browser tests job run them.Migration notes
None.
Checklist
!before the colon for a change that breaks users (feat!:orfeat(api)!:).Summary by Sourcery
Fix Otter voice-note turn detection across text and Word exports, especially when block separators are missing or transcript lines resemble headers.
Bug Fixes:
Enhancements:
Documentation:
Tests:
Summary by CodeRabbit