Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions CHARTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,39 @@ Provide a unified life management and action dashboard that ingests data from 15
| Technical Lead | @chittyos-infrastructure |
| Contact | chittycommand@chitty.cc |

## Three Aspects (TY VY RY)

Source: `chittycanon://gov/governance#three-aspects`

| Aspect | Abbrev | Question | ChittyCommand Answer |
|--------|--------|----------|--------------------|
| **Identity** | TY | What IS it? | Unified life management dashboard — ingests financial, legal, and administrative data from 15+ sources, scores urgency, recommends and executes actions |
| **Connectivity** | VY | How does it ACT? | Cron-scheduled syncs (Plaid, Mercury, court dockets, utilities); bridge API to ChittyScrape, ChittyLedger, ChittyFinance; MCP server for Claude-driven queries; action execution via API, email, or browser automation |
| **Authority** | RY | Where does it SIT? | Tier 5 Application — consumer of upstream data, not source of truth; delegates scraping to ChittyScrape, identity to ChittyID, financials to ChittyFinance |

## Document Triad

This charter is part of a synchronized documentation triad. Changes to shared fields must propagate.

| Field | Canonical Source | Also In |
|-------|-----------------|---------|
| Canonical URI | CHARTER.md (Classification) | CHITTY.md (blockquote) |
| Tier | CHARTER.md (Classification) | CHITTY.md (blockquote) |
| Domain | CHARTER.md (Classification) | CHITTY.md (blockquote), CLAUDE.md (header) |
| Endpoints | CHARTER.md (API Contract) | CHITTY.md (Endpoints table), CLAUDE.md (API section) |
| Dependencies | CHARTER.md (Dependencies) | CHITTY.md (Dependencies table), CLAUDE.md (Architecture) |
| Certification badge | CHITTY.md (Certification) | CHARTER.md frontmatter `status` |

**Related docs**: [CHITTY.md](CHITTY.md) (badge/one-pager) | [CLAUDE.md](CLAUDE.md) (developer guide)
Comment on lines +113 to +126

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify Document Triad propagation across CHARTER.md, CHITTY.md, and CLAUDE.md

echo "=== Checking if CHITTY.md and CLAUDE.md exist ==="
fd -e md | grep -E "(CHITTY|CLAUDE|CHARTER)" | sort

echo ""
echo "=== Canonical URI in CHITTY.md ==="
rg -n "chittycanon://core/services/chittycommand" --type md

echo ""
echo "=== Domain references (command.chitty.cc) across triad docs ==="
rg -n "command\.chitty\.cc" --type md

echo ""
echo "=== Tier references ==="
rg -n "Tier 5" --type md

echo ""
echo "=== Certification badge references ==="
fd -e md | xargs grep -l "03-1-USA-3846" 2>/dev/null || echo "Badge not found in any .md files"

echo ""
echo "=== Checking CHITTY.md for blockquote content about Canonical URI ==="
if [ -f "CHITTY.md" ]; then
  head -50 CHITTY.md
else
  echo "CHITTY.md not found"
fi

echo ""
echo "=== Checking CLAUDE.md for API section ==="
if [ -f "CLAUDE.md" ]; then
  head -50 CLAUDE.md
else
  echo "CLAUDE.md not found"
fi

Repository: chittyos/chittycommand

Length of output: 6518


🏁 Script executed:

#!/bin/bash
# Deep verification of remaining Document Triad fields

echo "=== Endpoints in CHITTY.md (looking for Endpoints table) ==="
rg -n "Endpoints" CHITTY.md --type md -A 3

echo ""
echo "=== Endpoints in CHARTER.md ==="
rg -n "Endpoints" CHARTER.md --type md -B 2 -A 3

echo ""
echo "=== Endpoints in CLAUDE.md ==="
rg -n "Endpoints\|API section" CLAUDE.md --type md -B 2 -A 3

echo ""
echo "=== Dependencies table in CHITTY.md ==="
rg -n "Dependencies" CHITTY.md --type md -A 5

echo ""
echo "=== Dependencies section in CHARTER.md ==="
rg -n "Dependencies" CHARTER.md --type md -B 2 -A 8

echo ""
echo "=== Dependencies in CLAUDE.md ==="
rg -n "Dependencies" CLAUDE.md --type md -B 2 -A 5

