test-case: CMD: extraction + confirm gate (yes and no answers) #22

Closed
opened 2026-05-10 21:38:01 +00:00 by claude-noether · 1 comment
Collaborator

Steps

  1. cd ~/src/aish && luajit main.lua
  2. Type: How do I list the files in the current directory?
  3. Model responds; somewhere in the response is a line starting with CMD: (e.g. CMD: ls).
  4. At the confirm prompt execute 'ls'? [y/N] , type n + Enter.
  5. Verify no ─── exec output ─── frame appears — the next [aish:fast]> prompt comes right back.
  6. Repeat: type the same question, wait for the same CMD: line + confirm.
  7. This time at the confirm, type y + Enter.

Expected

  • Step 4: assistant text is on screen, confirm asks, you answer n, nothing executes.
  • Step 7: assistant text is on screen, confirm asks, you answer y, the exec frame appears with the directory listing and ─── exit 0 ───.

What this exercises

  • executor.extract_cmd_lines finds the CMD: line (§3 substrate marker).
  • config.shell.confirm_cmd = true gates execution.
  • y/N parsing in repl.lua — case-insensitive y means yes, everything else means no.
  • After y, the PTY-backed exec runs and frames render correctly.
## Steps 1. `cd ~/src/aish && luajit main.lua` 2. Type: `How do I list the files in the current directory?` 3. Model responds; somewhere in the response is a line starting with `CMD: ` (e.g. `CMD: ls`). 4. At the confirm prompt `execute 'ls'? [y/N] `, type **n** + Enter. 5. Verify no `─── exec output ───` frame appears — the next `[aish:fast]>` prompt comes right back. 6. Repeat: type the same question, wait for the same CMD: line + confirm. 7. This time at the confirm, type **y** + Enter. ## Expected - Step 4: assistant text is on screen, confirm asks, you answer n, nothing executes. - Step 7: assistant text is on screen, confirm asks, you answer y, the exec frame appears with the directory listing and `─── exit 0 ───`. ## What this exercises - `executor.extract_cmd_lines` finds the `CMD: ` line (§3 substrate marker). - `config.shell.confirm_cmd = true` gates execution. - y/N parsing in `repl.lua` — case-insensitive y means yes, everything else means no. - After y, the PTY-backed exec runs and frames render correctly.
claude-noether added the test-case label 2026-05-10 21:38:01 +00:00
Owner

mfritsche@noether:~/src/aish$ cd ~/src/aish && luajit main.lua
aish: loaded config from ./config.lua
[aish:fast]> How do I list the files in the current directory?
CMD: ls
execute 'ls'? [y/N] n
[aish:fast]> How do I list the files in the current directory?
CMD: ls
execute 'ls'? [y/N] y
─── exec output ───
broker.lua config.lua docs ffi main.lua renderer.lua router.lua vendor
CLAUDE.md context.lua executor.lua history.lua README.md repl.lua safety.lua
─── exit 0 ───

Test passed

mfritsche@noether:~/src/aish$ cd ~/src/aish && luajit main.lua aish: loaded config from ./config.lua [aish:fast]> How do I list the files in the current directory? CMD: ls execute 'ls'? [y/N] n [aish:fast]> How do I list the files in the current directory? CMD: ls execute 'ls'? [y/N] y ─── exec output ─── broker.lua config.lua docs ffi main.lua renderer.lua router.lua vendor CLAUDE.md context.lua executor.lua history.lua README.md repl.lua safety.lua ─── exit 0 ─── Test passed
Sign in to join this conversation.