Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Access auth context in handlers via `c.get('userId')` and `c.get('scopes')`.
- All secrets go through `wrangler secret put` — never in `[vars]` in `wrangler.jsonc`.
- KV service tokens: `bridge:service_token`, `mcp:service_token`, `scrape:service_token`.
- CORS is restricted to approved origins: `app.command.chitty.cc`, `command.mychitty.com`, `chittycommand-ui.pages.dev`, `localhost:5173`.
- Credentials use 1Password (`op run`) in local development — never expose in terminal output or logs.
- Credentials use chittysecrets (`chittysecrets run`) in local development — never expose in terminal output or logs.

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Repository files of interest:"
for f in \
  .github/copilot-instructions.md \
  AGENTS.md \
  CLAUDE.md \
  docs/registration/SUBMISSION_RUNBOOK.md \
  scripts/onepassword-rotation-audit.sh \
  templates/governance-baseline/scripts/onepassword-rotation-audit.sh
do
  if [ -f "$f" ]; then
    echo "--- $f"
    wc -l "$f"
    sed -n '1,180p' "$f"
  else
    echo "MISSING $f"
  fi
done

echo
echo "Search for chittysecrets/op commands:"
rg -n "chittysecrets|\"?op run\"?|op run|op run" -S .

echo
echo "Search for dependency checks around chittysecrets/op:"
rg -n -C 3 "chittysecrets CLI|onepassword|op command|command -v op|which op|chittysecrets run|op run" -S .

Repository: chittyos/chittycommand

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Workflow/action and runbook mentions:"
rg -n -C 3 "chittysecrets|\"?op run\"?|op run|onepassword-rotation|ACCESS_BROKER_AND_1PASSWORD|1Password" .github docs scripts templates -S || true

echo
echo "Read targeted audit workflow examples:"
for f in \
  .github/workflows/onepassword-rotation-audit.yml \
  templates/governance-baseline/.github/workflows/onepassword-rotation-audit.sh \
  templates/governance-baseline/.github/workflows/onepassword-rotation-audit.yml \
  docs/security/ACCESS_BROKER_AND_1PASSWORD_RUNBOOK.md
do
  if [ -f "$f" ]; then
    echo "--- $f"
    wc -l "$f"
    sed -n '1,220p' "$f"
  else
    echo "MISSING $f"
  fi
done

Repository: chittyos/chittycommand

Length of output: 34277


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Targeted files around referenced lines:"
for f in AGENTS.md CLAUDE.md
do
  if [ -f "$f" ]; then
    echo "--- $f"
    wc -l "$f"
    sed -n '70,135p' "$f"
  fi
done

echo
echo "Audit script implementation around checks/invocations:"
for f in scripts/onepassword-rotation-audit.sh templates/governance-baseline/scripts/onepassword-rotation-audit.sh
do
  if [ -f "$f" ]; then
    echo "--- $f"
    sed -n '1,30p'
    sed -n '100,180p'
    sed -n '210,260p'
  fi
done

echo
echo "Direct executable invocations/dependencies in audit scripts:"
python3 - <<'PY'
import pathlib, re
for p in ["scripts/onepassword-rotation-audit.sh", "templates/governance-baseline/scripts/onepassword-rotation-audit.sh"]:
    text = pathlib.Path(p).read_text()
    print(f"--- {p}")
    for m in re.finditer(r'(require|command -v|chittysecrets|op |`op )', text):
        print(f"{m.start()}: {text[m.start():m.start()+120]}")
PY

Repository: chittyos/chittycommand

Length of output: 7713


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import pathlib, re

for p in ["scripts/onepassword-rotation-audit.sh", "templates/governance-baseline/scripts/onepassword-rotation-audit.sh"]:
    text = pathlib.Path(p).read_text()
    lines=text.splitlines()
    print(f"--- {p} line counts")
    for i,line in enumerate(lines,1):
        if re.search(r'\b(op|chittysecrets)\b|command -v', line):
            print(f"{i}: {line}")
    print()

for f in ["AGENTS.md","CLAUDE.md",".github/copilot-instructions.md","docs/registration/SUBMISSION_RUNBOOK.md"]:
    if pathlib.Path(f).exists():
        print(f"--- {f}")
        for i,line in enumerate(pathlib.Path(f).read_text().splitlines(),1):
            if "chittysecrets" in line or "op run" in line:
                print(f"{i}: {line}")
PY

