Commit graph

33 commits

Author SHA1 Message Date
Natalie
f9cf50e695 fix(server): unbuffered logging + reject operator token on contact sync
Some checks failed
Swift Build & Test / swift build + test (push) Waiting to run
Server Typecheck & Test / bun typecheck + test (push) Failing after 5m9s
- logger: emit straight to fd 1/2 (unbuffered). The buffered process.std*
  streams block-buffer to a pipe under systemd, so low-volume logs never
  flushed and were invisible.
- /client/imessage/contacts: return 401 (like /sync/batch) when the caller
  presents the operator/service token instead of a device token, instead of
  500ing on a null deviceId downstream.
- systemd unit: reflect the working deploy (root + /root/.bun, Redis
  dependency, file logging since the droplet journald is volatile).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 19:47:18 -04:00
Natalie
f6ce05d864 feat(server): declare queue/photo deps + REDIS_URL, switch to bun lockfile
Some checks are pending
Server Typecheck & Test / bun typecheck + test (push) Waiting to run
Swift Build & Test / swift build + test (push) Waiting to run
The server source imports bullmq/ioredis/sharp/exifr but they were never
declared (the stale pnpm-lock pinned tarballs to the dead black.lan registry).
Declare them, add REDIS_URL to the config schema (default local Redis) since
the queue connection already reads it, and replace the unusable pnpm-lock with
a bun.lock resolved against npmjs. Import graph now evaluates cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:03:08 -04:00
Natalie
e84b878cea feat(server): vendor createPool in-repo, drop dead @lilith/quinn-db-pg
Some checks are pending
Server Typecheck & Test / bun typecheck + test (push) Waiting to run
Swift Build & Test / swift build + test (push) Waiting to run
The @lilith/quinn-db-pg@1.0.1-dev.* snapshot was only ever published to the
retired black.lan Verdaccio and resolves nowhere now (not on the DO forge, no
local cache, no source). Replace the single `createPool` import with a faithful
in-repo pg.Pool factory (service-name -> QUINN_<SERVICE>_DB_URL) and add `pg`
as a direct dependency (was transitive via the dead package).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 17:49:03 -04:00
Natalie
1de0ccdfd6 feat(server): wire outbox + read features into app + my surface
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 11:35:13 -04:00
Natalie
9f7c9f4533 feat(read): conversation-read entity + read feature + my-surface endpoint & tests
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 11:35:13 -04:00
Natalie
8d821c8c97 feat(outbox): outbox entity, service, sweep + my-surface endpoint & tests
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 11:35:13 -04:00
Natalie
576496ca3e feat(deploy): video-projects FUSE mount over DO Spaces
Generalize the photos-originals rclone-mount pattern to a video-projects
prefix so the video studio (and imajin ETL, per storage-portability-plan
§2.3) can read/write multi-GB project sources/renders as local files while
only hot data stays resident on plum (bounded VFS LRU cache). Lets a
small-disk laptop work with large footage without filling APFS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:10:13 -04:00
Natalie
46d350d8ce feat(send-queue): autoqueue toggle + message provenance
autoqueue: send_rate_config gains auto_queue (default true). When on, the
pending endpoint holds over-cap sends to drip out (burst-friendly); when
off, the cap is disabled and queued sends release immediately. Threaded
through getSendRateConfig/setSendRateConfig and GET/PUT /admin/send-rate-limit.

provenance: send_queue gains authored_by + dispatched_by (who composed the
text vs what triggered the send), a fixed vocabulary (user, claude-prospector,
claude-messenger, autoresponder, scheduled-worker, unknown) validated at the
enqueue boundary and recorded on insert. Nullable for legacy rows.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 21:28:36 -04:00
Natalie
242d7cd1a8 feat(send-queue): burst-friendly outbound send-rate cap (default 10/5min)
The /client/imessage/send-queue/pending endpoint released up to 50 queued
sends per poll, so an enqueued burst all fired at once. Add a configurable
release cap: the endpoint now returns at most (maxSends − sent-in-window)
queued items, so a burst queues and drips out at the configured rate.

- macsync.send_rate_config single-row table, default max_sends=10,
  window_seconds=300 (10 per 5 min).
- entities/send-queue repo: getSendRateConfig / setSendRateConfig /
  countSentWithin.
- Admin control: GET/PUT /admin/send-rate-limit (service-token auth) so the
  cap is adjustable at runtime (wired to MCP via quinn.api separately).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 15:35:18 -04:00
Natalie
464bbbd48d refactor(imessage): remove redundant contact-summary enrichment
The contact-summary sweep generated a 3-field digest (mostRecently /
overallSummary / recap) per iMessage contact via the model-boss chat
endpoint. It's redundant with the prospector, which already classifies
1271 prospects with tier + archetype + score + status — strictly richer
per-person intel for the contacts that matter. It was also the path that
wedged the server against the decommissioned model-boss host (2026-06-23).

