Skip to content

[CTX-1802] fix(runtime): attribute plugin presentation overlays to their panel generation (bitty#2476 residual 8) - #3132

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-1802/feat-panel-generation-release
Nov 13, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-1802/feat-panel-generation-release

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

bitty#2476 residual 8. PanelRegistry::create_panel_overlay had no production writer, so release_attributed_overlays — reached only from release_generation_scope — dismissed zero overlays on the live path. The live plugin presentation surface (crates/bitty-runtime/src/plugin_runtime/presentation_overlay.rs) kept a private OverlayManager admission and carried no registry attribution at all.

Related #2476 — the issue keeps residuals 5 and 10 open; this does not close it.

What landed

A production writer, at the seam that already exists. The composition root installs the Core-owned SceneHost through PluginRuntime::set_ui_scene_backend (crates/bitty-terminal/src/plugin_runtime.rs:1047). That call now also installs the same host as the presentation session's attribution sink (PresentationOverlayAttribution, presentation_overlay.rs). The sink resolves the presenting generation's own panel — the terminal-slot scene panel SceneHost mints for (owner, epoch) (SceneHost::panel_handle_for) — and admits one attributed non-modal overlay through the new PanelRuntime::create_panel_overlay facade, which is the registry's existing public API.

No new ownership relation, no new plugin-visible verb, grammar, or capability, and no second binding minted by the plugin runtime: the panel identity stays the app-owned host's, and the plugin runtime gains no call direction it did not have (the Rc<SceneHost> was already handed to it).

Teardown is the generation release the tree already runs. clear_ui_blocks (suspend, dispose, crash, reload, activation rollback, services.rs:3193) releases the generation's scene panel → dispose_panel → release_generation_scope → release_attributed_overlays, which now has a non-zero attributed set to dismiss. The session's own clear() releases the row as well (hide, Esc, view-close), and an id the release already dismissed is an idempotent no-op, so a generation edge can neither leak nor double-count a surface.

Boundary stated, not hidden. A generation that mounts no terminal-slot scene owns no panel, so its presentation surface still presents and carries no attribution; the host refusal is counted (attribution_refusals), never silent. Attributing those surfaces needs a panel ownership relation this record does not decide — the same gap residual 5 names.

What stays unwired, and why (residual 5)

release_generation_scope (registry/panel.rs:2964) still has no caller at the plugin generation boundary. Its callers are dispose_panel (panel.rs:2152), present_placeholder (:2347, itself without a production caller) and rebind_panel phase 1 (:3752, whose production activation-time caller is also absent). Adding the edge caller needs the owner decision recorded in bitty-terminal-docs/specifications/panel-generation-ownership-decision.md — status: draft, accepts nothing:

  • Which surface performs the release, and what mints the controller generation. The live generation edge holds (plugin_id, ui_epoch: u32) (plugin_runtime/services.rs:1947; set_ui_epoch at :2621), while the release needs a registry (PanelId, Generation(u64)). Nothing in the tree compares the two counters, and a plugin-side (plugin_id, epoch) → PanelId ledger would be the second binding A.3 / the single-fence rule rejects.
  • No implementor can reach the registry. ReloadResources (bitty-plugin-host/src/lifecycle.rs:450) has zero production implementors (only tests/lifecycle.rs:180), so reload_generation (:473) is not on the live path.
  • The nearest edge is a dispose, not a release. The plugin runtime reaches the panel host only through SceneHost, whose release_owner (scene_host.rs:342) disposes the panel two lines later (release_panel, :471); dispose_panel already runs the release first, so a release call placed there would be a no-op.

That decision is not invented here. Residual 5 stays unwired.

Discrimination proof

The attribution hunk was reverted in a scratch copy (never in this worktree) with its own CARGO_TARGET_DIR:

export CARGO_TARGET_DIR=/home/fuyu/.hermes/cache/scratch/ctx-1802-prefix-target
cd /home/fuyu/.hermes/cache/scratch/ctx-1802-prefix-1794522559
cargo test -p bitty-runtime --test presentation_overlay_attribution --offline
RED_EXIT=101
test suspend_releases_the_attributed_surface ... FAILED
test presented_surface_is_attributed_to_the_generation_panel ... FAILED
test generation_release_dismisses_the_attributed_surface ... FAILED
test generation_without_a_panel_presents_unattributed ... FAILED
thread 'presented_surface_is_attributed_to_the_generation_panel' panicked at tests/presentation_overlay_attribution.rs:270:5:
assertion `left == right` failed: the presented surface is attributed in the panel registry
thread 'generation_without_a_panel_presents_unattributed' panicked at tests/presentation_overlay_attribution.rs:410:9:
assertion `left == right` failed: the unavailable attribution is counted, never silent
test result: FAILED. 0 passed; 4 failed

Restored (file copied back, diff -q clean), same target dir:

cargo test -p bitty-runtime --test presentation_overlay_attribution --offline
GREEN_EXIT=0
test generation_release_dismisses_the_attributed_surface ... ok
test presented_surface_is_attributed_to_the_generation_panel ... ok
test generation_without_a_panel_presents_unattributed ... ok
test suspend_releases_the_attributed_surface ... ok
test result: ok. 4 passed; 0 failed

The dismissal test is written so the registry release, not the session, is observably the dismisser: after the panel disposal it asserts the attributed row is gone (attributed_overlay_count() == 0, overlay_count() == 0) while the presentation session is still live and still holds the row id — the session's own clear() would have cleared it.

Gates run (real output)

$ cargo fmt --all -- --check
FMT_EXIT=0

$ cargo clippy -p bitty-runtime --all-targets --offline -- -D warnings
CLIPPY_EXIT=0
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 16.38s

$ cargo test -p bitty-runtime --test presentation_overlay_attribution --offline
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

$ cargo test -p bitty-runtime --test presentation_overlay_api --offline
test result: ok. 8 passed; 0 failed
$ cargo test -p bitty-runtime --test panel_rebind --offline
test result: ok. 11 passed; 0 failed
$ cargo test -p bitty-runtime --test panel_unbind_release --offline
test result: ok. 6 passed; 0 failed
$ cargo test -p bitty-runtime --test panel_workspace_dispose --offline
test result: ok. 10 passed; 0 failed
$ cargo test -p bitty-runtime --test panel_generation_ownership --offline
test result: ok. 3 passed; 0 failed

$ cargo test -p bitty-runtime --lib --offline
test result: ok. 1613 passed; 0 failed; 0 ignored

$ cargo +1.85 check -p bitty-runtime --tests --offline
MSRV_EXIT=0
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 26.49s

$ RUSTDOCFLAGS="-D warnings" cargo doc -p bitty-runtime --no-deps --offline
DOC_EXIT=0

$ cargo check -p bitty-runtime --tests --target x86_64-pc-windows-gnu --offline
WIN_EXIT=0
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 23.82s

just ci-local is unusable in this worktree (infra, not code)

Run once (CARGO_BUILD_JOBS=12), and it aborts before any Rust gate executes:

[CI/Quality gates]  | error:
[CI/Quality gates]  |  … while fetching the input 'git+file:///mnt/data/Workspace/Projects/bitty-terminal/bitty/.worktrees/ctx-1802-panel-generation-release'
[CI/Quality gates]  |  error: opening Git repository ".../.worktrees/ctx-1802-panel-generation-release": failed to resolve path '/mnt/data/Workspace/Projects/bitty-terminal/bitty/.git/worktrees/ctx-1802-panel-generation-release': No such file or directory (libgit2 error code = 2)
[CI/Quality gates]  | check-nix-lock: FAIL: flake.lock does not resolve; run 'nix flake lock' in the repository root
[CI/Quality gates]  ❌  Failure - Main Verify flake.lock resolves
[CI/Quality gates]  ❌  Failure - Main Show sccache stats (shard 1/2)  [line 2: --show-stats: command not found]
error: recipe `ci-local` failed with exit code 1

The act container mounts the worktree directory but not the parent repository's .git/worktrees/<name> metadata, so nix flake metadata on the git+file: input cannot open the repo; the sccache step then fails because the wrapper is not on the image's PATH. Both are runner-environment defects on this host, unrelated to this change (the branch touches no flake, no CI config, and no dependency edge). No local CI green is claimed — the focused gates above are what ran.

Review pointers

  • PresentationOverlayAttribution is a host-only backend seam, spelled like the sibling PanelCreateHandler / PanelPinHandler seams; it mints nothing the plugin can name.
  • The presentation session keeps its own OverlayManager admission for the 4+1 budget and the never-modal invariant, and the registry row carries the attribution; the two are created and destroyed together, so neither can outlive the surface. Collapsing them into one registry row is the follow-up that would move presentation admission onto the registry's manager — an overlay-ownership change outside this residual, since the accepted overlay-ownership reconciliation puts budget and modal authority in OverlayManager.
  • SceneHost::panel_handle_for looks up by owner only: the host holds at most one scene panel at a time and a new epoch re-mints it, so a stale epoch cannot address a live panel.
  • No assertion was weakened, no #[allow] added, no host path or username hardcoded.

Summary by CodeRabbit

  • New Features

    • Presentation surfaces can now be associated with the panel that presented them, making their ownership clearer.
    • Panels can create, dismiss, and query overlays, with counts available for all overlays or only those associated with panels.
  • Bug Fixes

    • Associated presentation surfaces are released when hidden or when their panel is disposed or suspended. Presentations remain available when no panel can be associated.

…eir panel generation

bitty#2476 residual 8. `PanelRegistry::create_panel_overlay` had no production
writer, so `release_attributed_overlays` -- reached only from
`release_generation_scope` -- dismissed zero overlays on the live path. The
live plugin presentation surface (`plugin_runtime/presentation_overlay.rs`)
kept a private `OverlayManager` admission and no registry attribution.

Wiring, at the seam that already exists: the composition root installs the
Core-owned `SceneHost` through `PluginRuntime::set_ui_scene_backend`, and that
call now also installs the same host as the session's attribution sink
(`PresentationOverlayAttribution`). The sink resolves the presenting
generation's own panel -- the `terminal`-slot scene panel `SceneHost` mints for
`(owner, epoch)` -- and admits one attributed, non-modal overlay through the new
`PanelRuntime::create_panel_overlay` facade, which is the registry's existing
public API. No new ownership relation, no new plugin-visible verb or grammar,
no second binding minted by the plugin runtime: the panel identity stays the
app-owned host's.

Teardown is the generation release the tree already runs. `clear_ui_blocks`
(suspend, dispose, crash, reload, activation rollback) releases the
generation's scene panel, `dispose_panel` calls `release_generation_scope`, and
that now has a non-zero attributed-overlay set to dismiss. The session's own
`clear()` releases the row too (hide, `Esc`, view-close), and an id the release
already dismissed is an idempotent no-op, so a generation edge cannot leak or
double-count a surface.

Boundary stated rather than hidden: a generation that mounts no terminal-slot
scene owns no panel, so its presentation surface still presents and carries no
attribution. The refusal is counted (`attribution_refusals`), never silent.
Attributing those surfaces needs a panel ownership relation this record does
not decide.

Residual 5 stays unwired. `release_generation_scope` has no caller at the
plugin generation boundary, and adding one still needs the owner decision
recorded in `bitty-terminal-docs/specifications/panel-generation-ownership-decision.md`
(draft, accepts nothing): which surface performs the edge release, and what
mints the controller generation. The live generation edge holds
`(plugin_id, ui_epoch: u32)` (`plugin_runtime/services.rs:1947`,
`set_ui_epoch` at `:2621`), while the release needs a registry
`(PanelId, Generation(u64))`; nothing compares the two counters, and a
plugin-side panel ledger would be the second binding the single-fence rule
rejects. `bitty-plugin-host`'s `ReloadResources`
(`lifecycle.rs:450`) still has no production implementor, so `reload_generation`
(`:473`) is not on the live path either. The panel host is app-owned and the
plugin runtime reaches it only through the scene host, which disposes the panel
at the same edge -- so a release call placed there would be a no-op in front of
`dispose_panel`. This PR does not invent that decision.

Tests: `crates/bitty-runtime/tests/presentation_overlay_attribution.rs` (4) over
a real plugin VM and the production composition seam -- attribution to the
generation's panel and generation, dismissal observed while the presentation
session is still live (so the registry release, not the session, dismissed it),
suspend releasing surface and row, and the unattributed boundary. Mutation
proof: the attribution hunk reverted in a scratch copy with its own
`CARGO_TARGET_DIR` turns all 4 red
(`assertion left == right failed: the presented surface is attributed in the
panel registry`); restored, all 4 green.
@Xuepoo Xuepoo added fix Bug fix P1 Priority: high labels Nov 12, 2026
@Xuepoo Xuepoo added this to the v0.1.0 milestone Nov 12, 2026
@Xuepoo Xuepoo added area:runtime Area: runtime orchestration area:panel Area: panel surface labels Nov 12, 2026
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The runtime now links presentation sessions to panel-attributed overlays when a scene host is available. The scene host and panel runtime expose overlay admission, dismissal, lookup, and counts. Clearing or replacing attribution releases rows. Tests cover hiding, panel disposal, suspension, and presentation without a panel.

Changes: Presentation overlay attribution

Layer / File(s) Summary
Panel overlay admission and lookup
crates/bitty-runtime/src/registry/host.rs, crates/bitty-runtime/src/scene_host.rs
PanelRuntime and SceneHost add methods to create and dismiss panel-attributed overlays, query their attribution, and count overlays.
Presentation attribution lifecycle
crates/bitty-runtime/src/plugin_runtime/presentation_overlay.rs
PresentationOverlay adds an attribution sink, tracks attributed rows and refused admissions, and releases attributed rows when the sink changes or a session clears.
Runtime wiring and lifecycle tests
crates/bitty-runtime/src/plugin_runtime/mod.rs, crates/bitty-runtime/tests/presentation_overlay_attribution.rs
PluginRuntime installs or clears the attribution sink based on the scene host. Integration tests cover presentation, hiding, panel disposal, suspension, and presentation without a panel.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant PluginRuntime
  participant PresentationOverlay
  participant SceneHost
  participant PanelRuntime
  PluginRuntime->>PresentationOverlay: installs attribution sink
  PresentationOverlay->>SceneHost: requests attributed overlay for owner
  SceneHost->>PanelRuntime: creates panel overlay
  PresentationOverlay->>SceneHost: releases attributed overlay on clear
  SceneHost->>PanelRuntime: dismisses overlay
Loading

Possibly related issues

  • bitty-terminal/bitty#2476 — This change adds generation attribution for overlays. The supplied issue context says generation-boundary release remains unwired, so the ownership question is still open.

Possibly related PRs

  • bitty-terminal/bitty#2856 — Introduces the presentation-overlay session and grant contract extended by this change.
  • bitty-terminal/bitty#2799 — Introduces SceneHost, set_ui_scene_backend, and the shared PanelRuntime used by the attribution wiring.

Suggested labels: fix, area:runtime

Merge Risk: Low · up to f3381

Plugin overlays are now attributed to the presenting generation's panel. If a plugin unmounts and remounts its scene panel while an overlay is showing, the overlay is not re-attached to the new panel and will not close when that panel is disposed. The user can still dismiss it with Esc, and the author lists panel ownership as an open item. This is a bounded limitation that the owner should be aware of; it is not a merge blocker.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: plugin presentation overlays are attributed to their panel generation in the bitty-runtime crate. The diff adds PresentationOverlayAttribution, PanelRuntime overlay me…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: plugin presentation overlays are attributed to their panel generation in the bitty-runtime crate. The diff adds PresentationOverlayAttribution, PanelRuntime overlay methods, SceneHost attribution, and tests that match this. The title is long (113 characters) and carries a ticket tag and a residual reference, but it still identifies the primary change, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1

crates/bitty-runtime/src/plugin_runtime/presentation_overlay.rs-231-236: 1

231-236: Minor · Data Integrity & Integration · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Restore attribution when replacing a live sink.

If set_ui_scene_backend installs a sink again while a session is live, set_attribution releases the existing row and retains the session. It does not admit a row through the new sink. This also happens when the caller supplies the same scene host again. Admit through the replacement sink when it can resolve the live session’s panel. (raw.githubusercontent.com)

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 764dc75f-4f92-4030-a963-2c21e67b50cd
Commits

Reviewing files that changed from the base of the PR and between 9d0e8a8 and f33812b.

Files selected for processing: 5

  • crates/bitty-runtime/src/plugin_runtime/mod.rs
  • crates/bitty-runtime/src/plugin_runtime/presentation_overlay.rs
  • crates/bitty-runtime/src/registry/host.rs
  • crates/bitty-runtime/src/scene_host.rs
  • crates/bitty-runtime/tests/presentation_overlay_attribution.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review — residual 8 claim

Claim under review: PanelRegistry::create_panel_overlay gains a production caller on the live plugin presentation path, so release_generation_scope → release_attributed_overlays dismisses a non-zero overlay set at the plugin generation edge. Residual 5 explicitly not claimed.

Everything below was re-derived at f33812b in a scratch copy of the tree with its own CARGO_TARGET_DIR (never the lane's target). No assertion below rests on the PR description.

1. Production writer is installed on a path a real run reaches — PASS

The sink is installed inside the existing seam, not a new one: PluginRuntime::set_ui_scene_backend (crates/bitty-runtime/src/plugin_runtime/mod.rs:1762-1769). Its production caller already existed at startup: crates/bitty-terminal/src/plugin_runtime.rs:1042-1049 builds SceneHost over the app's own PanelRuntime and installs it. The session that the sink is attached to is the same Rc the shipped Lua verbs drive (bitty-lua/src/host.rs:6660 for bitty.ui.overlay.show, :6764 for bitty.present.show → plugin_runtime/services.rs:6218 → presentation_overlay.rs:306-315). Not a test-harness-only wiring.

2. One session object, no second binding — PASS

mod.rs:3138 hands the runtime's presentation_overlay Rc to the services; the attribution is set on that same Rc at mod.rs:1763-1769, so there is no chance of attributing a session the verbs never touch. scene_host_attribution wraps the app-owned Rc<SceneHost> (presentation_overlay.rs:124-128), and the panel identity stays the host's .panel_handle_for(owner) (scene_host.rs:394), matched by the same plugin_id string used for SceneHost::attach (services.rs:5881 vs services.rs:6218).

3. The new test can actually fail — PASS

In the copy I removed the production wiring (the scene_host_attribution/set_attribution hunk at mod.rs:1763-1769) and re-ran the suite:

test suspend_releases_the_attributed_surface ... FAILED
test generation_without_a_panel_presents_unattributed ... FAILED
test presented_surface_is_attributed_to_the_generation_panel ... FAILED
test generation_release_dismisses_the_attributed_surface ... FAILED
test result: FAILED. 0 passed; 4 failed
panicked at tests/presentation_overlay_attribution.rs:273: the presented surface is attributed in the panel registry (left: 0, right: 1)

Restored, same target dir, 4 passed. So the tests are load-bearing on the production hunk, not merely on the new API surface.

4. release_generation_scope really releases a non-zero set — PASS (measured)

This was the check most able to hide behind a green test, so I instrumented crates/bitty-runtime/src/registry/panel.rs:3079 in the copy and re-ran generation_release_dismisses_the_attributed_surface:

PROBE panel.gen=Generation(2) controller=None handle.gen=Generation(2)
PROBE release_generation_scope panel=PanelId(1) gen=Generation(2) overlays=1

The attributed row is written under the scene panel's handle generation (scene_host.rs:424-427), the panel carries no bound controller here, so grant_key_generation() resolves to the allocation epoch and the release key matches: the release itself released 1, not 0 with the epoch sweep (panel.rs:2767) doing the work.

5. Dismissal assertion is not tautological — PASS, with a precision gap

The assertion reads two independent structures — the attribution map (attributed_overlay_count, panel.rs:2731) and the OverlayManager (overlay_count, panel.rs:2790) — and additionally asserts the session still holds the id (tests/presentation_overlay_attribution.rs:337-342), so the registry, not the session's clear(), is observably the dismisser. That is the right shape.

Gap: it does not pin which registry pass ran. dispose_panel (panel.rs:2152) runs release_generation_scope and then sweep_allocation_epoch_families (panel.rs:2767), which dismisses by panel id; the assertions would go green if the release released 0 and the sweep released 1. unbind_release_record cannot be asserted after dispose because release_records is removed in dispose_panel (panel.rs:2205). My out-of-tree probe (check 4) settles the question for this revision; the in-tree test does not. A test that calls release_generation_scope on the unbind edge before the dispose, or that keeps the record readable, would pin it. Non-blocking.

6. The other teardown edges cannot leak an attributed row — PASS

clear() releases the attributed id through the sink (presentation_overlay.rs:504-512), reached by hide / Esc / view-close, and show() on the same owner replaces the handle in place without re-admitting (presentation_overlay.rs:266-274), so no second row is minted. In-tree: hide → 0 rows (tests/presentation_overlay_attribution.rs:295-297), suspend → 0 rows and 0 panels (:372-382). A repeat release is deliberately idempotent (panel.rs:2735 → Option, scene_host.rs:441-445), and test 2 asserts the post-suspend release of an already-dismissed id is a no-op (:350-355).

7. Residual 5 stays unclaimed — PASS

No new caller of release_generation_scope was added; its production callers are unchanged (panel.rs:2152, :2347, :3752), and the doc comment at mod.rs:1755-1761 describes the release arriving via panel disposal, not a new generation edge. The PR body states residual 5 stays unwired and lists the three reasons. Test 3 (suspend_releases_the_attributed_surface) does not by itself distinguish "registry release" from "session clear" at that edge — test 2 carries that burden — but it does not overclaim, and the test module header states the no-panel boundary instead of hiding it.

8. MSRV 1.85 and repo hygiene — PASS

cargo fmt --all --check → exit 0 on f33812b; cargo clippy -p bitty-runtime --all-targets -- -D warnings → exit 0 (clean, my copy); CI's "MSRV 1.85 check" job is SUCCESS on this SHA. No let-chains: the sink swap uses nested if let (presentation_overlay.rs:230-238). No #[allow], no hardcoded host paths/usernames/ports — the harness uses std::env::temp_dir() plus the pid (tests/presentation_overlay_attribution.rs:72-78), and the only expect()s added are in test code.

Suite state

cargo test -p bitty-runtime in the copy: 201 suites ok, 0 regressions. One suite (spawn_surface::granted_production_backend_runs_confined_git) failed only because my scratch copy was not a git repository — it runs git status --porcelain and stores the output against the 8 KiB store ceiling; after git init + a clean commit in the same copy it passes 7/7. Environmental, not this diff.

Non-blocking notes

  • Docs will go stale on merge: bitty-terminal-docs/specifications/panel-generation-ownership-decision.md:273 and :938 still say create_panel_overlay "has no production caller … implemented-only (unwired)". The record is status: draft and accepts nothing, so this is not a merge gate, but the row is false the moment this lands — worth a same-PR or linked docs touch.
  • attribution_refusals() (presentation_overlay.rs:250) has no production reader, so "counted, never silent" currently means "available in a getter". A diagnostics consumer would make it true rather than nominal.
  • Budget interaction: the presented surface now occupies one registry slot in the window OverlayManager (bitty-ui/src/panel.rs:224, MAX_OVERLAYS_PER_WINDOW = 4) while the session keeps its own admission for 4+1. Nothing else writes registry overlays today, so no conflict is reachable, but a future second writer plus a live presentation surface can refuse a real overlay. The refusal path degrades to unattributed and counted, so it fails open.
  • Latent key mismatch: the row is keyed by the allocation epoch (scene_host.rs:426), while release_generation_scope releases by the binding/controller key (panel.rs:2964-3090). Unreachable now — the scene panel never binds a controller (measured above: controller=None) — but if it ever did, only dispose_panel's epoch sweep would reclaim the row; a pure unbind edge would not.

I did not find a case where the PR's claim holds less than stated, and the one measurement that could have falsified it (overlays=1 at the release) came back positive on a real run through the shipped verbs.

VERDICT: APPROVE

@Xuepoo
Xuepoo merged commit 3311892 into main Nov 13, 2026
42 of 49 checks passed
@Xuepoo
Xuepoo deleted the ctx-1802/feat-panel-generation-release branch November 13, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:panel Area: panel surface area:runtime Area: runtime orchestration fix Bug fix P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant