Skip to content

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

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

sambitcreate wants to merge 17 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. 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. Claimed at merge time (2026-11-25), after #907 (66), #910 (67) and #912 (68, bot:needs-you) merged. The constant, contract.json, the fixture (approval-plain-words-revision-69.json) and the iOS and Android revision asserts moved 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.
  • After merging main at 64e1dc2 (Pi 1.6.0, bot:needs-you at 68): npm run type-check clean, npm run test:ci-policy clean, 1,357 host tests (every aiden-remote-* suite except the cloud-hanging aiden-remote-service, plus command-reading, coding-tools, pi-agent-runtime-harness, the approval card and Bot approvals) with 0 failures, and packages/cli 371 passed, 0 failed.
  • iOS and Android, run on the owner's Mac at 59f7889. Later commits only touch the TS command reader, the CI registry, TS test fixtures and the revision renumbers, which change only comments, revision asserts, the fixture's file name and the opt-in lists (now holding both bot:needs-you and approval:plain-words) on the phones. CI's iOS and Android jobs cover the current head.
    • 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

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

CI flake

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

main now holds revisions 66 (#907) and 67 (#910), so the plain-words
contract written as 69 takes the next one: 68. The constant, the shared
fixture (renamed to approval-plain-words-revision-68.json), the iOS and
Android revision asserts, docs and changelogs move together.

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.

ℹ️ No critical issues — one minor documentation consistency suggestion inline.

Reviewed changes I reviewed the merge and Remote contract renumber since the prior Pullfrog review, plus the complete current diff for context.

  • Merged current Remote baseline — Incorporated main after contract revisions 66 and 67 landed.
  • Claimed revision 68 — Renumbered approval:plain-words from provisional 69 to claimed revision 68 across runtime constants, shared fixtures, native clients, assertions, and primary protocol documentation.
  • Verified contract alignment — Confirmed focused Remote tests pass 74/74, command-reading tests pass 15/15, and the iOS release-policy suite passes.

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 android/CHANGELOG.md Resolved

Copy link
Copy Markdown
Owner Author

The non-blocking iOS (Xcode 27) lane failed on 588dbbb, this time in AidenAppearanceTests.testThemeTilesPreviewTheLookTheModeGivesEveryTheme: "aiden left its preview transparent" (the rendered tile read alpha 0, not 255). This happened on the Xcode 27.1 / iOS 27.2 simulator, after several simulator service-hub disconnects in the same run.

This isn't from this PR. The test belongs to the theme-tile work in #875, and this PR changes no appearance or theme code. Every other test in that lane passed. The blocking iOS lane (Xcode 26) is still queued for a Mac runner.

Run: https://github.com/sambitcreate/aiden-agent/actions/runs/45561788583/job/139035184664


Generated by Claude Code

@sambitcreate sambitcreate mentioned this pull request Nov 25, 2026
3 tasks done
#912 (`bot:needs-you`) merged first and took revision 68, so plain-words
command approvals claim 69: the constant, contract.json, the renamed
approval-plain-words-revision-69.json fixture, the iOS and Android revision
asserts, and the docs move together. Conflicts in the phone opt-in lists,
the docs, changelogs and the CLI README keep both changes.

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.

ℹ️ No critical issues — one minor documentation correction inline.

Reviewed changes I reviewed the merge and Remote contract renumber since the prior Pullfrog review, plus the complete current diff for context.

  • Merged the revision-68 baseline — Incorporated main after bot:needs-you claimed Remote revision 68.
  • Moved plain-words approvals to revision 69 — Renumbered the runtime constant, shared fixture, native assertions, capability inventories, changelogs, and primary protocol documentation.
  • Preserved both mobile opt-ins — Reconciled iOS and Android capability lists so bot:needs-you and approval:plain-words remain independently negotiated.

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 docs/aiden-remote-api-v1.md Resolved
Keeps both sides of the package.json test lists.

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

Copy link
Copy Markdown
Owner Author

The non-blocking iOS (Xcode 27) lane failed on 532f59d in AidenBotSessionTests.testARefusedHandoffNoteWaitsUnderItsOwnMachine, with "The refusal never came". That message comes from an assertSettles timeout in a demo-coordinator test about hand-off note drafts.

I don't think this PR caused it. The PR doesn't change hand-off notes or drafts. The same test passed in this lane on 588dbbb, and on the owner's Mac (AidenBotSessionTests 101/101). The only phone-side change since then is the main merge that adds bot:needs-you beside approval:plain-words in the opt-in lists.

The blocking iOS lane runs the same suite on the new head, b9ebac2, which merges main again (a package.json union only). If that lane fails this test too, I'll look into it as a real failure.

Run: https://github.com/sambitcreate/aiden-agent/actions/runs/45640039222/job/139296770055


Generated by Claude Code

@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 revision-history correction and the two main merges since the prior substantive Pullfrog review, plus the complete current diff for context.

  • Corrected the revision history — Identified bot:needs-you as revision 68 in the plain-words section, leaving approval:plain-words correctly claimed at revision 69.
  • Reconciled current main — Incorporated the latest release, Bot-avatar, and CI changes without losing either Remote capability or the PR's test registrations.
  • Verified CI coverage — Confirmed the top-bar, command-reading, and plain-words fixture tests remain assigned, and npm run test:ci-policy passes 128/128.

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 | 𝕏

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