Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
explicitly scoped task and a reviewed security note; never widen silently.
- Origin: this package is the independent first-party realization created by
the OQ-053 bundled-plugin split decision ([bitty](https://github.com/bitty-terminal/bitty) `CTX-0397`). The accepted
Lua overlay path requires `ui.rich` in addition to the bundled
realization's `ui.overlay`; that difference is recorded, not a capability
widening done silently.
Lua overlay path requires `ui.rich` in addition to the former bundled
realization's `ui.overlay` (removed from `bitty` by PR #1611); that
difference is recorded, not a capability widening done silently.

## CarryCtx and agents

Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
(everything pre-1.0-stable stays on the `0.0.x` line). No behavior change;
no published tag or release existed, so no published artifact is downgraded.
- Requests `ui.rich` in addition to `ui.overlay`: the accepted Plugin API v1
Lua overlay path (`bitty.ui.mount`) requires both, unlike the bundled Rust
Lua overlay path (`bitty.ui.mount`) requires both, unlike the former bundled Rust
realization which used the lower-level Panel Runtime overlay path.
- Reframe the palette envelope citations (`lua/palette/filter.lua`,
`lua/palette/init.lua`, `README.md`, manifest and test comments): this
package is the authoritative realization, and the historical bundled Rust
realization (`crates/bitty-runtime/src/palette.rs`) was removed from `bitty`
by PR #1611 (commit `67cdcc14`). Comment and prose only; no behavior change
(`CTX-0008`).

### Removed

Expand Down
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ manifest `[compat]` ranges.

## Behavior

The plugin keeps the bundled palette behavior and bounds:
The plugin keeps the behavior and bounds of the former bundled palette; this
package now defines them:

- case-insensitive substring filtering over a bounded entry list, at most
`128` displayed entries (`PALETTE_MAX_ENTRIES`);
Expand All @@ -60,18 +61,21 @@ The plugin keeps the bundled palette behavior and bounds:
matching the returned count;
- refresh on `focus.changed` while the palette is open.

## Capability difference from the bundled realization

The bundled Rust realization (`bitty` `crates/bitty-plugin-host/src/bundled.rs`
`palette_manifest`, `crates/bitty-runtime/src/palette.rs`) declared only
`ui.overlay` because it used the lower-level Panel Runtime overlay path. The
accepted Plugin API v1 Lua overlay path (`bitty.ui.mount` on the `overlay`
slot) requires **both** `ui.rich` and `ui.overlay` per ADR 0009 and the Plugin
API v1 Lua Surface RFC. This package therefore requests `ui.rich` as well.

This is a recorded, intentional difference. Reconciling the bundled manifest or
introducing a `ui.overlay`-only plain-overlay Lua path is tracked as a
follow-up; see "Known gaps".
## Capability difference from the former bundled realization

This package is now the only realization of the palette envelope and
behavior. The historical bundled Rust realization in `bitty` is gone: its
manifest left the bundled catalog (`crates/bitty-plugin-host/src/bundled.rs`)
when the palette migrated to this package (`CTX-0397`), and its runtime module
(`crates/bitty-runtime/src/palette.rs`) was removed by `bitty` PR #1611
(commit `67cdcc14`). That realization declared only `ui.overlay` because it
used the lower-level Panel Runtime overlay path. The accepted Plugin API v1 Lua
overlay path (`bitty.ui.mount` on the `overlay` slot) requires **both**
`ui.rich` and `ui.overlay` per ADR 0009 and the Plugin API v1 Lua Surface RFC.
This package therefore requests `ui.rich` as well.

This is a recorded, intentional difference. Introducing a `ui.overlay`-only
plain-overlay Lua path is tracked as a follow-up; see "Known gaps".

## Known gaps

Expand Down
7 changes: 4 additions & 3 deletions bitty-plugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ description = "Command palette and picker UI via overlay slot, declarative primi
license = "MIT"

[compat]
# Unchanged from the bundled `bitty-terminal.palette` realization.
# Unchanged from the former bundled `bitty-terminal.palette` realization.
bitty = ">=0.1,<1.0"
plugin-api = "^1.0"

Expand All @@ -25,8 +25,9 @@ plugin-api = "^1.0"
# Unknown identifiers fail validation and there is no allow-all identifier.
#
# `ui.rich` gates `bitty.ui.mount`/`bitty.ui.update`; the `overlay` slot
# additionally requires `ui.overlay`. The bundled Rust realization declared
# only `ui.overlay` because it used the lower-level Panel Runtime overlay path;
# additionally requires `ui.overlay`. The former bundled Rust realization
# (removed from `bitty`) declared only `ui.overlay` because it used the
# lower-level Panel Runtime overlay path;
# the accepted Plugin API v1 Lua overlay path requires both (ADR 0009 /
# Plugin API v1 Lua Surface RFC). Recorded intentional difference.
ui.rich = true
Expand Down
14 changes: 8 additions & 6 deletions lua/palette/filter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
-- (bitty-terminal.palette).
--
-- Pure functions with no host dependency, so the palette policy is unit
-- testable in plain Lua. The numeric bounds mirror the bundled Rust
-- realization (`bitty-runtime/src/palette.rs`): at most `128` displayed
-- entries, a `128`-character query, and `128`-character display text per
-- entry (the host overlay text bound `MAX_OVERLAY_TEXT_LEN`). The input
-- testable in plain Lua. This module is the authoritative realization of
-- the palette envelope: at most `128` displayed entries, a `128`-character
-- query, and `128`-character display text per entry (the host overlay text
-- bound `MAX_OVERLAY_TEXT_LEN`). These values were carried over from the
-- historical bundled Rust realization, which was removed from `bitty` by
-- PR #1611 (commit `67cdcc14`); no Rust counterpart remains. The input
-- bound `MAX_INPUT` is a palette-local policy: candidate tables supplied
-- through settings are untrusted data, so a single filter pass examines at
-- most `MAX_INPUT` candidates regardless of how large the table is. No Rust
-- counterpart exists upstream (the bundled realization trusts its input).
-- most `MAX_INPUT` candidates regardless of how large the table is (the
-- historical bundled realization trusted its input).

local M = {}

Expand Down
11 changes: 6 additions & 5 deletions lua/palette/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
--
-- Accepted surface: Plugin API v1 Lua Surface RFC (ADR 0009). Capabilities
-- requested in `bitty-plugin.toml` are `ui.rich` (declarative UI mount) and
-- `ui.overlay` (the overlay slot). The bundled Rust realization declared only
-- `ui.overlay` because it used the lower-level Panel Runtime overlay path; the
-- accepted Lua overlay path (`bitty.ui.mount`) additionally requires
-- `ui.rich`, so this independent package declares both. This is a recorded,
-- intentional difference from the bundled manifest.
-- `ui.overlay` (the overlay slot). The historical bundled Rust realization
-- (since removed from `bitty`) declared only `ui.overlay` because it used the
-- lower-level Panel Runtime overlay path; the accepted Lua overlay path
-- (`bitty.ui.mount`) additionally requires `ui.rich`, so this independent
-- package declares both. This is a recorded, intentional difference from the
-- former bundled manifest.
--
-- v1 data adapter: the accepted surface exposes no command-registry
-- enumeration and no `PickerProvider` (the Plugin Reuse and Provider Ecology
Expand Down
5 changes: 3 additions & 2 deletions tests/spec/filter_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ local function run(context)
local tap = context.tap
local filter = require("palette.filter")

-- Output/query/text bounds mirror the bundled Rust realization; the input
-- bound is the palette-local untrusted-input policy.
-- Output/query/text bounds are this plugin's envelope (carried over from
-- the removed bundled Rust realization); the input bound is the
-- palette-local untrusted-input policy.
tap.equal(filter.MAX_ENTRIES, 128, "MAX_ENTRIES")
tap.equal(filter.MAX_QUERY_CHARS, 128, "MAX_QUERY_CHARS")
tap.equal(filter.MAX_TEXT_CHARS, 128, "MAX_TEXT_CHARS")
Expand Down
Loading