Repository: chittyos/chittycommand

Length of output: 1677


🌐 Web query:

1Password CLI op run chittysecrets command chittysecrets run

💡 Result:

The command sequence you provided, op run chittysecrets command chittysecrets run, is not a standard or documented 1Password CLI command [1][2][3]. In the context of the 1Password CLI, the op run command is used to securely inject secrets from 1Password into the environment of a subprocess [1][4]. The standard syntax for op run is [1]: op run -- For example, to run a script or application, you would use [5][4]: op run --./your-script.sh The term "chittysecrets" appears to be specific to a private project or organization-specific utility rather than a native part of the 1Password CLI [6][7]. Based on public code repositories, "chittysecrets" is referenced in custom commit messages and internal service configuration files (such as those for chittyconnect), suggesting it is a custom wrapper or tool used within that specific environment [6][7]. If you are trying to use 1Password CLI to run an application that relies on this custom "chittysecrets" tool, you would likely use the 1Password CLI to provide the necessary credentials to that tool, for instance: op run -- chittysecrets run This would execute the chittysecrets run command as a subprocess, with any secret references defined in your environment or configuration files automatically resolved and injected by 1Password [1][4].

Citations:


Define the canonical chittysecrets invocation style. The docs and scripts use chittysecrets run, standalone op run/op read, and direct op item get without documenting whether these are equivalent, wrapper-specific, or environment-specific flows. Align this consistently.

  • .github/copilot-instructions.md#L110, AGENTS.md#L94, CLAUDE.md#L121: declare whether op run -- chittysecrets run or direct op run is the canonical local command.
  • docs/registration/SUBMISSION_RUNBOOK.md#L37-L55: keep the chittysecrets cold-source → op run runtime handoff explicit if it remains a two-step flow.
  • scripts/onepassword-rotation-audit.sh#L7-L9 and template: either remove the confusing “chittysecrets CLI (op)” label or document that chittysecrets is provided through 1Password CLI.
📍 Affects 6 files
  • .github/copilot-instructions.md#L110-L110 (this comment)
  • AGENTS.md#L94-L94
  • CLAUDE.md#L121-L121
  • docs/registration/SUBMISSION_RUNBOOK.md#L37-L37
  • scripts/onepassword-rotation-audit.sh#L8-L8
  • templates/governance-baseline/scripts/onepassword-rotation-audit.sh#L8-L8
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/copilot-instructions.md at line 110, Define one canonical local
chittysecrets invocation consistently in .github/copilot-instructions.md (line
110), AGENTS.md (line 94), and CLAUDE.md (line 121), explicitly stating whether
direct op run or op run -- chittysecrets run is authoritative. In
docs/registration/SUBMISSION_RUNBOOK.md (line 37), preserve and clarify the
chittysecrets cold-source to op run runtime handoff if it remains two-step. In
scripts/onepassword-rotation-audit.sh (line 8) and
templates/governance-baseline/scripts/onepassword-rotation-audit.sh (line 8),
remove the ambiguous “chittysecrets CLI (op)” wording or document that
chittysecrets is supplied through the 1Password CLI.

- Error responses must **not** leak internal error messages, stack traces, or sensitive data.
- All user input must be validated with Zod before use.
- Use `X-Source-Service: chittycommand` header on all outbound service calls.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/onepassword-rotation-audit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 1Password Rotation Audit
name: chittysecrets Rotation Audit

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Complete or explicitly document the legacy naming migration.

  • .github/workflows/onepassword-rotation-audit.yml#L1-L1: align the workflow name with the remaining script and artifact identifiers, or document compatibility.
  • .github/workflows/onepassword-rotation-audit.yml#L49-L49: align the issue/report naming contract with the remaining legacy identifiers.
  • docs/security/ACCESS_BROKER_AND_1PASSWORD_RUNBOOK.md#L1-L1: explain why the document uses chittysecrets while referencing onepassword-named files.
  • docs/security/ACCESS_BROKER_AND_1PASSWORD_RUNBOOK.md#L25-L25: apply the same compatibility clarification to the section heading.
  • templates/governance-baseline/.github/workflows/onepassword-rotation-audit.yml#L1-L1: mirror the primary workflow’s naming decision.
  • templates/governance-baseline/.github/workflows/onepassword-rotation-audit.yml#L49-L49: mirror the primary workflow’s issue/report naming decision.
