Skip to content

refactor(core): finalize P1 decomposition safeguards#635

Open
limityan wants to merge 4 commits intoGCWing:mainfrom
limityan:yanzhn/refactor
Open

refactor(core): finalize P1 decomposition safeguards#635
limityan wants to merge 4 commits intoGCWing:mainfrom
limityan:yanzhn/refactor

Conversation

@limityan
Copy link
Copy Markdown
Collaborator

Summary

  • Finalizes the P1 core-decomposition safety pass after rebasing onto origin/main.
  • Aligns the guardrail and plan docs around crate ownership, product-full lifecycle rules, services-integrations debug-log, and ai-adapters ownership.
  • Hardens the session usage report UI for confirmed review findings: ARIA tab semantics, keyboard tab navigation, capped long tables with explicit expansion, stable table keys, locales, and regression coverage.

Changes

  • Keeps product runtime behavior stable: bitfun-core default still maps to product-full, product crates keep explicit full-runtime features, and server/relay manifests are not expanded just for symmetry.
  • Documents the terminal compatibility re-export so the legacy bitfun_core::service::terminal path remains intentional while terminal-core lives at workspace level.
  • Clarifies that product-full is a release-safety guardrail, not a new dumping ground, and leaves non-P1 follow-up work explicitly open instead of claiming broader migration completion.
  • Adds usage panel accessibility and performance safeguards without changing the report data contract.

Release Safety

  • Build scripts, installer files, and package scripts have no diff.
  • Feature/default changes do not alter product capability sets.
  • Existing Rust checks emit pre-existing unused import/variable warnings in bitfun-core / bitfun-desktop; no verification command failed.

Verification

  • pnpm run type-check:web
  • pnpm run lint:web
  • pnpm --dir src/web-ui run test:run (65 files / 324 tests)
  • cargo test -p bitfun-runtime-ports
  • cargo test -p bitfun-agent-stream
  • cargo test -p bitfun-core-types
  • cargo check -p terminal-core
  • cargo check -p tool-runtime
  • cargo check -p bitfun-core --features product-full
  • cargo check -p bitfun-desktop
  • cargo check -p bitfun-cli
  • cargo check -p bitfun-server
  • cargo check -p bitfun-acp
  • cargo check --workspace
  • git diff --check
  • git diff -- package.json scripts/dev.cjs scripts/desktop-tauri-build.mjs scripts/ensure-openssl-windows.mjs scripts/ci/setup-openssl-windows.ps1 BitFun-Installer

@limityan limityan force-pushed the yanzhn/refactor branch 3 times, most recently from a826623 to d112b08 Compare May 10, 2026 16:08
limityan added 4 commits May 11, 2026 10:01
Move the core decomposition plan into docs/plans and add the architecture
guardrail doc for future bitfun-core split work.

Introduce the product-full safety net without reducing the default core
capability set, and make current product crates opt into the full runtime
explicitly.

Add bitfun-core-types for shared AI error DTOs while preserving the existing
bitfun-events re-export path. Move the existing terminal-core and tool-runtime
packages to workspace-level crate paths without changing their package or lib
names.

Update AGENTS, README, and CONTRIBUTING guidance so future core decomposition
work follows the guardrails and uses the new support crate locations.
Introduce bitfun-agent-stream and move stream processing logic, fixtures, and
stream regression tests out of bitfun-core while keeping a compatibility wrapper
for the existing core import path.

Move shared AI error categorization and detail helpers into bitfun-core-types,
then narrow BitFunError's concrete dependency coupling at the core boundary.

Introduce bitfun-runtime-ports as a DTO and trait-only boundary for agent
submissions, dynamic tools, config reads, and session transcript reads, with
initial core adapters for the coordinator, config service, and tool registry.

Keep product feature defaults unchanged while reducing the compile surface needed
for stream-focused tests.
Carry AgentSubmissionSource through the runtime submission port and map it back
to DialogTriggerSource so port-based submissions preserve their original caller
semantics instead of collapsing to the bot default.

Rename the transcript filter DTO from from_turn_id to turn_id, keeping the
serialized camelCase contract explicit through tests.

Restrict DynamicToolProvider output to MCP dynamic tools and derive provider_id
from mcp__server__tool names so built-in registry tools are not exposed as
provider-owned dynamic tools.
Add WAI-ARIA tablist and tabpanel wiring to the session usage panel, including
keyboard navigation for ArrowLeft, ArrowRight, Home, and End.

Cap large usage tables behind an explicit expansion control, switch table header
and row rendering to stable ids, and add localized copy for the collapsed row
summary.

Extend usage panel regression coverage for tab semantics, keyboard navigation,
and long-table expansion. Also document the terminal-core compatibility re-export
so the legacy bitfun_core::service::terminal path remains intentional.
@GCWing GCWing requested a review from wsp1911 May 11, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants