10. Architecture PRDs
10.4 Chinwag Local Web App & Command Center
chinwag ui --openPRD-0039 & CHWG-0203: Customer-first local web application compiled into the chinwag CLI for active tasks, self-healing CI runs, code diff and visual previews, credit usage, and zero-knowledge Slack/GitHub/Linear notifications.
10.4 Chinwag Local Web App & Command Center
chinwag ui --open
PRD Metadata (
PRD-0039/CHWG-0203):
- Status:
IN FLIGHT — CUSTOMER-FIRST CLEAN PRODUCT REDESIGN (03 · ⚡ IN FLIGHT)- Live Board Ticket:
CHWG-0203on GitHub Projects v2 (github.com/orgs/emunlabs/projects/1)- Invariants Enforced:
ADR-002·ADR-003·INV-LOOPBACK-HARDEN-01·INV-SLACK-ZK-01·INV-VERIFY-BEFORE-DECRYPT-01·INV-NEVER-STOP-FOR-APPROVAL-01- Author & Assignee: Brian Spector (
Emun Labs, Inc., 1401 Lavaca St STE 81335, Austin, TX 78701) ·@ARCHITECT·@RUST·@TYPE·@QA
1. Product Philosophy: Customer-First Clarity, Invisible Security (ADR-002 & ADR-003)
The Chinwag Local Web App (chinwag ui --open) is a clean, cross-platform web interface compiled directly into the chinwag Rust binary and served locally on the developer's or engineering manager's machine.
- Designed Strictly Around Customer Jobs-to-be-Done:
- Every navigation item, card, and action button speaks plain, Linear/Slack-grade product language focused on the customer's own repositories, pull requests, CI builds, and team velocity.
- Internal protocol codes, cryptographic primitive names, and underlying provider plumbing remain invisible by default—tucked cleanly inside an optional
[✓ Verified · View Security Receipt ▸]drawer only when an engineer or auditor chooses to inspect a signature or hash.
- One Cross-Platform Local Web Application (
ADR-003):- Ships as a zero-dependency static web application embedded inside the
chinwagbinary with Day-1 parity across macOS, Linux, and Windows WSL2.
- Ships as a zero-dependency static web application embedded inside the
- Zero-Knowledge Local Custody (
ADR-002&INV-SLACK-ZK-01):- Cloud Notification Bridge: Delivers 4-state Slack, GitHub, and Linear build/task cards containing strictly non-sensitive status metadata (
0repository file paths,0source code lines,0raw logs). - Local Workstation Decryption: Source diffs, CI failure logs, and visual previews are unsealed and rendered strictly on the developer's local machine when clicking
[Open Locally ↗]from Slack, GitHub, or Linear (https://chinwag.sh/open#...). Zero inbound ports, VPNs, or tunnels are ever required.
- Cloud Notification Bridge: Delivers 4-state Slack, GitHub, and Linear build/task cards containing strictly non-sensitive status metadata (
2. Split-Trust Local & Cloud Architecture
flowchart LR
subgraph Cloud["Zero-Knowledge Cloud Notification Bridge (0 Source Code / 0 File Paths)"]
Slack["Slack / Linear / GitHub\n(4-State Live Status Card)"]
Bridge["Chinwag Notification Bridge\n(Status Metadata Only · INV-SLACK-ZK-01)"]
Bounce["https://chinwag.sh/open\n#task=CHWG-0203 (URL Fragment Only)"]
Slack <-->|"Status & Timing Metadata Only"| Bridge
Slack -->|"URL #fragment (Never Sent to Server)"| Bounce
end
subgraph Local["Developer Workstation Local App (chinwag ui --open)"]
Browser["Chinwag Local Web App\n(Midnight & Daylight Themes)"]
Guard["5-Layer Localhost Security Guard\nHost Match + Same-Origin + CSRF + 30s Stream Ticket"]
Engine["Local Chinwag CLI Server\nLocal Diff Rendering & Signature Verification"]
Repo["Customer Git Repository & Tasks\n(100% Local Source Custody)"]
Bounce -->|"250ms Local Ping -> Instant Deep-Link"| Browser
Browser <-->|"Local REST & Live Event Stream"| Guard
Guard --> Engine
Engine <--> Repo
end
Five-Layer Localhost Security Guard (INV-LOOPBACK-HARDEN-01)
Every local HTTP request passes five automatic browser-isolation checks inside chinwag ui so no external website visited in the browser can probe or invoke the local server:
- Exact Numeric
HostVerification (421 Misdirected Request): Rejects DNS-rebinding requests whoseHostheader does not match the bound numeric loopback address byte-for-byte. - Fetch Metadata &
OriginIsolation (403 Forbidden): Rejects cross-site requests whereSec-Fetch-Siteis notsame-origin. - Double-Submit Cookie + Header CSRF Token (
403 Forbidden): Requires both a port-boundHttpOnly; SameSite=Strictcookie and matchingX-Chinwag-Local-CSRFheader on every API call. - Single-Use
30sEvent-Stream Ticket: Mints a short-lived 128-bit single-use ticket (POST /api/bus/stream-ticket,TTL = 30s) before opening the liveEventSourcestream. - Zero-CDN Content Security Policy: Serves all fonts, stylesheets, and scripts locally from the
chinwagbinary withdefault-src 'none'; script-src 'self'; connect-src 'self'; frame-ancestors 'none'.
3. Core Customer Views (chinwag ui --open)
- Active Work & Board (
Default View):- In-Flight Tasks: Live cards showing the GitHub Issue or Linear ticket title, assigned coding agents (Solo, Pair, or Triad), elapsed time vs. DORA benchmark, and sub-issue checklist progress (
3/4 Surfaces Complete). - Shipped While You Worked: Completed tasks that passed all automated CI, visual geometry, and cross-model review gates, with 1-click
[View Diff & Preview]and[Revert Commit]. - Team & Agent Composer: Natural
@agentand#issuemessage bar with zero CLI flags or raw cryptographic hashes exposed in the UI.
- In-Flight Tasks: Live cards showing the GitHub Issue or Linear ticket title, assigned coding agents (Solo, Pair, or Triad), elapsed time vs. DORA benchmark, and sub-issue checklist progress (
- CI & Self-Healing Builds:
- Live build timeline showing
<2sCI failure wakeups, deduplicated matrix root-cause cards, automated fix diffs, and re-run verification status.
- Live build timeline showing
- Diffs & Visual Previews:
- Side-by-side syntax-highlighted code diffs and
1440×900desktop /390×844mobile visual screenshots, with cryptographic signature details tucked inside a clean collapsible[✓ Verified · View Security Receipt ▸]drawer.
- Side-by-side syntax-highlighted code diffs and
- Velocity & Time Saved:
- Engineering throughput, First-Pass CI Green rate, 7-day commit survival, and cumulative
Net Hours Savedsynced bi-directionally with GitHub Projects v2 and Linear.
- Engineering throughput, First-Pass CI Green rate, 7-day commit survival, and cumulative
- Usage, Credits & Team Settings:
- Organization Credit Pool balance, per-workflow credit consumption (
CI Remediation,Cross-Model Pair / Triad,Visual & Copy Gate), saved CI runner minutes, and 1-click audit export.
- Organization Credit Pool balance, per-workflow credit consumption (
4. Mechanized Delivery Slices on the Project Board (CHWG-0203)
- Slice 1 (
#CHWG-0203.1— 5-Layer Localhost Security Server & Live Event Stream): Ship the hardened local HTTP/SSE server (421Hostguard, double-submit CSRF cookie,30ssingle-use stream tickets, and zero-CDN CSP headers). - Slice 2 (
#CHWG-0203.2— Customer-First Local Web App & Diff/Preview Inspector): Build the embedded cross-platform web interface (Midnight&Daylightthemes) using plain customer-facing product language, zero vendor/stack leaks, and progressive security receipt drawers. - Slice 3 (
#CHWG-0203.3— Zero-Knowledge Slack/GitHub/Linear Bridge &#fragmentDeep-Link): Ship 4-state status notifications (INV-SLACK-ZK-01) andhttps://chinwag.sh/openlocal deep-link routing. - Slice 4 (
#CHWG-0203.4— Desktop & Mobile Visual Geometry Verification): Verify0.0pxhorizontal overflow, WCAG AA/AAA contrast, and zero jargon/vendor leaks viachinwag-ci ui-gate.
- Ready to ship verified code at autonomous speed? Reserve Your Organization Credit Pack →