Skip to content

Commit 5b0578a

Browse files
author
Paulo Aboim Pinto
committed
test(FEAT-025): pin the export slice with baseline-captured goldens and gates
Behaviour preservation is proven rather than claimed. Four goldens were captured from the pre-refactor implementation at `3f3aa9ed7` by dispatching frozen fixtures through the baseline public `/export` seam in a scratch worktree: - authoritative transcript with no restore repository (header, every content variant, D9 omission markers, redaction, ANSI stripping), - the turn handoff, - the visible-history fallback over a workspace with recorded restore points, - correlation against recorded restore points (table, newest-first order, `tool` snapshots listed but not correlated, the ambiguous double match, and the no-match line). Only genuinely clock-derived fields are normalised (the export stamp, the turn header stamp, and - for the recorded states - the snapshot id and `Recorded (UTC)` cell, because `git commit-tree` uses a wall-clock date). A unit test pins the normaliser so it cannot quietly widen. Everything else is byte-compared. Also here: the exhaustive `ContextParts` assertion that makes "no unrelated facet" a compile-time guarantee, the shared host-bound test-support module, the token-aware extraction audits plus their own unit test, and the boundary gate extension that keeps `codewhale-secrets` free of any TUI edge. Carries one unrelated, disclosed repair: a bounded retry for a fork/exec `ETXTBSY` race in the `wl-paste` regression, kept because the configured workspace gate was intermittently red without it. Generated with CodeWhale
1 parent f8e4148 commit 5b0578a

11 files changed

