# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Context Restoration

**Always read `RESEARCH_LOG.md` at the start of any session.** It is the authoritative context file for case status, completed work, pending items, and what evidence has been found. The `.cursor/rules/research-context.mdc` rule enforces this.

## Project Purpose

This is a Python-based legal evidence automation toolkit supporting **Richard Litman** (patent attorney) in a defense case against **Nath, Goldberg & Meyer (NGM)**. The core theory: Litman's name/professional identity was used in public-facing patent records and correspondence after **6/15/2020** (the SOL cutoff) while Joshua B. Goldberg took over control of that work.

Key dataset: 905 issued patents listing Litman as attorney since 6/15/2020, with 4 exemplar patents for deep docket analysis.

## Environment Setup

```bash
source .venv/bin/activate        # Python 3.14 venv already configured
pip install -r requirements.txt
brew install tesseract            # Required for IFEE OCR only
export USPTO_API_KEY='your_key'  # Required for USPTO API calls
```

## Commands

**Full pipeline (evidence → analysis → report → package):**
```bash
cd scripts && python3 run_all.py --counsel-ready
```

**Individual phases:**
```bash
# Evidence gathering (requires USPTO_API_KEY)
python3 scripts/fetch_ifw_documents.py
python3 scripts/download_poa_pdfs.py
python3 scripts/download_ifee_pdfs.py
python3 scripts/extract_ifee_submitter_ocr.py   # requires tesseract

# Analysis
python3 scripts/run_full_analysis.py             # runs 10 analyses → output/ANALYSIS_*.csv

# Report generation
python3 scripts/build_report.py                  # → output/LITMAN_DEFENSE_REPORT.md

# RFP/BOP legal support (no API key needed)
python3 scripts/rfp_compliance_checklist.py
python3 scripts/evidence_rfp_mapping.py
python3 scripts/generate_bop_patent_list.py

# Package for counsel
python3 scripts/build_lawyer_package.py          # → Litman_Evidence_Package.zip
```

**Test USPTO API key:**
```bash
python3 scripts/test_uspto_api_key.py
```

## Architecture

The pipeline has four phases:

1. **Evidence gathering** — `scripts/fetch_ifw_documents.py` calls the USPTO Patent File Wrapper API (`https://api.uspto.gov/api/v1/patent/applications/{appNum}/documents`, header `X-API-Key`) for 4 exemplar application numbers defined in `scripts/patent_app_mapping.csv`. Outputs IFW JSON to `uspto_richard_litman_package_full/uspto_richard_litman/uploads/`.

2. **Analysis** — `scripts/run_full_analysis.py` runs 10 analyses on the core datasets (905-patent CSV, IFW JSON, evidence PDFs). Outputs `output/ANALYSIS_*.csv` and `output/ANALYSIS_FULL_REPORT.md`.

3. **Report generation** — `scripts/build_report.py` assembles `output/LITMAN_DEFENSE_REPORT.md`. `scripts/build_front_page_exhibit_binder.py` generates `output/EXHIBIT_A_FRONT_PAGES.pdf`.

4. **RFP/BOP helpers** — Scripts prefixed `generate_` and `rfp_` produce legal filings referencing `config/rfp_config.yaml` for placeholder dates/addresses.

## Key Data Files

| File | Description |
|------|-------------|
| `uspto_richard_litman_package_full/uspto_richard_litman/richard_litman_attorney_issued_patents_since_2020-06-15.csv` | 905-patent backbone dataset |
| `scripts/patent_app_mapping.csv` | Patent → application number (17 records, 4 exemplars fully mapped) |
| `uspto_richard_litman_package_full/uspto_richard_litman/likely_targets_litman_and_goldberg_post_2024-07-21.csv` | 12 post-SOL-safe overlap patents |
| `uploads/NOA_*.json` | USPTO API IFW responses for 4 exemplar patents |

## Key Dates

