agent-ecosystem/test/main/services
777genius c8d40be460 perf: cache negative team-affinity verdicts from a full head window
fileBelongsToTeam only cached POSITIVE affinity durably; a negative verdict was
re-decided on any change, so during a launch every non-matching transcript in the
project dir that grew (mtime+size change from an active session) was re-streamed
(createReadStream+readline) and re-parsed (up to 40 head lines) on every bootstrap
poll. A live atlas-hq-5 launch profile put this whole subsystem (readline streaming
+ fileBelongsToTeam + line/team matching) at ~31% of main-thread JS, the single
largest launch cost.

A team's first 40 head lines are immutable for an append-only transcript, so a
`false` decided from a FULL inspected window (>= TEAM_AFFINITY_SCAN_LINES) stays
valid while the file only grows. Track headWindowFull on the cache entry and short-
circuit such negatives the same way positives are short-circuited (size >= cached).
Short files (partial window) are still re-scanned on growth, so a team mention that
later lands inside the head window is still detected. A shrink/rewrite (size <
cached) forces a re-scan, identical to the positive path.

Behavior-preserving for affinity correctness (no new false negatives); only removes
redundant re-streams. Adds regression tests for both the durable-negative and the
short-file-flips-to-true cases.
2026-05-30 13:17:49 +03:00
..
analysis fix(provenance): classify synthetic user turns 2026-05-26 23:51:17 +03:00
discovery fix(provenance): classify synthetic user turns 2026-05-26 23:51:17 +03:00
editor fix: harden Windows frontend path handling 2026-05-16 17:34:50 +03:00
extensions fix(ci): restore dev validation checks 2026-05-19 02:49:45 +03:00
identity feat: add telemetry identity and runtime status 2026-05-17 20:26:34 +03:00
infrastructure fix: export notifyTeamWatchScopeChanged so the committed build resolves 2026-05-30 12:33:57 +03:00
parsing fix(provenance): classify synthetic user turns 2026-05-26 23:51:17 +03:00
runtime fix(opencode): extend summary status timeout 2026-05-28 00:39:53 +03:00
schedule feat(runtime): add provider fast mode support 2026-04-21 22:22:47 +03:00
team perf: cache negative team-affinity verdicts from a full head window 2026-05-30 13:17:49 +03:00