nightshift/docs/devlog/phase6.md
K. Hodges c1baf9b7d8 Implement NightShift MVP phases 1-6
Includes starter project generation, validation for configs/tasks/commands, artifact snapshot writing, structured stage results, command output capture, devlogs for phases 1-6, and unit coverage for the implemented MVP layers.
2026-05-17 00:17:13 -07:00

22 lines
1.1 KiB
Markdown

# Phase 6 Devlog: Command Executor
## Implemented
- Added `nightshift/commands.py`.
- Added command-stage execution for configured `command` stages.
- Captured stdout, stderr, exit code, duration, and timeout state.
- Persisted command transcripts through the artifact store.
- Returned structured `StageResult` objects.
- Added tests for passing commands, failing commands, output persistence, and allowlist rejection.
## Decisions Made
- Commands are validated through the Phase 3 safety layer immediately before execution, even though config validation also checks them. This keeps command execution safe if called directly in later code.
- Command stages stop at the first failing or timed-out command and persist the commands that ran.
- Commands run with `shell=True` because v1 config stores commands as shell-style strings. This is constrained by exact allowlist matching and forbidden fragment checks.
- The default timeout is 300 seconds. Tests can override it later if timeout-specific behavior needs coverage.
## Notes
- This phase does not wire command execution into a full pipeline runner. That belongs to Phase 8.