Skip to content

Explain commands in plain words on the approval card - #920

Open
sambitcreate wants to merge 11 commits into
mainfrom
claude/project-thread-3i2krx
Open

sambitcreate wants to merge 11 commits into
mainfrom
claude/project-thread-3i2krx

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Requested by sbt · project thread

Problem

The "Run on your Mac?" card shows only the raw shell command, for example mkdir -p bf-out && sed -i '' 's#/tmp/bf/#bf-out/#g' fetch.py && …. Someone who doesn't read shell can't tell what they're approving.

Change

sbt's choices: 1a, 2a, 3a, 4a, 5b. That means a flip button in the corner, a required description, Aiden's own tags, the card always opening on plain words, and one PR that covers everything.

  • The model explains every command. run_command's description is now required, with guidance to write one plain sentence that names the files, folders and sites the command touches. A call without it, or with a blank one, is refused before anything runs, and the model is told description: missing. No extra model call is made.
  • Aiden's own tags. renderer/shared/command-reading.ts reads the command text with a small quote-aware shell reader. It uses no model, so a misleading description can't hide them.
    • Risky tags, in soft red, always come first:
      • can't read all of it
      • runs a script from the internet
      • deletes files
      • needs admin rights
      • uses files outside this project
      • uses the internet
      • stops programs
      • shuts down or restarts the computer
    • Calm tags, in grey: makes a folder, creates, edits or writes a named file, moves, copies, changes permissions, runs a named script.
    • Text inside quotes isn't mistaken for an action. A command decided only at run time (eval "$(…)", $CMD) gets the can't-read tag.
  • Flip card (desktop chats and Bot chats).
    • The card opens on What it will do.
    • An icon-only flip button in the well's corner shows the exact command, with Copy, and flips back. The flip is a short tilt, and Reduce Motion turns it off.
    • The tags sit under the well.
    • A call with no description shows the command as before.
    • Remembered rules still match the exact command, never the description.
  • aiden serve. It builds the same reading. daemonApprovalSummary no longer falls back to raw JSON when a run_command carries its description, which used to show phones run_command: {…}.
  • Phones: Remote contract revision 69 (provisional). The new opt-in approval:plain-words adds explanation and tags to a typed shell card.
    • The card carries them only for a device holding both this opt-in and approval:cards, on stream, run and Bot approvals.
    • The host-side reading never reaches a device.
    • iOS and Android ask for it alone after the revision-61 opt-ins. They decode it as strictly as the host does and draw the same flip card and tags.
    • On iPhone, only the answer buttons dim while an answer can't be sent, so the command can still be checked.
  • Docs. docs/aiden-remote-api-v1.md gets the capability row and a revision 69 section. Also updated: docs/design-guide.md, PRODUCT.md, packages/cli/README.md, ios/PROJECT_SPEC.md, both phone changelogs and .memory/tool-approval-card.md.

Revision 69 is provisional. main is at 65 and open PRs claim 66 to 68, so re-claim the next free number at merge. When you do, move AIDEN_REMOTE_APPROVAL_PLAIN_WORDS_CONTRACT_REVISION, contract.json, the new fixture and the iOS and Android revision asserts together.

Not covered yet (follow-ups):

  • A paired Mac viewing another host's chat (the read-only card)
  • Sub-agent shell approvals
  • Bot computer computer_shell
  • background_job

These still show the command alone.

Screenshots

Desktop, light and dark, using sbt's original command (calm) and a risky one.

Light Dark
Calm command, opens on words
Risky command, opens on words
Risky command, flipped to the command (with Copy)
In the chat window

iPhone and Android, taken on the owner's Mac. The iPhone shots come from AidenBotUXUITests (chat-approval-card and chat-approval-command) on the demo chat. Its command, npm run test:upload, only runs tests, so it gets no tags. The Android shots draw the fixture's risky command with a throwaway instrumented test, because no Android demo screen shows this card yet.

Light Dark
iPhone, opens on words
iPhone, flipped to the command
Android, opens on words
Android, flipped to the command

Scope

