F3 SLICE-5: live claude-code turn via applyAgentEdit seam + manual smoke (INV-8) (#6)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-10 10:25:56 -07:00
parent 20b709f794
commit c08dc075af
7 changed files with 209 additions and 3 deletions
+42
View File
@@ -0,0 +1,42 @@
# F3 manual smoke — live `claude-code` turn (spec §6.8)
The live turn is deliberately NOT in CI (unit + host E2E drive the seam). It
gets this documented smoke, run once per machine that has Claude Code
installed and signed in (Pro/Max). The extension itself holds no credentials
(INV-8) — auth is entirely the local Claude Code login.
## 1. Scripted smoke (the quick check)
npm run smoke:live
Expected: prints a `replacement:` line containing "The smoke test passed.",
the model id, a non-empty `sessionId`, and exits 0.
## 2. In-editor smoke (the real PUC-2)
1. `npm run build`, then F5 (Extension Development Host) opening this repo.
2. Open any markdown file in the workspace; type a sentence — it renders with
the human gutter border (left edge) as you type.
3. Select the sentence → run **“Cowriting: Ask Claude to Edit Selection”** →
instruction: `rewrite this more formally`.
4. Expected: progress notification; on completion the replacement text lands
**tinted** (Claude-attributed), the human border remains on your other
edits, and after **save** the sidecar
`.threads/<doc>.json` has an `attributions[]` entry with
`author.kind: "agent"`, `agent.model`, `agent.sessionId`, and a `turnId`.
5. **Cowriting: Toggle Attribution** hides/shows both decorations (PUC-5).
## 3. Failure paths (INV-8 — graceful, tracking unaffected)
- Signed out / no Claude Code: `PATH="" npm run smoke:live` (or sign out) →
the script exits 1 with a clear error; in-editor, the command shows an
error notification and NO edit is applied.
- Buffer edited mid-turn: start an edit-selection turn, type elsewhere in the
document before it completes → warning notification "document changed", no
partial application (stale `expectedVersion`, spec §6.9).
## Smoke log
| Date | Machine | Result |
| --- | --- | --- |
| 2026-06-10 | benstull mac (darwin) | PASS — `replacement: "The smoke test passed."`, model `sonnet`, sessionId `run_g_rYKGYl`, 6.9s, exit 0. Failure-path note: with `PATH="/usr/bin:/bin"` the turn STILL succeeded (6.2s) — the SDK resolves `claude` via an absolute path (`~/.local/bin/claude`), not PATH, so a stripped PATH does not exercise the signed-out error; sign out of Claude Code to exercise it for real. |