📍 Affects 3 files
  • .github/workflows/onepassword-rotation-audit.yml#L1-L1 (this comment)
  • .github/workflows/onepassword-rotation-audit.yml#L49-L49
  • docs/security/ACCESS_BROKER_AND_1PASSWORD_RUNBOOK.md#L1-L1
  • docs/security/ACCESS_BROKER_AND_1PASSWORD_RUNBOOK.md#L25-L25
  • templates/governance-baseline/.github/workflows/onepassword-rotation-audit.yml#L1-L1
  • templates/governance-baseline/.github/workflows/onepassword-rotation-audit.yml#L49-L49
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/onepassword-rotation-audit.yml at line 1, Complete the
legacy chittysecrets/onepassword naming migration consistently: update the
workflow name and issue/report identifiers in
.github/workflows/onepassword-rotation-audit.yml lines 1 and 49, then mirror
those decisions in
templates/governance-baseline/.github/workflows/onepassword-rotation-audit.yml
lines 1 and 49. Clarify the compatibility rationale for chittysecrets
terminology alongside onepassword-named files in
docs/security/ACCESS_BROKER_AND_1PASSWORD_RUNBOOK.md lines 1 and 25.


on:
workflow_dispatch:
Expand All @@ -23,8 +23,8 @@
set -euo pipefail
[[ -n "${GH_TOKEN:-}" ]] || { echo "Missing ORG_AUTOMATION_TOKEN"; exit 1; }
[[ -n "${OP_SERVICE_ACCOUNT_TOKEN:-}" ]] || { echo "Missing OP_SERVICE_ACCOUNT_TOKEN"; exit 1; }
- name: Install 1Password CLI
uses: 1password/install-cli-action@v1
- name: Install chittysecrets CLI
uses: chittysecrets/install-cli-action@v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow or composite action Medium

Unpinned 3rd party Action 'chittysecrets Rotation Audit' step
Uses Step
uses 'chittysecrets/install-cli-action' with ref 'v1', not a pinned commit hash
Comment on lines +26 to +27

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow files =="
fd -a 'onepassword-rotation-audit\.ya?ml$' . | sed 's#^\./##'

echo
echo "== relevant lines =="
for f in $(fd 'onepassword-rotation-audit\.ya?ml$' .); do
  echo "--- $f"
  sed -n '1,60p' "$f" | cat -n
done

echo
echo "== all chittysecrets action refs in repo =="
rg -n "chittysecrets/install-cli-action|uses: .*`@v`[0-9]|uses: [^@]+@[0-9a-fA-F]{40}" . || true

Repository: chittyos/chittycommand

Length of output: 248


🌐 Web query:

chittysecrets install-cli-action v1 GitHub repository releases

💡 Result:

There is no GitHub repository named chittysecrets/install-cli-action. It appears you may be confusing this with 1Password/install-cli-action, an official GitHub Action for installing the 1Password CLI [1][2]. While searching for the term chittysecrets, results indicate it is associated with the organization chittyos (e.g., chittyconnect, chittymcp, chittychronicle) [3][4][5]. Within the repositories of the chittyos organization, there are instances where they utilize 1Password/install-cli-action, but they do not maintain an install-cli-action of their own [4][6]. If you are looking for the releases for the 1Password/install-cli-action repository, they are available on the official GitHub repository page [2]. As of July 26, 2026, the latest release for 1Password/install-cli-action is v4.0.0, which was released on June 11, 2026 [1][2].

Citations:


Pin the installed Action to a verified immutable commit.
Replace chittysecrets/install-cli-action@v1 with a full commit SHA in both workflow files, or switch to an established/released Action such as 1Password/install-cli-action with an immutable tag.

🧰 Tools
🪛 GitHub Check: CodeQL

[warning] 27-27: Unpinned tag for a non-immutable Action in workflow or composite action
Unpinned 3rd party Action 'chittysecrets Rotation Audit' step Uses Step uses 'chittysecrets/install-cli-action' with ref 'v1', not a pinned commit hash

📍 Affects 2 files
  • .github/workflows/onepassword-rotation-audit.yml#L26-L27 (this comment)
  • templates/governance-baseline/.github/workflows/onepassword-rotation-audit.yml#L26-L27
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/onepassword-rotation-audit.yml around lines 26 - 27, Pin
the Install chittysecrets CLI action to a verified immutable commit SHA in both
.github/workflows/onepassword-rotation-audit.yml (lines 26-27) and
templates/governance-baseline/.github/workflows/onepassword-rotation-audit.yml
(lines 26-27), or replace it in both workflow files with the established
1Password/install-cli-action using an immutable tag.

Source: Linters/SAST tools

- name: Run rotation audit
id: rotation
shell: bash
Expand All @@ -46,7 +46,7 @@
shell: bash
run: |
set -euo pipefail
title="[Security] 1Password rotation policy violations"
title="[Security] chittysecrets rotation policy violations"
body="$(cat reports/secret-rotation/latest.md)"
existing="$(gh issue list --state open --search "\"${title}\" in:title" --json number,title --jq '.[] | select(.title=="'"${title}"'") | .number' | head -n1 || true)"
if [[ -n "${existing}" ]]; then
Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Neon PostgreSQL via Hyperdrive binding. All tables prefixed `cc_`. Schema in `sr

### Action Execution

> **Agent Routing Rules**: Agents interfacing with ChittyCommand must respect the Attorney Decision Queue. Agents may assemble packets, detect contradictions (ChittyPro), and propose strategies (ChittyClaw), but cannot bypass the human approval gate for filings, strategy shifts, or irreversible ecosystem mutations.

Three modes:
1. **API** — Mercury transfers, Stripe payments via bridge routes
2. **Codex in Chrome** — Browser automation for portals without APIs
Expand Down Expand Up @@ -89,7 +91,7 @@ Three modes:

## Security

- Credentials via 1Password (`op run`) — never expose in terminal output
- Credentials via chittysecrets (`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`, `command.mychitty.com`, `chittycommand-ui.pages.dev`, `localhost:5173`
Expand Down
2 changes: 2 additions & 0 deletions CHARTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ The dashboard is one consumer of the platform among many.

Provide a unified life management and action dashboard that ingests data from 15+ financial, legal, and administrative sources, scores urgency with AI, recommends actions, and executes them via APIs, email, or browser automation.

> **Core Principle**: ChittyCommand is the cockpit, not the engine. It shall never act as a source of truth for facts, finances, assets, or legal conclusions. Its sole mandate is to visualize, route, and orchestrate the truth produced by the canonical ChittyOS ecosystem.

## Scope

### IS Responsible For
Expand Down
2 changes: 2 additions & 0 deletions CHITTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Unified life management dashboard that ingests data from 15+ financial, legal, a

## Architecture

> **Constraint**: All ChittyCommand UI components must explicitly render their canonical provenance, including the Owning Service, Source Table, and Canonical ID. Any data mutation must be routed through the Ch1tty pilot layer to the appropriate bedrock service.

Cloudflare Worker at command.chitty.cc with Neon PostgreSQL via Hyperdrive, R2 for document storage, and KV for sync state. Cron-triggered data ingestion from Mercury, Plaid, ChittyFinance, ChittyScrape, and more. React SPA frontend at app.command.chitty.cc. MCP server for Claude-driven queries.

### Stack
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Three modes:

## Security

- Credentials via 1Password (`op run`) — never expose in terminal output
- Credentials via chittysecrets (`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`, `cmd.chitty.cc`, `command.mychitty.com`, `disputes.chitty.cc`, `chittycommand-ui.pages.dev`, `localhost:5173`
Expand Down
6 changes: 3 additions & 3 deletions daemon/supervisor.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Every node:
- `CHITTYCONNECT_URL` and `CHITTYCONNECT_TOKEN` for `meta/context.ts`.

Secrets are delivered via the operator manifest's standard path:
1Password (cold source of truth) → Cloudflare Secrets / launchd env / systemd
chittysecrets (cold source of truth) → Cloudflare Secrets / launchd env / systemd
`EnvironmentFile=` (runtime delivery). The daemon never reads secrets from
local disk except via the supervisor-injected environment.

Expand All @@ -54,7 +54,7 @@ StandardOutPath = /var/log/chittycommand-daemon.out.log
StandardErrorPath = /var/log/chittycommand-daemon.err.log
EnvironmentVariables = { CHITTYCOMMAND_NODE_ID = ...,
CHITTYCOMMAND_NODE_DESCRIPTOR = ...,
DATABASE_URL = ... } # injected by 1Password CLI at boot
DATABASE_URL = ... } # injected by chittysecrets CLI at boot
```

Notes:
Expand Down Expand Up @@ -91,7 +91,7 @@ WantedBy=multi-user.target
```

Notes:
- `EnvironmentFile` is rendered at boot from 1Password via the operator's
- `EnvironmentFile` is rendered at boot from chittysecrets via the operator's
bootstrap script — never checked in.
- `Restart=on-failure` + `RestartSec=10` matches the launchd throttle behavior.
- `TimeoutStopSec=30` gives the loop time to release the lease cleanly on
Expand Down
127 changes: 127 additions & 0 deletions docs/ARCHITECTURE_V2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# ChittyCommand v2: Principled Refactor Spec

## 1. Product Concept
ChittyCommand v2 shifts from being a "better dashboard" or standalone application into the **canonical orchestration cockpit for ChittyOS**. It is the shell through which the user interacts with the entire suite of distributed truth-producing engines.

ChittyCommand **does not own truth**. It is a visualization, routing, and orchestration layer. It exposes the litigation, life, and asset command modes, acting as the unified interface where the Ch1tty pilot layer, the ChittyClaw legal brain, and the underlying bedrock services converge to empower human decision-making.

## 2. Canonical Service Responsibility Matrix
The engines generate truth; the cockpit visualizes it.

| Domain | Owning Engine | Cockpit Role (ChittyCommand) |
| :--- | :--- | :--- |
| **Matters & Strategy** | `ChittyCases` / `ChittyClaw` | Visualizes matter posture, synthesizes legal elements, queues strategy |
| **Evidence & Facts** | `ChittyEvidence` / `ChittyStorage` | Reconstructs timeline, maps source files, highlights audit gaps |
| **Proof & Discovery** | `ChittyProof` / `ChittyPro` | Displays contradiction hotspots, assembles proof packets, gates readiness |
| **Finance & Runway** | `ChittyFinance` | Projects cashflow, stages damages, monitors burn rate |
| **Assets & Value** | `ChittyAssets` | Surfaces valuations, tracks encumbrances, maps entities |
| **Immutable Truth** | `ChittyLedger` | Reads chronological event custody and DRL (Reputation) reckoning |
| **Orchestration** | `Ch1tty` | Routes intents, launches workflows, handles agent handoffs |

## 3. Refactored Navigation
Navigation moves away from generic views to highly opinionated, purpose-driven **Command Modes**.

* **[Default] Case Command**: Litigation + Life Operations Cockpit
* **Evidence Command**: Timeline reconstruction and gap analysis
* **Finance Command**: Damages staging and runway protection
* **Asset Command**: Entity map and encumbrance tracking
* **Proof Command**: Citation completeness and packet assembly
* **Contradiction Command**: ChittyPro conflict detection and impeachment logic
* **Life Ops Command**: Daily non-litigation operations
* **Ch1tty Orchestration Command**: Agent routing, workflow supervision
* **Export / Filing Command**: Court-ready document sequencing
* **System Health Command**: Ecosystem readiness and canonical compliance

## 4. Data Ownership Map
To prevent ChittyCommand from becoming a shadow source of truth, all data flows adhere strictly to canonical pipelines:

* **Source-gated data:** `ChittyStorage` → `ChittyEvidence` → `ChittyProof` → `ChittyLedger` → `ChittyCases`
* **Financial data:** `ChittyFinance` → `ChittyLedger` → `ChittyCases`
* **Asset/Value data:** `ChittyAssets` → `ChittyFinance` → `ChittyCases`
* **Contradictions:** `ChittyEvidence` + `ChittyContextual` → `ChittyPro Contradiction Engine` → `ChittyCases`
* **Legal Strategy:** `ChittyClaw` → `ChittyCases` → **Attorney Review Queue**

## 5. Workflow Orchestration Map
Ch1tty serves as the pilot layer. Workflows are launched from ChittyCommand, executed by Ch1tty, processed by the bedrock services, and returned to ChittyCommand for approval.

```mermaid
graph TD
A[Human Action / Goal] --> B(ChittyCommand UI)
B --> C{Ch1tty Router}
C --> D[ChittyClaw]
C --> E[ChittyPro]
C --> F[ChittyFinance]

D --> G(ChittyCases)
E --> G
F --> G

