Skip to content

Commit e8a6800

Browse files
committed
Enhance CLI exit code handling and documentation updates
- Updated CLI commands to return non-zero exit codes for unavailable launch targets and command execution failures. - Improved documentation in cli-reference.md to clarify exit codes and command behaviors. - Revised cross-platform.md to reflect the current state of Linux and macOS enforcement capabilities. - Enhanced final-report.md to provide a more accurate assessment of the repository's status and confidence levels. - Added installation instructions for self-contained binaries in getting-started.md. - Clarified the solution structure in solution-structure.md, emphasizing the current project roles and build capabilities. - Implemented tests to verify daemon launch resolver behavior when no candidates are available.
1 parent ea915ca commit e8a6800

File tree

10 files changed

+219
-1670
lines changed

10 files changed

+219
-1670
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ dotnet run --project src/AgentPowerShell.Cli -- policy validate default-policy.y
5858
## Release And CI
5959

6060
- Pull requests and pushes to `main` and `master` run .NET build/test jobs on Windows, Linux, and macOS.
61+
- The CI matrix now also smoke-tests published install outputs, not just repo-local `dotnet` execution paths.
6162
- Docker smoke coverage runs on Linux and Windows GitHub-hosted runners. macOS runners only execute the direct .NET test matrix because hosted macOS runners do not expose a Docker daemon.
6263
- Release tags use semantic versioning in the form `vMAJOR.MINOR.PATCH`.
63-
- Tagged releases publish CLI artifacts and Linux multi-arch Docker images under the `a5c-ai` GitHub organization.
64+
- Tagged releases publish packaged CLI + daemon artifacts and Linux multi-arch Docker images under the `a5c-ai` GitHub organization.
6465
- The nightly workflow publishes `edge` container images to `ghcr.io/a5c-ai/agentpowershell`.
6566

6667
## Status

docs/architecture.md

Lines changed: 77 additions & 997 deletions
Large diffs are not rendered by default.

docs/cli-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Resolution order:
2222
- sibling `AgentPowerShell.Daemon(.exe|.dll)` next to the current binaries
2323
- `src/AgentPowerShell.Daemon/AgentPowerShell.Daemon.csproj` from the repo root
2424

25-
If no launch target is discoverable, the command returns `status: unavailable` with guidance.
25+
If no launch target is discoverable, the command returns `status: unavailable` with guidance and exits non-zero.
2626

2727
### `stop`
2828

2929
Stop the tracked daemon PID from `.agentpowershell/daemon.json` and remove that state file. If the process is already gone, the command still cleans up the stale state.
3030

3131
### `exec <session-id> <command...>`
3232

33-
Execute an explicit command in a session through the current daemon processor path. Inline PowerShell commands route through the hosted constrained runspace when supported. Interactive shell launches such as bare `powershell` or `pwsh` are rejected by design.
33+
Execute an explicit command in a session through the current daemon processor path. Inline PowerShell commands route through the hosted constrained runspace when supported. Interactive shell launches such as bare `powershell` or `pwsh` are rejected by design. The CLI process exits with the underlying command or policy result code.
3434

3535
### `session create`
3636

docs/cross-platform.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ The repository currently has the first real Windows-specific enforcement slice i
88

99
## Linux
1010

11-
The Linux project captures the intended abstraction boundaries, but the repository does not yet provide runtime-complete cgroups, Landlock, seccomp-bpf, ptrace, eBPF, or namespace enforcement. Current Linux support should be treated as buildable structure plus shared policy behavior, not production-grade sandboxing.
11+
The Linux project captures the intended abstraction boundaries, but the repository does not yet provide runtime-complete cgroups, Landlock, seccomp-bpf, ptrace, eBPF, or namespace enforcement. Today the Linux platform code primarily turns policy into enforcement plans plus shared behavior; it should not be treated as production-grade sandboxing.
1212

1313
## macOS
1414

15-
The macOS project likewise reflects the planned abstraction surface for Endpoint Security, sandbox-exec, Network Extension, FSEvents, RLIMIT, and XPC, but those integrations are not yet wired into a verified runtime enforcement path.
15+
The macOS project likewise reflects the planned abstraction surface for Endpoint Security, sandbox-exec, Network Extension, FSEvents, RLIMIT, and XPC, but those integrations are not yet wired into a verified runtime enforcement path. As with Linux, the current macOS code is closer to planning/scaffolding than finished native enforcement.
1616

1717
## Practical Guidance
1818

