9 Commits

Author SHA1 Message Date
Codex
c8aa1ae714 🐛 Surface owned source failures and skip automatic continuation 2026-11-02 20:20:30 -08:00
d-robotics
e94a8d2c14 ⚡ Integrate projected annotation buffer summary polling 2026-10-28 09:09:10 -07:00
d-robotics
8fed6d14a1 ⚡ Add opt-in annotation buffer summaries 2026-10-28 08:38:17 -07:00
d-robotics
b2a4f16a1f ⚡ Cache work-buffer display labels and keep dashboards cached across autosaves
- The work-buffer poll resolved each item's project, workflow and capture
  labels by reading the full run document (up to 6MB) every 3s. Cache the
  resolved labels per item for 2 minutes.
- Slots whose item the active scan already counted keep their slot without
  rereading the item and its claim receipt (same outcome as before).
- Draft, review-draft, review-session and work-buffer saves no longer flush
  the dashboard response cache; they change nothing a dashboard counts.

Local perf DB with a 6MB run: poll total p50 141ms -> 7ms (enrich 131 -> 0),
byte-identical response. Admin dashboard stays cached across draft and
session saves and is still recomputed after other writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 00:49:09 +08:00
d-robotics
99900d5870 ⚡ Fix work-buffer 2-4s poll: projected existence query for buffer enablement + humanBatches org/project/plugin index
The trace deployed in round5 located the cost: batches_ms carried 80% of
every work-buffer poll (1400-3900ms of 1600-4100ms total). The poller's
enablement check called ListHumanBatches for the project, which — because
the legacy migration created one batch per task — materialized 12,009 full
batch documents on every 3s poll, walking an organizationId-only index over
17,334 docs.

- HasRawHumanAnnotationBatch (Memory + Mongo): projects only the stages
  field and stops at the first three-role raw_human match (105ms on the
  production dataset, was 2000ms+).
- New humanBatches index organizationId_projectId_pluginId backs both the
  enablement query and ListHumanBatches' project-scoped reads.
- store.Store interface gains the method; both store implementations keep
  identical semantics (mid-test profile flips stay visible).
2026-10-12 00:37:24 +05:30
d-robotics
a19459d9db 🔭 Add work-buffer latency breakdown tracing (auth/batches/store/enrich) to locate the remaining 2-3s poll cost
The new indexes cut the work-buffer poll from 3-5s to 2-3s, but the remaining
cost is unlocated. This trace records where the time goes per poll so the
next fix targets evidence, not guesses.
2026-10-12 00:24:57 +05:30
d-robotics
54d74042d3 🐛 Hydrate capture names before task selection 2026-09-21 12:26:39 +08:00
d-robotics
ac8496c802 🐛 Restrict task buffering to trusted Fanyu human workflows 2026-09-21 02:48:38 +08:00
d-robotics
7d1c1e7fe2 ✨ Add bounded annotation work buffers and continuous task handoff 2026-09-21 02:38:16 +08:00