You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/plans/completed/one-way-output-bundle-previews.md
+11-17Lines changed: 11 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@
9
9
10
10
## Status
11
11
12
-
- State: active
12
+
- State: completed
13
13
- Last updated: 2026-04-17
14
-
- Current phase: implementation
14
+
- Current phase: completed
15
15
16
16
## Current Direction
17
17
@@ -38,12 +38,12 @@
38
38
- Define the one-way contract and the bounded in-memory preview state.
39
39
- Phase 1: completed
40
40
- Add cached image-preview state to `ActiveOutputBundle` and remove old-image rereads from later reply rendering.
41
-
- Phase 2: pending
42
-
-Add cached text head/tail preview state and stop reconstructing later previews from spilled file state.
43
-
- Phase 3: pending
44
-
- Replace tests that depend on disk rereads with tests for the one-way contract.
45
-
- Phase 4: pending
46
-
- Run full validation and update plan status for any remaining follow-on work.
41
+
- Phase 2: completed
42
+
-Confirm that later text replies already render from in-memory retained reply items and do not reread `transcript.txt`.
43
+
- Phase 3: completed
44
+
- Replace reread-oriented regressions with one-way contract coverage for deleted bundle image and transcript files.
45
+
- Phase 4: completed
46
+
- Run full validation and close the initiative.
47
47
48
48
## Locked Decisions
49
49
@@ -55,18 +55,11 @@
55
55
56
56
## Open Questions
57
57
58
-
- What exact text preview state should be cached in memory?
59
-
- Likely one bounded head window plus one bounded tail window, but the final shape should preserve current preview wording and stream ordering.
60
-
- Should the preview cache live only on `ActiveOutputBundle`, or should `StagedTimeoutOutput` also keep a lightweight preview summary before a bundle is materialized?
61
-
- When an output-bundle directory or subdirectory disappears mid-session, what minimal recreation behavior is worth supporting for continued appends without expanding this slice into generic filesystem recovery logic?
62
-
- Can image preview caching reuse the existing `ReplyImage` payloads directly, or should it store a more compact internal representation?
58
+
- None for this slice.
63
59
64
60
## Next Safe Slice
65
61
66
-
- Decide whether the text-preview slice is needed at all.
67
-
- If text preview caching is needed, start that slice only after confirming that the remaining text path still violates the one-way contract in a user-visible way.
68
-
- Decide whether text preview caching is needed purely for architectural consistency or whether the current text spill path is already sufficiently one-way.
69
-
- If text caching is needed, define the exact bounded head/tail representation before changing text compaction behavior.
62
+
- None. The planned work is complete.
70
63
71
64
## Stop Conditions
72
65
@@ -82,3 +75,4 @@
82
75
- 2026-04-17: Kept the public bundle layout unchanged for this initiative so the refactor can land without redefining the client-facing files-mode contract.
83
76
- 2026-04-17: Began the image-preview implementation by caching the first-history and latest image previews on `ActiveOutputBundle` and moving the public regression toward “later replies do not depend on old bundle image files remaining on disk”.
84
77
- 2026-04-17: Completed the image-preview slice. Later image-bundle replies now render from cached preview images in memory instead of rereading old image files from the bundle directory.
78
+
- 2026-04-17: Confirmed the text spill path already satisfied the one-way contract for visible replies. Later text replies render from in-memory retained reply items, and a new public regression now covers transcript deletion and recreation without replaying previously spilled text.
let input = "big <- paste(rep('y', 120), collapse = ''); cat('start\\n'); flush.console(); Sys.sleep(0.2); for (i in 1:80) cat(sprintf('mid%03d %s\\n', i, big)); flush.console(); Sys.sleep(0.35); cat('tail\\n')";
1057
+
let first = session.write_stdin_raw_with(input,Some(0.05)).await?;
1058
+
let first_text = result_text(&first);
1059
+
ifbackend_unavailable(&first_text){
1060
+
eprintln!("write_stdin_behavior backend unavailable in this environment; skipping");
1061
+
session.cancel().await?;
1062
+
returnOk(());
1063
+
}
1064
+
1065
+
sleep(Duration::from_millis(260)).await;
1066
+
let spilled = session.write_stdin_raw_with("",Some(0.1)).await?;
1067
+
let spilled_text = result_text(&spilled);
1068
+
let transcript_path = matchbundle_transcript_path(&spilled_text){
0 commit comments