Repository navigation
[fix] preserve session recordings and report write failures (STAR-106) - #37
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #37 +/- ##
==========================================
+ Coverage 86.34% 87.99% +1.64%
==========================================
Files 23 23
Lines 1128 1166 +38
==========================================
+ Hits 974 1026 +52
+ Misses 117 108 -9
+ Partials 37 32 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
--recordomitted readline prompts/input echoes despite promising a complete session, leaked two pipe readers per completed recording, and treated a full recording destination as success. A runtime write failure could also stop draining a pipe and stall a sufficiently chatty script.Tee readline's existing platform-specific terminal writers without taking ownership of them, close all owned pipe ends on normal and failed setup paths, and retain recording errors while continuing to drain script output. Return a non-zero exit code on recording failure while preserving an existing non-zero script exit code. Stop is idempotent. The readline version is unchanged; its existing dependency is now a direct import.
Fixes STAR-106. Behavior changes: transcripts now include terminal prompts/input echoes and may contain ANSI sequences; recording setup/write/close failures are observable. The real terminal rehearsal now runs for the installed Unix release archives, including plain REPL, post-script inspection, evaluation-error recovery, Ctrl-C and EOF. Portable session append/error tests run on all six targets.
Validation:
/dev/fullreturned exit 0 and executed the script. Regression tests failed before the fix.Additional validation: ten alternating 4 MiB recording workloads (4096 print calls) showed 22.68 ms before and 22.77 ms after at the median on macOS arm64, including process startup (about +0.4%, a local sample rather than a throughput guarantee). Native CI also exposed non-portable descriptor-test assumptions, which are now checked using the documented close contract. The terminal driver waits for readline raw mode before control keys and drains terminal output through child exit.