fix(tracing): page trace chunks by retained byte offsets - #119
Merged
Merged
Conversation
Xuepoo
added a commit
that referenced
this pull request
Sep 18, 2026
…nc trace accounting semantics (#131) * [CTX-0075] chore(devtools): record bitty-core jurisdiction and sync trace docs Docs-only governance sync under bitty-core jurisdiction; no code behavior changes. - repo.toml: owner TBD -> bitty-core (matches workspace.toml). - AGENTS.md: record bitty-core commander jurisdiction; keep the core-vs-docs boundary sentences; unify the scratch wording (ephemeral under /tmp/bitty/, durable under recording/); replace the blanket pre-implementation claim only where stale against merged code (tracing phases 1/2, inspect-only watch mode, live-socket fixtures) with Implemented-only wording. - README.md: document the trace accounting semantics implemented by CTX-0053/#117 and CTX-0054/#119 and clarified in bitty-terminal-docs specifications/devtools-rfc.md (CTX-0026): retained redacted logical UTF-8 export-byte accounting, independent per-record normalization with leading U+FEFF preserved, effective min(trace maxBytes, retention maxBytes) rejection with one counted drop and unchanged retained state, raw append vs typed stream coalescing, and fetchTraceChunk pagination on retained UTF-8 byte offsets. Each claim verified read-only against src/tracing.ts and crates/devtools-client/src/tracing.rs. - CHANGELOG.md: docs-only entry recording the same semantics sync. Gates: just check green (prettier, markdownlint, tsc, bun test 444, cargo fmt/check/clippy/test); actionlint clean; act -n CI dry-run clean (offline action mode). Refs #130 Task: CTX-0075 * [CTX-0075] fix(docs): repoint DevTools RFC links to bitty-terminal-docs NEEDS-FIX PX-0389: README.md pointed the accepted DevTools RFC at bitty-docs/docs/specifications/devtools-rfc.md (404); the canonical copy lives in bitty-terminal-docs specifications/devtools-rfc.md (HTTP 200). Sweep all four occurrences in README.md (45, 169, 201, 454; the review cited 45/169/424) and correct the CTX-0026 attribution to bitty-terminal-docs. Gates: just check green (prettier 3.9.6, markdownlint 0 issues, tsc, bun test 444 pass, cargo fmt/check/clippy/test 79+20 pass). Refs #130 Task: CTX-0075 * [CTX-0075] fix(docs): repoint IPC and Agent RFC link to bitty-ai-docs (review PX-0390)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #99. Task: CTX0054.
Scope
src/tracing.ts:fetchTraceChunknow pages by actual accumulated encoded byte offsets instead of dividing by a fixed chunk ceiling.tests/tracing.test.ts: variable-size pagination tests against a reference concatenated stream (raw and structured), UTF-8 boundary offset tests, normalized fragment tests, multilingual multi-chunk reconstruction, and explicit empty/end/appended-tail continuation tests.Behavior
continuation: false.Evidence
bun run check:types,bun run build, cargo fmt/check/clippy/test (76/76) with offline env.Complexity
O(retained bytes) time per fetch, O(largest stored chunk) transient space.