Kellen Poole ← All projects

Automation · agentic workflow · reliability

NightShift Manager

A local queue runner that executes AI coding jobs unattended and only marks one "done" when its output is objectively verified — the guardrails around an autonomous agent.

Verified · 19/19 test assertions pass

Started June 2026 · self-directed

The problem

Letting an AI coding agent run unattended is risky: a process can exit "successfully" while producing nothing useful, and you can burn hours and API credits with no guardrails. NightShift treats "the process exited" as not good enough.

How it works — queue → verify → repair → done

  1. Run one job at a time in a constrained sandbox (codex exec --sandbox workspace-write --ask-for-approval never).
  2. The completion contract: a job passes only when a verification command succeeds and the required files it should have produced actually exist.
  3. On failure, bounded repair passes. A human-only blocker (e.g. missing credentials) is marked blocked, not failed. Locking, crash recovery, atomic writes, and reports throughout.

The story · STAR

S

Situation

I was using an AI coding agent for unattended work and realized I couldn't trust "the process finished" as proof it actually did the job — it's easy to wake up to wasted time and credits.

T

Task

Build a local manager that runs AI coding jobs overnight but only marks them done when the output is objectively verified, and fails safely otherwise.

A

Action

Built a PowerShell queue that runs one job at a time in a constrained sandbox. The key decision was the completion contract: a job passes only if a verification command succeeds and the required files exist. On failure it runs bounded repair passes; human-only blockers are marked blocked, not failed. I added locking, recovery, scheduling, and reporting, and — to avoid spending real credits testing — wrote a mock runner and a fixture suite with 19 passing assertions.

R

Result

The manager works against the mock runner with all tests green and correctly refuses to mark a failed job "done." It demonstrates that I think about reliability and safety around AI tools, not just prompting them.

Verified — actual test output (no API spend)

PS> .\validate-setup.ps1
NightShift setup validation passed.

PS> .\tests\run-manager-tests.ps1
[test] lock prevention · state recovery · atomic queue write · repair · blocker · …
Manager tests passed: 19 assertions.

PS> .\run-nightshift.ps1 -DryRun
Dry run: queue is valid. No jobs are eligible right now.

The 19 assertions cover queue validation, dry run, locking, recovery, success, failure, repair, blocker handling, required files, paths with spaces, and reset — all against a mock Codex runner, so the whole system is testable with zero API spend.

Built with

PowerShell moduleJSON state machineWindows Task Schedulermock-driven testssandboxed codex exec

Status & honest limitations

Implemented & tested. The full queue / verify / repair / recover / report engine passes 19 mock-based assertions.

  • A real, paid Codex run was intentionally not executed; confirm codex login before unattended real-project use.
  • Windows-only; CLI (no GUI). A short dry-run screen recording is a planned addition.

Self-directed project, built with AI-assisted development. "I don't just use AI tools — I built the guardrails."