5 Commits

Author SHA1 Message Date
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