feat(tui): generate SelectListCore via fluessig single_threaded handle#344
feat(tui): generate SelectListCore via fluessig single_threaded handle#344zmaril wants to merge 1 commit into
Conversation
Swap the hand-written `SelectListCore` napi class (packages/tui/src/ components/select-list.ts) for a fluessig-generated one, extending the #80 single_threaded (thread-confined `!Send`) handle path proven by InputCore to a second, larger UI core with a 4-param fallible ctor (2 nullable) and a fallible op: - Author the ctor + five sync ops in schema/api.json, marking the interface `single_threaded: true`. fluessig lowers it to a THREAD-CONFINED handle: `pub struct SelectListCore { core: RefCell<SelectListCoreImpl> }` — no `Arc`, no `Send`/`Sync` — and the `SelectListCoreCore` trait sheds its `Send + Sync` supertraits (`Sized + 'static`) with `&mut self` ops reached through `borrow_mut()`. - This is what lets a `!Send` core compile: `SelectListCoreImpl` (core_impl.rs) owns pi's `SelectList`, whose baked-in identity `SelectListTheme` hooks are non-`Send` boxed closures (`Box<dyn Fn(&str) -> String>`) — the same wiring the deleted hand-written class used. The `SelectItemIn`/`identity_select_theme` helpers move with it. - regen src/generated.rs (fluessig e056bb9); delete the hand-written `#[napi]` struct/impl + helpers from lib.rs; keep `pub mod generated;`. Self-mutability is invisible to the TS type, so the RefCell-vs-`&mut self` handle is byte-transparent: the generated `SelectListCore` class `.d.ts` block, the `.js` export, and the nativeBinding entry are all byte-identical to the pre-swap build. pi's own test/select-list.test.ts oracle passes 5/5 against the locally-built addon. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xL2W7dkhPsTSRuXQNCDeY
Conformance smoke: agent + ai + tui
Headline is rust-backed: passing cases in files whose module-under-test is a native (Rust addon) module. Raw all-pass is shown secondary — it is inflated by unflipped TypeScript that passes without touching any Rust.
agent: 55/180 (30.6%) · ai: 74/1296 (5.7%) · tui: 375/678 (55.3%) rust-backed = passing / total tests run, per the manifest's per-native-row AttributionA pi test file is rust-backed iff the module it primarily exercises — its module-under-test — is Per-file decisions (from each native manifest row's
CLI conformance (black-box, against the pidgin binary)
The four repointed coding-agent CLI test files spawn the compiled pidgin binary via |
Swap the hand-written
SelectListCorenapi class for a fluessig-generated one, extending the #80single_threaded(thread-confined!Send) handle path proven by InputCore (#341) to a second, larger UI core: a 4-param fallible ctor with 2 nullable params and a fallible op (getSelectedItemJson).What changed
schema/api.json, marking the interfacesingle_threaded: true. fluessig lowers it to a THREAD-CONFINED handlepub struct SelectListCore { core: RefCell<SelectListCoreImpl> }— noArc, noSend/Sync— with theSelectListCoreCoretrait sheddingSend + Sync(Sized + 'static),&mut selfops reached throughborrow_mut().SelectListCoreImpl(core_impl.rs) owns pi's!SendSelectList— its baked-in identitySelectListThemehooks are non-Sendboxed closures (Box<dyn Fn(&str) -> String>). TheSelectItemIn/identity_select_themehelpers move with it.src/generated.rs(fluessig e056bb9); delete the hand-written#[napi]struct/impl + helpers from lib.rs; keeppub mod generated;.Gates
SelectListCore.d.tsblock,.jsexport, and nativeBinding entry are byte-identical to the pre-swap build.cargo build/fmt/clippy -D warningsclean; codespell 0; straitjacket v0.2.3 0 errors.test/select-list.test.tspasses 5/5 against the locally-built addon.Stacked on
napi-fluessig/single-threaded-tui(#341, InputCore).🤖 Generated with Claude Code
https://claude.ai/code/session_017xL2W7dkhPsTSRuXQNCDeY
Generated by Claude Code