fix(x): stop KG agent from rewriting meeting notes; gate People notes on calendar attendees - #785
Open
arkml wants to merge 2 commits into
Open
fix(x): stop KG agent from rewriting meeting notes; gate People notes on calendar attendees#785arkml wants to merge 2 commits into
arkml wants to merge 2 commits into
Conversation
… on calendar attendees
The note_creation agent treated knowledge/Meetings/ as one of its own
writable note types (an empty "Meetings" template was rendered into its
prompt), so it rewrote recorded meeting notes into an invented entity
format — destroying the post-meeting summary and transcript — and
fabricated duplicate "meeting entity" notes. It also processed notes
mid-recording (the file changes every ~1s, so every 15s tick re-ran the
LLM on the growing transcript) and minted People notes from ASR name
variants ("Shubham" heard as "Shubhrant"/"Shivam") with no attendee
ground truth.
Fixes:
- Source files are read-only to the agent: empty-template note types no
longer render into the prompt; new non-negotiable prompt rules; and a
mechanical guard (revertAgentSourceWrites) that snapshots the
knowledge repo before each agent batch and restores/deletes any agent
write under knowledge/Meetings/, knowledge/Voice Memos/, gmail_sync/,
or knowledge_sources/ (deletes only when the repo has a HEAD commit).
Reverts are logged as warn service events.
- In-flight recordings are held: meeting-source files modified within
the last 6 minutes (above the recorder's 5-minute silence backstop)
are skipped until quiet — one LLM run per meeting instead of ~20.
- People notes anchored to the calendar invite: the recorder stamps the
invite's attendees into the note's calendar_event frontmatter, and
build_graph emits an authoritative ATTENDEES-GATE banner per recorded
meeting (frontmatter → linked event file → calendar_sync title+start
match). New People notes only for listed attendees (teammates on the
invite included); similar-sounding transcript names resolve to one
attendee note via Aliases; ad-hoc recordings with no invite create no
People notes at all — names still appear in summaries.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
People sometimes join a meeting without being on the calendar invite.
Previously the summarizer's hard "attendee names only" rule left them
permanently unnamed ("They"), and the new ATTENDEES-GATE wording could
be read as blocking even updates to their existing People note.
- Summary: a non-attendee name may be used when the transcript clearly
supports it (introduced/addressed by that name repeatedly), with one
canonical spelling for similar-sounding ASR variants; a name heard
once or inconsistently stays "They".
- Knowledge graph: an off-list transcript name that clearly matches an
EXISTING People note (name/alias plus context) may update that note;
creating a new note for anyone off the invite stays forbidden.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Follow-up commit (0206b0f) for uninvited joiners — people who join a meeting without being on the invite:
🤖 Generated with Claude Code |
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.
Problem
Two user-reported bugs, root-caused via the knowledge repo's git history:
note_creationagent treatedknowledge/Meetings/as one of its own writable note types (an empty "Meetings" template was rendered into its prompt, and nothing marked source files read-only). On the graph tick after a meeting ended it rewrote the recorded note into an invented entity format, replacing the detailed summary + transcript with ~3 lines. Git evidence:Research_reading.mdwent 60KB → 1,073 bytes mid-recording (only the recorder's 1s debounced rewrite restored it), and the agent fabricated a duplicatemeeting-<timestamp>.mdentity note alongside it.Shubham.md,Shubhrant.md, andShivam.md, plus 47-byte stubs for other misheard names.Fixes
Meeting sources are read-only to the KG agent (prompt + mechanical guard)
note_system.ts)note_creation.ts, batch message inbuild_graph.ts)revertAgentSourceWritesbackstop: aPre-agent snapshotcommit runs before every agent batch; any agent write underknowledge/Meetings/,knowledge/Voice Memos/,gmail_sync/, orknowledge_sources/is restored from the batch snapshot / git HEAD, or deleted if the agent created it (deletion requires the repo to have a HEAD commit, so a fresh install can never lose data). Reverts surface aswarnservice-log events. Wired into both the main batch loop and the voice-memo loop.In-flight recordings are held
MEETING_NOTE_QUIET_MS(6 min, above the recorder's 5-min silence backstop): meeting-source files are skipped until they stop changing — one LLM run per meeting instead of ~20, and no partial-transcript processing.People notes anchored to the calendar invite
"Name <email>") into the note'scalendar_eventfrontmatter, resolved from the linked event file or passed through from the detector/notification flow (useMeetingTranscription.ts,App.tsx,calendar-block.tsx)meetingAttendeesBannerstamps an authoritative ATTENDEES-GATE onto each rowboat-recorded source (frontmatter attendees → linked event file →calendar_syncscan by exact title+start): new People notes only for listed attendees — teammates on the invite included; similar-sounding transcript names resolve to ONE attendee's note (variant spellings go to Aliases); ad-hoc recordings with no invite create no People notes at all, though names still appear in summariesTesting
npm run deps,npm run typecheckclean; lint errors are pre-existing in untouched filesmeetingAttendeesBannertests (non-rowboat sources ignored, stamped attendees listed, ad-hoc → no-People banner)🤖 Generated with Claude Code