Ralph Loop
You are implementing /yolo approval-less mode for keen-code (issue #95).
Goal: a yolo agent mode where ALL permission prompts are skipped, even for dangerous bash commands.
Users activate it via /yolo command and via shift+tab cycling build → plan → yolo.
In yolo mode the REPL shows the same input text area as build/plan, but in red.
Issue: https://github.com/mochow13/keen-code/issues/95
Right now, Keen at least requires approval for
bashcommands that are classified as risky. Using/yolocommand, users can skip all permissions and let Keen fly.
Progress checklist: .ai-interactions/tasks/issue-95/PROGRESS.md (create it on the first
invocation if missing, using the Task list below; keep the same - [ ] / - [x] format).
Work autonomously, but complete exactly one unchecked task per invocation, in order. Do not begin a later task until all prior tasks are checked off. Treat a task as incomplete unless its stated implementation and test requirements are satisfied.
Required workflow for this invocation¶
- Read this prompt and the progress checklist (
PROGRESS.mdin the same directory; create it from the Task list below if it does not exist yet). - Inspect
git status --short, the current implementation, and tests relevant to the next task. - Implement only that task. Make minimal, idiomatic changes that preserve current behavior outside the task.
- Run
gofmton every modified Go file and rungo mod tidyafter the change. - Run focused tests for the changed package(s). If this completes the final task, also run
go test -race ./.... - Update
PROGRESS.mdin the same directory: check off the completed task; add a concise note with changed files and tests run; record any blocker instead of claiming completion. - Inspect
git diff --checkandgit status --shortbefore responding.
Codebase orientation (from investigation)¶
- Modes:
internal/llm/systemprompt.go:12-17(AgentMode,ModeBuild/ModePlan),Build()atsystemprompt.go:88-122appendsbuildModePrompt/planModePrompt. - State:
internal/cli/repl/appstate/state.go:34(defaultModeBuild),SetModeat:334-339(coerces anything non-plan to build — must be extended),Mode()at:341-346,EffectiveToolRegistry()at:323-328(plan strips write/edit tools),systemPromptMessage()at:185-190. - REPL model:
internal/cli/repl/repl_helpers.go:430-455(currentMode,setMode,toggleModeplan↔build),internal/cli/repl/repl.go:73,227,241,274(permission requester wiring),repl.go:869-885(textareaFocused.Promptswitch +renderInputAreacall). - Input rendering:
renderInputAreaatrepl_helpers.go:595-635, rule-style chain at:604-615, chip-style at:629-633; theme atinternal/cli/repl/theme/styles.go:131-136(input rules),:234-235(ModeBuildChipStyle/ModePlanChipStyle),:237-241(InputRulePlanStyle,PromptPlanStyle). - Keybinding:
internal/cli/repl/handlers.go:595-597(shift+tab→toggleMode()only when no suggestion is visible). - Slash commands:
internal/cli/repl/commands/commands.go:23(Mode = "/mode"),Allat:47-73,Suggestionsat:75-110; dispatch atinternal/cli/repl/command_handlers.go:73-76,handleModeCommandat:419-437(/mode plan|buildonly). - Permissions:
internal/cli/repl/permissions/requester.go:37-43(Requesterstruct),:53-57(NewAutoApproveRequesterfor headless),:59-99(RequestPermissionorder: autoApprove → project allow → session-allowed → prompt). Headless wiring atinternal/cli/repl/headless_run.go:87-89. Tool wiring atinternal/cli/repl/tooling/tool_registry.go:20-57. - Bash:
internal/tools/bash.go:133-163— workdirCheckPathprompt, then dangerous-command prompt (isDangerous || IsDangerousCommand(command)). This is the prompt/yolomust skip. - Permission UI:
internal/cli/repl/stream_permission.go,handlers.go:869-915(handlePermissionKeyMsg). Guard policy (internal/filesystem/guard.go,docs/permission-system.md) stays authoritative: yolo skips prompts, neverPermissionDeniedblocks (same boundary as/allow-permission). - Help/tips text:
repl_helpers.go:34(`Shift+Tab` swaps plan ↔ build),:55(`/mode build` exits plan-only mode),internal/cli/repl/tips.go:7,26, mode line atcommand_handlers.go:428.
Tasks¶
-
[ ] Task 1 —
ModeYolo+ system prompt (internal/llm/systemprompt.go) AddModeYolo AgentMode = "yolo", ayoloModePrompt(build-leaning, approval-less: agent may run any tool including dangerous bash without asking; keep the never-expose-secrets safety line), and route it inBuild()(yolo→ yolo prompt,plan→ plan prompt, else build). Tests: extendinternal/llm/systemprompt_test.go— yolo prompt contains yolo marker and does not contain the plan read-only restriction; existing build/plan assertions still pass. -
[ ] Task 2 — AppState mode handling (
internal/cli/repl/appstate/state.go)SetModeacceptsModeYolo(only unknown values coerce to build);Mode()returns yolo when set;EffectiveToolRegistry()returns the full registry in yolo (same as build — plan still strips write/edit). Tests: extendappstate/state_test.go— set/get yolo round-trips, yolo registry includes write/edit/bash, plan still excludes write/edit. -
[ ] Task 3 — Permission bypass in the requester (
internal/cli/repl/permissions/requester.go) Add a yolo flag (e.g.yoloMode bool+SetYoloMode(bool)) soRequestPermissionreturns(true, nil)immediately when set, before project/session/prompt logic. Do NOT touch theautoApprove(headless) path or theGuardpolicy path. Tests: extendpermissions/requester_test.go— yolo requester allows dangerous + non-dangerous without a pending request; toggling yolo off restores prompting; existing autoApprove tests pass. -
[ ] Task 4 — Wire yolo into the REPL model (
internal/cli/repl/repl.go,repl_helpers.go,command_handlers.go:1162-1170)setModeaccepts yolo, syncsappState.SetModeANDpermissionRequester.SetYoloMode(mode == yolo);toggleModecyclesbuild → plan → yolo → build;/new+/clearsession-restore path preserves yolo the same way it preserves plan (do not force-reset to build). Tests: extendrepl_helpers_test.go/command_handlers_test.go— set/toggle cycle covers all three modes, appState + requester stay in sync, clear/new preserve yolo. -
[ ] Task 5 —
/yolo+/mode yoloslash commands (internal/cli/repl/commands/commands.go,command_handlers.go) AddYolo = "/yolo"const withAll/Suggestionsentries ("Enable approval-less yolo mode"); add a dispatch case for/yolo(activates yolo viasetMode) and extendhandleModeCommandto acceptplan|build|yolo(updateUsage: /mode plan|build|yolo, bare-/modehint, and theMode:status line). Tests: extendcommands_test.go+command_handlers_test.go—/yoloenters yolo,/mode yoloenters yolo,/mode invalidstill shows usage and keeps mode,/helplists/yolo. -
[ ] Task 6 —
shift+tabthree-state toggle + help text (internal/cli/repl/handlers.go:595-597,repl_helpers.go:32-63,tips.go)shift+tabcycles build→plan→yolo (via the Task-4toggleMode); update loading tip (`Shift+Tab` swaps plan ↔ build→ mention yolo),/mode buildhint,tips.goplan/shift-tab tips. Tests: extendhandlers_test.go— three consecutiveshift+tabpresses cycle build→plan→yolo→build with appState in sync. -
[ ] Task 7 — Red yolo input UI (
internal/cli/repl/theme/styles.go,repl_helpers.go:595-635,repl.go:869-885) AddModeYoloChipStyle(red background, e.g.ErrorColor),YoloInputRuleStyle/PromptYoloStyle(red foreground);renderInputAreauses the yolo rule style when focused in yolo mode and the yolo chip for the mode label (same shape as build/plan, only color differs);repl.gosetsFocused.Prompt = PromptYoloStylein yolo mode. Tests: extendrepl_test.go— yolo view contains the yolo chip render and the yolo rule-style color prefix (mirror the existing plan-mode assertions atrepl_test.go:308-313). -
[ ] Task 8 — Docs + full verification Update
docs/cli-usage.md(/yolo,/mode plan|build|yolo, 3-stateshift+tab, red input indicator) anddocs/permission-system.md(yolo lookup order: yolo → autoApprove → project allow → session → prompt; guardPermissionDeniedstill blocks). Rungofmt,go mod tidy,go test -race ./...,git diff --check. Record results inPROGRESS.md.
Locked design constraints¶
- Yolo skips interactive permission prompts only (including the dangerous-bash prompt in
internal/tools/bash.go:152-163). FilesystemGuardPermissionDeniedverdicts (blocked system paths,.gitignore, home dotfiles) still deny — same boundary as/allow-permission. - Do not reuse
autoApprovefor yolo: headless (headless_run.go) keeps its ownNewAutoApproveRequester; interactive yolo is a per-mode flag on the existingRequesterso leaving yolo mode restores normal prompting. - Yolo has the full build tool registry (no plan-style tool stripping) and its own system-prompt branch; plan-mode restrictions are untouched.
- Same input text area shape in all modes — only the color/chip changes to red in yolo.
- Keep existing public tool contracts and permission checks; file operations must go through
internal/filesystemguards. No new dependencies. No secrets in code, logs, or commits.
Completion protocol¶
Do not emit the completion marker until all Tasks 1–8 are done, all checklist entries are
checked, no blocker remains, go mod tidy has passed, gofmt has been run on modified Go files,
and go test -race ./... passes.
When and only when everything is complete, end your final response with this exact standalone line:
Otherwise, summarize the one task completed, tests run, and the next unchecked task. Do not emit the marker.