Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d8399d2
Add Week 1 protocol config and storage layers
ThomasK33 Mar 19, 2026
c48b0ee
Add Week 1 CLI command stubs
ThomasK33 Mar 19, 2026
7bc39dd
Add PTY creation wrapper
ThomasK33 Mar 19, 2026
20c89dc
Add in-memory session state machine
ThomasK33 Mar 19, 2026
5ac308c
Add append-only event log writer
ThomasK33 Mar 19, 2026
a2871e5
Add RPC client and server socket transport
ThomasK33 Mar 19, 2026
28d323a
Add session host entrypoint
ThomasK33 Mar 19, 2026
4212c47
Implement host lifecycle helpers
ThomasK33 Mar 19, 2026
e891b93
Wire lifecycle CLI commands
ThomasK33 Mar 19, 2026
30973c6
Fix reported lint errors
ThomasK33 Mar 19, 2026
a34fcc4
Add PTY key and paste encoders
ThomasK33 Mar 19, 2026
1c162ca
Prepare host PTY control plumbing
ThomasK33 Mar 19, 2026
82c60ad
Implement CLI control commands
ThomasK33 Mar 19, 2026
a7f1b45
Wire PTY control handlers in host
ThomasK33 Mar 19, 2026
6c5436c
Add PTY control integration tests
ThomasK33 Mar 19, 2026
8d9faba
Fix event log append sequencing race
ThomasK33 Mar 19, 2026
cc3670d
Add deterministic e2e fixture apps
ThomasK33 Mar 19, 2026
0932e97
Add week 1 dogfood proof bundle
ThomasK33 Mar 19, 2026
abdc164
Fix formatting across Week 1 files
ThomasK33 Mar 19, 2026
f8513e7
Add dogfood visual screenshots
ThomasK33 Mar 19, 2026
caf05f1
Add nvim dogfood demo evidence artifacts
ThomasK33 Mar 19, 2026
ffe7f79
Add nvim dogfood demo proof bundle
ThomasK33 Mar 19, 2026
32a1f63
Drain event log writes before close
ThomasK33 Mar 20, 2026
20f6c82
Tighten protocol message schemas
ThomasK33 Mar 20, 2026
1a433c4
fix: rename lifecycle proof screenshots to svg
ThomasK33 Mar 20, 2026
1e3085a
test: cover wait timeout result
ThomasK33 Mar 20, 2026
eb4317c
Fix create CLI error handling
ThomasK33 Mar 20, 2026
ee54509
Fix formatting for review fix commits
ThomasK33 Mar 20, 2026
6089c24
Fix idle wait and signal race handling
ThomasK33 Mar 20, 2026
684de3a
Fix formatting for idle-wait fix
ThomasK33 Mar 20, 2026
e314d3a
Add RPC buffer size limits
ThomasK33 Mar 20, 2026
baba7ff
Fix session cleanup on launch failure
ThomasK33 Mar 20, 2026
b0fe293
Set default wait timeout and reject empty type text
ThomasK33 Mar 20, 2026
ed49977
refactor: share test helpers across suites
ThomasK33 Mar 20, 2026
17f0ee7
Fix formatting for wait timeout change
ThomasK33 Mar 20, 2026
81a5207
Fix CLI command error envelopes
ThomasK33 Mar 20, 2026
7a0583a
Fix formatting for error envelope fix
ThomasK33 Mar 20, 2026
5777b20
Register INVALID_INPUT error code
ThomasK33 Mar 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dogfood/20260319-lifecycle/01-create.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ok": true,
"command": "create",
"timestamp": "2026-03-19T18:02:15.173Z",
"result": {
"sessionId": "01KM3M69V23RWMMDMS1EK3ZXB4"
}
}
20 changes: 20 additions & 0 deletions dogfood/20260319-lifecycle/02-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"ok": true,
"command": "list",
"timestamp": "2026-03-19T18:02:15.471Z",
"result": {
"sessions": [
{
"sessionId": "01KM3M69V23RWMMDMS1EK3ZXB4",
"status": "running",
"command": [
"node",
"--import",
"tsx",
"../../test/fixtures/apps/hello-prompt/main.ts"
],
"createdAt": "2026-03-19T18:02:14.759Z"
}
]
}
}
27 changes: 27 additions & 0 deletions dogfood/20260319-lifecycle/03-inspect-live.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"ok": true,
"command": "inspect",
"timestamp": "2026-03-19T18:02:15.861Z",
"result": {
"session": {
"version": 1,
"sessionId": "01KM3M69V23RWMMDMS1EK3ZXB4",
"createdAt": "2026-03-19T18:02:14.759Z",
"updatedAt": "2026-03-19T18:02:15.078Z",
"status": "running",
"command": [
"node",
"--import",
"tsx",
"../../test/fixtures/apps/hello-prompt/main.ts"
],
"cwd": "/home/coder/.mux/src/agent-terminal/agent_exec_d1aeb26ed6/dogfood/20260319-lifecycle",
"cols": 80,
"rows": 24,
"hostPid": 278189,
"childPid": 278201,
"exitCode": null,
"exitSignal": null
}
}
}
6 changes: 6 additions & 0 deletions dogfood/20260319-lifecycle/04-type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ok": true,
"command": "type",
"timestamp": "2026-03-19T18:02:16.162Z",
"result": {}
}
6 changes: 6 additions & 0 deletions dogfood/20260319-lifecycle/05-send-keys.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ok": true,
"command": "send-keys",
"timestamp": "2026-03-19T18:02:16.456Z",
"result": {}
}
8 changes: 8 additions & 0 deletions dogfood/20260319-lifecycle/06-wait-idle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ok": true,
"command": "wait",
"timestamp": "2026-03-19T18:02:16.977Z",
"result": {
"timedOut": false
}
}
6 changes: 6 additions & 0 deletions dogfood/20260319-lifecycle/07-paste.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ok": true,
"command": "paste",
"timestamp": "2026-03-19T18:02:17.309Z",
"result": {}
}
6 changes: 6 additions & 0 deletions dogfood/20260319-lifecycle/08-send-keys-enter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ok": true,
"command": "send-keys",
"timestamp": "2026-03-19T18:02:17.612Z",
"result": {}
}
8 changes: 8 additions & 0 deletions dogfood/20260319-lifecycle/09-wait-idle-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ok": true,
"command": "wait",
"timestamp": "2026-03-19T18:02:18.211Z",
"result": {
"timedOut": false
}
}
9 changes: 9 additions & 0 deletions dogfood/20260319-lifecycle/10-resize.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ok": true,
"command": "resize",
"timestamp": "2026-03-19T18:02:18.622Z",
"result": {
"cols": 120,
"rows": 40
}
}
27 changes: 27 additions & 0 deletions dogfood/20260319-lifecycle/11-inspect-resized.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"ok": true,
"command": "inspect",
"timestamp": "2026-03-19T18:02:19.035Z",
"result": {
"session": {
"version": 1,
"sessionId": "01KM3M69V23RWMMDMS1EK3ZXB4",
"createdAt": "2026-03-19T18:02:14.759Z",
"updatedAt": "2026-03-19T18:02:18.619Z",
"status": "running",
"command": [
"node",
"--import",
"tsx",
"../../test/fixtures/apps/hello-prompt/main.ts"
],
"cwd": "/home/coder/.mux/src/agent-terminal/agent_exec_d1aeb26ed6/dogfood/20260319-lifecycle",
"cols": 120,
"rows": 40,
"hostPid": 278189,
"childPid": 278201,
"exitCode": null,
"exitSignal": null
}
}
}
9 changes: 9 additions & 0 deletions dogfood/20260319-lifecycle/12-signal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ok": true,
"command": "signal",
"timestamp": "2026-03-19T18:02:19.371Z",
"result": {
"signal": "SIGINT",
"delivered": true
}
}
9 changes: 9 additions & 0 deletions dogfood/20260319-lifecycle/13-wait-exit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ok": true,
"command": "wait",
"timestamp": "2026-03-19T18:02:19.711Z",
"result": {
"timedOut": false,
"exitCode": 130
}
}
27 changes: 27 additions & 0 deletions dogfood/20260319-lifecycle/14-inspect-exited.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"ok": true,
"command": "inspect",
"timestamp": "2026-03-19T18:02:20.056Z",
"result": {
"session": {
"version": 1,
"sessionId": "01KM3M69V23RWMMDMS1EK3ZXB4",
"createdAt": "2026-03-19T18:02:14.759Z",
"updatedAt": "2026-03-19T18:02:19.379Z",
"status": "exited",
"command": [
"node",
"--import",
"tsx",
"../../test/fixtures/apps/hello-prompt/main.ts"
],
"cwd": "/home/coder/.mux/src/agent-terminal/agent_exec_d1aeb26ed6/dogfood/20260319-lifecycle",
"cols": 120,
"rows": 40,
"hostPid": 278189,
"childPid": 278201,
"exitCode": 130,
"exitSignal": null
}
}
}
9 changes: 9 additions & 0 deletions dogfood/20260319-lifecycle/15-destroy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ok": true,
"command": "destroy",
"timestamp": "2026-03-19T18:02:20.328Z",
"result": {
"sessionId": "01KM3M69V23RWMMDMS1EK3ZXB4",
"destroyed": true
}
}
14 changes: 14 additions & 0 deletions dogfood/20260319-lifecycle/event-log.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{"seq":0,"ts":"2026-03-19T18:02:15.194Z","type":"output","payload":{"data":"READY> "}}
{"seq":1,"ts":"2026-03-19T18:02:16.160Z","type":"input_text","payload":{"data":"hello world"}}
{"seq":2,"ts":"2026-03-19T18:02:16.160Z","type":"output","payload":{"data":"hello world"}}
{"seq":3,"ts":"2026-03-19T18:02:16.454Z","type":"input_keys","payload":{"keys":["Enter"]}}
{"seq":4,"ts":"2026-03-19T18:02:16.455Z","type":"output","payload":{"data":"\r\n"}}
{"seq":5,"ts":"2026-03-19T18:02:16.455Z","type":"output","payload":{"data":"ECHO: hello world\r\nREADY> "}}
{"seq":6,"ts":"2026-03-19T18:02:17.308Z","type":"input_paste","payload":{"data":"\u001b[200~pasted-content\u001b[201~"}}
{"seq":7,"ts":"2026-03-19T18:02:17.308Z","type":"output","payload":{"data":"^[[200~pasted-content^[[201~"}}
{"seq":8,"ts":"2026-03-19T18:02:17.610Z","type":"input_keys","payload":{"keys":["Enter"]}}
{"seq":9,"ts":"2026-03-19T18:02:17.610Z","type":"output","payload":{"data":"\r\nECHO: pasted-content\r\nREADY> "}}
{"seq":10,"ts":"2026-03-19T18:02:18.620Z","type":"resize","payload":{"cols":120,"rows":40}}
{"seq":11,"ts":"2026-03-19T18:02:19.369Z","type":"signal","payload":{"signal":"SIGINT"}}
{"seq":12,"ts":"2026-03-19T18:02:19.370Z","type":"output","payload":{"data":"INTERRUPTED\r\n"}}
{"seq":13,"ts":"2026-03-19T18:02:19.380Z","type":"exit","payload":{"exitCode":130,"exitSignal":null}}
20 changes: 20 additions & 0 deletions dogfood/20260319-lifecycle/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"scenario": "lifecycle-proof",
"date": "2026-03-19",
"sessionId": "01KM3M69V23RWMMDMS1EK3ZXB4",
"commands": [
"create",
"list",
"inspect",
"type",
"send-keys",
"wait",
"paste",
"resize",
"signal",
"destroy"
],
"fixture": "hello-prompt",
"result": "pass",
"knownGaps": ["renderer screenshots", "asciicast export", "gc command"]
}
54 changes: 54 additions & 0 deletions dogfood/20260319-lifecycle/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Lifecycle proof bundle