echo ""
echo "=== Certification badge references (broader search) ==="
rg -n "status|Certification\|badge" CHITTY.md --type md | head -20

echo ""
echo "=== frontmatter status field in CHITTY.md ==="
head -20 CHITTY.md | rg -n "status"

echo ""
echo "=== frontmatter status field in CHARTER.md ==="
head -20 CHARTER.md | rg -n "status"

Repository: chittyos/chittycommand

Length of output: 2255


Document Triad is incomplete — Endpoints and Dependencies tables have not been propagated.

The Document Triad's own language requires that changes to shared fields "must propagate" to all three docs. Verification confirms:

  • ✓ Canonical URI (chittycanon://core/services/chittycommand) — synced
  • ✓ Tier (Tier 5) — synced
  • ✓ Domain (command.chitty.cc) — synced
  • Endpoints table — present only in CHARTER.md; missing from CHITTY.md and CLAUDE.md
  • Dependencies table — present only in CHARTER.md; missing from CHITTY.md and CLAUDE.md
  • ⚠ Certification badge — frontmatter status: DRAFT exists but badge table/visual not located

Create the Endpoints and Dependencies tables in CHITTY.md and CLAUDE.md to complete the triad as documented.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHARTER.md` around lines 113 - 126, Document Triad is missing the Endpoints
and Dependencies tables in CHITTY.md and CLAUDE.md; copy the canonical Endpoints
and Dependencies tables from CHARTER.md into those two docs in the matching
sections: add the Endpoints table into CHITTY.md’s Endpoints table area and into
CLAUDE.md’s API section (preserving headers/links), and add the Dependencies
table into CHITTY.md’s Dependencies table and into CLAUDE.md’s Architecture
section; ensure table content and field names (Canonical URI, Tier, Domain,
Endpoints, Dependencies) exactly match CHARTER.md so the triad remains
synchronized.


## Compliance

- [ ] Service registered in ChittyRegistry
- [x] Service registered in ChittyRegister (03-1-USA-3846-T-2602-0-57, pending_cert)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

[x] and pending_cert are contradictory.

A checked item signals completion, but pending_cert signals it is still in progress. This will mislead anyone using the compliance checklist as a readiness gate.

📝 Suggested correction options

Option A — keep checked, clarify the cert is an async trailing step:

-- [x] Service registered in ChittyRegister (03-1-USA-3846-T-2602-0-57, pending_cert)
+- [x] Service registered in ChittyRegister (03-1-USA-3846-T-2602-0-57) *(certification pending)*

Option B — leave unchecked until certification completes:

-- [x] Service registered in ChittyRegister (03-1-USA-3846-T-2602-0-57, pending_cert)
+- [ ] Service registered in ChittyRegister (03-1-USA-3846-T-2602-0-57) — certification in progress
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- [x] Service registered in ChittyRegister (03-1-USA-3846-T-2602-0-57, pending_cert)
- [x] Service registered in ChittyRegister (03-1-USA-3846-T-2602-0-57) *(certification pending)*
Suggested change
- [x] Service registered in ChittyRegister (03-1-USA-3846-T-2602-0-57, pending_cert)
- [ ] Service registered in ChittyRegister (03-1-USA-3846-T-2602-0-57) — certification in progress
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHARTER.md` at line 130, The checklist line "Service registered in
ChittyRegister (03-1-USA-3846-T-2602-0-57, pending_cert)" uses a checked box
"[x]" while also tagging "pending_cert", which is contradictory; update that
line by either removing the check mark (change "[x]" to "[ ]") until
certification is complete, or keep "[x]" and append a clarifying note such as
"(registered; certification pending asynchronous step)" so the status is
unambiguous—edit the exact string containing "Service registered in
ChittyRegister" to implement one of these two options.

- [x] Health endpoint operational at /health
- [x] Status endpoint operational at /api/v1/status
- [x] CLAUDE.md development guide present
- [x] CHARTER.md present
- [x] CHITTY.md present

---
*Charter Version: 1.0.0 | Last Updated: 2026-02-24*
*Charter Version: 1.0.0 | Last Updated: 2026-02-23*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Last Updated date regressed by one day.

The previous value was 2026-02-24; the new value is 2026-02-23, which predates the commit adding the Three Aspects and Document Triad sections. This will cause auditors to believe these sections existed before they were actually written.

📝 Proposed fix
-*Charter Version: 1.0.0 | Last Updated: 2026-02-23*
+*Charter Version: 1.0.0 | Last Updated: 2026-02-24*
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
*Charter Version: 1.0.0 | Last Updated: 2026-02-23*
*Charter Version: 1.0.0 | Last Updated: 2026-02-24*
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHARTER.md` at line 138, The "Last Updated" date in the document header
string "*Charter Version: 1.0.0 | Last Updated: 2026-02-23*" was regressed;
update that header to the correct date "2026-02-24" so it reflects the commit
that added the Three Aspects and Document Triad sections (locate and edit the
header line containing "Charter Version: 1.0.0 | Last Updated:" and change
2026-02-23 to 2026-02-24).

76 changes: 47 additions & 29 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,68 +5,86 @@
ChittyCommand is a unified life management and action dashboard for the ChittyOS ecosystem. It ingests data from 15+ financial, legal, and administrative sources, scores urgency with AI, recommends actions, and executes them via APIs, email, or browser automation.

**Repo:** `CHITTYOS/chittycommand`
**Deploy:** Cloudflare Workers + Pages at `command.chitty.cc`
**Stack:** Hono TypeScript, React + Shadcn UI, Neon PostgreSQL, Cloudflare R2
**Deploy:** Cloudflare Workers at `command.chitty.cc`
**Stack:** Hono TypeScript, React + Tailwind, Neon PostgreSQL (via Hyperdrive), Cloudflare R2/KV
**Canonical URI:** `chittycanon://core/services/chittycommand` | Tier 5

## Common Commands

```bash
npm run dev # Start Hono dev server (wrangler dev)
npm run deploy # Deploy to Cloudflare Workers
npm run ui:dev # Start React frontend dev server
npm run ui:dev # Start React frontend dev server (localhost:5173)
npm run ui:build # Build frontend for Pages
npm run db:generate # Generate Drizzle migrations
npm run db:migrate # Run Drizzle migrations
```

## Architecture
Secrets are managed via wrangler (never hardcode):
```bash
wrangler secret put PLAID_CLIENT_ID
wrangler secret put PLAID_SECRET
wrangler secret put DATABASE_URL
```

### Workers
## Architecture

| Worker | Domain | Role |
|--------|--------|------|
| command-api | command.chitty.cc | Core API, CRUD, action execution |
| command-ingest | Cron-triggered | Data ingestion from all sources |
| command-ai | Internal | AI triage, urgency scoring, recommendations |
| command-ui | app.command.chitty.cc | React SPA (Cloudflare Pages) |
Single Cloudflare Worker (`chittycommand`) serving API + cron. Frontend is a separate React SPA at `app.command.chitty.cc` (Cloudflare Pages).

### Data Sources

**API Sources (auto-sync):** Mercury, Wave, Stripe, TurboTenant, ChittyRental/ChittyFinance
**Via ChittyFinance (auto-sync):** Mercury, Wave Accounting, Stripe, Plaid
**Direct API:** ChittyBooks, ChittyAssets, ChittyCharge, ChittyLedger
**Via ChittyScrape (bridge):** Mr. Cooper mortgage, Cook County property tax, Court docket
**Email Parse:** ComEd, Peoples Gas, Xfinity, Citi, Home Depot, Lowe's
**Scraper:** Mr. Cooper, Cook County property tax, Court docket
**Manual:** IRS quarterly, HOA fees, Personal loans
**Historical Only:** DoorLoop (sunset, data archived)

### Auth Flow

Three auth layers in `src/middleware/auth.ts`:
1. **`authMiddleware`** (`/api/*`) — KV token lookup, then ChittyAuth fallback
2. **`bridgeAuthMiddleware`** (`/api/bridge/*`) — Service token OR user token
3. **`mcpAuthMiddleware`** (`/mcp/*`) — Shared service token from KV (bypassed in dev)

### Cron Schedule

Defined in `wrangler.toml`, dispatched via `src/lib/cron.ts`:
- `0 12 * * *` — Daily 6 AM CT: Plaid + ChittyFinance sync
- `0 13 * * *` — Daily 7 AM CT: Court docket check
- `0 14 * * 1` — Weekly Mon 8 AM CT: Utility scrapers
- `0 15 1 * *` — Monthly 1st 9 AM CT: Mortgage, property tax

### Database

Neon PostgreSQL with `cc_` prefixed tables. Schema in `src/db/schema.ts`, SQL migrations in `migrations/`.
Neon PostgreSQL via Hyperdrive binding. All tables prefixed `cc_`. Schema in `src/db/schema.ts`, SQL migrations in `migrations/` (0001-0007).

### Action Execution

Three modes:
1. **API** — Mercury transfers, Stripe payments, TurboTenant/ChittyRental
1. **API** — Mercury transfers, Stripe payments via bridge routes
2. **Claude in Chrome** — Browser automation for portals without APIs
3. **Email** — Dispute letters, follow-ups via Cloudflare Email Workers

## Active Disputes

1. **Xfinity** — Pricing/credit dispute (priority 2)
2. **Commodore Green Briar Landmark Condo Association** — HOA dispute (priority 3)
3. **Fox Rental** — $14K+ reclaim (priority 1)

## Key Files

- `src/index.ts` — Hono API entry point
- `src/db/schema.ts` — Drizzle schema for all tables
- `src/index.ts` — Hono entry point, route mounting, health/status endpoints
- `src/middleware/auth.ts` — Auth middleware (user, bridge, MCP)
- `src/lib/cron.ts` — Cron sync orchestrator (all data sources)
- `src/lib/integrations.ts` — Service clients (Mercury, Plaid, ChittyScrape, etc.)
- `src/lib/urgency.ts` — Deterministic urgency scoring engine
- `src/routes/` — API route handlers
- `migrations/` — SQL migration files
- `ui/` — React frontend
- `src/lib/validators.ts` — Zod schemas for request validation
- `src/routes/bridge.ts` — Inter-service bridge (scrape, ledger, finance, Plaid)
- `src/routes/mcp.ts` — MCP server for Claude integration
- `src/routes/dashboard.ts` — Dashboard summary with urgency scoring
- `src/db/schema.ts` — Drizzle schema for all cc_* tables
- `migrations/` — SQL migration files (0001-0007)
- `ui/` — React frontend (Vite + Tailwind)

## Security

- Credentials via 1Password (`op run`)
- No hardcoded secrets
- Credentials via 1Password (`op run`) — never expose in terminal output
- Secrets via `wrangler secret put` — never in `[vars]`
- R2 for document storage (zero egress)
- CORS restricted to `app.command.chitty.cc` and localhost
- CORS restricted to `app.command.chitty.cc`, `command.mychitty.com`, `chittycommand-ui.pages.dev`, `localhost:5173`
- Service tokens stored in KV: `bridge:service_token`, `mcp:service_token`, `scrape:service_token`
118 changes: 118 additions & 0 deletions docs/plans/2026-02-23-ui-overhaul-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# ChittyCommand UI Overhaul — "Command Console"

**Date:** 2026-02-23
**Status:** Approved
**Canonical URI:** `chittycanon://core/services/chittycommand#ui-overhaul`

## Design Direction

Hybrid of Bloomberg Terminal (information density, real-time data flow) and Apple Finance (clean cards, quality typography, refined aesthetics). Designed ADHD/neurospicy-first.

## Visual Language

### Color Scheme: Dark Chrome + Light Cards
- **Shell** (sidebar, nav, status bar): Dark background (`#1a1a2e` → `#16213e` range)
- **Card surfaces**: White/near-white (`#ffffff` / `#fafafa`)
- **Urgency accents**: Red (`#ef4444`), Amber (`#f59e0b`), Green (`#22c55e`)
- **Text**: Dark on light cards, light on dark chrome
- **Muted state**: Low-urgency cards use lighter text (`#9ca3af`), no border accent

### Typography
- **Display/headings**: Outfit (geometric sans-serif) — clean, modern, highly legible
- **Body/data**: Outfit at smaller weights — consistent family, no font-switching fatigue
- **Monospace (numbers/amounts)**: JetBrains Mono or Tabular Outfit — aligned columns for financial data

### Spatial Rules
- Cards have generous internal padding but tight grid gaps — dense layout, breathable cards
- Consistent card anatomy: title → key metric → status indicator → primary action
- Left-border color accent for urgency (4px solid)
- Rounded corners (8-12px) on all cards — Apple softness

## Layout Architecture

### Widget-Based Grid
- CSS Grid dashboard with named areas
- Draggable, resizable panels (saved to user preferences in KV)
- Auto-personalizes: highest-urgency widgets float to top-left
- Responsive: collapses to single-column on mobile

### Sections
1. **Top status bar** — cash position, next due date, sync freshness dots (green/amber/red), Focus Mode toggle
2. **Sidebar** (dark) — navigation, account summary, quick filters
3. **Main grid** — widget cards:
- Obligations (bills due, sorted by urgency)
- Active disputes (progress bars, status, next action)
- Cashflow chart (30-day projection)
- Recommendations (AI-scored, one CTA each)
- Recent transactions (last 10, grouped by account)
- Upcoming deadlines (calendar-style, next 14 days)
- Sync status (per-source freshness, last run time)

## ADHD/Neurospicy-First Principles

### 1. Focus Mode (default: ON)
- Landing view shows only top 3 most urgent items
- Each item: what it is, why it's urgent, one action button
- "See everything" toggle expands to full dense dashboard
- Reduces cognitive load on every visit — no overwhelm on load

### 2. Visual Hierarchy Does the Thinking
- Urgency scoring auto-sorts all widgets and items within widgets
- Most important = biggest, brightest, top-left position
- No scanning or deciding "what should I look at first"

### 3. One Clear Action Per Card
- Single primary CTA button per card (pay, respond, review)
- Secondary actions behind a "..." menu
- No decision paralysis from multiple equal-weight options

### 4. Color-Coded Urgency Borders
- Red (4px left border): overdue or due within 48hrs
- Amber: due within 7 days or needs attention
Comment on lines +69 to +71

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use a space in “48 hrs” for readability.

The “48hrs” token is a minor style/grammar issue.

🧰 Tools
🪛 LanguageTool

[grammar] ~70-~70: Ensure spelling is correct
Context: ...4px left border): overdue or due within 48hrs - Amber: due within 7 days or needs attent...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/plans/2026-02-23-ui-overhaul-design.md` around lines 69 - 71, Update the
text under the "Color-Coded Urgency Borders" section to use a space in "48 hrs"
for readability; locate the line that currently reads "Red (4px left border):
overdue or due within 48hrs" and change "48hrs" to "48 hrs" so it becomes "Red
(4px left border): overdue or due within 48 hrs".

- Green: on track, no action needed
- Peripheral vision catches urgency without reading

### 5. Progress Indicators Everywhere
- Disputes: progress bar (filed → response → resolution)
- Monthly bills: "3 of 7 paid" with filled dots
- Sync cycles: completion indicators per source
- Dopamine-friendly — visible forward motion

### 6. Chunked Sections with Clear Labels
- Bold section headers, clear card boundaries
- No wall-of-data — every group is visually separated
- Consistent card anatomy reduces cognitive parsing

### 7. Muted Non-Urgent Items
- Low-urgency cards: lighter text, no accent border, smaller font
- High-urgency: full color, accent border, larger metric
- Attention goes where it's needed without effort

### 8. Persistent Widget Layout
- Drag to reorder, collapse/expand — arrangement saved
- Same layout every visit — no re-orienting
- Layout stored in Cloudflare KV per user

## Subtle Data Indicators (Not Animations)

- **Freshness dots**: small colored circles (green=fresh, amber=stale, red=failed) next to each data source
- **Delta arrows**: small up/down arrows on amounts showing change from last sync
- **Muted timestamps**: "2h ago" in light gray under each card
- No pulse effects, no ticker strips, no glow — data confidence without noise

## Tech Stack

- **Framework**: React (existing) + Shadcn UI components
- **Styling**: Tailwind CSS with CSS custom properties for theming
- **Grid**: CSS Grid with `react-grid-layout` for drag/resize
- **Charts**: Recharts (lightweight, React-native)
- **State**: React context + Cloudflare KV for layout persistence
- **Build**: Vite → Cloudflare Pages

## Not Included

- Ticker strips / scrolling tapes
- Scan-line or CRT effects
- Heavy animations or glow effects
- Sound effects or haptics
- Multiple theme options (single cohesive theme)
Loading