Skip to content

Reduce durable-state duplication and heartbeat volume #1147

Closed as duplicate

Description

@aviggiano

Suggested labels: enhancement, priority:P2, storage, performance

Problem

Long campaigns retain repeated workspaces, trusted CLI closures, continuation snapshots, adapter data, and sub-second heartbeat events. One observed run consumed roughly 13 GB, and more than 90% of its large event stream consisted of heartbeats.

Generic reproduction

  1. Run a detached campaign for several hours.
  2. Continue it multiple times.
  3. Measure the run directory and count event types.

Expected behavior

Durable state grows mainly with unique artifacts and meaningful transitions.

Proposed fix

  • Content-address immutable closures and workspace snapshots.
  • Reference shared objects instead of copying them per continuation.
  • Coalesce unchanged heartbeats into intervals.
  • Rotate or compact event logs while preserving terminal events.
  • Apply retention policies to superseded attempts.
  • Expose a storage breakdown in the CLI.

Acceptance criteria

  • Continuation does not duplicate unchanged closures.
  • Heartbeat storage scales with reporting intervals rather than polling frequency.
  • Compaction preserves terminal and verification records.
  • The CLI identifies the largest retained categories.

This issue intentionally omits the audited repository and all audit results.

Activity

  1. added
    enhancementNew feature or request
    In ProgressClaimed and actively worked on; has an assignee. Remove if work stops.
    on Sep 25, 2026
  2. aviggiano commented on Sep 29, 2026

    @aviggiano
    CollaboratorAuthor

    Status update. Heartbeat volume is fixed, and the duplicated per-run trees are the remaining cost. Those are tracked in #921's plan, so I'm keeping this open.

    Landed

    Draft

    Measured on current main (tiny-vault smoke campaign)

    • The sealed execution snapshot is ~51k files / ~772 MB per generation.
    • The trusted CLI closure is ~247 MB per run.

    These two dominate durable state. #921's plan replaces them with a slim run build (~20 MB / ~1.8k files of first-party code, with third-party packages linked into the install) and a PATH shim. It is waiting on the owner questions there.

    Not built

    • Event-log compaction or rotation: compacting _smithers_events would break Smithers' seq pagination and Ultrafuzz's full-history event reads.
    • Retention of superseded attempts, and a storage-breakdown command.
  3. removed
    In ProgressClaimed and actively worked on; has an assignee. Remove if work stops.
    on Oct 2, 2026
  4. aviggiano commented on Oct 2, 2026

    @aviggiano
    CollaboratorAuthor

    Closing as a duplicate of #921. The heartbeat half is fixed: #1166 (aa58130) stopped Smithers persisting the per-pulse TaskHeartbeat event, #1201 (f1789d7) removed the ~595 MB TMPDIR controller root left by each resume, and #1245 stopped copying Frog into every run. The dominant remaining cost, the per-generation execution snapshot and the per-run trusted CLI closure, is #921's slim-run-build and PATH-shim steps; unreaped task worktrees are tracked in #1227. Event-log compaction (it would break Smithers' seq pagination and full-history event reads), pruning of superseded generations/attempts, and a storage-breakdown command are not planned; refile any of them with a measurement if they still matter after #921 lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions