feat(ops): add portable War Room preflight command#56
Conversation
Add npm run ops:preflight that checks operational readiness before launching a War Room mission: API health, active mission status, pending action receipts, local-agent/provider configuration, and arsenal tool availability. Follows same pattern as scripts/doctor.mjs. Supports --json for machine-readable output and --strict to fail on warnings. Fixes elder-plinius#35 Signed-off-by: Shivam Singh <shivamsingh-007@users.noreply.github.com>
|
The preflight script looks good and is appropriately read-only (execFile, no shell, only hits the local API). One nit: the PR carries |
Restores package-lock.json to upstream main version. Removes unintended npm-version lockfile rewrite (peer flips, @emnapi/* entry shifts).
|
Thanks for the quick lockfile revert (b3bb807) — the diff is clean now (just the script + the I went back and reviewed the script itself more thoroughly against the live server (started it and curled each endpoint the preflight hits). The good news: 1. Mission-active check (line ~95). const missionActive = mission.ok && mission.data?.active === true;
// (and mission.data?.mission?.id / .currentPhase for the detail string)2. Pending-approvals check (line ~104). pendingCount = Array.isArray(approvals.data?.approvals) ? approvals.data.approvals.length : 0;3. Local-agent check (line ~115). const agents = Array.isArray(localAgent.data?.connected) ? localAgent.data.connected : [];
const connected = agents.length > 0; // name: agents[0]?.nameWith those three fixed, this is a genuinely useful launch gate. Everything else (structure, exit codes, |
…ls, and agent checks
Three bugs identified by jmagly in review:
1. Mission-active: API returns {active: boolean}, not {phase}
2. Pending-approvals: API returns {approvals: [...]}, not a flat array
3. Local-agent: API returns {connected: [...]} (array), not a boolean
All three verified against live endpoints per review feedback.
Signed-off-by: Shivam Singh <shivamsingh-007@users.noreply.github.com>
|
Thanks for the detailed review @jmagly. All three bugs are fixed in 07e7df8:
Ready for another look. |
|
Please rebase this branch onto current The branch currently deletes benchmark corpora, benchmark scripts, provenance docs, and existing tests that are unrelated to the War Room preflight command. That is the primary blocker. Suggested agent repair path:
|
Summary
Add a portable
pm run ops:preflight\ command that checks War Room operational readiness before launching a mission.
Related Issue
Fixes #35
What changed
Why this approach
Follows the same pattern as \scripts/doctor.mjs\ — fetch-based checks against the local War Room API with clean pass/fail/warn output. Supports --json\ for machine-readable output and --strict\ to fail on warnings.
Testing done
pm run typecheck\ passes
Checklist