Remove the generation path entirely: the per-sync sweep in
ingestContacts, the contact-summary feature module + its test, and the
now-orphaned chatJson client in shared/model-boss.ts (contact-summary was
its only caller). The connection circuit breaker stays — the
embedding-worker still calls the same coordinator and needs the same
wedge protection.

Kept the read-side data layer (summary_data column, summaryData field,
updateContactSummary, the /my/contacts surface field) dormant as the
landing spot if summaries are ever repopulated offline via batch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 14:02:10 -04:00
Natalie
1ebbd8e872 fix(imessage): circuit-break model-boss calls so a dead coordinator can't wedge ingest
The contact-summary sweep and embedding-worker call model-boss (GPU
coordinator) sequentially. When its host is offline every call paid the
full TCP-connect timeout (~3s) before failing; a sweep over ~1700
contacts serialised thousands of slow failures and stalled the whole
server — message ingest froze for hours while the listener stayed up
(observed 2026-06-23, coordinator host decommissioned).

Add a connectivity circuit breaker in shared/model-boss.ts: after 3
consecutive connection failures it opens for a 60s cooldown and fails
fast (no fetch), auto-probing once afterwards to recover. The
contact-summary sweep now bails the moment the breaker is open instead
of queueing doomed per-contact work. HTTP error responses still count as
reachable — the breaker tracks connectivity, not request success.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 13:30:15 -04:00
Natalie
cae15ae9f1 fix(@applications/@mac-sync): 🐛 update lan instead of local in all configs
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 03:12:06 -07:00
Natalie
0bffc51524 feat(contacts): enable contact render polling opt-in
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-22 13:34:08 -07:00
Natalie
c2c7870915 feat(photos): improve search weighting and type safety
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-19 00:04:30 -07:00
Natalie
9a9040cad5 feat(@applications/mac-sync): add message metadata fields
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-18 23:58:09 -07:00
Natalie
b95d6c40af fix(@applications/mac-sync): 🐛 update mac sync send queue queries and db table names
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-18 21:12:47 -07:00
Natalie
a8a5654e97 fix(client): 🐛 change put to post for attachment upload endpoint
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-18 01:19:51 -07:00
Natalie
b2882a0751 fix(@applications/mac-sync): 🐛 adjust body limit to 1gb
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-18 00:12:23 -07:00
Natalie
e496834530 feat(server): add body length tracking middleware
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-18 00:06:04 -07:00
Natalie
bbf86b31c5 feat(apps/mac-sync): add debug logging for attachment uploads
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-17 23:59:42 -07:00
Natalie
e5437a9baa fix(@applications/mac-sync): 🐛 update blob sync id handling
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-17 21:34:11 -07:00
Natalie
2568866c70 feat(@applications): implement mac-sync identity and photo workflows
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-17 20:27:05 -07:00
Natalie
ff9abc5e3c feat(@mac-sync): update handoff docs with verified paths
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-15 21:17:32 -07:00
quinn
e02ee2be00 schema rename: postgres namespace icloud.* → macsync.* (24 tables + index names) 2026-05-15 18:52:46 -07:00
quinn
10acb9f262 rename service identifier: QUINN_ICLOUD_DB_URL → QUINN_MACSYNC_DB_URL (postgres schema 'icloud.*' unchanged) 2026-05-15 18:48:57 -07:00
quinn
1295aec3e9 merge fixes: typecheck (attributedBody → base64 string), syncNow race coalescing, test alignment 2026-05-15 18:35:50 -07:00
quinn
8cc2c50fed merge batch 7: TODO marker for /my/* auth model divergence (ssoRequired vs serviceTokenAuth) 2026-05-15 18:22:37 -07:00
quinn
4ba759ba92 merge batch 5: server surfaces (admin/client/my route registration), my/calendar, my/mail, features/imessage/service typedstream decode 2026-05-15 18:16:46 -07:00
quinn
cb92645142 merge batch 4: server app + entities (device/contact/conversation/event/message) 2026-05-15 18:12:49 -07:00
quinn
c420741292 merge batch 3: MacSyncApp menu (reminders+notes+contacts), Info.plist; deploy/entitlements kept apricot 2026-05-15 18:08:15 -07:00
quinn
f4bd7e6829 merge: restore plum-only additive files atop apricot baseline 2026-05-15 17:06:07 -07:00
quinn
90443dad36 apricot baseline: contacts-sync-core + BlobSyncManager + embedding/search/sync-history 2026-05-15 17:05:39 -07:00
quinn
b8b63ac63d plum baseline: Phase 1/3/4/5 work (BaseSyncManager, SendQueue layer, ireminders, inotes) 2026-05-15 17:05:13 -07:00