Lines changed: 2573 additions & 22 deletions
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Codewhale conversation export
2+
3+
- Exported: 2026-09-11T13:31:54Z
4+
- Session: session-
5+
- Provider: deepseek
6+
- Model: deepseek-v4-pro
7+
- Mode: Act
8+
- Workspace: example
9+
- Messages: 8
10+
11+
> Hidden instructions, internal reasoning, and reasoning signatures are omitted. Secret-like values and credential-bearing URLs are redacted as a defense in depth; review the export before sharing it.
12+
13+
## Restore points
14+
15+
No workspace restore points are recorded for this workspace, so nothing in this export can be correlated to a restorable workspace state. Snapshots may be disabled, or no turn has taken one yet.
16+
17+
## 1. system
18+
19+
[internal context omitted]
20+
21+
## 2. user
22+
23+
### Content 1: Text
24+
25+
Please inspect this output
26+
27+
## 3. assistant
28+
29+
### Content 1: Internal reasoning
30+
31+
[internal reasoning and signature omitted]
32+
33+
### Content 2: Tool call
34+
35+
- ID: call-1
36+
- Name: fetch_url
37+
- Caller type: code_execution_20250825
38+
- Caller tool ID: server-tool-1
39+
40+
Input:
41+
42+
```json
43+
{
44+
"url": "https://***:***@example.com/path?token=***&ok=1",
45+
"api_key": "[redacted]",
46+
"nested": {
47+
"authorization": "[redacted]"
48+
}
49+
}
50+
```
51+
52+
## 4. user
53+
54+
### Content 1: Tool result
55+
56+
- Tool call ID: call-1
57+
- Error: false
58+
59+
Result:
60+
61+
Authorization: [redacted]
62+
result ok
63+
64+
Structured result blocks:
65+
66+
```json
67+
[
68+
{
69+
"type": "image",
70+
"mime_type": "image/png",
71+
"omission_code": "inline_or_local_image_payload",
72+
"omitted_base64_bytes": 25
73+
},
74+
{
75+
"session_token": "[redacted]",
76+
"note": "keep me"
77+
}
78+
]
79+
```
80+
81+
## 5. assistant
82+
83+
### Content 1: Image attachment
84+
85+
- Reference: https://example.com/visible.png?token=***
86+
87+
### Content 2: Image attachment
88+
89+
- Reference omitted (inline or local image payload)
90+
91+
## 6. assistant
92+
93+
### Content 1: Server tool call
94+
95+
- ID: srv-1
96+
- Name: web_search
97+
98+
Input:
99+
100+
```json
101+
{
102+
"query": "secret token"
103+
}
104+
```
105+
106+
## 7. user
107+
108+
### Content 1: Tool-search result
109+
110+
- Tool call ID: srv-1
111+
112+
```json
113+
{
114+
"results": []
115+
}
116+
```
117+
118+
## 8. assistant
119+
120+
### Content 1: Code-execution result
121+
122+
- Tool call ID: srv-2
123+
124+
```json
125+
{
126+
"stdout": "ok"
127+
}
128+
```
129+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Codewhale conversation export
2+
3+
- Exported: 2026-09-11T14:39:58Z
4+
- Session: session-
5+
- Provider: deepseek
6+
- Model: deepseek-v4-pro
7+
- Mode: Act
8+
- Workspace: f025-golden-workspace
9+
- Messages: 3
10+
11+
> Hidden instructions, internal reasoning, and reasoning signatures are omitted. Secret-like values and credential-bearing URLs are redacted as a defense in depth; review the export before sharing it.
12+
13+
## Restore points
14+
15+
The 3 most recent workspace restore points, newest first. `/restore <N>` restores by the index in this table and `/restore list` shows the live list.
16+
17+
> The index is the position at export time. Every new turn records another restore point and shifts it, so re-check `/restore list` before restoring from an older export. The snapshot id does not shift.
18+
19+
| N | Restore point | Recorded (UTC) | Label |
20+
| --- | --- | --- | --- |
21+
| 1 | `3d0ad76f0222` | 2026-09-11T14:39:58Z | pre-turn:3: Fix the login test |
22+
| 2 | `6a3bc0698866` | 2026-09-11T14:39:58Z | tool:call-1 |
23+
| 3 | `e24e175a7a57` | 2026-09-11T14:39:58Z | pre-turn:2: Fix the login test |
24+
25+
## 1. user
26+
27+
### Content 1: Text
28+
29+
Fix the login test
30+
31+
- Restore points: N1 `3d0ad76f0222` (pre-turn turn 3), N3 `e24e175a7a57` (pre-turn turn 2)
32+
- More than one restore point carries this prompt snippet, so the match is ambiguous; compare the recorded times above before restoring.
33+
34+
## 2. assistant
35+
36+
### Content 1: Text
37+
38+
Working on it.
39+
40+
## 3. user
41+
42+
### Content 1: Text
43+
44+
unrelated question
45+
46+
- Restore points: none recorded for this message within the listed window.
47+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Codewhale conversation export
2+
3+
- Exported: 2026-09-11T14:39:58Z
4+
- Session: session-
5+
- Provider: deepseek
6+
- Model: deepseek-v4-pro
7+
- Mode: Act
8+
- Workspace: f025-golden-workspace
9+
- Messages: 2
10+
11+
> Hidden instructions, internal reasoning, and reasoning signatures are omitted. Secret-like values and credential-bearing URLs are redacted as a defense in depth; review the export before sharing it.
12+
13+
## Restore points
14+
15+
The 3 most recent workspace restore points, newest first. `/restore <N>` restores by the index in this table and `/restore list` shows the live list.
16+
17+
> The index is the position at export time. Every new turn records another restore point and shifts it, so re-check `/restore list` before restoring from an older export. The snapshot id does not shift.
18+
19+
| N | Restore point | Recorded (UTC) | Label |
20+
| --- | --- | --- | --- |
21+
| 1 | `3d0ad76f0222` | 2026-09-11T14:39:58Z | pre-turn:3: Fix the login test |
22+
| 2 | `6a3bc0698866` | 2026-09-11T14:39:58Z | tool:call-1 |
23+
| 3 | `e24e175a7a57` | 2026-09-11T14:39:58Z | pre-turn:2: Fix the login test |
24+
25+
> Structured API messages were unavailable; the entries below are a sanitized visible-history fallback.
26+
27+
## 1. user
28+
29+
Fix the login test
30+
31+
## 2. assistant
32+
33+
Done.
34+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Turn handoff
2+
_Status: completed · generated 2026-09-11 15:31:54_
3+
4+
## Intent
5+
Fix the flaky login test
6+
7+
## Files changed
8+
9+
10+
## Turn timeline
11+
- 1. user prompt: Fix the flaky login test
12+
- 2. assistant result: Fixed the login test. — done
13+
- 3. checkpoint: unavailable — no numbered turn snapshot yet · action: e export handoff
14+
15+
## Tests / verifier
16+
17+
18+
## Model route + tokens/cost
19+
- Route: DeepSeek · deepseek-v4-pro
20+
21+
## Result / status
22+
- Status: completed
23+
- Result: Fixed the login test.

crates/tui/src/commands/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ mod session_acceptance;
3434
#[cfg(test)]
3535
mod session_control_regression_tests;
3636
#[cfg(test)]
37+
mod session_export_regression_tests;
38+
// FEAT-025 Phase 5: public command-surface parity lives at the `commands` root
39+
// for the same extraction reason as the host regressions above.
40+
#[cfg(test)]
41+
mod session_export_surface_tests;
42+
// FEAT-025 audit hardening: shared host-bound test support for both export
43+
// test suites (timestamp normalisation and the exhaustive envelope check).
44+
#[cfg(test)]
45+
mod session_export_test_support;
46+
#[cfg(test)]
3747
mod session_lifecycle_regression_tests;
3848

3949
use std::sync::OnceLock;

0 commit comments

Comments
 (0)