Skip to content

[CTX-0097] docs(specifications): propose the panel.overlay capability grammar - #189

Merged
Xuepoo merged 2 commits into
mainfrom
docs/ctx-0097-panel-overlay
Nov 13, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
docs/ctx-0097-panel-overlay

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

What this adds

One candidate specification, specifications/panel-overlay-capability-candidate.md, plus its row in the specifications index.

The gap it addresses: the Core half of a panel-attributed overlay landed in bitty#3132 — SceneHost::admit_attributed_overlay (crates/bitty-runtime/src/scene_host.rs:418) admits an attributed overlay through PanelRegistry::create_panel_overlay (crates/bitty-runtime/src/registry/panel.rs:2708), and the presentation session is its only caller through PresentationOverlayAttribution. The plugin-facing half does not exist: panel.overlay is a capability string (crates/bitty-plugin-host/src/capability.rs:217, :547) with no host backend, no grammar, no bound and no error code. This document is candidate text for RFC-OQ-5 (panel.* capability mapping) and claims no acceptance.

Proposed surface

bitty.panel.overlay_show(panel_id, opts) -> overlay_id
bitty.panel.overlay_hide(panel_id, overlay_id) -> boolean

The bitty.panel.* namespace is used deliberately: bitty.ui.overlay.* is already spent on the W-01 capture surface (ui.overlay.focus) and on the presentation spellings of bitty.ui.present.* (ui.present). opts carries a kind from the closed plugin domain (nonmodal, tooltip; Modal and Palette refused because the modal authority stays Core-owned), an optional tier at or below the kind ceiling, text (128 chars) and tooltip (256), and optional bounds/anchor requests that host policy may narrow. Multiplicity is 1 per (panel_id, generation), 2 per plugin generation, inside the accepted 4+1 window envelope; a second raise supersedes and the old id goes stale.

Bounds: borrowed vs proposed

Borrowed and cited to their owners, never restated as new: the 4+1 envelope and OverlayBusy (Panel Runtime RFC; MAX_OVERLAYS_PER_WINDOW = 4), overlay text 128 / tooltip 256 (MAX_OVERLAY_TEXT_LEN, MAX_OVERLAY_TOOLTIP_LEN), SCN-1..SCN-5 (2048 nodes, depth 32, 256 KiB per block, 2 MiB and 64 blocks per terminal, Rich Presentation RFC), SNAPSHOT_MAX_BYTES 256 KiB, RC-5 queue budgets (64 per subscription, 1024 events / 256 KiB per plugin), PENDING_DISMISSED_MAX 64, RC-1 and RC-2.

Marked proposed with a one-line rationale each: OV-1 (1 live attributed surface per panel generation), OV-2 (2 live surfaces per plugin generation), OV-3 (8 admissions per second per generation), OV-4 (4096-cell bounds area, no axis above 256). Refusing over-cap text instead of truncating it, and the superseded dismissal reason, are also labelled proposed.

Denials and lifetime

New codes in the existing style — E_PANEL_OVERLAY_INVALID, E_PANEL_OVERLAY_UNAVAILABLE, E_PANEL_OVERLAY_NOT_OWNER, E_PANEL_OVERLAY_BUDGET — with E_CAPABILITY_DENIED and E_TIMEOUT reused. Six ordered checks, all before allocation, and the rule taken from the code's own refusal path: a refusal allocates nothing. Dismissal is by the raising plugin, generation release (release_attributed_overlays), panel disposal (the epoch sweep), or Core (Esc / view close), never by callback. A raise by a generation that owns no panel is refused and counted rather than degrading to an unattributed surface, unlike the Core presentation path.

Gates

just check from the worktree root, all recipes green: fmt-check (prettier 3.9.6), markdownlint (0.23.1, 0 issues, 111 files), links, metadata, language, agents, hygiene, svg, actionlint (1.7.12). No bunx segfault on this run.

Scope

Documentation only. No behavior, no capability is granted, no accepted contract is amended. Acceptance of RFC-OQ-5 remains with the panel-contract owner.

Related bitty-terminal/bitty#2476 (residual 8, RFC-OQ-5) and Related bitty-terminal/bitty#2191.

…ds, and error codes

The Core admits a panel-attributed overlay (bitty#3132) but no plugin-facing
verb exists: panel.overlay is a capability string with no backend, grammar,
bound, or error code. This candidate specifies bitty.panel.overlay_show/hide,
the parameter grammar, borrowed SCN/RC/envelope bounds with their owners,
OV-1..OV-4 as explicitly proposed values, typed denials that allocate nothing,
and lifetime across the three existing overlay owners. Acceptance (RFC-OQ-5)
is out of scope.
@Xuepoo Xuepoo added docs Documentation P1 Priority: high area:ui Area: UI / layout area:plugins labels Nov 13, 2026
… the gap section

Corrects the manifest and consent-profile line numbers and records that the
panel-scoped grant row already exists (grant_panel_capability) while nothing
consumes it to admit a surface.

@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.

Guard verification (2026-11-13 cron tick)

Read-only check of the candidate's load-bearing claims. Everything below was re-read by symbol/text, at bitty origin/main 3311892f:

  • Namespace choice is grounded, not invented. bitty.ui.overlay.* already means the W-01 capture/transient surface (sdk/plugin-api-v1-lua-surface-rfc.md:43-53), and bitty.panel.* really ships create/close/destroy/get_presentation/set_presentation/toggle_floating (crates/bitty-runtime/src/plugin_runtime/services.rs:6988-7057, several answering not_implemented). Proposing overlay_show/overlay_hide in that prefix instead of a third meaning on ui.overlay is the defensible reading.
  • Borrowed constants point at their owners. The 4 + 1 envelope and OverlayBusy are panel-runtime-rfc.md PR-10 (<= 4 active plus 1 modal, per window); the 128/256 text/tooltip and SCN-1..5 rows are the accepted RichBlock/render constants; RC-1/RC-2 come from runtime/isolation-resource-rfc.md. OV-1..OV-4 are marked proposed with a rationale each, which is what the corpus requires for a new number.
  • The tier gap is real. Overlay carries id, kind, bounds, text, tooltip, generation, truncated and no tier field (crates/bitty-ui/src/panel.rs:239-249), so OP-2's "advisory until a Core change" is a correct reading and not a hidden assumption.
  • No acceptance claim. Frontmatter is status: draft, the body says in terms that it asks for review and never means the host implements it, and the PR body carries Related bitty#2476 / Related bitty#2191 with no Closes.
  • Gates: Docs quality + Secret scan pass (4/4 checks).

This is a candidate pending owner acceptance; merging it publishes the proposal and closes nothing. bitty#2476 residual 8 therefore stays open until the verb itself is accepted and implemented.

@Xuepoo
Xuepoo merged commit 9b4174f into main Nov 13, 2026
4 checks passed
@Xuepoo
Xuepoo deleted the docs/ctx-0097-panel-overlay branch November 13, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugins area:ui Area: UI / layout docs Documentation P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant