Skip to content

[CTX-1416] feat(plugins): add candidate extension component catalog (#2114) - #2369

Merged
Xuepoo merged 4 commits into
mainfrom
ctx-1416/feat-extension-component-catalog
Oct 21, 2026
Merged

Xuepoo merged 4 commits into
mainfrom
ctx-1416/feat-extension-component-catalog

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Priority: P2 | Area: plugins | Labels: feat,P2,area:plugins | Milestone: v0.1.0 | RFC: extension-component-catalog-candidate.md | Task: CTX-1416

Summary

Bounded slice of bitty#2114: a headless, host-side candidate catalog surface for extension building blocks composed only from the accepted Plugin API v1 node set (Text, Row, Column, List). Five closed entries: band, pill-row, tooltip-detail-fallback, modal-sheet, status-strip.

Candidate catalog surface; no consumer yet. Nothing installs, composes, or renders these descriptors in production: there is no host path, band host, overlay path, bridge, render-loop, or plugin wiring, and no extension can opt in today. The module is candidate evidence, not a plugin API: no Lua surface, no new node kind, no VM, no style fields, no input bindings, no coordinates, no focus/modality, and no capability. This PR does not claim shipped usability.

What changed

  • crates/bitty-lua/src/ui_catalog.rs — typed descriptors (StripDescriptor, PillRowDescriptor, DetailFallbackDescriptor, ModalSheetDescriptor), CatalogEntry closed-name parse, pure compose, canonical from_scene round-trip, verify for mutation/ignored-block rejection, typed CatalogError, and documented caps.
  • crates/bitty-lua/src/lib.rs — module + re-exports and a crate-role note that the catalog never constructs a VM.

Caps and fail-closed behavior

  • Segments/modules/pills/sheet rows: inclusive 64 (anchored to chrome-band BAND_MAX_REGIONS); empty declarations/items rejected.
  • Segment text 64 bytes; pill label 32 bytes (no [/]); detail/title/sheet row 128 bytes.
  • Aggregate SCN-1 nodes, SCN-3 text, and v1 depth; recognition is iterative and early-exiting, so an oversized/over-deep input cannot recurse past the caps.
  • No clamp, truncation, or silent omission. A declared band/status strip drops no region identity; an ignored or mutated block fails verify with ShapeMismatch.

Evidence (local)

  • cargo test -p bitty-lua --locked: catalog boundary/order tests + full bitty-lua suite pass.
  • Cap boundary coverage: one at-cap/over-cap test per descriptor cap (segment/pill/sheet-row count; segment/pill-label/detail/title/row bytes; nested-block depth and node budgets; aggregate text budget). Mutation-verified: removing each cap check fails its boundary test.
  • Composition-order coverage: shuffled band, status-strip, pill-row, and modal-sheet inputs assert the exact emitted leaf-and-separator sequence; reversing emission order fails the test.
  • cargo clippy -p bitty-lua --all-targets --locked -- -D warnings: clean.
  • cargo fmt --all --check: clean.
  • cargo check --workspace --all-targets --locked: clean.
  • cargo check --target x86_64-pc-windows-gnu --workspace --all-targets --locked: clean.
  • just scratch-paths, just actionlint: clean.
  • No act / ci-local run (per task instruction); remote CI is the acceptance gate.

Docs

Companion candidate design note: bitty-terminal-docs PR #271 (CTX-0138) — Scene shapes, style hooks (reserved), a11y notes, illustrative examples, open points, acceptance criteria.

Remainder (why this uses Refs, not Closes)

  • band/statusline dogfood migration belongs to bitty-plugins and needs an accepted Lua-visible surface; no plugin was changed here.
  • Headed proof, the Lua surface, style hooks (post scene-style acceptance), tooltip/notification vehicle, and modal focus/modality ownership remain open in the design note.
  • Docs submodule pin bump follows after the docs PR merges.

Refs #2114

@Xuepoo Xuepoo added this to the v0.1.0 milestone Oct 21, 2026
@Xuepoo Xuepoo added feat Feature P2 Priority: medium area:plugins labels Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 183b92a5-9ae7-406f-84a0-be386ec49f92
📥 Commits

Reviewing files that changed from the base of the PR and between b10cb9e and a533208.

📒 Files selected for processing: 2
  • crates/bitty-lua/src/lib.rs
  • crates/bitty-lua/src/ui_catalog.rs
  • 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

Comment @coderabbitai help to get the list of available commands.

@Xuepoo
Xuepoo force-pushed the ctx-1416/feat-extension-component-catalog branch 3 times, most recently from 6c15195 to efd6744 Compare October 21, 2026 06:19

@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 — PR #2369 ([CTX-1416] candidate extension component catalog)

Verdict: LGTM. Reviewed efd67442 plus the full PR diff (crates/bitty-lua/src/lib.rs, new crates/bitty-lua/src/ui_catalog.rs, docs submodule bump). No blocking findings.

Checks against the review criteria:

  1. Stays a candidate surface / no v1 capability claim — pass.
    crates/bitty-lua/src/ui_catalog.rs:1 — "Extension component catalog (candidate catalog surface; no consumer yet)"; lines 8-13 state "Nothing here is an accepted contract, a plugin-facing API, a compatibility promise, or a shipped extension capability. No production consumer exists: no host path, band host, overlay path, bridge, render loop, Lua surface, or plugin installs, composes, or renders these descriptors". Crate doc (lib.rs:24-25) likewise says "has no production consumer yet (candidate surface only)". Every composition is limited to the accepted v1 node set (Text/Row/Column/List) and explicitly excludes Block/Image/CodeBlock/Table/Rule. grep -inE 'register_panel|panel|lifecycle' over ui_catalog.rs returns zero hits — no panel or register_panel lifecycle is claimed or mentioned. The spec's only Panel Runtime RFC reference (docs/…/extension-component-catalog-candidate.md:75-76) is an out-of-scope/ownership pointer, not a claim.

  2. Numeric bounds match the source document — pass, no invented constants.
    Module cap table (lines 64-72) is a verbatim match of the spec's cap table (extension-component-catalog-candidate.md:351-358): segments/pills/rows 64, segment text 64 B, pill label 32 B, detail/title/row 128 B, composed text 256 KiB (SCN-3), composed nodes 2048 (SCN-1). Each constant's doc comment cites the owning record vocabulary (BAND_MAX_REGIONS = 64, status-system draft module text 64, bar plugin pill-name bound 32, overlay/tooltip 128). The aggregate bounds are aliases, not re-declared literals: CATALOG_MAX_TEXT_BYTES = UI_MAX_TEXT_BYTES, CATALOG_MAX_NODES = UI_MAX_NODES, CATALOG_MAX_DEPTH = UI_MAX_DEPTH, which resolve in crates/bitty-lua/src/ui.rs:127,130,133 to 16 / 2048 / 256 * 1024 — consistent with the docs' 256 KiB/2048/16. No doc-only constant is missing from code, and no code constant is undocumented.

  3. No hardcoded host paths/usernames — pass. grep -nE '/home/|/Users/|/mnt/|xuepoo|fuyu|C:\\\\' over ui_catalog.rs and the spec: no hits.

  4. Docs English-only — pass. Only non-ASCII characters are em dashes (U+2014) in prose; no CJK or other non-English text in code or spec.

  5. No unrelated edits — pass. 3 files: lib.rs (+12, doc bullet + module declaration), new ui_catalog.rs, and a docs submodule pointer bump from 667c2965 to 65ce8cd7; that docs commit ([CTX-0138] … (#271)) touches exactly specifications/README.md and specifications/extension-component-catalog-candidate.md, i.e. only the record this PR implements.

gh pr checks 2369 — every job pass (Analyze (actions|rust), CodeQL, Extension pin drift, Linux Wayland, Linux X11 (xvfb), M1 matrix (Tier 1 aggregate), MSRV 1.85 check, Quality gates (1|2), Supply chain (deny/audit), VM tier (PR), Windows check and test, macOS ARM64 check and test); VM tier (main)/VM tier (nightly ARM64) skipping; CodeRabbit pass with "Review rate limited" (so no independent bot verdict exists). Only non-green line is Compat release matrix (Tier 1 aggregate) pending — queue state, not a failure.

Non-blocking note (out of scope for this candidate slice): the cap anchors to chrome-band/status-system/bar-plugin draft records are prose citations only, so a future acceptance will need to keep those records and these constants in sync; the spec already flags this as open question 8 ("Cap ownership").

Review follow-up for the candidate extension component catalog:

- Narrow the candidacy wording: the module and crate docs now state the
  catalog is a candidate surface with no production consumer (no host path,
  band/overlay/bridge/render wiring, Lua surface, or plugin opt-in).
- Split the cap tests into one at-cap/over-cap boundary test per descriptor
  cap: segment/pill/sheet-row count, segment/pill-label/detail/title/row
  bytes, nested-block depth and node budgets, and the aggregate text budget.
  Removing any cap check fails its boundary test.
- Replace the sorted-looking ordering checks with a shuffled-input test that
  asserts the exact emitted leaf-and-separator sequence for band,
  status-strip, pill-row, and modal-sheet composition; reversing emission
  order fails.
@Xuepoo
Xuepoo force-pushed the ctx-1416/feat-extension-component-catalog branch from efd6744 to 4929a17 Compare October 21, 2026 07:02
Resolve the docs gitlink to main's pin (7219148), which already contains the catalog spec commit (65ce8cd7 is its ancestor).
@Xuepoo
Xuepoo merged commit 8e05172 into main Oct 21, 2026
18 checks passed
@Xuepoo
Xuepoo deleted the ctx-1416/feat-extension-component-catalog branch October 21, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugins feat Feature P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant