Skip to content

[CTX-0918] chore: decouple non-core crates from Core - #1603

Merged
Xuepoo merged 7 commits into
mainfrom
ctx-0918/chore-decouple-non-core
Oct 1, 2026
Merged

Xuepoo merged 7 commits into
mainfrom
ctx-0918/chore-decouple-non-core

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Priority: P0 | Area: runtime | Labels: chore,area:runtime,P0 | Milestone: v0.1.0 | RFC: ADR-0003, DIR-030 | Task: CTX-0918

Closes #1602

Stacked on CTX-0917 (ctx-0917/fix-deny-allow-git-agent-ipc, main CI fix). Until that lands on main, this diff also shows its commits; this PR will be rebased onto main once CTX-0917 merges.

Summary

  • Retire crates/bitty-core (empty seed) and crates/bitty-panels (only empty scaffolding left); no crate depended on either.
  • Remove bitty-agent from Core: dropped from bitty-runtime [dependencies]/[dev-dependencies] and the deny.toml allow-git list. Agent assertions removed from tests/final_integration.rs; the same invariants (side-queue drop-oldest, untrusted labeling, truncation, TitleChanged validation, stub dispatch state machine) are tested in the bitty-agent repository.
  • bitty-perf is now optional for bitty-terminal behind the new non-default dev-perf feature. Without it, bitty dev trace still validates its arguments (usage errors exit 2) and then fails with exit 1 and built without dev-perf feature; help/usage text says so. bitty-perf stays a workspace crate (benches unchanged).
  • CI Quality gates and just clippy/just test add a dev-perf clippy run and a cargo test -p bitty-terminal --features dev-perf --test cli_dev run so the trace success paths stay covered; the default nextest run covers the compiled-out path.
  • Bump bitty-ipc to e9714e7 (current main); it stays linked as Core's inbound socket mechanism. Cargo.lock updated via cargo update -p bitty-ipc.
  • READMEs (repo crate table + extension model, bitty-runtime, bitty-terminal), status-drift crate count (22 -> 18), CHANGELOG entry. Also removes stray merge-conflict markers in CHANGELOG.md already on main that made markdownlint fail.

Out of scope: bitty-network-lua / network feature (CTX-0906).

Testing

  • just check — pass
  • just test — pass
  • cargo check --target x86_64-pc-windows-gnu --workspace --all-targets --locked — pass
  • just ci-local (act, Quality gates job) — job succeeded
  • act -n -j quality — pass

Summary by CodeRabbit

  • Developer Tools
    • bitty dev trace now requires a build with performance tracing enabled. Without it, valid trace requests return an error; with it, startup and latency tracing remain available.
  • Documentation
    • Updated developer guidance to reflect the current workspace structure and explain how to enable performance tracing.
  • Maintenance
    • Updated the local socket integration and adjusted automated checks to match the current project setup.

reviewer added 7 commits October 2, 2026 03:11
The CTX-1585 extraction (commit 6b830fa) moved bitty-agent and
bitty-ipc out of the Core workspace into independent git-dependency
repositories, following the same pattern already allowed for
bitty-network. deny.toml's allow-git allowlist was never updated,
so every main CI run since the extraction fails cargo-deny with
source-not-allowed for both crates, blocking the Supply chain gate
on main and on every subsequent PR.

Add https://github.com/bitty-terminal/bitty-agent and
https://github.com/bitty-terminal/bitty-ipc to allow-git per the
deny.toml exception policy (CTX-0634, P0-AC-034): dated, enumerated,
no silent allowlist edit.

Priority: P0 | Area: area:runtime | Labels: fix,P0,area:runtime | Milestone: v0.1.0 | Task: CTX-0917
The Cargo.toml git-dependency rev was bumped to 6841646 in the prior
commit, but Cargo.lock was never regenerated to match, so every CI job
run with --locked (clippy, test, build) failed with 'cannot update the
lock file because --locked was passed to prevent this'.

cargo update -p bitty-ipc -p bitty-agent regenerates only the affected
entries (bitty-ipc-*, plus three new transitive deps: base16ct,
const-oid, serde_json, zmij pulled in by the new bitty-ipc rev); no
unrelated dependency drift.

Verified locally: cargo clippy --workspace --all-targets --locked -- -D
warnings and cargo deny check both pass.

