Skip to content

perf: warm-deploy agent loop — drive < 4 s rebuild+verify+reconnect budget #114

@zackees

Description

@zackees

Goal

Warm rebuild + deploy + monitor reconnect on ESP32-S3 should complete end-to-end in under 4 000 ms when:

  1. No source / config / toolchain changes since the last build.
  2. The device already holds the exact firmware image (verify-flash MD5 match).
  3. The serial monitor is expected to reattach and receive the first JSON-RPC byte.

"Auto-research" is the SerialMonitor.auto_reconnect behaviour — the monitor reattaching after a deploy preempts the serial session.

Budget tree (total: 4 000 ms)

Phase Budget
CLI → daemon handshake 200 ms
Daemon lock + dispatch 100 ms
Warm-build fingerprint hit (no compile, no link) 500 ms
Verify-flash MD5 match (3 regions) 1 500 ms
Serial port re-open + WebSocket reattach 700 ms
TTFB (first JSON-RPC byte from device) 1 000 ms
Slack 0 ms

Agent loop

The full spec — test matrix, per-iteration procedure, decision rules, outputs — lives at LOOP.md in the repo root (landed in #113 / `cacba6f`). It is invokable with the `/loop` skill:

```
/loop @./LOOP.md
```

Every iteration appends a row to `tasks/loop-runs/RESULTS.csv` and the agent judges each capture against the budget tree. On three consecutive green T1–T3 iterations, the loop writes `tasks/loop-runs/SUMMARY.md` and terminates; on five attempts without improvement, it files a follow-up issue and stops.

Known suspects (from existing investigation)

From docs/PERF_WARM_BUILD.md (issue #91):

  • First warm build after a daemon restart spends ~68 s in the ESP32 orchestrator even with the fingerprint populated.
  • Second warm build still takes ~1.3 s because `fp-watches-collect` walks thousands of files and zccache re-verifies.
  • Fix direction: split the fast-path fingerprint into in-memory + on-disk layers.

From #66:

Deliverables

  • `LOOP.md` committed (docs(perf): LOOP.md — warm-deploy agent loop spec #113)
  • First pass of the loop against real ESP32-S3 hardware to confirm or tune budgets
  • Follow-up issues for any phase that consistently breaches its budget
  • Close when T1–T3 land inside the total budget for three consecutive iterations

Related: #91 (warm-build investigation), #66 (espflash migration).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions