feat(ops): add portable strict War Room preflight (#56)

* feat(ops): add portable War Room preflight command

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 #35

Signed-off-by: Shivam Singh <shivamsingh-007@users.noreply.github.com>

* chore: revert package-lock.json churn to reduce diff noise

Restores package-lock.json to upstream main version.
Removes unintended npm-version lockfile rewrite (peer flips, @emnapi/* entry shifts).

* fix(ops-preflight): correct response-shape reads for mission, approvals, 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>

* fix(ops): harden portable preflight checks

Signed-off-by: Joseph Magly <1159087+jmagly@users.noreply.github.com>

---------

Signed-off-by: Shivam Singh <shivamsingh-007@users.noreply.github.com>
Signed-off-by: Joseph Magly <1159087+jmagly@users.noreply.github.com>
Co-authored-by: Shivam Singh <shivamsingh-007@users.noreply.github.com>
Co-authored-by: Joseph Magly <1159087+jmagly@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-07-15 21:59:27 -04:00
1 parent 916c260fd8
commit 3e19454bd4
3 files changed
+468 -1

No files matched your search

+3 -1
View File
@@ -54,7 +54,7 @@
"install:tools": "bash scripts/install-tools.sh",
"mcp": "tsx src/mcp-server.ts",
"mcp:prod": "node dist/mcp-server.js",
"test": "vitest run src",
"test": "vitest run src && node scripts/test-ops-preflight.mjs",
"test:watch": "vitest src",
"lint": "eslint src/**/*.ts",
"typecheck": "tsc --noEmit",
@@ -80,6 +80,8 @@
"capability": "node scripts/capability-smoke.mjs",
"gauntlet": "node scripts/capability-smoke.mjs --gauntlet",
"test:gate": "npm run build --silent && node scripts/test-gate.mjs",
"ops:preflight": "node scripts/ops-preflight.mjs",
"test:ops-preflight": "node scripts/test-ops-preflight.mjs",
"update": "node scripts/update.mjs",
"update:dry": "node scripts/update.mjs --dry-run",
"update:hard": "node scripts/update.mjs --hard",