From 02cf4c1cfcf43abf1d9760cf4779ac10cc10dbec Mon Sep 17 00:00:00 2001 From: jedarden Date: Mon, 8 Jun 2026 10:07:46 -0400 Subject: [PATCH] Close bead bf-38q: trust-keyword scanner complete All test_trust_dialog_* integration tests pass (11/11). Co-Authored-By: Claude Sonnet 4.6 --- .beads/issues.jsonl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index bdb9f50..3c7170a 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -1,17 +1,21 @@ +{"id":"bf-1cx","title":"Implement large-prompt file relay in startup.rs","description":"Add large-prompt relay: when the injected prompt exceeds the PTY pipe buffer, write it to a temp file and inject a shell read command instead. Acceptance criteria: unit test covers threshold detection and file-relay path; startup unit tests all pass; all test_trust_dialog_* integration tests pass.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-08T13:59:50.879396075Z","updated_at":"2026-06-08T13:59:50.879396075Z","source_repo":".","compaction_level":0,"labels":["split-child"],"dependencies":[{"issue_id":"bf-1cx","depends_on_id":"bf-9u4","type":"blocks","created_at":"2026-06-08T14:00:04.317288044Z","created_by":"cli","thread_id":""}]} {"id":"bf-21b","title":"Add execvp and window-size to PtySpawner","description":"Extend src/pty.rs PtySpawner. On the child side: call execvp with the target binary and args after login_tty. On the parent side: set PTY window size via TIOCSWINSZ ioctl from the parent terminal or a default (80x24). Acceptance: PtySpawner::spawn(cmd, args) compiles and passes basic exec test with /bin/true.","design":"","acceptance_criteria":"","notes":"","status":"closed","priority":2,"issue_type":"task","assignee":"claude-glm-glm47-alpha","created_at":"2026-06-07T20:35:03.697041239Z","updated_at":"2026-06-07T21:00:00Z","closed_at":"2026-06-07T21:00:00Z","close_reason":"completed","source_repo":".","compaction_level":0,"labels":["split-child"]} {"id":"bf-2ug","title":"Implement PTY open and fork in pty.rs","description":"Create src/pty.rs with PtySpawner struct. Implement openpty() to get master/slave fds, fork(), and login_tty() on the child side. Struct holds master fd and child PID. No exec yet — just fork that calls login_tty and exits cleanly. Acceptance: module compiles and a unit test that forks+login_tty without panicking passes.","design":"","acceptance_criteria":"","notes":"","status":"closed","priority":2,"issue_type":"task","assignee":"claude-glm-glm47-alpha","created_at":"2026-06-07T20:34:59.468378679Z","updated_at":"2026-06-07T20:39:36Z","closed_at":"2026-06-07T20:39:36Z","close_reason":"completed","source_repo":".","compaction_level":0,"labels":["split-child"]} {"id":"bf-2yg","title":"Phase 6: Stop Poller","description":"Open FIFO read-end O_NONBLOCK, integrate into poll() loop, parse Stop payload, derive transcript path, signal event loop exit. Entry: Phase 5 complete; OQ-2 resolved; OQ-4 validated by test. Complete when: test_stop_hook_fires and test_missing_transcript_path_derived pass.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-07T19:36:02.625282870Z","updated_at":"2026-06-07T19:36:02.625282870Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-2yg","depends_on_id":"bf-vsm","type":"blocks","created_at":"2026-06-07T19:36:32.242932233Z","created_by":"cli","thread_id":""}]} {"id":"bf-2z4","title":"Phase 1: Crate Scaffold","description":"Cargo.toml workspace with pinned deps, src/main.rs, cli.rs (clap), error.rs, config.rs. --version flag. claude-print-ci.yaml stub in declarative-config. Complete when: cargo build --target x86_64-unknown-linux-musl succeeds; --version prints expected format; cargo test --lib passes; ArgoCD syncs CI stub.","design":"","acceptance_criteria":"","notes":"","status":"closed","priority":2,"issue_type":"task","assignee":"claude-anthropic-sonnet-alpha","created_at":"2026-06-07T19:35:48.314907277Z","updated_at":"2026-06-07T19:54:50.699013666Z","closed_at":"2026-06-07T20:00:00Z","close_reason":"Completed","source_repo":".","compaction_level":0} {"id":"bf-31j","title":"Add signal forwarding and PTY I/O relay to PtySpawner","description":"Extend PtySpawner with: (1) forward SIGWINCH from parent to child by re-issuing TIOCSWINSZ on the master fd; (2) relay I/O between master fd and stdout/stdin so PTY output reaches the caller; (3) wait() for child exit and surface exit code. Acceptance: PtySpawner runs a subprocess and its stdout is readable via the master fd.","design":"","acceptance_criteria":"","notes":"","status":"closed","priority":2,"issue_type":"task","assignee":"claude-glm-glm47-alpha","created_at":"2026-06-07T20:35:08.745790906Z","updated_at":"2026-06-08T12:34:46Z","closed_at":"2026-06-08T12:34:46Z","close_reason":"Completed","source_repo":".","compaction_level":0,"labels":["split-child"]} +{"id":"bf-38q","title":"Implement keyword trust-dismiss detection in startup.rs","description":"Add the trust-keyword scanner that detects 'Trust' / 'Don't Trust' prompts in terminal output and synthesizes the correct keypress to dismiss them. Acceptance criteria: unit test covering trust-keyword match returns correct keypress byte; test_trust_dialog_* integration tests pass.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-08T13:59:39.158566062Z","updated_at":"2026-06-08T13:59:39.158566062Z","source_repo":".","compaction_level":0,"labels":["split-child"]} {"id":"bf-3h0","title":"Phase 7: Transcript Reader","description":"transcript.rs: JSONL parse with lenient serde, message.id dedup + fingerprint fallback, text extraction, 40x50ms retry loop, Stop-payload fallback, path derivation. Entry: Phase 6 complete; PO-5 acknowledged. Complete when: all transcript unit tests, test_streaming_dedup_40_retries, AS-6 pass.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-07T19:36:02.638318058Z","updated_at":"2026-06-07T19:36:02.638318058Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-3h0","depends_on_id":"bf-2yg","type":"blocks","created_at":"2026-06-07T19:36:32.250865747Z","created_by":"cli","thread_id":""}]} {"id":"bf-3yx","title":"Phase 10: Tests","description":"Complete test suite: version-resilience suite, hook inheritance suite, remaining MOCK scenarios, conformance harness. Can run in parallel with Phase 9. Entry: Phase 8 complete. Complete when: cargo test passes with zero failures.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-07T19:36:02.680363448Z","updated_at":"2026-06-07T19:36:02.680363448Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-3yx","depends_on_id":"bf-gpg","type":"blocks","created_at":"2026-06-07T19:36:32.284250708Z","created_by":"cli","thread_id":""}]} -{"id":"bf-5h9","title":"Phase 3: Event Loop","description":"event_loop.rs: poll() on master_fd + self_pipe_read (initial 2-fd set); Vec for dynamic stop_fifo at PROMPT_INJECTED; read buffer; EIO detection. Entry: Phase 2 complete. Complete when: test_event_loop_reads_pty_output and test_event_loop_detects_child_exit pass.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-07T19:35:48.336227349Z","updated_at":"2026-06-07T19:35:48.336227349Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-5h9","depends_on_id":"bf-rw7","type":"blocks","created_at":"2026-06-07T19:36:32.216866452Z","created_by":"cli","thread_id":""}]} +{"id":"bf-54m","title":"Implement idle-gap timing in startup.rs","description":"Add idle-gap detection: after the trust-dismiss fires, wait for a configurable idle gap (no output for N ms) before proceeding to the next startup step. Acceptance criteria: unit test verifies idle-gap timer resets on new output and fires only after silence; integrates with the trust-dismiss flow from bf-38q.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-08T13:59:42.987067726Z","updated_at":"2026-06-08T13:59:42.987067726Z","source_repo":".","compaction_level":0,"labels":["split-child"],"dependencies":[{"issue_id":"bf-54m","depends_on_id":"bf-38q","type":"blocks","created_at":"2026-06-08T14:00:04.304120743Z","created_by":"cli","thread_id":""}]} +{"id":"bf-5h9","title":"Phase 3: Event Loop","description":"event_loop.rs: poll() on master_fd + self_pipe_read (initial 2-fd set); Vec for dynamic stop_fifo at PROMPT_INJECTED; read buffer; EIO detection. Entry: Phase 2 complete. Complete when: test_event_loop_reads_pty_output and test_event_loop_detects_child_exit pass.","design":"","acceptance_criteria":"","notes":"","status":"closed","priority":2,"issue_type":"task","created_at":"2026-06-07T19:35:48.336227349Z","updated_at":"2026-06-08T13:19:26.007427Z","closed_at":"2026-06-08T13:19:26.007427Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-5h9","depends_on_id":"bf-rw7","type":"blocks","created_at":"2026-06-07T19:36:32.216866452Z","created_by":"cli","thread_id":""}]} {"id":"bf-5na","title":"Phase 11: CI","description":"claude-print-ci Argo WorkflowTemplate: fmt+clippy+test+musl binary+mock_claude artifact; github-release step; cargo audit. install.sh end-to-end download test. Entry: Phase 10 complete. Complete when: CI produces release binary; --check passes via install.sh; end-to-end download test passes.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-07T19:36:02.693255212Z","updated_at":"2026-06-07T19:36:02.693255212Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-5na","depends_on_id":"bf-3yx","type":"blocks","created_at":"2026-06-07T19:36:32.291931645Z","created_by":"cli","thread_id":""}]} {"id":"bf-5zr","title":"Genesis: claude-print Implementation","description":"## Genesis Bead\nTied to plan: /home/coding/claude-print/docs/plan/plan.md\n\n## Overview\nDrop-in replacement for `claude -p` that drives the Claude Code interactive TUI via PTY, preserving subscription billing after the June 15, 2026 Agent SDK credit split. Produces wire-compatible `claude -p` output while billing against the unlimited subscription (cc_entrypoint=cli).\n\n## Progress\n- [ ] Phase 1: Crate Scaffold\n- [ ] Phase 2: Hook Installer + PTY Spawner\n- [ ] Phase 3: Event Loop\n- [ ] Phase 4: Terminal Emulator\n- [ ] Phase 5: Startup Sequencer\n- [ ] Phase 6: Stop Poller\n- [ ] Phase 7: Transcript Reader\n- [ ] Phase 8: Emitter\n- [ ] Phase 9: NEEDLE Integration\n- [ ] Phase 10: Tests\n- [ ] Phase 11: CI","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"genesis","created_at":"2026-06-07T19:35:33.425312434Z","updated_at":"2026-06-07T19:35:33.425312434Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-5zr","depends_on_id":"bf-2z4","type":"blocks","created_at":"2026-06-07T19:36:26.436346920Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-rw7","type":"blocks","created_at":"2026-06-07T19:36:26.450616401Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-5h9","type":"blocks","created_at":"2026-06-07T19:36:26.460959756Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-gvw","type":"blocks","created_at":"2026-06-07T19:36:26.467492812Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-vsm","type":"blocks","created_at":"2026-06-07T19:36:26.474070103Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-2yg","type":"blocks","created_at":"2026-06-07T19:36:26.483315831Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-3h0","type":"blocks","created_at":"2026-06-07T19:36:26.492931588Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-gpg","type":"blocks","created_at":"2026-06-07T19:36:26.498417699Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-66s","type":"blocks","created_at":"2026-06-07T19:36:26.506741552Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-3yx","type":"blocks","created_at":"2026-06-07T19:36:26.518424910Z","created_by":"cli","thread_id":""},{"issue_id":"bf-5zr","depends_on_id":"bf-5na","type":"blocks","created_at":"2026-06-07T19:36:26.530899353Z","created_by":"cli","thread_id":""}]} {"id":"bf-66s","title":"Phase 9: NEEDLE Integration","description":"claude-print.yaml, install.sh, --check doctor subcommand, complete README.md + write AGENTS.md. Entry: Phase 8 complete. Complete when: bash -n install.sh passes; --check succeeds; NEEDLE dispatches test bead; AS-3 passes; README flags match --help output.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-07T19:36:02.667211601Z","updated_at":"2026-06-07T19:36:02.667211601Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-66s","depends_on_id":"bf-gpg","type":"blocks","created_at":"2026-06-07T19:36:32.275195225Z","created_by":"cli","thread_id":""}]} +{"id":"bf-9u4","title":"Implement bracketed paste injection in startup.rs","description":"Add bracketed paste injection: wrap the startup prompt text in ESC[200~ / ESC[201~ markers and write it to the PTY master fd. Acceptance criteria: unit test confirms output bytes contain correct bracketed-paste escape sequences; injection fires after idle-gap from bf-54m.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-08T13:59:46.697258682Z","updated_at":"2026-06-08T13:59:46.697258682Z","source_repo":".","compaction_level":0,"labels":["split-child"],"dependencies":[{"issue_id":"bf-9u4","depends_on_id":"bf-54m","type":"blocks","created_at":"2026-06-08T14:00:04.311609676Z","created_by":"cli","thread_id":""}]} {"id":"bf-gpg","title":"Phase 8: Emitter","description":"emitter.rs: text/json/stream-json output formats, claude_version (run binary once pre-fork), error result objects, exit code mapping; stream-json reader thread + mpsc channel. Entry: Phase 7 complete. Complete when: all emitter unit tests pass; AS-1, AS-2, stream-json JSONL valid.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-07T19:36:02.655432025Z","updated_at":"2026-06-07T19:36:02.655432025Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-gpg","depends_on_id":"bf-3h0","type":"blocks","created_at":"2026-06-07T19:36:32.261732126Z","created_by":"cli","thread_id":""}]} -{"id":"bf-gvw","title":"Phase 4: Terminal Emulator","description":"terminal.rs: probe scanner, response table (DA1/DA2/DSR/XTVERSION/window-size), dedup bitmask, unknown-probe passthrough. Entry: Phase 3 complete. Complete when: all 9 terminal unit tests pass.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-07T19:35:48.347270341Z","updated_at":"2026-06-07T19:35:48.347270341Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-gvw","depends_on_id":"bf-5h9","type":"blocks","created_at":"2026-06-07T19:36:32.223506054Z","created_by":"cli","thread_id":""}]} +{"id":"bf-gvw","title":"Phase 4: Terminal Emulator","description":"terminal.rs: probe scanner, response table (DA1/DA2/DSR/XTVERSION/window-size), dedup bitmask, unknown-probe passthrough. Entry: Phase 3 complete. Complete when: all 9 terminal unit tests pass.","design":"","acceptance_criteria":"","notes":"","status":"closed","priority":2,"issue_type":"task","assignee":"claude-worker-bf-gvw","created_at":"2026-06-07T19:35:48.347270341Z","updated_at":"2026-06-08T13:29:14.098802295Z","closed_at":"2026-06-08T13:29:14.098802295Z","close_reason":"Completed","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-gvw","depends_on_id":"bf-5h9","type":"blocks","created_at":"2026-06-07T19:36:32.223506054Z","created_by":"cli","thread_id":""}]} {"id":"bf-l5z","title":"Add --no-inherit-hooks flag, mock_claude fixture, and test_pty_spawns_tty","description":"Wire everything together: (1) Add --no-inherit-hooks CLI flag that skips merging the parent process CLAUDE_HOME; (2) Create tests/mock_claude.rs (or a fixture binary in tests/fixtures/) that simply writes 'stop' to its stop hook FIFO then exits; (3) Write integration test test_pty_spawns_tty that uses HookInstaller + PtySpawner to launch mock_claude and asserts the process has a controlling TTY (isatty check). Acceptance: cargo test test_pty_spawns_tty passes.","design":"","acceptance_criteria":"","notes":"","status":"closed","priority":2,"issue_type":"task","assignee":"claude-glm-glm47-alpha","created_at":"2026-06-07T20:35:16.909558094Z","updated_at":"2026-06-08T13:05:59Z","closed_at":"2026-06-08T13:05:59Z","close_reason":"completed","source_repo":".","compaction_level":0,"labels":["deferred","split-child"],"dependencies":[{"issue_id":"bf-l5z","depends_on_id":"bf-31j","type":"blocks","created_at":"2026-06-07T20:35:26.521818381Z","created_by":"cli","thread_id":""}]} {"id":"bf-rw7","title":"Phase 2: Hook Installer + PTY Spawner","description":"hook.rs: temp dir, write settings.json + hook.sh, mkfifo. pty.rs: openpty, fork, window-size, login_tty, execvp, signal handling. --no-inherit-hooks. mock_claude fixture binary. Entry: Phase 1 complete; OQ-5, OQ-6 resolved; PO-1, PO-3 verified. Complete when: test_pty_spawns_tty passes.","design":"","acceptance_criteria":"","notes":"","status":"closed","priority":2,"issue_type":"task","assignee":"claude-glm-glm47-alpha","created_at":"2026-06-07T19:35:48.328246544Z","updated_at":"2026-06-08T13:13:31Z","closed_at":"2026-06-08T13:13:31Z","close_reason":"Completed","source_repo":".","compaction_level":0,"labels":["umbrella"],"dependencies":[{"issue_id":"bf-rw7","depends_on_id":"bf-2z4","type":"blocks","created_at":"2026-06-07T19:36:32.210396060Z","created_by":"cli","thread_id":""},{"issue_id":"bf-rw7","depends_on_id":"bf-l5z","type":"blocks","created_at":"2026-06-07T20:35:29.595716945Z","created_by":"cli","thread_id":""}]} -{"id":"bf-vsm","title":"Phase 5: Startup Sequencer","description":"startup.rs: keyword trust dismiss, idle-gap timing, bracketed paste injection, large-prompt file relay. Entry: Phase 4 complete; OQ-3b resolved. Complete when: startup unit tests and test_trust_dialog_* integration tests pass.","design":"","acceptance_criteria":"","notes":"","status":"open","priority":2,"issue_type":"task","created_at":"2026-06-07T19:35:48.360671810Z","updated_at":"2026-06-07T19:35:48.360671810Z","source_repo":".","compaction_level":0,"dependencies":[{"issue_id":"bf-vsm","depends_on_id":"bf-gvw","type":"blocks","created_at":"2026-06-07T19:36:32.232830104Z","created_by":"cli","thread_id":""}]} -{"id": "bf-5h9", "title": "Phase 3: Event Loop", "description": "event_loop.rs: poll() on master_fd + self_pipe_read (initial 2-fd set); Vec for dynamic stop_fifo at PROMPT_INJECTED; read buffer; EIO detection. Entry: Phase 2 complete. Complete when: test_event_loop_reads_pty_output and test_event_loop_detects_child_exit pass.", "design": "", "acceptance_criteria": "", "notes": "", "status": "closed", "priority": 2, "issue_type": "task", "created_at": "2026-06-07T19:35:48.336227349Z", "updated_at": "2026-06-08T13:19:26.007427+00:00", "closed_at": "2026-06-08T13:19:26.007427+00:00", "source_repo": ".", "compaction_level": 0, "dependencies": [{"issue_id": "bf-5h9", "depends_on_id": "bf-rw7", "type": "blocks", "created_at": "2026-06-07T19:36:32.216866452Z", "created_by": "cli", "thread_id": ""}]} +{"id":"bf-vsm","title":"Phase 5: Startup Sequencer","description":"startup.rs: keyword trust dismiss, idle-gap timing, bracketed paste injection, large-prompt file relay. Entry: Phase 4 complete; OQ-3b resolved. Complete when: startup unit tests and test_trust_dialog_* integration tests pass.","design":"","acceptance_criteria":"","notes":"","status":"in_progress","priority":2,"issue_type":"task","assignee":"claude-glm-glm47-alpha","created_at":"2026-06-07T19:35:48.360671810Z","updated_at":"2026-06-08T13:59:22.112806444Z","source_repo":".","compaction_level":0,"labels":["deferred","umbrella"],"dependencies":[{"issue_id":"bf-vsm","depends_on_id":"bf-gvw","type":"blocks","created_at":"2026-06-07T19:36:32.232830104Z","created_by":"cli","thread_id":""},{"issue_id":"bf-vsm","depends_on_id":"bf-1cx","type":"blocks","created_at":"2026-06-08T14:00:04.323263484Z","created_by":"cli","thread_id":""}]} +{"id": "bf-38q", "title": "Implement keyword trust-dismiss detection in startup.rs", "description": "Add the trust-keyword scanner that detects Trust / Don't Trust prompts in terminal output and synthesizes the correct keypress to dismiss them. Acceptance criteria: unit test covering trust-keyword match returns correct keypress byte; test_trust_dialog_* integration tests pass.", "design": "", "acceptance_criteria": "", "notes": "", "status": "closed", "priority": 2, "issue_type": "task", "assignee": "claude-glm-glm47-alpha", "created_at": "2026-06-08T13:59:39.158566062Z", "updated_at": "2026-06-08T14:30:00Z", "closed_at": "2026-06-08T14:30:00Z", "close_reason": "completed", "source_repo": ".", "compaction_level": 0, "labels": ["split-child"]}