Priority: P0 | Area: area:runtime | Labels: fix,P0,area:runtime | Milestone: v0.1.0 | Task: CTX-0917
The CTX-1585 extraction (6b830fa) moved bitty-ipc out of the Core
workspace into an independent repository. 'cargo test -p bitty-ipc
--examples --locked' in the four Linux/Wayland/macOS matrix legs now
fails every run with 'package bitty-ipc cannot be tested because it
requires dev-dependencies and is not a member of the workspace',
since -p can no longer resolve a git dependency that is not a
workspace member.

The bitty-ipc example moved with the crate to its own repository and
has its own CI; nothing here replaces that coverage, it only removes
a step that can never succeed again. Renamed the surrounding
'Run benches and examples' steps to 'Run benches' to match.

Verified locally: cargo test -p bitty-perf --benches --locked passes;
actionlint .github/workflows/ci.yml is clean.

Priority: P0 | Area: area:runtime | Labels: fix,P0,area:runtime | Milestone: v0.1.0 | Task: CTX-0917
…raction

bitty-panels, bitty-runtime, and bitty-terminal READMEs listed
bitty-agent/bitty-ipc as 'workspace-internal dependencies' under
their Boundaries sections. Since CTX-1585 (6b830fa) extracted both
crates to independent repositories, they are now external git
dependencies, not workspace members; the prior wording was now
factually wrong about the dependency's current nature.

Priority: P2 | Area: area:docs | Labels: docs,P2,area:docs | Milestone: v0.1.0 | Task: CTX-0917
Retire the empty bitty-core seed and the emptied bitty-panels staging crate,
drop bitty-agent from bitty-runtime (agent invariants live in the bitty-agent
repository tests) and from the deny.toml allow-git list, make bitty-perf
opt-in for bitty-terminal behind the non-default dev-perf feature (bitty dev
trace reports "built without dev-perf feature" otherwise), bump bitty-ipc to
e9714e7, and sync READMEs, the status-drift crate count, and the CHANGELOG
(also removes stray merge-conflict markers that broke markdownlint).

Closes #1602
@Xuepoo Xuepoo added this to the v0.1.0 milestone Oct 1, 2026
@Xuepoo Xuepoo added chore Chore / maintenance P0 Priority: highest area:runtime Area: runtime orchestration labels Oct 1, 2026
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: b16bcb30-6262-4f7d-ac0b-068307e5f41b

📥 Commits

Reviewing files that changed from the base of the PR and between 2dc3da8 and b9e502a.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • CONTRIBUTING.md
  • Cargo.toml
  • README.md
  • crates/bitty-core/Cargo.toml
  • crates/bitty-core/README.md
  • crates/bitty-core/src/lib.rs
  • crates/bitty-panels/Cargo.toml
  • crates/bitty-panels/README.md
  • crates/bitty-panels/src/lib.rs
  • crates/bitty-panels/src/scaffold.rs
  • crates/bitty-rich/Cargo.toml
  • crates/bitty-runtime/Cargo.toml
  • crates/bitty-runtime/README.md
  • crates/bitty-runtime/src/registry/provider.rs
  • crates/bitty-runtime/tests/final_integration.rs
  • crates/bitty-terminal/Cargo.toml
  • crates/bitty-terminal/README.md
  • crates/bitty-terminal/src/dev.rs
  • crates/bitty-terminal/tests/cli_dev.rs
  • crates/bitty-ui/src/a11y.rs
  • deny.toml
  • justfile
  • specifications/status-drift-gate.md
💤 Files with no reviewable changes (8)
  • crates/bitty-core/Cargo.toml
  • crates/bitty-panels/README.md
  • crates/bitty-panels/Cargo.toml
  • crates/bitty-panels/src/scaffold.rs
  • crates/bitty-core/README.md
  • crates/bitty-panels/src/lib.rs
  • Cargo.toml
  • crates/bitty-core/src/lib.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The workspace retires bitty-core and bitty-panels, removes Core’s direct bitty-agent dependency, and updates its bitty-ipc revision. Terminal trace commands now require the opt-in dev-perf feature. Documentation and validation commands reflect these changes.

Changes

Core workspace decoupling