1919
- Keep shared models and policy logic in `AgentPowerShell.Core`.
2020
- Put platform-native behavior behind explicit abstractions.
2121
- Validate cross-platform projects in CI for every change.
2222
- Treat Docker support as Linux-container packaging that is smoke-tested on Linux and Windows runners; GitHub-hosted macOS runners do not provide Docker.
23+
- Treat native Linux/macOS install validation as a separate verification step from Windows install coverage.
2324
- Prefer runtime-specific integration tests before claiming full feature parity on a platform.
2425
- Phrase current support in terms of verified behavior, not architectural intent.

docs/final-report.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,31 @@
22

33
## Verdict
44

5-
AgentPowerShell is a strong repository-level baseline, not yet a finished fulfillment of the broader `agentsh`-style specification. It has a passing build, passing automated tests, a defined CLI surface, and concrete implementations for sessions, events, approvals, authentication, LLM proxying, MCP inspection, reporting, checkpoints, and the current command-execution path.
5+
AgentPowerShell is a usable repository-level baseline, not a finished fulfillment of the broader `agentsh`-style specification. It now has a passing build, passing automated tests, a verified install-publish path on Windows, a passing Docker smoke path, a defined CLI surface, and concrete implementations for sessions, events, approvals, authentication helpers, MCP/LLM support, reports, checkpoints, and the current command-execution path.
66

77
## Strengths
88

99
- Clear multi-project separation between shared models, daemon services, CLI, events, proxying, MCP, and platform-specific code
1010
- Policy and config primitives are simple, testable, and easy to extend
1111
- End-to-end build and test verification is green across unit, integration, and platform test projects
12+
- Install and Docker publish flows are now exercised through real smoke coverage rather than only by static configuration
1213
- The CLI now executes real checkpoint operations instead of placeholder output
1314
- Hosted PowerShell execution and explicit policy-backed command blocking are now exercised through the tested runtime surface
1415

1516
## Concerns
1617

1718
- Some cross-platform enforcement capabilities remain scaffolding rather than runtime-complete implementations
18-
- Packaging assets are ready for CI and publish flows, but signing and installer distribution still need production secrets and release hardening
19+
- Native Linux/macOS install execution and real tagged-release execution still need runner-backed confirmation beyond this local Windows session
20+
- Signing and installer distribution still need production secrets and release hardening
1921
- Feature parity claims against `agentsh` should continue to be framed carefully until deeper platform-native enforcement paths are completed
2022

2123
## Follow-Up Tasks
2224

23-
1. Add runtime integration coverage for checkpoint restore interactions during active daemon/session workflows.
25+
1. Correct remaining architecture-oriented docs so they describe verified runtime behavior instead of target-state intent.
2426
2. Expand platform-specific tests from build validation into behavior validation on Windows, Linux, and macOS runners.
2527
3. Turn the code-signing placeholder into an operational signing pipeline with secret-backed configuration.
2628
4. Add lifecycle management for checkpoint retention and deletion.
2729

2830
## Confidence
2931

30-
Confidence is high for repository health and implementation quality, and moderate for production-readiness of the platform-native enforcement story.
32+
Confidence is high for repository health and current packaging/runtime verification, and moderate for production-readiness of the platform-native enforcement story.

docs/getting-started.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ dotnet test agentpowershell.sln --verbosity minimal --no-build
1515

1616
## First Commands
1717

18+
If you want self-contained binaries instead of `dotnet run`, use:
19+
20+
```powershell
21+
./install.ps1
22+
```
23+
24+
or on native Unix shells:
25+
26+
```bash
27+
./install.sh
28+
```
29+
1830
Print the CLI version:
1931

2032
```powershell
@@ -73,7 +85,9 @@ dotnet run --project src/AgentPowerShell.Cli -- checkpoint restore latest --dry-
7385
## Current Boundaries
7486

7587
- `exec` supports explicit commands; it does not yet provide an interactive shell session.
76-
- Inline PowerShell commands route through a hosted constrained runspace.
88+
- Inline PowerShell commands route through the hosted execution path that exists today; the broader PSHost/ConstrainedLanguage architecture remains target direction, not a fully verified parity story.
7789
- Native commands use the daemon processor path and current policy prechecks.
90+
- `exec` now returns the underlying command or policy exit code to the calling shell, so denials and runtime failures are observable to automation.
7891
- The shim will attempt to connect to the daemon first and will auto-start it only when a daemon command, binary, or source project can be discovered.
7992
- Cross-platform sandboxing is still uneven; Windows has the most concrete runtime enforcement today.
93+
- Network blocking currently means explicit-target policy filtering, not full OS-level egress interception.

0 commit comments

Comments
 (0)