Skip to content

initiative: define evolution rules for OpenPI-owned persisted sidecars #901

Open

Description

@outlier27-cell

Problem

OpenPI already persists several package-owned records with independently
versioned decoders: setup configuration, Workflow replay journals, Plan Mode
custom entries, Web turn-change evidence, and Workflow artifact markers.
Their current behavior is intentionally defensive but differs by owner:
explicit migration on save, unavailable/no reuse, blocked writes, ignored
evidence, or an invalid artifact.

That is appropriate locally, but the repository has no small, explicit
contract for deciding which owner owns a record, which versions it supports,
and what legacy/future/malformed input must do. During normal evolution this
can turn a newly added record version into an accidental compatibility choice.

This is not a request to migrate Pi Session JSONL. Pi remains the owner of
Session identity, transcript persistence, resume, fork, and compaction.

Current evidence

  • Setup config has configVersion: 1; legacy unversioned config is diagnosed
    and migrated only on an explicit save, while malformed input remains
    preserved and non-writable.
  • Workflow journal is version 2 and intentionally rejects v1 because replay
    would otherwise lack side-effect/resource identity.
  • Plan Mode accepts only exact version-1 entry shapes and blocks writes when
    the latest state is malformed.
  • Web turn-change evidence accepts only v1/v2 records with distinct
    invariants and byte bounds.
  • Workflow commit markers validate their version and artifact manifest before
    recovery.

Related but non-duplicate work: #73 handles release/engineering drift; #181
tracks Pi AgentHarness compatibility; #193 owns Session/recovery boundaries;
#196 owns execution lifecycle planes; #118/#125 fixed one Workflow fail-open
state decoder; #631, #698, and #714 are focused decoder fixes.

Goal

Define and enforce a small compatibility contract for OpenPI-owned persisted
sidecars
:

  1. each record declares its owner, version, supported input versions, and
    legacy/future/malformed outcome;
  2. unsupported input cannot be mistaken for a successful/complete execution;
  3. a migration is explicit, bounded, and owner-local; and
  4. user-visible diagnostics identify the affected capability without exposing
    record contents or rewriting user data implicitly.

Non-goals

  • no migration, rewrite, or storage ownership for Pi Session JSONL;
  • no database, global persistence registry, global resource router, or second
    Session store;
  • no automatic background rewrite of user configuration or artifacts;
  • no provider request capture, credential export, or Web UI redesign;
  • no change to existing replay, lifecycle, or delivery ownership.

Staged milestones

  1. Inventory and decision: source-pinned table of OpenPI-owned versioned
    records, their current behavior, and proposed owner-local compatibility
    outcome. Stop if a candidate record is Pi-owned.
  2. Executable contract: add bounded fixture coverage for legacy, known,
    future, and malformed inputs in three existing record families. Preserve
    their intentionally different outcomes.
  3. One reviewed evolution: only after milestone 2 and maintainer agreement,
    make one small schema evolution explicit with its decoder, diagnostic, and
    regression tests. No bulk historical rewrite.
  4. Review: decide whether the result warrants a durable Decision or whether
    local owner tests remain sufficient.

First PR: deliberately small boundary

Add a source-pinned inventory and tests around existing decoders only:

  • extensions/shared/setup-config.ts legacy/future/malformed behavior;
  • extensions/workflows/journal.ts replay safety for legacy/future journals;
  • extensions/plan-mode/persisted-state.ts malformed/future entry behavior.

The PR must not add a shared runtime abstraction, alter Pi Session files, write
real user data, or change any existing successful behavior. It should use
synthetic in-memory/temp fixtures and point to the relevant owners.

Acceptance evidence

  • a reviewed owner/version/outcome table covers every included record;
  • tests prove that unknown/future records never produce a false successful
    execution, replay, or writable state;
  • legacy support remains explicit and tested where intentionally supported;
  • malformed records preserve fail-closed behavior and do not silently rewrite
    source data;
  • Pi Session fixtures, provider credentials, and workspace files are absent
    from the test inputs;
  • bun run check, targeted tests, and bun run test pass.

Risks and decisions needed

  1. Which records are truly OpenPI-owned rather than Pi-owned or provider-owned?
  2. For each owner, should an unknown future version be unavailable, preserved
    for an explicit migration, or block the local capability?
  3. Is a repository-level inventory useful enough to maintain, or should the
    contract remain only in owner-local tests and docs?
  4. Which one record family is the appropriate first schema evolution, if any?

Please confirm the ownership boundary before implementation. If this belongs
under #193 or #196 instead, this Issue should be closed as a duplicate and the
inventory attached to that tracker.

Activity

  1. outlier27-cell commented on Oct 24, 2026

    @outlier27-cell
    ContributorAuthor

    I am claiming P0 only: a source-pinned inventory of the existing OpenPI-owned decoder seams plus legacy/future/malformed synthetic-fixture contract tests.

    I am not claiming or starting any schema migration, automatic user-data rewrite, Pi Session-file work, second Session store, global migration engine, or runtime orchestration change.

    @tt-a1i @testikun, could you please confirm the ownership boundary: which persisted sidecars are appropriately OpenPI-owned for this contract, and whether this belongs here rather than under #193 or #196? This is a scope question only; I am not asking for approval or merge.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions