Skip to content

chore(core): review V2 table and durable event type names before GA #34922

Closed as not planned

Description

@kitlangton

While V2 is still beta, do one deliberate pass over durable naming — SQL table names, column names, and versioned event types — so code vocabulary and durable vocabulary match before renames become expensive. Needs discussion with Dax before any migrations land.

Known instance

  • session_context_epoch should likely become session_context_checkpoint: refactor(core): simplify system context into a belief model #34917 renamed the module and symbols (SessionContextEpoch → SessionContextCheckpoint) but deliberately left the table name untouched. ALTER TABLE ... RENAME TO is metadata-only in SQLite (no data or field loss), and the repo already uses the pattern.

Things to settle

  • Multi-process safety: a rename migration applied by one process breaks other already-running processes still reading the old name. During beta this is probably acceptable (V2 state was recently wiped by reset migrations anyway), but decide the general policy: are durable renames allowed until GA, and is there a cutoff?
  • Field-deletion policy: clarify the "never delete fields in a migration" rule vs. history — 20260622142730_simplify_session_context_epoch dropped three columns. Was that a pre-release exemption for V2 tables? Write the actual rule down.
  • Event types: review versioned durable event names (e.g. session.next.*.1) with the same lens; renaming those is harder than tables since old rows replay through decode.

Scope

One review pass producing either "names are fine" or a single migration batch, before V2 GA.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Jul 5, 2026
  2. opencode-agent commented on Jul 5, 2026

    @opencode-agent
    Contributor

    Consolidated #34832 here. Keep its broader audit checks in scope alongside table/event naming: migration-sensitive records, system-context and synthetic-message replay safety, event versioning, and a documented pre-GA outcome checklist.

  3. Dante-dan commented on Sep 26, 2026

    @Dante-dan
    Contributor

    I checked the current v2 tree for the pre-GA naming pass. The original session_context_epoch → session_context_checkpoint example is no longer a live rename: the V2 split migration drops that old table on both upgrade paths. Current context storage uses instruction_state/instruction_entry (schema).

    Two durable names still deserve an explicit decision:

    • session_v2.time_suspended now stores the execution-claim timestamp; the schema calls it a historical column name. A column rename would affect already-running processes and should follow the chosen migration policy.
    • Event rows store ${type}.${version} and replay rejects unknown durable types. Renaming an event therefore needs an old-version decoder/upcast or an explicit pre-GA reset decision; changing the current definition alone would strand existing rows.

    For the requested audit outcome, could the V2 maintainers decide whether pre-GA renames and destructive drops are allowed for V2-only state, the cutoff for that exception, and whether mixed-version processes must remain compatible during a migration? That also resolves the apparent tension with the older simplify_session_context_epoch column drops. I have only inspected source here; no migration or runtime validation is claimed.

  4. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    Thanks for opening this. It's a planning and naming review rather than a bug, so there's nothing to reproduce. Here's what I found when checking the cited facts against the latest dev (f43563b2f4e0), in case it helps the review:

    • session_context_epoch no longer exists on dev. Migration 20260804233008_loose_psylocke drops it (DROP TABLE / DROP TABLE IF EXISTS), and no current schema defines it under the old or new name. The session_context_checkpoint rename may not be needed, unless the table is meant to come back.
    • The column drops are confirmed. 20260622142730_simplify_session_context_epoch did drop agent, replacement_seq and revision, and 20260622170816_reset_v2_session_state later wiped the rows. That supports writing down a pre-GA exemption for V2 tables.
    • The same migration is relevant to the multi-process and deletion policy questions. loose_psylocke also renames session → session_v2 and drops data_migration and session_input.
    • Current table names on dev: project, project_directory, instruction_blob, instruction_state, blob, workspace, kv, credential, account, account_state, event_sequence, plus the session, inbox, worktree, permission, schedule and event tables. Those, along with the versioned event types, are what's left to review.
  5. neriousy commented on Nov 12, 2026

    @neriousy
    Member

    Closing this. The one concrete rename it listed, session_context_epoch → session_context_checkpoint, is no longer needed because migration 20260804233008_loose_psylocke drops that table. V2 has also shipped since then, so any further table or event renames now need their own migration and a specific issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.0coreAnything pertaining to core functionality of the application (opencode server stuff)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions