cial/docs/ops/deploy-logs.md
Eliot M e223ba45ec docs(self-edit): document synchronous /api/v1/self/deploy
Update API docs, recipes, design doc, deploy-pipeline architecture,
and deploy-logs ops doc to match the new synchronous behaviour
(commit 8505981). The endpoint now returns 200/500 with status,
durationMs, exitCode, errorSummary, and an inline logTail (last
~8KB) — no polling, no companion GET endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 14:56:48 +00:00

1.9 KiB

Deploy logs

Where build logs live and how to read them.

On-disk location

/cial/data/deploy-logs/<deployId>.log

This dir lives in the named state volume (cial-dev-tenant-state in dev, the per-tenant volume in prod), so logs survive container restart.

Format

Plain text. Each line is prefixed with OUT (stdout) or ERR (stderr) followed by the original line:

OUT [@cial/protocol] tsc -b
OUT [@cial/protocol] ✓ done in 1.2s
ERR [@cial/back] error TS2345: ...

Tail in real time

tail -f /cial/data/deploy-logs/$DEPLOY_ID.log

Or only the stderr stream:

tail -f /cial/data/deploy-logs/$DEPLOY_ID.log | grep '^ERR '

Programmatic access

The synchronous POST /api/v1/self/deploy already returns the final row + a logTail (last ~8KB) inline — for builds you trigger from the agent shell, no extra call is needed.

For historical inspection (auth-gated, instance_admin):

# Snapshot of the deploy row (status, exitCode, errorSummary, logPath)
curl -sf http://127.0.0.1:4000/deploy/$DEPLOY_ID | jq .deploy

# Last N deploys
curl -sf "http://127.0.0.1:4000/deploy?limit=20" | jq '.deploys[] | {id, status, mode, startedAt}'

Error summary

Every failed deploy stores the last 20 lines of stderr in the errorSummary column of the deploy SQLite table. That's what surfaces in the UI's deploy panel and in the deploy.done WS event when ok: false.

Streaming via WebSocket

The deploy controller broadcasts deploy.log events to the requesting user's connected tabs. For the self-edit endpoints, requestedByUserId = '__self__', so WS broadcasts go nowhere — the synchronous response carries logTail (last ~8KB) inline, and the full log lives at /cial/data/deploy-logs/<deployId>.log.

Cleanup

Logs are not auto-rotated. If /cial/data/deploy-logs/ grows large, manually rm old .log files. The deploy table will still reference them but will gracefully 404 when reading.