[recipes] Authorship edges — speaker attribution + self author edges - #51
Open
alanshurafa wants to merge 1 commit into
Open
[recipes] Authorship edges — speaker attribution + self author edges#51alanshurafa wants to merge 1 commit into
alanshurafa wants to merge 1 commit into
Conversation
OB1's correspondent resolver keys people off email addresses, so spoken and machine-generated capture has no path to authorship: a transcript labelled "You"/"Alex"/"Speaker 1" never becomes an edge, and nothing marks a device-generated summary as machine-made. This recipe is the display-name counterpart — a deterministic self/other/mixed/machine/ unknown classifier that links the thoughts you spoke to a configured self-entity via thought_entities author edges, plus the "what I said vs. what a machine generated" query layer. No LLM, no hardcoded ids, additive on the existing entities/thought_entities tables, and thought_id is treated opaque so it works on UUID or BIGINT brains. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
A
recipes/authorship-edges/recipe that brings authorship to spoken and machine-generated capture.The atomizer's correspondent resolver keys people off RFC-2822 email addresses. Spoken capture has no addresses: a wearable transcript chunk is labelled
You/Alex/Speaker 1, and a device-generated title or action item has no human speaker at all. Nothing in OB1 turns those into an authorship edge, and nothing marks a row as machine-generated. This recipe is the display-name counterpart.lib/speaker-attribution.mjs, no LLM) maps a thought's speaker labels toself/other/mixed/machine/unknown.lib/author-edges.mjs) link everyself/mixedthought to a configured self-entity viathought_entities(mention_role = 'author' | 'participant').backfill-authorship.mjs) adds edges to thoughts you've already captured — idempotent, keyset-paginated, with one batched edge lookup per page.queries.sql) — "everything I said" vs. "machine-generated only", or down-rank machine rows in search.Why it's safe to merge
entitiesandthought_entitiestables from the entity-extraction schema. It creates no tables, changes no columns, and does not depend on acanonical_emailcolumn.OB_SELF_ENTITY_IDor a display name the recipe upserts once (and marksis_self). If a same-named non-self entity already exists, it refuses rather than mis-attributing your speech.thought_idis passed through opaque, so it works whether yourthoughts.idis UUID or BIGINT (no numeric coercion of ids).node test-attribution.mjsself-test (21 assertions) covering the full classifier matrix.Scope
Named-other speakers are classified but not resolved to entity rows — display-name → entity resolution is deliberately left as an extension point, the same way the email resolver defers multi-address identity. This recipe links the unambiguous self side and ships the substrate for the rest.
🤖 Generated with Claude Code