| Date | Significance |
|------|-------------|
| 6/15/2020 | SOL cutoff — use after this date is the evidence target |
| 6/14/2023 | Arbitration decision |
| 7/21/2024 | Post-SOL-safe cutoff — acts after this are strongest for SOL arguments |
| 6/15/2025 | Late-period cutoff — "especially problematic" per Litman |

## Known Limitations

- Patent dataset ends **2025-01-14**; post-6/15/2025 patents require manual PatentsView search (`PATENTSVIEW_API_KEY` env var)
- USPTO IFW document list does **not** include submitter names — need PDF OCR via `extract_ifee_submitter_ocr.py` for Goldberg identification
- Wayback Machine returns 403 for automated requests; use manual browser capture with `capture_wayback_screenshot.py` as a guide only
- USPTO API requires application numbers (not patent numbers); `patent_app_mapping.csv` bridges this for the 4 exemplars

## Web Interfaces (No Server Required)

- `easymode.html` — Offline evidence explorer; open directly in browser
- `case_walkthrough.html` — Interactive walkthrough for counsel

---

## Session State (as of 2026-04-10 — AAA lawsuit package update)

### Case Posture
- **Litman v. Goldberg, Index No. 524343/2025** — NY Sup. Ct., Kings County
- **Judge:** Hon. Brian L. Gotlieb, J.S.C. (reassigned from Maslow at 02/19/2026 preliminary conference)
- **Only Count V survives** (NY Civil Rights Law §§ 50-51 misappropriation of name). Counts I-IV dismissed 12/05/2025.
- **Goldberg's Answer (Doc #65, 01/20/2026):** ADMITS Litman's name appeared on patent front pages and NGM website after 6/15/2020 (¶¶32, 72). DENIES he "caused" it (¶33) — contradicted by 16 POA signatures. DENIES Nunc Pro Tunc Assignment paragraph (¶38) — contradicted by his own recorded USPTO document.
- **10 affirmative defenses** all mapped to counter-evidence (see `project_court_status.md` memory or RESEARCH_LOG.md § 8, 2026-03-18).

### Upcoming Deadlines (URGENT)
- **04/02/2026:** BOPs due
- **06/02/2026:** Depositions complete (Goldberg depo still pending — 02/24 was failed appearance)
- **09/22/2026:** Compliance conference (CCP Room 282, 9:30am, Judge Gotlieb)
- **02/05/2027:** Note of Issue


### Detailed Context Files

Heavy case content has been split out of this file to keep `CLAUDE.md` under the 40k-char performance threshold. These are plain-text pointers — Claude reads them only when the current task needs that section. Do NOT convert to `@` imports (that would auto-load them and defeat the purpose).

| File | What's in it | When to read |
|------|---------------|--------------|
| `.claude-context/findings.md` | Critical Findings #1–116 (full text, all dates, all Bates cites) | Any task that needs a specific finding, a cross-reference, or chronology |
| `.claude-context/gaps.md` | Open Gaps / Pending Work (27 items, open and closed) | When picking up work, tracking what's outstanding, or updating status |
| `.claude-context/case_strategy.md` | Damages Range, Key Decisions Made, Representative Clients, Session History pointer | When drafting filings, discussing damages, or reasoning about strategic choices |
| `.claude-context/deliverables.md` | What's Been Built (Complete) — evidence corpus, HTML deliverables, MSJ briefs, memos | When the question is "what do we already have?" |
| `RESEARCH_LOG.md` § 8 | Full session log 2026-03-14 → present | Deep history / audit trail |
| `.claude-memory/summary.md`, `.claude-memory/context.md` | Session memory system | Automatic — already referenced below |

<!-- ClaudCLIMac Memory System -->
## Session Memory
This project has detailed session memory in `.claude-memory/`.
Read `.claude-memory/summary.md` for a complete picture of previous work.
Read `.claude-memory/context.md` for what was happening most recently.
