Skip to content

Forward cloud AMICODE_PULSE into the run inspector - #231

Merged
jack-champagne merged 1 commit into
mainfrom
jack/cloud-pulse-forwarder
Jul 29, 2026
Merged

Forward cloud AMICODE_PULSE into the run inspector#231
jack-champagne merged 1 commit into
mainfrom
jack/cloud-pulse-forwarder

Conversation

@jack-champagne

Copy link
Copy Markdown
Member

What

Adds a /pulse poll lane to RemoteExecutor so a cloud solve's progressive pulse reaches the run inspector — the last missing piece for "submit a cloud solve → watch the pulse animate," which works locally today but not for cloud runs.

Why

The poll pump already forwards AMICODE_ITER (/stats) and PNG frames (/frames) into the mirror run.log, but never the AMICODE_PULSE_META / AMICODE_PULSE lines. The render side (native type-aware pulse plot, #224) tails these off run.log for local solves — it just never received them for cloud runs, so the cloud pulse plot stayed at "No pulse data."

How

A /pulse lane that mirrors /stats exactly (remote_executor.ts):

  • relay AMICODE_PULSE_META once (it carries no iter),
  • relay each new AMICODE_PULSE line on the iteration high-water (the API re-serves full history each poll),
  • verbatim — so the a= drive knots and the d= derivative tail reach the plotter unaltered.
  • Best-effort like stats/frames: a runner/API without /pulse 404s → swallowed → no-op, so this is safe to merge before the cloud endpoint exists (degrades exactly like the pre-feat(hp): cloud-only enforcement + cloud iters/frames reach the Run Inspector #219 state).

Scope

Client-only. Does not touch the solve templates / solver output (@rchari's current lane) — this only relays whatever pulse the solve already emits.

⚠️ Requires a cloud companion (for @rchari to wire, or a follow-up)

GET /solves/{id}/pulse in the solves_poll lambda (aws-infra), ~10 lines mirroring _stats:

# grep AMICODE_PULSE_META + AMICODE_PULSE out of the S3-synced run.log
for line in log.splitlines():
    if "AMICODE_PULSE" in line:
        pulse.append({"raw": line.strip()})
return _resp(200, {"task_id": task_id, "pulse": pulse})

Response shape {task_id, pulse: [{raw}], submitter} — identical to /stats. Until it ships, this lane is inert (no-op), not broken.

Tests

FakeCloud now serves /pulse (mirrors the live wire shape); new test asserts the meta line is relayed once and pulse frames dedupe on the iteration high-water in run.log. Full amico-run suite green (939 passed); build + typecheck + prettier clean.

End-to-end status (for context)

This is client gap #1 of the "Altissimo cloud solve → run inspector" flow. Remaining: (2) an Altissimo emitter branch in the solve template (Raghav's #2 — coarse, per-outer-iteration), and (3) an amicode release carrying #219 + #224 + this.

Cloud solves surfaced iteration/convergence rows and frames in the run
inspector, but the pulse plot stayed empty: the poll pump forwarded
AMICODE_ITER (/stats) and PNG frames (/frames) into the mirror run.log, but
never the AMICODE_PULSE_META / AMICODE_PULSE lines. The render side (native
type-aware pulse plot) already tails these off run.log for local solves; it
just never received them for cloud runs.

Add a /pulse poll lane that mirrors /stats exactly: relay AMICODE_PULSE_META
once (it carries no iter) and each new AMICODE_PULSE line on the iteration
high-water (the API re-serves history every poll), verbatim so the a= drive
knots AND the d= derivative tail reach the plotter unaltered. Best-effort like
stats/frames: a runner/API without /pulse 404s and is swallowed, so this is
safe to merge before the cloud endpoint exists.

Client-only: does not touch the solve templates / solver output.

Requires a cloud companion: GET /solves/{id}/pulse in the solves_poll lambda,
~10 lines mirroring _stats (grep AMICODE_PULSE* out of the S3-synced run.log,
return {task_id, pulse: [{raw}], submitter}).
@jack-champagne
jack-champagne merged commit 5efc482 into main Jul 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant