email-activity agent: propose -> review -> approve grid notes (v0.1.0:64)

When a sent/received email is matched to an investor, a local-model agent drafts a
one-line dated note and queues it as a PENDING proposal (it never writes the grid
itself). On the Email Capture page a partner sees "Proposed grid notes", can edit the
text, and Approve (appends to that investor's grid notes cell, newest at bottom,
stamped with the approver) or Dismiss. Going-forward only: a cutoff (app_settings
email_activity_since, set on first run) means email dated before the feature was
enabled is never summarized, so the historical backfill makes no noise. Sovereign:
summaries run entirely on the local model (no redaction needed). Gmail sync interval
tightened 180 -> 15 min so outgoing email surfaces quickly.

Backend: migration 0002 (email_activity_proposals); propose_email_activity_notes()
runs via a new scheduler post_sync hook; list/decide functions + routes
GET /api/activity/proposals, POST .../{id}/approve|dismiss. Grid append stamps the
approving user (fundraising_state.updated_by has a FK to users). Test
test_email_activity.py (propose cutoff/idempotency, approve appends + edited note,
dismiss, already-decided guard) under FK enforcement.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Keysat
2026-06-06 15:55:26 -05:00
parent 3893a4fb9f
commit 069e60053b
9 changed files with 462 additions and 7 deletions
+3 -2
View File
@@ -28,8 +28,9 @@ export const PACKAGE_TITLE = 'Ten31 Database'
// * 0.1.0:60 (Email Capture: single-mailbox enroll field for testing)
// * 0.1.0:61 (Email Capture: live backfill progress + auto-refresh)
// * 0.1.0:62 (fix backfill crash on no-Reply-To emails; Sync now retries errored mailboxes)
// * Current: 0.1.0:63 (System Status: storage usage — DB, attachments, backups, disk free)
export const PACKAGE_VERSION = '0.1.0:63'
// * 0.1.0:63 (System Status: storage usage — DB, attachments, backups, disk free)
// * Current: 0.1.0:64 (email-activity agent: propose->review->approve grid notes; sync ~15 min)
export const PACKAGE_VERSION = '0.1.0:64'
export const DATA_MOUNT_PATH = '/data'
export const WEB_PORT = 8080
+3 -2
View File
@@ -24,8 +24,9 @@ import { v_0_1_0_60 } from './v0.1.0.60'
import { v_0_1_0_61 } from './v0.1.0.61'
import { v_0_1_0_62 } from './v0.1.0.62'
import { v_0_1_0_63 } from './v0.1.0.63'
import { v_0_1_0_64 } from './v0.1.0.64'
export const versionGraph = VersionGraph.of({
current: v_0_1_0_63,
other: [v_0_1_0_39, v_0_1_0_40, v_0_1_0_41, v_0_1_0_42, v_0_1_0_43, v_0_1_0_44, v_0_1_0_45, v_0_1_0_46, v_0_1_0_47, v_0_1_0_48, v_0_1_0_49, v_0_1_0_50, v_0_1_0_51, v_0_1_0_52, v_0_1_0_53, v_0_1_0_54, v_0_1_0_55, v_0_1_0_56, v_0_1_0_57, v_0_1_0_58, v_0_1_0_59, v_0_1_0_60, v_0_1_0_61, v_0_1_0_62],
current: v_0_1_0_64,
other: [v_0_1_0_39, v_0_1_0_40, v_0_1_0_41, v_0_1_0_42, v_0_1_0_43, v_0_1_0_44, v_0_1_0_45, v_0_1_0_46, v_0_1_0_47, v_0_1_0_48, v_0_1_0_49, v_0_1_0_50, v_0_1_0_51, v_0_1_0_52, v_0_1_0_53, v_0_1_0_54, v_0_1_0_55, v_0_1_0_56, v_0_1_0_57, v_0_1_0_58, v_0_1_0_59, v_0_1_0_60, v_0_1_0_61, v_0_1_0_62, v_0_1_0_63],
})
+22
View File
@@ -0,0 +1,22 @@
import { VersionInfo } from '@start9labs/start-sdk'
// Email-activity agent (propose -> review -> approve). When a sent/received email is
// matched to an investor, a local-model agent drafts a one-line dated note and queues
// it for review on the Email Capture page; a partner edits if needed and Approves
// (appends to that investor's grid notes) or Dismisses. Going-forward only (never
// summarizes email older than when this was switched on), so the historical backfill
// makes no noise. Sovereign: the summary runs entirely on the local model. Gmail sync
// interval tightened to ~15 min so outgoing email surfaces quickly. Migration 0002
// (email_activity_proposals).
export const v_0_1_0_64 = VersionInfo.of({
version: '0.1.0:64',
releaseNotes: {
en_US: [
'New email-activity agent: when an email is matched to an investor, it drafts a short',
'dated note (on your local model) and queues it on the Email Capture page for you to',
'edit, approve into that investors grid notes, or dismiss. Going-forward only, so',
'the historical backfill stays quiet. Gmail now syncs about every 15 minutes.',
].join(' '),
},
migrations: { up: async () => {}, down: async () => {} },
})