Skip to content

prompt the accept-edits switch when the operator owns deploys - #84

Merged
bborbe merged 1 commit into
masterfrom
feat/permission-mode-precheck-in-orientation
Aug 16, 2026
Merged

prompt the accept-edits switch when the operator owns deploys#84
bborbe merged 1 commit into
masterfrom
feat/permission-mode-precheck-in-orientation

Conversation

@bborbe

@bborbe bborbe commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Why

work-on-task-assistant Phase 5 already extracts the deploy workflow and reports who runs the mutations. On 2026-08-16 that block fired correctly for a cluster TLS migration and said:

the operator runs the cluster mutations

…and the session then spent roughly 40 minutes handing back make/kubectl command blocks for the owner to paste, until they interrupted:

"As always, I don't want to run any commands. You should suggest switching to the edit mode and then you can run the commands yourself. What should I do?"

"As always" marks it as habitual, not a one-off.

The global CLAUDE.md rule Permission Mode Precheck already says to surface this at task start, and it did not help — a rule restating what an artifact should emit is a symptom patch. Phase 5 is the artifact loaded at exactly the right moment, and it was one line short of enforcing it.

What

When the extracted workflow assigns cluster/deploy mutations to the operator (make apply, make buca, kubectl writes, helm install/upgrade, ssh deploys, prod runbook steps), Phase 5 now appends a verbatim line prompting the accept edits switch.

The distinction the change rests on: the existing split describes who may run the command; the new line makes the switch that lets the agent actually run it in-session.

Scoped, not unconditional — non-ops tasks are unaffected.

Verification

make precommit passes (formatting, mocking, tests, linting, vulnerability scans, CHANGELOG, license headers — 27.3s).

Behavioural check belongs to the next ops-shaped work-on-task run: the Development Workflow section should carry the 🔐 line, and a task with no operator-run deploy steps should not.

work-on-task-assistant Phase 5 already extracts the deploy workflow and prints
who runs the mutations. That is not enough on its own: observed 2026-08-16, the
block correctly said 'the operator runs the cluster mutations' and the session
still spent ~40 minutes handing back command blocks to paste, until the owner
interrupted with 'as always, I don't want to run any commands — you should
suggest switching to the edit mode'.

The split says who may run the command. The added line makes the permission-mode
switch that lets the agent actually run it in-session, and fires only when the
extracted workflow assigns cluster/deploy mutations to the operator.

@ben-s-pull-request-reviewer ben-s-pull-request-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I have a complete picture. Let me compile the review.

Summary of Changes:

  1. CHANGELOG.md — Added ## Unreleased section with a feat entry describing the change.
  2. agents/work-on-task-assistant.md — Added a "Permission-mode precheck" bullet in Phase 5 that detects when extracted workflows assign cluster/deploy mutations to the operator and appends a verbatim line instructing the user to switch permission mode via Shift+Tab.

Review Report

Must Fix

None. No security vulnerabilities, no correctness bugs, no data issues.

Should Fix

None.

Nice to Have

  • agents/work-on-task-assistant.md:161 — The Shift+Tab instruction is UI-specific. If the Claude Code UI changes this mechanism, the instruction becomes stale without any code change to flag it. Consider adding a brief note that this instruction reflects the UI at time of writing (2026-08-16), or structuring the line so the UI mechanism is parameterized rather than hardcoded. (Not a bug — the rationale paragraph correctly explains why this specific instruction was added based on the 2026-08-16 observation.)

Toolchain Gap

  • ast-grep-runner.sh unavailable — The runner script at $CLAUDE_PLUGIN_ROOT/scripts/ast-grep-runner.sh could not be accessed due to sandbox restrictions blocking paths outside the working directory. The ast-grep binary itself is present (/usr/bin/ast-grep) but the aggregated runner (which also handles script-tier rule checks) is unreachable. Mechanical funnel was skipped per Step 4.0 fail-fast.

Plan Concerns — Addressed

Concern Status
Phase 5 conditional logic correctly identifies all mutation types ✅ Addressed — make apply, make buca, kubectl writes, helm install/upgrade, ssh deploys, prod runbook steps are all explicitly listed and the condition correctly gates on "operator rather than the agent"
Shift+Tab instruction may become stale with UI changes ⚠️ Acknowledged — inherent to any UI-specific instruction; rationale paragraph documents the observed failure this was meant to fix
Appends cleanly when no deploy steps exist ✅ Addressed — the precheck is inside the "If code task" block and gated on the workflow assigning mutations to the operator; if either condition is false, nothing is appended

{
  "verdict": "approve",
  "summary": "PR adds a permission-mode precheck to Phase 5 of work-on-task-assistant that detects when the extracted workflow assigns cluster/deploy mutations to the operator and appends a verbatim line instructing the user to switch to accept-edits mode via Shift+Tab. The change is well-reasoned (documenting a real 40-minute failure observed 2026-08-16), the conditional logic covers all listed mutation types, and the append integrates cleanly within the existing Phase 5 structure. No correctness or security issues found.",
  "comments": [
    {
      "file": "agents/work-on-task-assistant.md",
      "line": 166,
      "severity": "nit",
      "message": "Shift+Tab is UI-specific. If Claude Code's UI changes this mechanism, the instruction becomes stale without any code change to flag it. Consider a note that this reflects the UI at 2026-08-16, or parameterizing the UI mechanism."
    }
  ],
  "concerns_addressed": [
    "correctness: Phase 5 conditional logic correctly identifies all mutation types (make apply, make buca, kubectl writes, helm install/upgrade, ssh deploys, prod runbook steps) — addressed",
    "correctness: Shift+Tab instruction may become stale with UI changes — acknowledged as inherent risk, rationale paragraph documents the observed failure",
    "correctness: appends cleanly when no deploy steps exist — addressed, precheck is gated inside 'If code task' block and only triggers when workflow assigns mutations to operator"
  ]
}

@bborbe
bborbe merged commit e222b26 into master Aug 16, 2026
1 check passed
@bborbe
bborbe deleted the feat/permission-mode-precheck-in-orientation branch August 16, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant