Skip to content

A recording source syncs a meeting's transcript as timestamped sections - #248

Merged
zlareb1 merged 5 commits into
mainfrom
feat/knowledge-source-transcripts
Nov 4, 2026
Merged

zlareb1 merged 5 commits into
mainfrom
feat/knowledge-source-transcripts

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Related: #215
Related: #235
Related: #245
Related: #247

Changelog category (leave one):

  • New Feature

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

A repository's maintainers can register a recording document source (provider: meet with meeting space ids, or provider: zoom with meeting ids): the sync worker writes each recording's transcript into the repository's documents as one # mm:ss–mm:ss: <first words> section per five minutes, with each speaker turn as <speaker>: <text>. A recording whose transcript is not finished yet is counted under no_transcript, checked again on each pass for a day after the meeting and then on each periodic full listing, and written once the store has it; Loom transcribes nothing, and a credential whose token carries any scope beyond reads is refused.

Why

Meeting recordings are where many design decisions are explained; a deck whose decision slides are pictures often has its reasons only in the meeting that presented it. The knowledge plane pulls shared folders (#235) and a project tracker's documents (#245) but not a meeting store. This adds the recording kind on the same registry, probe and sync contracts, reading only the store's own transcript.

Clients (server/clients/recording.py), checked against the vendors' public API references:

  • meet: the credential is an OAuth authorized_user JSON file (client_id, client_secret, refresh_token). The store's REST API takes user authentication only, so a plain service account key cannot read it. The refresh token is exchanged with the refresh_token grant. A turn reads each space (spaces.get, which gives the canonical spaces/<id> used in the filter) and lists its conference records (conferenceRecords.list, filter=space.name = "spaces/<id>", plus AND end_time >= "<stamp less a day>" on an incremental turn). Records still running have no endTime and are left out. For a record not stored yet it lists the transcripts, the participants (for display names) and each transcript's entries (transcripts.entries.list). A record's transcripts are merged into one document, its sections in time order, and LOOM_KNOWLEDGE_SOURCE_SYNC_MAX_FILE_BYTES bounds their text together.
  • A meet record is read only once every one of its transcripts is FILE_GENERATED. The reference defines ENDED as "the transcript session has ended, but the transcript file hasn't been generated yet" and says nothing about whether the entries are complete then; the entries page only warns that they "might not match the transcription found in the Google Docs transcript file". So ENDED is not trusted. A record's revision does not change once it is written, so a record is not written while any of its transcripts is unfinished.
  • zoom: the credential is a server-to-server app's JSON (account_id, client_id, client_secret), exchanged with the account_credentials grant at the token endpoint with Basic auth. A turn lists a meeting's ended instances (past_meetings/{id}/instances). For an instance not stored yet it reads the recording (meetings/{uuid}/recordings, the uuid encoded twice when it starts with / or holds //, as the reference asks) and downloads the TRANSCRIPT file (WebVTT) of recording_files. The media files are never fetched.
  • Read-only credentials. Both token exchanges read the answer's scope and refuse the credential (CredentialRefused) when it holds anything beyond reads: for meet anything but meetings.space.readonly, for zoom any scope that is not <resource>:read…. An answer that names no scope is refused too (fail closed): add and rotate answer CREDENTIAL_REFUSED, check answers reachable: false with that summary, and a turn ends credential_invalid, so a stored credential can never change the store.
  • Every host is a constant. The bearer token goes to a transcript download link only when it is https on zoom.us or a subdomain of it. Ids are checked against the stores' alphabets before they go into a path or a filter. Errors carry the HTTP status, never a response body, which names meetings and people. Nothing retries.
  • The rate-limit test is the shared-folder client's (gdrive.rate_limited, now public), so the Google endpoints recognise the same quota reasons and the OAuth error string. Folding the meeting and folder clients' error classes and request helpers into one shared module is left for a follow-up; this PR only stops the rate-limit rules from drifting.

Conversion (server/knowledge/domain/transcripts.py, pure):

  • Timed entries come from the entries API (offsets from the record's start, text and speaker names whitespace-normalised) or from WebVTT. The VTT parser skips a BOM, unescapes entities, ends a cue that runs into the next one without a blank line, and skips a cue whose timing cannot be read. It takes the speaker from <v Name>, or from a leading Name: only when most of the file's cues start that way, so Note: … in a file without speakers stays text.
  • The entries become one # mm:ss–mm:ss: <first eight words> section per five minutes, and inside a section one paragraph per speaker turn.
  • A line that would read as Markdown structure (#, >, |, <, a fence, a Setext underline) is escaped, so a speaker's words cannot cut a section.
  • The chunker then cuts at the minute, and each chunk's section path carries its time, so a citation of a chunk names when it was said.

Sync turn (server/knowledge/app/source_sync_recording.py). The kind has its own turn module, chosen by source_sync._turn_of like linear's, and built on the public helpers #245 made shared: start_waits, full_due, capped, sync_item, give_up, wait, require_current, write_document, client_error. The folder and tracker turns are unchanged and their tests pass untouched; source_sync.py gains only the dispatch branch. The helpers apply as for the other kinds: revision skip, pass bound, waits for a failure that may pass, give-up for a refusal or a size over LOOM_KNOWLEDGE_SOURCE_SYNC_MAX_FILE_BYTES, another writer's address skipped, and turn-level failures for the token exchange, the listing, a 401 and a rate limit.

  • Revision and listing. The revision is the meeting's end (meet) or the instance's start (zoom), so a stored transcript is never fetched again. Neither listing says whether a recording has a transcript (records and instances carry no artifacts), so a recording not stored yet costs one check; the APIs offer no cheaper test.
  • No transcript. A recording with no finished transcript is counted unconverted under no_transcript, not as an error.
    • Until a day (SETTLE_S) after its revision it has no wait entry and is checked again whenever listed. The check is given back to the pass bound (it fetched no document), so recent unrecorded meetings never hold back a recorded one behind them.
    • After that it is given up on its revision like a refused file: later passes skip it without a call, and the existing retries check it once more on each completed periodic full listing and on a full sync request.
  • Off-host transcript. A transcript whose download link is off the store's hosts is given up on under transcript_off_host.
  • Late transcripts. An incremental listing reaches a day behind the stamp, since a store finishes a transcript some time after the meeting.
  • 30-day window for zoom full listings. A zoom full listing, and its probe, read the instances that started in the last 30 days (ZOOM_LISTING_DAYS). Without a window, every unrecorded instance of a long recurring meeting (the instances list reaches 15 months back) would cost a check on each full listing's retry. It is a constant, not a setting: it matches meet, which deletes conference records 30 days after the meeting, so both providers read the same window, and nothing on a deployment would tune it. Documents already written from older instances stay.
  • A space or meeting the account cannot read. One the account no longer sees or may not read (a 404 or a 403 on its listing) ends the turn failed with space <id>: http_403 (or http_404, or meeting <id>: …), keeps the stamp and retires nothing, while the other ids' recordings are written. Only the token exchange or a 401 marks the credential invalid. A probe of such an id fails: add and rotate answer SOURCE_UNREACHABLE naming it, and check answers reachable: false with that summary. Every error of a space's listing names the space id the source was configured with (space <id>: http_<status>); the canonical spaces/<id> name is used only in the filter.
  • One copy per recording. Two configured ids can name one space (its id and its meeting code); the listing keeps the first copy of each recording, so none is fetched or written twice.
  • No retirement by absence. Both stores delete recordings and transcripts on their own retention schedule (a conference record 30 days after the meeting), so a recording the store no longer lists is not positive evidence that anyone removed it, and its document stays. A recording's document goes with remove(delete_documents=true) or knowledge.delete.
  • What each document carries.
    • Address: the store's API address of the recording (https://meet.googleapis.com/v2/conferenceRecords/<id>, https://api.zoom.us/v2/meetings/<uuid>/recordings). It is unique, stable and known at listing time, so the skip needs no fetch.
    • Title: Meeting <start> (meet) or Meeting <meeting id> <start> (zoom).
    • ingested_format: transcript.
    • Tags source-kind:design_doc, repo:<id>, source:<name>, so decision extraction treats a transcript like a design document.
    • Actor worker:knowledge-source-sync, source_class=imported, user_id/agent/session_id -.

Probe: the credential exchange (with the scope check), each id read, and the recordings listed (counted, the first 1000; up to five titles).

Speaker names and the knowledge plane's rules. Speaker names are transcript text like any other and get no new handling. What applies, checked against the tree:

  • Synced documents are in loom.documents / loom.chunks, already in the erasure census (server/erasure/store/census.py).
  • They are written with user_id='-', so a namespace erasure removes them and an erasure scoped to one user does not.
  • The document write path has no sensitivity check; the sensitivity rules cover conversations and memory, not knowledge.upsert.
  • A speaker's words are removed by deleting the document (knowledge.delete), and at the store, or the next full listing writes them again.
  • Decision rows. loom decisions extract, and the per-sync mining in the open A changed document is mined for decisions on the next sync pass #239, can mine a transcript into decision records that quote a speaker. Deleting the transcript leaves them; memory.delete of each decision's row (which retires its record), or the namespace's erasure, removes them.

docs/features/knowledge.md says all of this.

Departures from the design this follows, each a call made on the code:

  • The design listed no_transcript as a turn status. It is an unconverted_reasons entry instead, as the per-file reasons already are: a turn whose other recordings were written is ok, and a status would hide a real failure of the same turn.
  • The design named "the recording URL" as the address. Neither listing gives a viewer link (the share link comes with the recording read, after the skip check), so the address is the store's API address of the recording.
  • No retirement by absence for this kind (above); the design's removal rule assumed a store that keeps what it lists.

Scope and risk

  • Touches:
    • New modules: the meeting-store client, the kind's turn module and the transcript converter.
    • parse_config and the probe table for the kind, and the _turn_of branch.
    • gdrive._rate_limited made public as rate_limited.
    • The repository card's labels (frontend/src/lib/knowledgeSources.ts, from The repository card shows and manages its document sources #247): a recording source reads "meeting transcripts", with a credential label for rotate. The card's add form still serves gdrive only; a recording source is added with knowledge.source.add, as a linear one is.
    • Wire descriptions.
    • Docs: docs/features/knowledge.md "A recording source", security.md, and rolling-upgrades.md rule 28.
  • Leaves alone: speech-to-text (a recording without a transcript is listed, never transcribed), audio and video, the dashboard's add form, the folder and tracker turns.
  • Tenant isolation: every statement is keyed by the source's own (org, namespace), as before.
  • Security:
    • The stores' hosts are constants.
    • A transcript download sends the token only to the store's https hosts, and httpx drops Authorization on a cross-origin redirect.
    • A stored credential can only read: one whose token carries any other scope is refused.

Compatibility, rollout and rollback

  • Wire: knowledge.source.add accepts kind: recording with config: {provider: meet | zoom, ids: [1-20]}. The descriptions of kind, config and credential on add and rotate are updated (SDK and reference regenerated). No field added or removed.
  • Operator steps: none. The worker still runs only where LOOM_KNOWLEDGE_SOURCE_SYNC_ENABLED is on.
  • Rolling upgrade (docs/architecture/rolling-upgrades.md rule 28): no schema change.
    • N-1 refuses to add a recording source (BAD_KIND) and still lists and inspects one.
    • N-1's check and rotate of one answer a server error, since it has no probe for the kind.
    • An N-1 worker that takes such a source's turn reads it as a shared folder (its _turn_of default), finds no service account key, and ends credential_invalid before any request, retiring nothing. N's next turn writes the real status.
  • Rollback: recording sources stay as registry rows, which a reverted build handles as above; their documents stay as ordinary documents.

Tests

No live vendor credentials exist: every store response in the tests and in the end-to-end run is written by hand (httpx MockTransport), never a recording of real content. The request and response shapes were checked against the vendors' public API references: records list, transcripts, entries, participants and spaces; the server-to-server token request; the past-instances list; the recordings read and its recording_files.

  • tests/unit/test_knowledge_source_recordings.py (new; 28 test functions, 37 cases with their parameters), on the in-memory world of test_knowledge_source_sync.py:
    • Config: prefix stripped, numeric ids, duplicates, bounds, unknown keys and providers.
    • Conversion:
      • The five-minute sections and merged speaker turns.
      • Structure escaped, < included, and minutes past 59.
      • A voice span as speaker.
      • VTT with a BOM, an entity, an unreadable timing and a run-on cue.
      • A Note: line not taken as a speaker.
      • A Meet speaker name with a newline and # read as one line.
    • Clients:
      • The zoom token request's grant and Basic header, and uuid encoding.
      • The download host check.
      • A refused refresh token.
      • Read-only scope refusal for both stores (an extra scope, a write scope, an empty or missing scope).
      • A quota reason in a 403 read as a rate limit.
    • meet turn: a timestamped document with display names and normalised text. A recent record with no transcript is counted under no_transcript with no wait entry. The next turn's filter reaches a day back, skips the stored record by revision and writes the one whose transcript arrived.
    • Unfinished meet transcripts: ENDED, STARTED, a mix, and none are not read.
    • A settled recording without a transcript is given up and not checked on the next pass; a full request reads it once its transcript exists.
    • documents_per_pass=2 with three unrecorded instances ahead of a recorded one, recent and settled: the recorded one is written and the turn completes.
    • zoom turn: an instance's VTT transcript written. An unrecorded instance is given up as no_transcript and an off-host link as transcript_off_host. The token goes only to the store's hosts and the media is never fetched.
    • A zoom full listing reads the last 30 days and keeps an older instance's document.
    • Retirement and lost ids: a recording the store stopped listing is kept. A lost space (404) and a forbidden space (403) fail the turn, retire nothing and still write the other space. The probe answers SOURCE_UNREACHABLE naming the forbidden space.
    • Turn-level failures: a refused credential, a rate limit and a write scope on the token exchange; and the probe's count, titles and refusals.
    • Added in review rounds 4 to 6:
      • test_a_401_on_a_space_after_the_token_exchange_is_the_turn_s_credential: credential_invalid with space <id>: http_401, nothing written.
      • test_a_401_on_a_transcript_s_entries_stops_the_turn: credential_invalid with an error naming the transcript, the later record never read, the stamp kept.
      • test_a_record_s_transcripts_are_merged_under_one_size_bound: two FILE_GENERATED transcripts merged in order; a bound each fits alone and both together do not raises TooLarge.
      • test_two_ids_naming_one_space_list_each_record_once: a meeting code and a space id resolving to one space; the record is checked and written once and counted once.
      • test_a_space_s_listing_error_names_the_configured_id: a records-listing 500 reads space <configured id>: http_500, not the canonical name.
    • A session's repr does not show its token.
  • test_knowledge_source_sync.py, test_gdrive_probe.py, test_knowledge_sources.py and the linear tests pass untouched.
  • tests/integration/test_knowledge_sources.py against a server from this branch with its own ClickHouse (auth off): 3 passed, 6 skipped (the cases that need a configured code repository). The new case checks that add reads a recording config (BAD_CONFIG) before the namespace (NOT_A_CODE_NAMESPACE).
  • End to end on that ClickHouse and server, with the store answered by a mock transport (first head; the write path is unchanged since): a meet source with two records, one without a transcript.
    • Pass 1: changed 1, unconverted 1 (no_transcript), status ok. knowledge.source.inspect lists the document. knowledge.search "why not sort-merge join" returns the record's chunks with section paths 02:00–02:20: …, 09:00–09:20: …, 31:00–31:20: … and content Dana Park: ….
    • Pass 2 (a full request, with the second transcript now present): changed 1, unconverted 0, the first record skipped.
    • Both rows read back with actor worker:knowledge-source-sync, source_class=imported, user_id/agent/session_id -, ingested_format=transcript.
  • Gates:
    • make format-check lint typecheck and the generators (sdk_py_gen, sdk_py_client_gen, sdk_ts_gen, docs_reference, op_reach_census).
    • test_public_copy.py, test_doc_links.py, test_package_contracts.py.
    • npm --prefix frontend run test (1,796 passed) and run build.
    • The full unit suite: 26,610 passed, 18 skipped, 1 xfailed on 9868f670f; the final head 9c2f5fc93 adds an error label, drops a sort and dedups the listing; its touched tests pass (the recording, folder, tracker and source tests: 273).

AI assistance in the code (leave one; writing this description with AI is fine):

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

@zlareb1
zlareb1 force-pushed the feat/knowledge-source-transcripts branch 4 times, most recently from e429c3e to d59e0cd Compare November 4, 2026 03:07
zlareb1 and others added 2 commits November 4, 2026 03:32
The `recording` kind reads a meeting store's transcripts, never its audio or
video: `provider: meet` lists a space's ended conference records and reads
each one's transcript entries once every transcript's file is generated;
`provider: zoom` lists a meeting's ended instances of the last 30 days and
downloads each one's WebVTT transcript file from the store's own hosts. A
transcript becomes one `# mm:ss–mm:ss: <first words>` section per five
minutes with one `<speaker>: <text>` paragraph per turn, so a chunk and its
citation name the minute.

A recording with no transcript yet is counted under `no_transcript` and
checked again on each listing, at none of the pass bound, until a day after
the meeting, when it is given up on its revision. A transcript link off the
store's hosts is given up as `transcript_off_host`. A recording the store
stops listing is never retired: both stores expire recordings on their own
schedule. Both token exchanges refuse a credential whose scope holds more
than reads.

The kind's turn is its own module (source_sync_recording), chosen by
source_sync's kind dispatch and built on its shared item helpers. A space or
meeting the account may not read (a 404 or a 403 on it) fails the turn and
retires nothing while the other ids are written; only the token exchange or
a 401 marks the credential invalid.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 force-pushed the feat/knowledge-source-transcripts branch from d59e0cd to 70d137e Compare November 4, 2026 03:34
zlareb1 and others added 3 commits November 4, 2026 03:43
…rors name it

- A meet record's transcripts share one size bound: each entries read gets
  what the earlier transcripts left.
- A records-listing error names its space, so a turn's error and a probe's
  refusal say which space failed.
- Tests: a 401 on a space read after a good token exchange, and on a
  transcript's entries, end the turn credential_invalid with nothing written;
  a record's two transcripts merge in order under one bound.
- Docs and the credential description say what add, rotate and check answer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
The records listing labels its errors with the space id the source was
configured with, keeping the canonical name for the filter only, and a
record's transcripts are read in the order the store lists them (the
sections are put in time order anyway).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
A space's id and its meeting code resolve to one space; the listing keeps the
first copy of each recording, so none is fetched or written twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit cd7a413 into main Nov 4, 2026
21 of 22 checks passed
@zlareb1
zlareb1 deleted the feat/knowledge-source-transcripts branch November 4, 2026 04:20
@pufit pufit mentioned this pull request Nov 4, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant