Measure capture and recovery costs with separate storage, RAM and token budgets

Author: rohitg00Created Sep 29, 2026Updated Sep 29, 2026

Validation limitation

The live 100-observation run on main ab3e4efd282659b87d31b36c8514c6bc6b871f0b provides useful point measurements, but it does not establish a capacity envelope or the cost of recovery at larger sizes. Disk retention, resident memory, model processing and agent-visible context are different costs and need separate evidence before adding default background work.

Observed in the isolated test:

  • Keyless capture used 156,126 bytes of state/config after 100 observations and sampled 151,760 KiB combined worker/engine RSS.
  • All 100 hooks emitted zero stdout bytes, with automatic compression and context injection disabled.
  • Full fixture search responses reported an estimated 238 tokens each. This is a server estimate, not provider billing.
  • A checkpointed 768-dimensional vector profile used 575,216 state/config bytes. Its inference process was additional and excluded from worker/engine RSS.
  • The small fixture and point samples do not justify linear per-memory projections or a large-store efficiency claim.

Requested scope

Add a reproducible resource regression profile around the actual built capture, retrieval and recovery paths. Extend existing evaluation tooling rather than creating a second data-generation or model orchestration system.

Acceptance checks

  • Keep keyless, embedding-only and optional extraction/reflection profiles separate.
  • Measure process-tree peak RSS, CPU time, cold/warm startup, hook/request latency distributions, and logical observation count.
  • Report source, summary, index, queue, failed-delivery and diagnostic bytes separately; distinguish fixed overhead from growth.
  • Count provider requests and returned usage where available. Mark missing counters unknown. Record retries and repeated successful work separately.
  • Measure agent-visible context independently of model extraction/embedding usage. Preserve default-off automatic processing and injection.
  • Run comparable profiles serially with a pinned corpus, declared provider configuration and explicit model context cap. Record supporting service/inference resources separately.
  • Verify recovery and evidence completeness alongside costs so a smaller store caused by lost source is not considered an improvement.
  • Establish baselines at 1,000 and 10,000 records before attempting a larger capacity run. Set regression thresholds from repeatable measurements, not the existing 100-record sample.

This is a validation task, not a proposal to load all history into context or retain unlimited raw data. Per-session enforcement is already tracked by #767 and PR #934; statistical retrieval evaluation is tracked by #769. This issue covers resource accounting and recovery cost evidence around those boundaries.