o2r packaging: one-time import of historical Agent Channel data into the packaged channels deployment #52
Labels
No labels
burndown-2026-06
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/otel-a2a-relay#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #45. Depends on #47 (channels layer must be deployed with its own Postgres first).
Goal: one-time import of the historical Agent Channel data ("historical o2r runs") into the newly-packaged channels deployment. Kai: we only need to do this once - not a vendored seed, not a recurring tool.
What the data is / where it lives now
otel-a2a-relay-cli(o2r channel ...) against configbase_url(defaulthttp://api, the tailnet sidecar).GET /agent-channel.VUJD(Qwen/Ollama keep-alive) andTU7P(rdp-restore-kai-desktop-tower) OPEN; closed ones viao2r channel list --all.Migration approach (preferred: DB-level)
pg_dumpthe channel tables from the current backend's Postgres -> restore into the #47 deployment's Postgres. Schema is the channels packageSCHEMAconstant, so source and target schemas match - preserves channel ids, event ordering, and timestamps.o2r channel list --all+o2r channel events <id>on the source, re-POST /agent-channel+.../eventagainst the new deployment. Note: API replay may re-stampcreated_at/event times and mint new ids unless the channels API is extended to accept them - call that out before choosing this path.Sequence
o2rbase_urlat the new deployment -> verify -> retire the old store.Acceptance
o2r channel list --allagainst the new deployment shows the same channels (open + closed) as the old backend, ando2r channel events <id>returns the same event history for a spot-checked channel.DB-level path verified — source store probed (read-only)
Connected to the old store via the DSN Kai supplied (
postgresql://backend@backend-db/backend, reachable over tailnet) and ran SELECT-only probes. DB-level dump/restore is confirmed viable and trivial.Schema parity: the live store's tables are exactly the packaged
SCHEMA(channels/src/otel_a2a_relay_channels/router.py):agent_channels(id text, title, created_by, created_at, closed_at)andagent_channel_events(id bigint, channel_id->agent_channels CASCADE, kind, author, payload jsonb, created_at). No conversion needed - source schema == target schema.What's there (as of 2026-06-02):
agent_channels: 6 rows - TU7P (open), VUJD (open), VHGC, DWUW, Q9WR, XCMG (closed). XCMG is "o2r CLI smoke test (safe to ignore)" - consider dropping it on import.agent_channel_events: 72 rows (VHGC 44, DWUW 17, Q9WR 6, TU7P 2, VUJD 2, XCMG 1).Critical scoping caveat: the old DSN points at a shared backend DB. Alongside the two channel tables it also holds
documents,queue_jobs,sentinels,sql_tables(unrelated backend data). The migration must dump onlyagent_channels+agent_channel_events- never a whole-DBpg_dump.Concrete migration (data-only, target schema pre-created by the channels app's
SCHEMA):pg_dump orders parent (
agent_channels) before child (agent_channel_events), so the CASCADE FK is satisfied. Run once at #47 cutover; target is the packaged channels deployment's Postgres. OptionallyDELETE FROM agent_channels WHERE id='XCMG';post-import to drop the smoke-test channel.Acceptance (unchanged):
o2r channel list --allagainst the new deployment shows the same 6 (or 5 sans XCMG) channels;o2r channel events <id>matches for a spot-checked channel (e.g. VHGC's 44 events).Source DSN host is a meaningful name (
backend-db); resolved tailnet FQDN/IP are opaque and deliberately omitted here per SSM rules.Cutover note: the new channels deployment is tailnet-only (see #47). The
o2rbase_urlrepoint after import must target the new service's tailnet address, never a public endpoint.Backlog burndown 2026-06-17: closing low-priority (P3/P4) to bring the open count to a manageable level. Nothing lost — reopen if this resurfaces. Batch tag:
burndown-2026-06.