Skip to content

[0.1.0] Panel restore: no production producer for restore records or provider registration (bitty#3239 row 13) #3243

Closed

Description

@Xuepoo

Panel restore has no production producer for restore records or provider registration

Follow-up for bitty#3239 row 13 (PlaceholderReason::Incompatible has no producer). PR #3242 landed the rule and the seam; it did not land a consuming path, so row 13 remains open. #3239 stays open until this closes.

Review of #3242 proved the seam is unreachable in a shipped binary: the branch has tests but no producer. This issue names exactly what is missing, in symbols rather than line numbers.

What already landed (do not redo)

  • PanelProviderManifest::parse (crates/bitty-runtime/src/registry/provider.rs) admits any version >= 1 and refuses only 0; PanelProviderManifest::requires_newer_runtime names the admitted skew, so a too-new declaration survives registration instead of being deleted at the gate.
  • PanelRuntime::provider_manifest (crates/bitty-runtime/src/registry/host.rs) is the read-only accessor a bind edge reads.
  • Runtime::restore_one_panel (crates/bitty-runtime/src/runtime/panel_restore.rs) refuses the first bind when the driver's registered manifest requires a newer runtime: it retains the freshly allocated container, presents incompatible, grants nothing, mints no controller generation, and emits no mount/layout/focus op.
  • Rows prove the rule on the restore chain: tests/panel_restore_path.rs::a_provider_manifest_newer_than_the_runtime_keeps_the_container_with_an_incompatible_placeholder and a_provider_manifest_at_the_supported_schema_still_first_binds (version-comparison control), plus lib registry::provider::tests::a_newer_manifest_is_admitted_and_declares_it_needs_a_newer_runtime.

Missing producer 1 — restore records

Runtime::set_panel_restore_records (crates/bitty-runtime/src/runtime/panel_restore.rs:358, takes Vec<PanelRestoreInput>) has no caller outside crates/bitty-runtime/tests/. Both Runtime constructors seed panel_restore_inputs: Vec::new() (crates/bitty-runtime/src/runtime.rs:2589, :2927), so Runtime::plan_panel_restore plans zero records and Runtime::commit_panel_restore runs zero times in a shipped process.

Missing call sites:

  1. Save — nothing encodes a manifest. bitty_ui::encode_manifest / bitty_ui::RestartManifest (crates/bitty-ui/src/panel_persist.rs) exist and are unused by bitty-runtime; Runtime::save_session_to_path (crates/bitty-runtime/src/runtime/session.rs:1676) writes the session snapshot only.
  2. Load — nothing decodes one. bitty_ui::decode_manifest + bitty_ui::plan_restore are not called from Runtime::load_session_from_path (crates/bitty-runtime/src/runtime/session.rs:1732) or from Runtime::apply_session_snapshot (:1255), so no record reaches the restore step before commit_panel_restore runs (session.rs:1473).

Blocking sub-problem: a PanelRestoreInput also needs panel_type and a PanelDriverAnswer, and neither exists on the persisted record. The record's field set is RFC-OQ-9's pending persistence contract (bitty#3239 row 16), so adding the panel type (and the owning plugin) is an encoding change the RFC owns, not a wiring slice — it would bump PERSIST_MANIFEST_VERSION past 2.

Missing producer 2 — provider registration

PanelRuntime::register_panel_provider (crates/bitty-runtime/src/registry/host.rs:1168) also has no caller outside crates/bitty-runtime/tests/, so PanelRuntime::provider_manifest answers None for every owner and provider_contract_outruns_runtime (panel_restore.rs:595) is constant false.

There is no production registration point to wire today: panel.provider is a capability token only (crates/bitty-plugin-host/src/capability.rs, crates/bitty-package/src/manifest.rs), and the plugin manifest grammar accepted by crates/bitty-runtime/src/plugin_runtime/manifest_toml.rs admits only plugin | compat | capabilities | lazy | limits | dependencies — there is no field carrying a provider contract version or a declared panel-type set. Registering a manifest needs that declaration to exist first, then a call at plugin activation.

Missing call sites:

  1. A provider-contract declaration in the plugin package manifest (schema version + declared PanelTypes) and its parser.
  2. PanelRuntime::register_panel_provider at the point a plugin generation activates. Nothing maps a plugin to the PanelDriverAnswer a PanelRestoreInput needs either: no production code resolves "which installed plugin drives this record, and with which panel.* resolution" (PanelDriverAnswer is constructed only in crates/bitty-runtime/tests/panel_restore_path.rs).

Missing producer 3 — a panel host at restore time

Even with both halves supplied, the shipped order makes the step drop every record. crates/bitty-terminal/src/main.rs:1186 runs Runtime::restore_session_on_startup, and the production panel host is only constructed later, inside plugin_runtime::discover_and_activate (main.rs:1241 → crates/bitty-terminal/src/plugin_runtime.rs:1909) and installed into the runtime when the app is built (crates/bitty-terminal/src/terminal_app.rs:1944). A restore before that point answers PanelRestoreDrop::NoPanelHost for every record (row: tests/panel_restore_path.rs::a_runtime_without_a_panel_host_drops_the_record_with_a_typed_reason).

So making row 13 observable end to end needs a startup order where the panel host exists before the session restore — or a deferred panel step applied when the host is installed — which is why this is scoped separately instead of being folded into #3242.

Closing condition

One production chain proves the whole path, and it must fail if any producer is reverted: save a session with a recorded panel → a restart manifest on disk → load in a fresh process → the record's driver registered a provider manifest above PROVIDER_MANIFEST_VERSION_V1 → the restored container presents incompatible, keeps its allocation epoch, holds no controller generation, and is granted nothing. Plus: removing the save-side encode, the load-side decode, or the register_panel_provider call must each turn that row (or its dedicated control) red.

Related: #3239 (row 13 stays open), #3242 (seam landed), #3240/#3241 (the restore edge this gate sits on).

Activity

  1. added
    P1
    area:runtime
    on Nov 18, 2026
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

    P1area:runtime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions