On abso's log (12,344 entries, 48 agents), the engine's status takes about 495 ms of CPU per call. The CPU profile behind this, and Speed's live measurement, are on abso issue 299 · not public.
About 95% of it is project-status.ts:108 → overlaps.ts draftFiles, which works out every agent's draft files on every status: #agentView → #draftFiles → graph.ts closureOf (64%) and #closed (52%), plus each agent's view (views.ts keyed, about 27%). Most agents haven't moved since the last status.
Plan:
- Keep each agent's draft files keyed on the log position of that agent's last entry, plus shared's version. Compute them again only for agents whose key moved. The cache lives in the Project instance, in memory, and nothing new is written to the log.
- A test that status answers the same with and without the cache across a run of records, publishes, syncs and drafts. A timing check on a generated log with many idle agents.
- abso's replay gate, then pinned into abso with tool-pin --from.
Done when status on abso's log costs under 100 ms in the engine, measured before and after the same way.
Engine: done in version 55. On abso's log (13,148 entries, 48 agents), status went from about 330 ms to 1 ms median (30 ms max), in Node, measured the same way before and after.
Most of the cost was markedCollisions building every agent's view to look for collision markers, before checking whether the agent had any marked files. It now checks first. draftFiles also skips the view for an empty draft, and Project keeps each agent's draft files under the agent's view key plus its draft.
Pinch's catch: the key holds the agent's own space and base, its atoms, and its draft as worked out against its space's current set. So a publish by someone else into the same named draft changes it whenever the answer could change. The new test draft-files-kept compares a warm project's status with a cold load after every step, in shared and with two agents in one named draft. A key of space and base alone fails it.
Pinning 55 in abso now, behind the replay gate.