Skip to content

Commit cb357ac

Browse files
timvisher-ddclaude
andcommitted
Update documentation for streaming dedup and live-validate workflow
- Add live-validate command documentation for verifying rendering pipeline changes with a live batch session - Update AGENTS.md development workflow with live-validate step - Update README.org features list: expand CI sub-features, add streaming dedup, DWIM context insertion, and runtime invariants Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1c5cea9 commit cb357ac

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

.agents/commands/live-validate.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Live validation of agent-shell rendering
2+
3+
Run a live agent-shell session in batch mode and verify the buffer output.
4+
This exercises the full rendering pipeline with real ACP traffic — the only
5+
way to catch ordering, marker, and streaming bugs that unit tests miss.
6+
7+
## Prerequisites
8+
9+
- `ANTHROPIC_API_KEY` must be available (via `op run` / 1Password)
10+
- `timvisher_emacs_agent_shell` must be on PATH
11+
- Dependencies (acp.el-plus, shell-maker) in sibling worktrees or
12+
overridden via env vars
13+
14+
## How to run
15+
16+
```bash
17+
cd "$(git rev-parse --show-toplevel)"
18+
timvisher_agent_shell_checkout=. \
19+
timvisher_emacs_agent_shell claude --batch \
20+
1>/tmp/agent-shell-live-stdout.log \
21+
2>/tmp/agent-shell-live-stderr.log
22+
```
23+
24+
Stderr shows heartbeat lines every 30 seconds. Stdout contains the
25+
full buffer dump once the agent turn completes.
26+
27+
## What to check in the output
28+
29+
1. **Fragment ordering**: tool call drawers should appear in
30+
chronological order (the order the agent invoked them), not
31+
reversed. Look for `` lines — their sequence should match the
32+
logical execution order.
33+
34+
2. **No duplicate content**: each tool call output should appear
35+
exactly once. Watch for repeated blocks of identical text.
36+
37+
3. **Prompt position**: the prompt line (`agent-shell>`) should
38+
appear at the very end of the buffer, after all fragments.
39+
40+
4. **Notices placement**: `[hook-trace]` and other notice lines
41+
should appear in a `Notices` section, not interleaved with tool
42+
call fragments.
43+
44+
## Enabling invariant checking
45+
46+
To run with runtime invariant assertions (catches corruption as it
47+
happens rather than after the fact):
48+
49+
```elisp
50+
;; Add to your init or eval before the session starts:
51+
(setq agent-shell-invariants-enabled t)
52+
```
53+
54+
When an invariant fires, a `*agent-shell invariant*` buffer pops up
55+
with a debug bundle and recommended analysis prompt.
56+
57+
## Quick validation one-liner
58+
59+
```bash
60+
cd "$(git rev-parse --show-toplevel)" && \
61+
timvisher_agent_shell_checkout=. \
62+
timvisher_emacs_agent_shell claude --batch \
63+
1>/tmp/agent-shell-live.log 2>&1 && \
64+
grep -n '' /tmp/agent-shell-live.log | head -20
65+
```
66+
67+
If the `` lines are in logical order and the exit code is 0, the
68+
rendering pipeline is healthy.

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@ When adding or changing features:
3131
changes land. Both `bin/test` and CI enforce this — changes to `.el`
3232
or `tests/` files without a corresponding `README.org` update will
3333
fail.
34+
3. **Live-validate rendering changes.** For changes to the rendering
35+
pipeline (fragment insertion, streaming, markers, UI), run a live
36+
batch session to verify fragment ordering and buffer integrity.
37+
See `.agents/commands/live-validate.md` for details. The key command:
38+
```bash
39+
timvisher_agent_shell_checkout=. timvisher_emacs_agent_shell claude --batch \
40+
1>/tmp/agent-shell-live.log 2>&1
41+
```

README.org

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@ A soft fork of [[https://github.com/xenodium/agent-shell][agent-shell]] with ext
66
* Features on top of agent-shell
77

88
- CI workflow and local test runner ([[https://github.com/timvisher-dd/agent-shell-plus/pull/1][#1]], [[https://github.com/timvisher-dd/agent-shell-plus/pull/6][#6]], [[https://github.com/timvisher-dd/agent-shell-plus/pull/8][#8]])
9+
- Byte-compilation of all =.el= files ([[https://github.com/timvisher-dd/agent-shell-plus/pull/1][#1]])
10+
- ERT test suite ([[https://github.com/timvisher-dd/agent-shell-plus/pull/1][#1]])
11+
- README update check when code changes ([[https://github.com/timvisher-dd/agent-shell-plus/pull/4][#4]])
12+
- Dependency DAG check (=require= graph must be acyclic) ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]])
913
- Desktop notifications when the prompt is idle and waiting for input ([[https://github.com/timvisher-dd/agent-shell-plus/pull/2][#2]], [[https://github.com/timvisher-dd/agent-shell-plus/pull/8][#8]])
1014
- Per-shell debug logging infrastructure ([[https://github.com/timvisher-dd/agent-shell-plus/pull/2][#2]])
1115
- Regression tests for shell buffer selection ordering ([[https://github.com/timvisher-dd/agent-shell-plus/pull/3][#3]])
1216
- CI check that README.org is updated when code changes ([[https://github.com/timvisher-dd/agent-shell-plus/pull/4][#4]])
1317
- Usage tests and defense against ACP =used > size= bug ([[https://github.com/timvisher-dd/agent-shell-plus/pull/5][#5]])
18+
- Streaming tool output with dedup: advertise =_meta.terminal_output= capability, handle incremental chunks from codex-acp and batch results from claude-agent-acp, strip =<persisted-output>= tags, fix O(n²) rendering, and partial-overlap thought dedup ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]])
19+
- DWIM context insertion: inserted context lands at the prompt and fragment updates no longer drag process-mark past it ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]])
20+
- Runtime buffer invariant checking with event tracing and violation debug bundles ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]])
1421

1522
-----
1623

0 commit comments

Comments
 (0)