Skip to content

feat(ipc): implement framing, scopes, auth and wire limits (CTX-0068) - #108

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-0068/feat-ipc-framing
Aug 29, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-0068/feat-ipc-framing

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #107

Implements IPC framing and scopes (OQ-018) per CTX-0068.

Summary

  • crates/bitty-ipc/src/scope.rs: 13 scopes (terminal/view/config/plugin/process/debug), RFC grammar validation, ScopeSet cli/mcp defaults, authorize_method server-side, ConsentLedger per-client/per-scope ledgered 64 cap, no bundled admin, terminal:inspect does not imply input/manage.
  • crates/bitty-ipc/src/auth.rs: SO_PEERCRED paradigm headless verify_peer_uid/verify_unix_endpoint (0700/0600 owner checks) + Windows pipe ACL stub + ChildToken/Store short-lived PTY-fd tokens 60s TTL bounded 64, no env leak, replay fail-closed, deterministic now_ms.
  • crates/bitty-ipc/src/wire.rs: v1 envelope (WIRE_VERSION=1, MAX_ID_BYTES=64, MAX_METHOD_BYTES=128, MAX_JSON_DEPTH=32, no ambient auth/scope, chunk 256 KiB RC-10), version/depth/chunk/id/method validation, forbid(unsafe).
  • crates/bitty-ipc/src/limits.rs: RC-9 defaults (100 req/s burst 200, 1 MiB payload, 16 conn shed-newest) + RateLimiter headless, bounded deterministic (rate_limiter_burst_and_window, rc9_defaults_match_rfc).
  • crates/bitty-ipc/src/channel.rs / error.rs / lib.rs: tightened re-exports, error variants for scope/auth/wire/limits, lib exposure + docs, bounded 256 KiB framing preserved (frame.rs MAX_FRAME_BYTES=262144, Framer 512 KiB, incremental decode).

Testing & gates

  • cargo fmt --all PASS
  • just check 0 issues (fmt-check 0, clippy -D warnings 0, test workspace 93 bitty-ipc + 808 workspace pass, actionlint 0, markdownlint 0/29)
  • cargo test --workspace --all-targets --locked PASS
  • cargo check --target x86_64-pc-windows-gnu PASS
  • act -n DRYRUN PASS (Quality gates + CodeQL rust/actions)
  • forbid(unsafe_code) enforced, deterministic, no I/O, no wall-clock

Follow-up

Review PASS with low-severity follow-up about limits.rs burst vs sustained (document as follow-up, not blocking) — tracked separately per instruction.

Refs: OQ-018, CTX-0068
CarryCtx: CTX-0068

@Xuepoo
Xuepoo merged commit be3bdb4 into main Aug 29, 2026
5 checks passed
@Xuepoo
Xuepoo deleted the ctx-0068/feat-ipc-framing branch August 29, 2026 10:22
@Xuepoo Xuepoo added feat Feature area:ipc Area: IPC / MCP boundary P0 Priority: highest labels Aug 29, 2026
@Xuepoo Xuepoo added this to the v0.0.1 milestone Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ipc Area: IPC / MCP boundary feat Feature P0 Priority: highest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CTX-0068] Implement IPC framing, scopes, auth and wire limits (OQ-018)

1 participant