G --> H[Attorney Review Queue]
H --> I((Human Approval Gate))
```

## 6. UI Component Plan
Every card, timeline item, task, and recommendation must be a strict projection of the bedrock. They must explicitly declare their provenance.

**Standardized Component Anatomy:**
* **Visual Data:** The projection of the data (e.g., a timeline event).
* **Metadata Ribbon (Bottom/Side):**
* `Owning Service`: (e.g., `ChittyEvidence`)
* `Source Table`: (e.g., `ev_facts`)
* `Canonical ID`: (e.g., `FCT-9A2B`)
* **State Indicators (Top Right):**
* `Readiness Status`: (e.g., `Sourced`, `Unverified`)
* `Blocker State`: (e.g., `Awaiting Deposition`)
* **Action Row:**
* `Next Action`: Auto-computed by ChittyClaw
* `Approval Gate`: Explicit human/attorney sign-off button

## 7. Readiness Scoring Model
Readiness is computed, not asserted.
* **Fact Readiness:** (Sourced + Hashed in Ledger) = 1.0
* **Element Readiness:** (All required facts for a legal element reach 1.0) = Ready
* **Filing Readiness:** (All elements Ready + Attorney Approval Gate cleared) = Ready for Export

## 8. Evidence Governance Rules
* **No Raw Storage:** ChittyCommand cannot accept file uploads directly to its own DB. It must use the `ChittyStorage` canonical pipeline.
* **No Unattributed Facts:** A fact without a valid `canonical ID` pointing to `ChittyEvidence` renders with a red `[UNSOURCED]` warning and prevents filing export.
* **Immutability:** ChittyCommand cannot edit a ledger event. It can only dispatch a workflow to append a correction to `ChittyLedger`.

## 9. Context-Aware Matter Implementation (Example: Arias v. Bianchi)
ChittyCommand dynamically configures its default mode based on the active matter injected by `ChittyContextual`. It does not hardcode cases.

**Example Homepage layout for an active litigation matter (e.g., Arias v. Bianchi):**
1. **Ch1tty Command Bar:** Global intent routing.
2. **Case Readiness Thermometers:** Visualizing elements of the claim (e.g., Breach of Fiduciary Duty, Fraud).
3. **Strategic Objective Cards:** Sourced from `ChittyContextual` / `ChittyCases` for this specific matter.
4. **Evidence Reconstruction Timeline:** Intersecting `ChittyFinance` anomalies with `ChittyEvidence` emails.
5. **Strategy Execution Timeline:** Forward-looking roadmap.
6. **Filing Sequencer:** Document assembly for the next court deadline.
7. **Attorney Decision Queue:** Items requiring explicit human approval.
8. **Financial Runway:** Current cash flow vs projected litigation costs.
9. **Contradiction Hotspots:** Highlighting where counterparty statements conflict with `ChittyPro`.
10. **Ecosystem Health Rail:** (Governance is shifted here, not the homepage).

## 10. Migration Plan from Current ChittyCommand
1. **Audit:** Map all current ChittyCommand local states to their canonical bedrock owners.
2. **Strip:** Remove all truth-owning database tables from ChittyCommand.
3. **Rewire:** Rebuild data fetching to query `ChittyCases`, `ChittyFinance`, etc.
4. **Componentize:** Implement the Standardized Component Anatomy for all UI elements.
5. **Launch:** Default the router to Case Command.

## 11. CHARTER.md Update Proposal
**Add to Core Principles:**
> "ChittyCommand is the cockpit, not the engine. It shall never act as a source of truth for facts, finances, assets, or legal conclusions. Its sole mandate is to visualize, route, and orchestrate the truth produced by the canonical ChittyOS ecosystem."

## 12. CHITTY.md Update Proposal
**Add to Architecture Constraints:**
> "All ChittyCommand UI components must explicitly render their canonical provenance, including the Owning Service, Source Table, and Canonical ID. Any data mutation must be routed through the Ch1tty pilot layer to the appropriate bedrock service."

## 13. AGENTS.md Update Proposal
**Add to Agent Routing Rules:**
> "Agents interfacing with ChittyCommand must respect the Attorney Decision Queue. Agents may assemble packets, detect contradictions (ChittyPro), and propose strategies (ChittyClaw), but cannot bypass the human approval gate for filings, strategy shifts, or irreversible ecosystem mutations."

## 14. Open Questions / Integration Blockers
* **Latency:** Does rendering the Standardized Component Anatomy across hundreds of timeline events introduce query bloat? (Requires aggressive caching and materialized views in the bedrock).
* **Authentication:** How does ChittyAuth map user roles to the "Attorney Review Queue"?
* **Contextual Sync:** Ensuring `ChittyContextual` accurately maintains the "active context" as the user switches between Command Modes.
6 changes: 3 additions & 3 deletions docs/plans/2026-02-23-mercury-chittybooks-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ interface MercuryOrg {
opRef: string;
}

/** Refresh Mercury tokens from ChittyConnect/1Password into KV */
/** Refresh Mercury tokens from ChittyConnect/chittysecrets into KV */
bridgeRoutes.post('/mercury/refresh-tokens', async (c) => {
const connect = connectClient(c.env);
const orgsJson = await c.env.COMMAND_KV.get('mercury:orgs');
Expand All @@ -221,7 +221,7 @@ bridgeRoutes.post('/mercury/refresh-tokens', async (c) => {
try {
let token: string | null = null;
if (connect) {
// Try fetching from ChittyConnect (1Password proxy)
// Try fetching from ChittyConnect (chittysecrets proxy)
const res = await fetch(`${c.env.CHITTYCONNECT_URL}/api/credentials/${encodeURIComponent(org.opRef)}`, {
headers: { 'X-Source-Service': 'chittycommand' },
signal: AbortSignal.timeout(5000),
Expand Down Expand Up @@ -677,7 +677,7 @@ This is a manual step. The user needs to populate the `mercury:orgs` KV key with
npx wrangler kv key put --binding COMMAND_KV "mercury:orgs" '[{"slug":"aribia-mgmt","opRef":"op://ChittyVault/mercury-aribia-mgmt/token"},{"slug":"personal","opRef":"op://ChittyVault/mercury-personal/token"}]'
```