- **Date:** 2026-03-19
- **Scenario:** Full session lifecycle against the `hello-prompt` fixture
- **Fixture command:** `node --import tsx ../../test/fixtures/apps/hello-prompt/main.ts`
- **Session ID:** `01KM3M69V23RWMMDMS1EK3ZXB4`
- **Isolation:** run under a fresh `AGENT_TERMINAL_HOME=$(mktemp -d)` so only this scenario's state was present
- **Overall result:** pass; every JSON envelope in this directory has `ok: true`

## What was run

This scenario exercises the Week 1 control-plane lifecycle end to end: create, list, inspect, type, send Enter, wait for idle, paste, resize, signal, wait for exit, inspect the exited session, and destroy it.

For the `create` step, the working invocation was `create --json -- node --import tsx ...` so the CLI parsed `--json` as a control-plane flag and `--import tsx ...` as the child command.

## Step-by-step review guide

| Step | File | What the command did | What the reviewer should observe |
| ---- | ------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1 | `01-create.json` | Created a session running the `hello-prompt` fixture. | `ok: true`, `command: "create"`, and `result.sessionId == "01KM3M69V23RWMMDMS1EK3ZXB4"`. |
| 2 | `02-list.json` | Listed all sessions in the isolated home directory. | Exactly one session is present; its `sessionId` matches step 1, its `status` is `running`, and the command array points at the fixture. |
| 3 | `03-inspect-live.json` | Inspected the live session before any interaction. | `status: "running"`, `cols: 80`, `rows: 24`, and populated `hostPid` / `childPid`. `exitCode` and `exitSignal` are still `null`. |
| 4 | `04-type.json` | Sent literal text `hello world` to the PTY without pressing Enter. | Ack-only envelope: `ok: true` with an empty `result` object. The effect is visible in `event-log.jsonl` at seq 1-2. |
| 5 | `05-send-keys.json` | Sent the `Enter` key to submit the typed line. | Ack-only envelope. In the event log, seq 3-5 shows the Enter key, a newline, and the fixture response `ECHO: hello world` followed by `READY> `. |
| 6 | `06-wait-idle.json` | Waited for the session to go idle after the first prompt round-trip. | `timedOut: false`, proving the prompt settled within the 10s timeout. |
| 7 | `07-paste.json` | Sent a paste payload containing `pasted-content`. | Ack-only envelope. In the event log, seq 6 records `input_paste` with bracketed-paste wrappers and seq 7 shows the raw terminal echo. |
| 8 | `08-send-keys-enter.json` | Sent `Enter` so the pasted line would execute. | Ack-only envelope. Event-log seq 8-9 shows the Enter key and the fixture response `ECHO: pasted-content` followed by another prompt. |
| 9 | `09-wait-idle-2.json` | Waited for idle after the paste flow. | `timedOut: false`, confirming the second prompt cycle completed. |
| 10 | `10-resize.json` | Resized the PTY to 120x40. | `result.cols == 120` and `result.rows == 40`. |
| 11 | `11-inspect-resized.json` | Re-inspected the live session after resize. | Session is still `running`, and `cols` / `rows` now read `120` / `40`. |
| 12 | `12-signal.json` | Delivered `SIGINT` to the session. | `signal: "SIGINT"` and `delivered: true`. |
| 13 | `13-wait-exit.json` | Waited specifically for process exit. | `timedOut: false` and `exitCode: 130`, matching a Ctrl-C style termination. |
| 14 | `14-inspect-exited.json` | Inspected the terminated session before deletion. | `status: "exited"`, `exitCode: 130`, and the resized dimensions `120x40` are still preserved in metadata. |
| 15 | `15-destroy.json` | Deleted the session record from the isolated home directory. | `destroyed: true` and the same `sessionId` appears in the result. |

## Event log observations

- `event-log.jsonl` has 14 entries with monotonic sequence numbers `0` through `13`.
- The first entry is prompt output: `READY> `.
- The typed-text path is visible as `input_text` followed by echoed output.
- The paste path is distinct: seq 6 is `input_paste` and contains bracketed-paste control wrappers (`[200~` / `[201~`).
- The resize is recorded explicitly at seq 10 with `cols: 120` and `rows: 40`.
- The shutdown path is visible as `signal` -> `output` (`INTERRUPTED`) -> `exit` with `exitCode: 130`.

## Known gaps

- No renderer screenshots are included because the renderer path is not implemented yet.
- No asciicast export is available yet, so the proof is JSON/event-log based rather than video based.
- The `gc` command is not implemented yet, so garbage-collection behavior is out of scope for this bundle.

## Additional notes

- No command failed during this run, so there are no expected `ok: false` envelopes to explain.
- The bundle is intentionally self-contained for reviewer consumption: the JSON envelopes show command results, and `event-log.jsonl` shows the terminal-side evidence those commands produced.
29 changes: 29 additions & 0 deletions dogfood/20260319-lifecycle/screenshots/01-create.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions dogfood/20260319-lifecycle/screenshots/02-list.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading