feat(agent): add machine-readable manageability CLI#103
Conversation
DiffGuard AI AnalysisAI Review Summary🏆 Overall Score: 82/100 This PR implements a comprehensive agent-manageability CLI with JSON-first commands for external automation. The implementation is well-structured with good test coverage, but has a few behavioral concerns around queue handling for paused jobs. ✅ Key Strengths
|
| Issue Type | Issue Name | Affected Components | Description | Impact/Severity |
|---|---|---|---|---|
| Maintainability | Queue Job Removal on Pause | packages/cli/src/commands/queue.ts |
Dispatch removes paused jobs instead of deferring them, potentially losing queued work during temporary pauses. | Medium |
| Maintainability | Stale Exit Code in Last Runs | packages/cli/src/commands/agent.ts |
lastExitCode only captures the first success/failure, not the most recent run's actual exit code. |
Low |
| Testing | JSON Parse Error Handling | packages/core/src/utils/config-path.ts |
parseConfigValue doesn't wrap JSON.parse in try-catch; malformed JSON-like strings throw unhandled errors. |
Low |
🔚 Conclusion
This is a strong implementation that delivers the core agent-manageability contract well. The queue removal behavior for paused jobs should be clarified or adjusted before merge to avoid unexpected data loss. Minor exit code and error handling refinements can be addressed in follow-up.
Analyzed using z-ai/glm-5
DiffGuard AI AnalysisAI Review Summary🏆 Overall Score: 88/100 This PR implements a comprehensive agent-manageability CLI layer with stable JSON contracts, pause/resume job control, and config management. The implementation is well-structured, thoroughly documented, and integrates cleanly with existing systems. ✅ Key Strengths
|
| Issue Type | Issue Name | Affected Components | Description | Impact/Severity |
|---|---|---|---|---|
| Maintainability | Hardcoded Mock Behavior | core-flow-smoke.test.ts |
Mock CLI scripts always return exit 1 for is-paused, bypassing actual pause logic and reducing test value. |
Medium |
| Consistency | Missing JSON Flag | packages/cli/src/commands/agent.ts:jobCommand |
job is-paused exits with code only; no JSON output option for callers preferring structured responses. |
Low |
| Testing | No Negative Pause Tests | agent.test.ts |
Tests verify pause/resume state changes but don't test that paused jobs are actually skipped by cron. | Low |
🔚 Conclusion
Strong implementation that fulfills the PRD requirements with clean architecture and good test coverage. The issues are minor and non-blocking; the hardcoded mock behavior in smoke tests is the most notable follow-up for long-term maintainability. Ready to merge.
Analyzed using z-ai/glm-5
Summary
night-watch agent status --jsonas a stable machine-readable snapshot with schema versioning, legacy status data, pause state, queue state, board summary, health checks, and recent run telemetry.night-watch config list/get/set,night-watch health --json, andnight-watch job pause/resumecommands.night-watch.config.jsonand makes cron/queue entry points skip paused jobs before starting new work.Tests Run
yarn workspace @jonit-dev/night-watch-cli test src/__tests__/commands/agent.test.ts src/__tests__/commands/status.test.ts src/__tests__/commands/queue.test.tsbash -n scripts/night-watch-cron.sh scripts/night-watch-pr-reviewer-cron.sh scripts/night-watch-qa-cron.sh scripts/night-watch-audit-cron.sh scripts/night-watch-slicer-cron.sh scripts/night-watch-plan-cron.sh scripts/night-watch-merger-cron.sh scripts/night-watch-pr-resolver-cron.sh scripts/night-watch-helpers.shyarn verifyyarn workspace @jonit-dev/night-watch-cli buildyarn lint(passes with existing warnings)Docs
docs/prds/agent-manageability-cli.md.docs/reference/commands.mdwith command contracts, JSON behavior, examples, and pause semantics.SELF_REVIEW.mdwith implementation notes, tests, and limitations.Known Limitations
job pauseprevents new cron/queue-dispatched starts; it does not terminate already running jobs.agent statusincludes board details only when a board is configured; board provider errors are captured inboard.errorrather than failing the entire snapshot.lastRunsdepends on available job-run telemetry from the last 30 days.Closes #99