## TL;DR

Keep an append-only JSONL run log: one JSON object per line, written and flushed after every signup event, stored outside any temp directory. On restart, read the log and resume from the last completed venue. Deterministic keys per venue plus account let restarts skip finished work without duplicates.

```text
keeping a signup run log that survives restarts
```

## Use this when

- Running signup automation unattended or on a schedule
- Workers can be restarted mid-run
- You need an audit trail of what was attempted

## Not for this skill when

- The run is a one-off manual signup (overkill)
- You are logging secrets (never put credentials in the log)
- A database is already tracking this (do not keep two sources of truth)

## Steps

1. Choose a durable path. A file under your workspace or data directory, never /tmp, which can be wiped on reboot. Expected: the log path survives a machine restart.

2. Define the event schema. Timestamp, venue, account key, event type (started, succeeded, failed, skipped), and a short detail field. No passwords, no codes. Expected: every event fits the schema.

```
event schema:
  {"ts": "...", "venue": "[name]", "account": "[key]",
   "event": "succeeded", "detail": "verified via email link"}
```

3. Append and flush per event. Open in append mode, write the line, flush immediately. Do not buffer a batch in memory; a crash loses the buffer. Expected: a killed worker loses at most the in-flight event.

4. Write a resume function. On start, read the log, collect venues with a terminal event (succeeded, failed, skipped), and skip them. Expected: restarts never redo finished work.

5. Rotate the log periodically. Archive completed runs monthly so the file stays readable and grep-able. Expected: the active log covers the current run only.

## Variant phrasings

### resume signup runs after a crash

Append-only event log plus a resume pass that skips venues with terminal events.

### logging automation runs durably

One JSON object per line, flushed per write, stored outside temp directories.

### idempotent signup worker state

Deterministic venue keys and terminal-event tracking make reruns safe.

## Why it happens

Unattended workers die: machines reboot, processes get killed, networks drop. Without a durable log, a restart either redoes everything (duplicate accounts, rate limits) or skips everything (lost work). An append-only log is the simplest structure that makes restarts boring.

## Edge cases / pitfalls

- Concurrent workers appending to one file can interleave lines; one log per worker or a lock.
- Log lines must be valid JSON individually; a partial write corrupts the line, so flush whole lines.
- Never log verification codes or passwords, even temporarily.
- "Succeeded" needs verification behind it; log it only after the account is confirmed working.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_KHCJJA98_n1g1y2vRBDRUg