Requested in the project thread; no issue.

Verification

  • npm run type-check: clean. ESLint on the touched files: clean.
  • tsx --test: 782 passed, 0 failed, across:
    • command-reading, approval-card-model, chat-approval-card
    • the new aiden-remote-approval-plain-words, aiden-remote-bot-ux, -streams, -host-runs, -bot-session, -protocol, -router
    • coding-tools, bot-extension, bot-approvals, remote-approval, generation-stream, tool-approval, host-run-registry
    • The native helpers were built first.
  • New tests:
    • tag behaviour and explanation sanitising
    • the card opening on words, flipping and back, and the no-description fallback
    • Remote gating on streams, host runs and Bot sessions
    • a shared revision-69 fixture, including cards every parser must refuse
    • a run_command with no description refused before it runs
  • packages/cli: npm run build && npm test: 368 passed, 0 failed. Includes new daemonApprovalSummary cases.
  • iOS and Android, run on the owner's Mac at 59f7889. The later commits only touch the TS command reader, the CI registry and TS test fixtures.
    • iOS, on an iPhone 17 Pro simulator with iOS 27.0:
      • AidenBotUXTests 26/26
      • AidenBotSessionTests 101/101
      • AidenBotPlanTests 10/10
      • AidenBackgroundJobsTests 4/4
      • AidenRemotePhase0Tests 47/47, with 2 device-only tests skipped
      • AidenBotUXUITests screenshot test passing in light and dark
    • Android (testDebugUnitTest):
      • AidenApprovalPlainWordsContractTest 4/4
      • AidenBotPlanContractTest 6/6
      • AidenBackgroundJobsTest 6/6
      • AidenBotAccessRequestsContractTest 6/6
      • AidenRemoteClientTest 53/53
  • Pullfrog review: four tag gaps found and fixed, then a fifth (wget -qO). Its latest review found no new issues:
    • blank descriptions
    • unquoted here-docs
    • src/../../x paths
    • download-then-run scripts

Flaky tests seen

  • tests/e2e/browser.spec.ts:21 ("browser user and automation share a sandboxed page…"), Electron E2E (3/5) on 726e505. It failed once and passed on retry. In the failing attempt the viewport didn't switch to the requested 390×844 phone size (innerWidth/innerHeight read 560×427). This PR doesn't touch the browser. Run: https://github.com/sambitcreate/aiden-agent/actions/runs/45458555225/job/138840352183. The failed jobs were rerun once.
  • The non-blocking iOS (Xcode 27) lane failed in AidenShellUITests: the app launch timed out and an automation-type mismatch broke the "Add Computer" tap. This lane is also red on main.

AI disclosure

Written by Claude Code, an AI coding agent, at the owner's request.

Checklist

  • I tested these changes locally and reviewed the diff myself
  • Related docs / tests are updated where behavior, settings, or contracts changed
  • No unrelated refactors or changes are included

🤖 Generated with Claude Code

https://claude.ai/code/session_018VA6RJMteUn47RqiwzmhFx

run_command now requires a plain-language description. The "Run on your
Mac?" card opens on that description with a flip button to the exact
command, and shows Aiden's own tags read from the command text (soft red
for risky steps such as deleting files, the internet, downloaded scripts,
admin rights, files outside the project, stopping programs).

Desktop chats, Bot chats and aiden serve build the reading where the
workspace folder is known. Phones get the words and tags on the typed
approval card under the new approval:plain-words opt-in (contract
revision 69). aiden serve no longer shows phones raw JSON when a
run_command carries a description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RJMteUn47RqiwzmhFx
Both phones ask for approval:plain-words alone after approval:cards,
decode the card's explanation and tags as strictly as the Mac's parser,
and open a shell card on the plain words with a flip button to the exact
command. Aiden's tags sit under the card: soft red for risky steps, grey
for calm ones. The shared revision-69 fixture is read by the host, iOS
and Android tests. On iPhone the flip still works while answering is
paused, since only the answer buttons dim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RJMteUn47RqiwzmhFx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RJMteUn47RqiwzmhFx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RJMteUn47RqiwzmhFx
@sambitcreate sambitcreate self-assigned this Nov 24, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Four accepted command shapes bypass parts of the new plain-words safety contract, so these should be fixed before merge.

Reviewed changes I reviewed the complete six-commit diff, including command validation and parsing, desktop and native flip cards, Remote capability gating and projections, CLI parity, fixtures, tests, and documentation.

  • Required descriptions — run_command now declares a required model-written explanation and rejects an omitted field before execution.
  • Independent command reading — a new bounded shell reader generates risky and calm tags without another model call.
  • Approval-card presentation — desktop, Bot, iOS, and Android cards open on plain words and flip to the exact command.
  • Remote and CLI propagation — provisional revision 69 gates explanation and tags behind approval:cards plus approval:plain-words across stream, run, and Bot approvals.
  • Contracts and coverage — strict cross-platform fixtures, focused behavioral tests, product docs, design guidance, and mobile changelogs were updated.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment thread main/services/coding-tools.ts Resolved
Comment thread renderer/shared/command-reading.ts Resolved
Comment thread renderer/shared/command-reading.ts Resolved
Comment thread renderer/shared/command-reading.ts Resolved
- Refuse a blank run_command description before approval, not only a missing one.
- Read the command substitutions an unquoted here-document expands; a quoted one stays text.
- Flag a relative path that climbs out of the project anywhere in it (src/../../x).
- Flag a script that an earlier step downloaded to a file and a later step runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RJMteUn47RqiwzmhFx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RJMteUn47RqiwzmhFx

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Combined wget short options still bypass the downloaded-script warning, so the approval card can present a fetched script as a calm local action.

Reviewed changes I reviewed the two follow-up commits since the prior Pullfrog review, plus the complete current diff for context.

  • Required descriptions — Rejected empty and whitespace-only run_command descriptions before execution and added behavioral coverage.
  • Command safety parsing — Added expanding here-document inspection, lexical relative-path escape detection, and downloaded-file provenance across command separators.
  • CI coverage — Assigned both new plain-words test files to CI lanes.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment thread renderer/shared/command-reading.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes I reviewed the wget parser follow-up since the prior Pullfrog review, plus the complete current diff for context.

  • Combined short options — Parsed wget -O inside valid short-option clusters with attached or separate output names, preserving downloaded-script provenance for -qO file and -qOfile.
  • Behavioral coverage — Added positive and negative cases that distinguish the explicit output name from the URL-derived filename.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

sambitcreate added a commit that referenced this pull request Nov 24, 2026
iPhone 17 Pro simulator (iOS 27.0), AidenBotUXUITests chat-approval-card and chat-approval-command, light and dark. Android medium_phone emulator (API 36), AidenTypedApprovalCardContent with the riskyCommand card from approval-plain-words-revision-69.json, words and flipped to the command, light and dark. Captured from PR #920 head 59f7889.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes I reviewed the receipt-test fixture update since the prior Pullfrog review, plus the complete current diff for context.

  • Required command descriptions — Added plain-language descriptions to the three run_command calls in the process-receipt tests so they continue exercising real success, failure, and receipt-write-fencing behavior under the new required schema.
  • Focused verification — Confirmed both affected receipt tests execute and pass on the current head.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

Copy link
Copy Markdown
Owner Author

The non-blocking iOS build and simulator tests (Xcode 27) job failed on 726e505 in two tests this PR doesn't touch:

  • AidenShellUITests.testShellLaunchesForEveryScenario: the app timed out while launching on the simulator.
  • AidenShellUITests.testUnpairedSearchOffersPairingAndExplainsInvalidManualInput: the "Add Computer" tap failed with an Xcode 27 automation-type mismatch.

Both look like failures of the Xcode 27 simulator itself. Earlier PRs saw this lane go red on main as well. The required iOS build and simulator tests job (Xcode 26) passed on this head, and so did every other required check that has finished.


Generated by Claude Code

This branch has not been deployed

No deployments
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.

2 participants