core-agent-ide/codex-rs/state/migrations
Charley Cunningham fce4ad9cf4
Add process_uuid to sqlite logs (#11534)
## Summary
This PR is the first slice of the per-session `/feedback` logging work:
it adds a process-unique identifier to SQLite log rows.

It does **not** change `/feedback` sourcing behavior yet.

## Changes
- Add migration `0009_logs_process_id.sql` to extend `logs` with:
  - `process_uuid TEXT`
  - `idx_logs_process_uuid` index
- Extend state log models:
  - `LogEntry.process_uuid: Option<String>`
  - `LogRow.process_uuid: Option<String>`
- Stamp each log row with a stable per-process UUID in the sqlite log
layer:
  - generated once per process as `pid:<pid>:<uuid>`
- Update sqlite log insert/query paths to persist and read
`process_uuid`:
  - `INSERT INTO logs (..., process_uuid, ...)`
  - `SELECT ..., process_uuid, ... FROM logs`

## Why
App-server runs many sessions in one process. This change provides a
process-scoping primitive we need for follow-up `/feedback` work, so
threadless/process-level logs can be associated with the emitting
process without mixing across processes.

## Non-goals in this PR
- No `/feedback` transport/source changes
- No attachment size changes
- No sqlite retention/trim policy changes

## Testing
- `just fmt`
- CI will run the full checks
2026-02-14 17:27:22 -08:00
..
0001_threads.sql feat: sqlite 1 (#10004) 2026-01-28 15:29:14 +01:00
0002_logs.sql chore: unify log queries (#10152) 2026-01-29 16:28:15 +00:00
0003_logs_thread_id.sql chore: unify log queries (#10152) 2026-01-29 16:28:15 +00:00
0004_thread_dynamic_tools.sql [feat] persist thread_dynamic_tools in db (#10252) 2026-02-03 00:06:44 +00:00
0005_threads_cli_version.sql Leverage state DB metadata for thread summaries (#10621) 2026-02-05 16:39:11 +00:00
0006_memories.sql feat: mem v2 - PR5 (#11372) 2026-02-10 23:22:55 +00:00
0007_threads_first_user_message.sql Leverage state DB metadata for thread summaries (#10621) 2026-02-05 16:39:11 +00:00
0008_backfill_state.sql feat: resumable backfill (#10745) 2026-02-05 14:34:34 +00:00
0009_stage1_outputs_rollout_slug.sql feat: add slug in name (#11739) 2026-02-13 15:24:03 +00:00
0010_logs_process_id.sql Add process_uuid to sqlite logs (#11534) 2026-02-14 17:27:22 -08:00