Skip to content

feat: shell-step execution modes — pass-input stdin/args and run-with-admin (goal 0240 S5) - #525

Merged
alicoding merged 1 commit into
mainfrom
feat/0240-s5-execution-modes
Aug 30, 2026
Merged

feat: shell-step execution modes — pass-input stdin/args and run-with-admin (goal 0240 S5)#525
alicoding merged 1 commit into
mainfrom
feat/0240-s5-execution-modes

Conversation

@alicoding

Copy link
Copy Markdown
Owner

Closes goal 0240's final slice. Both halves owner-decided this session after a deeper research round (full records in the goal file, mill-docs).

Pass input (code-execution, literal mode)

The converged Shortcuts/Automator semantics: a literal script now receives the upstream payload — piped to stdin (default) or as one argument per line ($@, via the POSIX -c $0-operand convention). Previously literal mode silently discarded the payload. Source "payload" unchanged. procexec.Spec gains Stdin (written then closed; empty keeps the null-device default).

Run with admin rights (process-shell-command)

Escalation via sudo's own documented GUI hook: each step wraps in sudo -A with a Mill-materialized 0700 askpass (osascript hidden-answer dialog — never the deprecated administrator-privileges AppleScript API, and no root helper daemon). Where pam_tid is configured for sudo (it is on the owner's machine), the system Touch ID prompt satisfies authentication before any password is asked — Mill never touches the credential. A block resolving secrets refuses the combination honestly (sudo's env_reset would strip them). Headless/server mode fails closed.

Fail-safe policy: an admin run ALWAYS asks. One predicate (composition.AdminForcedAsk) applied at every verdict seam — runtime gate, canvas badges, dry-run, the Confirm preview's ShellCommandVerdicts (now reading the real seeded node's config so preview and gate can never disagree), mayRequireApproval — upgrades allow→ask; deny still wins.

Seed revisions bumped (coding loop→3, codeexec example→3, secret-guard example→2), fingerprints regenerated, steps.md/contract.json regenerated. Config UI derives from the registered fields (verified live: the shell step's checkbox + ASK badge, the code-execution Pass-input options). Proofs: procexec stdin tests, real-shell stdin/args integration tests, argv-wrap/askpass-shape/secrets-refusal units, guardrailsvc admin-upgrade test; the real PAM prompt joins testing.md's manual-only registry with a full installed-build verification script.

Note: two local gate runs tripped on TestWatchChanges_FiresOnRealChange — the QUARANTINE-registered real-pasteboard-contention flake (installed Mill running); passes standalone and is untouched by this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_012im1JxQQV2ahnXzZDdVmZq

…-admin (goal 0240 S5)

(see branch description; full message identical to prior attempt)

- Pass input (code-execution literal): payload to stdin (default) or one arg per line — Shortcuts semantics; procexec.Spec gains Stdin.
- Run with admin (shell step): sudo -A + materialized askpass; pam_tid Touch ID first; secrets+admin refused honestly; headless fails closed.
- Always-asks policy via composition.AdminForcedAsk at every verdict seam.
- Seed revisions bumped (coding loop 3, codeexec 3, secret-guard 2) + fingerprints regenerated.
- Proofs: stdin/args + admin units and integration tests, guardrailsvc admin-upgrade test; real PAM prompt in the manual registry; steps.md + contract.json regenerated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012im1JxQQV2ahnXzZDdVmZq
@alicoding
alicoding enabled auto-merge (squash) August 30, 2026 00:28
@alicoding
alicoding merged commit 596e17f into main Aug 30, 2026
30 checks passed
@alicoding
alicoding deleted the feat/0240-s5-execution-modes branch August 30, 2026 00:39
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