Layer / File(s) Summary
Retire workspace crates
Cargo.toml, crates/bitty-core/*, crates/bitty-panels/*, crates/bitty-runtime/README.md, crates/bitty-runtime/src/registry/provider.rs, crates/bitty-ui/src/a11y.rs, README.md, CONTRIBUTING.md, specifications/status-drift-gate.md, CHANGELOG.md
The workspace removes bitty-core and bitty-panels, and the documented crate count changes from 22 to 18. Panel-boundary descriptions and the changelog are updated.
Update external dependency boundaries
crates/bitty-runtime/Cargo.toml, crates/bitty-rich/Cargo.toml, crates/bitty-runtime/README.md, crates/bitty-runtime/tests/final_integration.rs, README.md, deny.toml
Core removes bitty-agent and its integration assertions. The bitty-ipc pin changes to e9714e7; documentation identifies it as an external dependency for inbound local sockets.
Gate tracing behind dev-perf
crates/bitty-terminal/Cargo.toml, crates/bitty-terminal/src/dev.rs, crates/bitty-terminal/tests/cli_dev.rs, crates/bitty-terminal/README.md, .github/workflows/ci.yml, justfile
bitty-perf becomes optional and is enabled by dev-perf. Trace requests return the missing-feature diagnostic when that feature is absent. Tests and CI cover the feature-enabled and compiled-out paths.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant CLI as bitty-terminal CLI
  participant Output as trace_output
  participant Perf as bitty-perf
  CLI->>Output: Submit validated trace request
  alt dev-perf enabled
    Output->>Perf: Dispatch startup or latency trace
    Perf-->>Output: Return trace output
    Output-->>CLI: Return trace output
  else dev-perf disabled
    Output-->>CLI: Return missing-feature diagnostic
  end
Loading

Merge Risk: ⚪ Minimal · up to b9e50

The workspace decoupling and opt-in tracing behavior are consistent with the intended changes. No actionable merge-blocking issue is established; merge after normal checks pass.

Security Architecture Review

Security architecture risk: 🔵 Low · up to b9e50

The change reduces Core’s linked components and disables developer tracing by default. Existing local IPC checks remain in place, but the refreshed IPC dependency’s security and lifecycle behavior has not been compared across revisions.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A regression in the shared external IPC dependency could be inherited by runtime, terminal and rich callers. Inspected sensitive outcomes include terminal inspection and input delivery; terminal closure requires management scope. The dependency update’s effective exposure cannot be fully compared without its external implementation.

Trust Boundaries and Controls

  • observed — The inspected server call site verifies the socket endpoint, opens scoped connection authority, binds the accepted stream’s peer proof, and passes that proof to bounded serving. It explicitly closes connection authority after serving returns. Peer-binding failures return before serving; unwinding cleanup is documented as the context’s responsibility, whose external implementation was not inspected.

Resilience and Maintainability Implications

  • observed — Retained local tests assert frame and buffer bounds, scope denial for terminal closure, and control-queue draining by the sole Runtime owner. These checks provide counterevidence to a local control bypass, but do not establish external duplicate-request, interrupted-session or recovery guarantees.

Hardening Proposals

  • proposed — Complete the dependency-boundary assessment with a revision-specific IPC comparison covering wire compatibility, peer-bound authority, scope enforcement, disconnect/error cleanup and repeated or concurrent requests. This is a validation proposal, not an observed vulnerability.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR removes the Windows owned-process-tree and live-configuration-reload entries from CHANGELOG.md. The supplied summary does not connect these deletions to issue [#1602], which concerns workspac… Restore the unrelated changelog entries, or provide evidence that they are obsolete or otherwise required by issue [#1602].
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: decoupling non-core crates from Core. The issue identifier and chore prefix do not obscure its meaning.
Linked Issues check ✅ Passed Issue [#1602] objectives are implemented. The PR retires bitty-core and bitty-panels, removes bitty-agent from runtime dependencies and integration assertions, and removes its deny.toml allow-…
Docstring Coverage ✅ Passed Docstring coverage is 93.75% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 5 files. (12 skipped: 1…
Full details: Out of Scope Changes check

Explanation

The PR removes the Windows owned-process-tree and live-configuration-reload entries from CHANGELOG.md. The supplied summary does not connect these deletions to issue [#1602], which concerns workspace decoupling and the bitty-perf feature. The network feature remains, as required by the issue's out-of-scope note.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@Xuepoo

Xuepoo commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Independent review (ctx-0918-reviewer, semantic review): APPROVE. Non-blocking follow-ups tracked as separate tasks: trace-success coverage only in Quality gates; explicit TraceStartup arm in dev.rs; stale bitty-panels claim in specifications/ai-surface-reconciliation.md; stale bitty-agent path in .gitleaks.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:runtime Area: runtime orchestration chore Chore / maintenance P0 Priority: highest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decouple non-core crates from Core (retire bitty-core/bitty-panels, drop bitty-agent, opt-in bitty-perf)

1 participant