The exact slugs and 1Password references depend on the user's setup.
The exact slugs and chittysecrets references depend on the user's setup.

**Step 2: Manually seed a test token (optional)**

Expand Down
2 changes: 1 addition & 1 deletion docs/plans/2026-02-23-mercury-live-data-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ChittyCommand is deployed and healthy at `command.chitty.cc`. The API, intellige

## Token Management

- **Source of truth:** 1Password, accessed via ChittyConnect (`connect.chitty.cc`)
- **Source of truth:** chittysecrets, accessed via ChittyConnect (`connect.chitty.cc`)
- **Runtime storage:** `COMMAND_KV` (same pattern as Plaid access tokens)
- **Org registry:** KV key `mercury:orgs` stores a JSON array of org configs:
```json
Expand Down
2 changes: 1 addition & 1 deletion docs/plans/2026-02-23-scrapers-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Data Sources → Service Apps (Finance, Ledger, Scrape)
- Callers pass `Authorization: Bearer <token>`

### Credentials
- Mr. Cooper login: 1Password → ChittyScrape KV (`mrcooper:username`, `mrcooper:password`)
- Mr. Cooper login: chittysecrets → ChittyScrape KV (`mrcooper:username`, `mrcooper:password`)
- Court docket and Cook County tax: public pages, no login

### Scrape Targets
Expand Down
6 changes: 3 additions & 3 deletions docs/plans/2026-02-23-scrapers-implementation-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pnpm install

```bash
cp .env.example .env
# Fill in DATABASE_URL from 1Password: op read "op://Private/ChittyFinance Neon/connection_string"
# Fill in DATABASE_URL from chittysecrets: op read "op://Private/ChittyFinance Neon/connection_string"
```

**Step 4: Start dev server and test endpoints**
Expand Down Expand Up @@ -908,7 +908,7 @@ npx wrangler kv key put --binding SCRAPE_KV --remote "scrape:service_token" "${t
**Step 4: Seed Mr. Cooper credentials**

```bash
# Get Mr. Cooper creds from 1Password
# Get Mr. Cooper creds from chittysecrets
mrcooper_user=$(op read "op://Private/Mr Cooper/username")
mrcooper_pass=$(op read "op://Private/Mr Cooper/password")
npx wrangler kv key put --binding SCRAPE_KV --remote "mrcooper:username" "${mrcooper_user}"
Expand Down Expand Up @@ -1365,7 +1365,7 @@ git commit -m "feat: add missing properties (Surf 211, Clarendon) with PINs and
**Step 1: Seed ChittyScrape service token in ChittyCommand KV**

```bash
# Get the token from 1Password (stored in Task 10)
# Get the token from chittysecrets (stored in Task 10)
token=$(op read "op://Private/Mercury API Keys/ChittyScrape/service_token")
npx wrangler kv key put --binding COMMAND_KV --remote "scrape:service_token" "${token}"
```
Expand Down
Loading
Loading