Skip to content

feat(warroom): surface pending action receipts before launch#59

Open
jmagly wants to merge 1 commit into
elder-plinius:mainfrom
jmagly:feat/war-room-pending-receipts
Open

feat(warroom): surface pending action receipts before launch#59
jmagly wants to merge 1 commit into
elder-plinius:mainfrom
jmagly:feat/war-room-pending-receipts

Conversation

@jmagly

@jmagly jmagly commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #34.

What it adds

An Action Receipts panel in the War Room that makes pending approval receipts visible before and during a mission — so an operator never launches with stale or unexpected approval state.

The panel:

  • fetches GET /api/approvals?status=pending;
  • shows the pending count and each receipt's action → target with its reason;
  • visually distinguishes loopback/local targets from external ones (green local vs red external tag);
  • offers Approve / Reject wired to the existing POST /api/approvals/:id/approve and /reject endpoints;
  • polls only while the War Room view is active (same cadence as refreshSystemStatus) and hides itself when nothing is pending.

How it's built

A single self-contained module appended before </body> — it injects its own styles and mounts into #page-warroom. No existing markup or scripts are modified, which keeps the change low-risk against the large SPA. The local/external detection is a faithful client-side mirror of the server's isLocalOrPrivateTarget; if the API later annotates approvals with a localTarget boolean, the panel prefers that authoritative value.

Verification

  • node --check on the inserted script — clean.
  • Local/external detection unit-checked against 16 cases (IPv4 private ranges incl. the 172.16–31 boundary, IPv6 ::1/[::1]:port, .local, external hosts).
  • npm test — 367 passing, unchanged (this is a UI-only change; no src/ files touched).

Note on scope

This is intentionally UI-only. The approve/reject/list endpoints already exist on main; only the War Room surface was missing. A monolithic-HTML SPA change has no unit-test surface in this repo, so verification is the syntax + detection-logic checks above rather than a vitest case. Happy to adjust placement/styling to taste.

Add an Action Receipts panel to the War Room that fetches
GET /api/approvals?status=pending and shows each pending receipt's action,
target, and reason with approve/reject controls wired to the existing
/api/approvals/:id/approve and /reject endpoints.

Receipt state is part of T3MP3ST's authority boundary; hiding pending
approvals lets an operator launch with stale or unexpected approval state.
The panel distinguishes loopback/local targets from external ones (client-side
mirror of isLocalOrPrivateTarget, and it honors a server-provided `localTarget`
flag if one is ever added). It polls only while the War Room view is active
(same cadence as refreshSystemStatus) and stays hidden when nothing is pending.

Self-contained module appended before </body>; no changes to existing markup
or scripts.
@jmagly

jmagly commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Please rebase this branch onto current main and resubmit it as a scoped UI/API change.

The pending action receipts idea is reviewable, but the current branch includes unrelated stale-base removals around Gemini/provider config. Those changes are outside this PR’s scope and make the merge impact too broad.

Suggested agent repair path:

  1. Start from current main.
  2. Reapply only the pending action receipt UI and its approval API calls.
  3. Keep provider config, Gemini support, tests, and env templates unchanged unless this PR intentionally touches them.
  4. Run a static parse check for docs/index.html scripts, or add a narrow DOM/API mock test if available.
  5. Verify with git diff --name-status upstream/main...HEAD that the diff is limited to the receipt feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

War Room should surface pending action receipts before launch

1 participant