Flatten cases directory structure and unify paths
- Remove cases/new|in-progress|completed subdivision (status managed in DB)
- Rename documents/original → documents/originals (consistent plural)
- Move exports from global data/exports/ into cases/{num}/exports/
- Add documents/research/ for case law and analysis files
- Update all agents, scripts, config, web API endpoints, and DB paths
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,28 +53,15 @@ GOOGLE_CLOUD_VISION_API_KEY = os.environ.get("GOOGLE_CLOUD_VISION_API_KEY", "")
|
||||
# Data directory
|
||||
DATA_DIR = Path(os.environ.get("DATA_DIR", str(Path.home() / "legal-ai" / "data")))
|
||||
TRAINING_DIR = DATA_DIR / "training"
|
||||
EXPORTS_DIR = DATA_DIR / "exports"
|
||||
EXPORTS_DIR = DATA_DIR / "exports" # legacy exports only
|
||||
|
||||
# Cases directory — new structure: cases/{new,in-progress,completed}/{case_number}/
|
||||
CASES_BASE = Path(os.environ.get("CASES_BASE", str(Path.home() / "legal-ai" / "cases")))
|
||||
CASES_NEW = CASES_BASE / "new"
|
||||
CASES_IN_PROGRESS = CASES_BASE / "in-progress"
|
||||
CASES_COMPLETED = CASES_BASE / "completed"
|
||||
CASES_DIR = CASES_NEW # backwards compatibility — new cases default here
|
||||
|
||||
_STATUS_DIRS = [CASES_NEW, CASES_IN_PROGRESS, CASES_COMPLETED]
|
||||
# Cases directory — flat structure: data/cases/{case_number}/
|
||||
CASES_DIR = DATA_DIR / "cases"
|
||||
|
||||
|
||||
def find_case_dir(case_number: str) -> Path:
|
||||
"""Find a case directory across all status folders.
|
||||
|
||||
Returns the existing directory, or defaults to CASES_NEW/{case_number}.
|
||||
"""
|
||||
for base in _STATUS_DIRS:
|
||||
candidate = base / case_number
|
||||
if candidate.exists():
|
||||
return candidate
|
||||
return CASES_NEW / case_number
|
||||
"""Return the case directory for a given case number."""
|
||||
return CASES_DIR / case_number
|
||||
|
||||
# Chunking parameters
|
||||
CHUNK_SIZE_TOKENS = 600
|
||||
|
||||
Reference in New Issue
Block a user