Skip to content

refactor: remove the Shell activity variant and run_shell dispatch [ORB-00374] - #501

Merged
danieljhkim merged 3 commits into
agent-mainfrom
orbit/ORB-00374
Jun 13, 2026
Merged

danieljhkim merged 3 commits into
agent-mainfrom
orbit/ORB-00374

Conversation

@danieljhkim

Copy link
Copy Markdown
Member

Summary

Removes the v2 Shell activity surface end to end — the fail-closed resolution of security bug ORB-00363.

run_shell spawned Command::new(program) with no OS sandbox, no cwd confinement, and no policy consultation (unlike the agent-CLI path), and its program allowlist was self-asserted within the same workspace-supplied spec — both program and allowed_programs came from the same YAML, so the gate was a tautology. A workspace activity/job declaring type: shell now fails to deserialize at load instead of executing.

What changed

  • Type surface: dropped ActivityV2Spec::Shell + ShellSpec, the ShellProgramNotAllowed / ShellSpawnFailed / ShellExitedUnexpected DispatchError variants, and every cross-crate match arm / re-export that named them.
  • Dispatch: removed run_shell, its dispatch arm, the "shell" label, and the now-dead std::process::Command import.
  • Demos (per chosen scope): deleted 7 pure-shell job fixtures, the shell_reference asset, and the shell smoke legs in both example binaries.
  • Tests migrated to deterministic: JobKind, round-trip, and workspace-shadow tests. The shadow test now uses an unregistered action, so an incorrectly-executed shadow fails the run rather than writing a marker — same security assertion.
  • Docs: write-activity.md and activity-job-yaml.md updated to drop the shell type.

Coverage note

Two shell-specific tests asserting the Ok(success=false) audit-message path were removed — deterministic actions cannot produce that outcome, so that path's only coverage was shell-based. Flagged in the task execution summary.

Verification

  • workspace + examples build clean
  • orbit-common / orbit-engine / orbit-cli / orbit-core targeted tests green
  • make ci-fast passed (all guardrail scripts)

Resolves ORB-00363.

🤖 Generated with Claude Code

claude and others added 2 commits June 12, 2026 20:28
…RB-00374]

Deletes the v2 Shell activity surface end to end: the ActivityV2Spec::Shell
variant + ShellSpec, run_shell with its dispatch arm and "shell" label, the
ShellProgramNotAllowed / ShellSpawnFailed / ShellExitedUnexpected DispatchError
variants, and the cross-crate match arms and re-exports that named them.

Removing the variant is the fail-closed resolution of ORB-00363. The shell
program allowlist was self-asserted within the same workspace-supplied spec
(both program and allowed_programs came from the same YAML, so the gate was a
tautology), and run_shell spawned Command::new(program) with no OS sandbox, no
cwd confinement, and no policy consultation -- unlike the agent-CLI path. A
workspace activity/job declaring `type: shell` now fails to deserialize at load
instead of executing.

Per the chosen scope, shell-only demos are deleted: 7 pure-shell job fixtures,
the shell_reference asset, and the shell smoke legs in both example binaries.
The JobKind, round-trip, and workspace-shadow tests are migrated to
deterministic specs (the shadow test now uses an unregistered action, so an
incorrectly-executed shadow fails the run rather than writing a marker). Two
shell-specific tests that asserted the Ok(success=false) message path are
removed -- deterministic actions cannot produce that outcome, so the path's
only coverage was shell-based.

Resolves ORB-00363.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
… [ORB-00363]

Follow-up to the Shell-variant removal (a005c23): resolves the stale-docs
review blocker and the dead-code cleanup item from PR review.

- ADR-0194 (proposed): records the fail-closed removal of the v2 `shell`
  activity surface as the security decision behind ORB-00363, including the
  cost of the lost Ok(success=false) coverage and the no-compat-shim migration.
- Design docs (1_overview, 2_design, 4_decisions): drop `shell` from the
  activity-type surface, the dispatch table, and the non-retryable error list;
  note the removal where a reader would otherwise expect the variant; bump
  last_updated and add ORB-00363/ORB-00374 task references.
- Code comments: five doc comments the removal commit missed still named the
  `shell` variant (activity_v2.rs discriminator example, job_v2.rs retry note,
  orbit-core activity_v2.rs backend note, dispatcher.rs host note, step.rs
  retry note). Re-anchored the retained Ok(success=false) machinery rationale
  to ADR-0194. The `success` field itself stays -- it is load-bearing across
  parallel/fan-out/loop aggregation, not shell-only scaffolding.

No behavior change: comment- and doc-only. make ci-fast passes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@danieljhkim

Copy link
Copy Markdown
Member Author

Follow-up commit bb7692d0 addresses the two review findings:

1. Stale design docs (blocker). The original commit updated the website how-to/reference docs but not the feature design docs under docs/design/activity-job/, which still listed shell as a live activity type.

  • 1_overview.md, 2_design.md: dropped shell from the activity-type surface, the dispatch delegation table, and the non-retryable error list; added a one-line pointer to the removal where a reader would otherwise expect the variant.
  • 4_decisions.md: added ADR-0194 (proposed) recording the fail-closed removal as the security decision behind ORB-00363 — context, decision, and the two costs (lost Ok(success=false) coverage; no compat shim, old YAML fails at load). Allocated via orbit.adr.add; artifact committed under .orbit/adrs/proposed/ADR-0194/.
  • Bumped last_updated and added ORB-00363/ORB-00374 task references in all three.

2. Dead-code cleanup. Five doc comments the removal commit missed still named the shell variant (the activity_v2.rs discriminator example, job_v2.rs retry note, orbit-core activity_v2.rs backend note, dispatcher.rs host note, step.rs retry note) — all fixed, with the retained Ok(success=false) machinery rationale re-anchored to ADR-0194.

Note: the DispatchOutcome.success field is kept — it's load-bearing across parallel/fan-out/loop/recovery aggregation, not shell-only scaffolding, so removing it would be a risky cross-cutting refactor outside this PR's scope. ADR-0194's second consequence documents that it's now retained as the general block-level outcome contract.

Comment- and doc-only; no behavior change. make ci-fast passes. ADR-0194 should flip proposed → accepted (orbit.adr.update) when this merges.

…B-00374]

`cargo clippy --workspace --all-targets -- -D warnings` failed on
crates/orbit-dashboard/src/tests/serve.rs: two `expect_err()` calls trip
`clippy::expect_used` (warn -> error under -D warnings). The sibling test
module already silences this -- api/tests/mod.rs and api/mod.rs both carry
`allow(clippy::expect_used, clippy::unwrap_used)` -- but the lib-level `tests`
module (added in ORB-00360) was missing it. Mirror that allow on tests/mod.rs.

Latent on agent-main since ORB-00360; surfaced on this PR because the earlier
doc/comment commit invalidated orbit-dashboard's clippy cache, forcing a fresh
all-targets lint. No behavior change.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@danieljhkim
danieljhkim merged commit e25d655 into agent-main Jun 13, 2026
4 of 5 checks passed
@danieljhkim
danieljhkim deleted the orbit/ORB-00374 branch June 13, 2026 04:19
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