Repository navigation
fix(transcripts): complete short reads within the requested tail - #3962
Conversation
ECC Tools / Security EvidenceCommit: Security evidence gate passed (success) No security-sensitive scanner-evidence gap detected. Mode: enforce Scanned 2 changed file(s). No missing scanner-evidence signal was detected. Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / PR Risk TaxonomyCommit: PR taxonomy review recommended (neutral) Detected 1 PR taxonomy bucket(s): CI/CD Recommendation. Scanned 2 changed file(s). Roadmap taxonomy buckets: CI/CD RecommendationCI, dependency, coverage, and contract signals should be routed into follow-up checks or verification work. Signals:
Paths:
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / Reference Set ReadinessCommit: Reference set readiness gaps detected (neutral) Reference evidence present for 0/7 areas (0%) across 2 changed file(s). This check is based on files changed in this PR. Repository-level readiness is still reported by
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / Hosted Promotion ReadinessCommit: Hosted promotion readiness passed (success) No hosted promotion evidence gaps detected across 2 changed file(s); 0 corpus scenarios had matching evidence. This check compares PR file changes against the evaluator/RAG promotion corpus in No evaluator corpus scenarios matched this PR. Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
[Medium impact] This PR appears safe to merge.
|
|
The latest Greptile review of Could a maintainer authorize that workflow and review this short-read fix for merging? The focused regression and coverage results, together with the full-suite baseline limitations, remain recorded in the PR description. |
|
Thank you for completing short reads within the requested transcript tail. We merged your original commit history through #4048 so the related changes could be tested together. We retained the UTF-8 regression while expressing its astral character as a Unicode escape required by the repository policy. The resulting main commit |
What Changed
Continue reading the requested transcript window until its buffer is full or the descriptor reaches EOF. Advance both buffer and file offsets by the actual byte count, then decode UTF-8 once. Keep reads bounded by the original file-size snapshot and preserve descriptor cleanup on errors.
Why This Change
A single
fs.readSync()call can legally return fewer bytes than requested, including on network filesystems (Node.js documentation). The old reader returned that first chunk as the complete tail. This can drop the latest usage record and make context detection returnnulleven though the record is present.Testing Done
ECC_TEST_ONLY=lib/file-tail.test.js,lib/transcript-context.test.js npm test: repository validators and both selected suites passed.Focused branch checks and repository validators passed. Full-suite integration is not claimed for this branch. The common upstream baseline
8abdf329also reproduces four unrelated failing suites in this environment (statusline project plugins, hooks, observer subdirectory detection and memory vault).Type of Change
fix:Preserve transcript data across valid short reads.Security & Quality Checklist
git diff --checkpassed.Documentation
The existing return shape and bounded-tail API are preserved.