A framework for managing legal disputes with software engineering rigor.
Track evidence. Enforce deadlines. Escalate automatically. Build arguments from structured knowledge.
LANCE applies software engineering lifecycle discipline to legal disputes:
Evidence management with SHA-256 integrity verification and chain of custody
Statute of limitations tracking with jurisdiction-aware auto-calculation
Case state machine with entry/exit criteria (like CI/CD gates)
Escalation engine with rule-based triggers (no response → auto-draft next action)
Legal knowledge base with embedded statutes, case law, and regulations
Damages calculator with prejudgment interest computation
Attorney handoff — one command generates a complete case package
"Never regress. Always escalate. Block on critical."
Inspired by SPEAR — legal disputes only move forward.
EVIDENCE ──> DEMAND ──> NEGOTIATION ──> REGULATORY ──> LITIGATION ──> RESOLUTION
^ | |
└────────────────────────┴────────────────┘ (loops back for new evidence)
# Clone
git clone https://github.com/migueljnew-droid/lance.git
cd lance
# Install dependencies
pip install -r requirements.txt
# Initialize a new case
python -m engine.cli init --name "My Case" --jurisdiction CA# Add evidence
python -m engine.cli evidence add \
--file contract.pdf \
--type contract \
--description "Original agreement dated 2020-01-15"
# Check deadlines
python -m engine.cli deadlines
# View case status
python -m engine.cli statusEvery case moves through defined states with entry/exit criteria:
LANCE ships as a Claude Code skill for AI-assisted legal work:
/lance status # Case state, deadlines, pending actions
/lance deadlines # All deadlines with countdown
/lance escalate # What should happen next (rule-based)
/lance research [topic] # Query knowledge base + web for law
/lance argue [claim] # Build legal argument from evidence + law
/lance damages # Calculate estimated recovery with interest
/lance audit # Run financial audit on royalty data
/lance handoff # Generate attorney package
/lance log [event] # Record communication or eventDeadline Engine
Tracks two types of deadlines:
- Response deadlines — 30/60/90 day windows after sending demands
- Statute of limitations — jurisdiction-aware, with discovery rule and tolling support
Alerts at configurable intervals (365, 180, 90, 30, 14, 7, 3, 1 days before expiry).
Evidence Chain
Every document gets:
- SHA-256 hash — proves integrity
- Chain of custody entries — who held it, when, what action
- Claim linkage — which legal claims this evidence supports
- Metadata — type, date, source, custodian
Knowledge Base
Structured YAML files covering:
- Federal statutes — Copyright Act (17 USC), Music Modernization Act
- State statutes — California Civil Code, CCP, Business & Professions Code
- Regulations — ASCAP/BMI consent decrees, MLC rules, Copyright Office procedures
- Case law — Organized by topic with facts, holdings, and application notes
- SOL reference — By claim type and jurisdiction with tolling doctrines
Escalation Rules
rules:
- trigger: "no_response"
days: 30
action: "draft_follow_up"
- trigger: "no_response"
days: 60
action: "draft_regulatory_complaint"
- trigger: "settlement_offered"
action: "compare_against_damages_estimate"
- trigger: "sol_approaching"
days: 90
action: "alert_retain_attorney"Damages Calculator
- Computes estimated damages from financial discrepancy data
- Applies jurisdiction-specific prejudgment interest rates
- Supports multiple claim types with different calculation methods
- Outputs court-ready damages summary
lance/
├── knowledge/ # Legal Knowledge Base (YAML, queryable)
│ ├── statutes/ # Federal and state statutes
│ ├── regulations/ # Agency rules, consent decrees
│ ├── precedent/ # Case law organized by topic
│ └── templates/ # Letter and filing templates
├── engine/ # Python engine
│ ├── cli.py # Command-line interface
│ ├── case.py # Case loader + state machine
│ ├── models.py # Pydantic data models
│ ├── deadlines.py # SOL + response deadline calculator
│ ├── evidence.py # Hashing, chain of custody, manifest
│ ├── escalation.py # Rule-based escalation engine
│ ├── damages.py # Damages calculator with interest
│ ├── knowledge.py # Knowledge base query engine
│ ├── arguments.py # Legal argument builder
│ └── handoff.py # Attorney handoff package generator
├── cases/ # Active cases (one dir per case)
├── skill/ # Claude Code skill definition
├── tests/ # Test suite
└── examples/ # Example case configurations
| 🎵 | Music publishing disputes — royalty audits, share corrections, publisher accountability |
| 📝 | Contract disputes — breach, accounting, fiduciary duty claims |
| © | IP disputes — copyright infringement, licensing disagreements |
| 💼 | Employment disputes — wage theft, misclassification, benefits claims |
| 🛒 | Consumer disputes — warranty claims, fraud, unfair business practices |
LANCE is a case management and legal research assistance tool. It does NOT provide legal advice. Always consult a licensed attorney for legal decisions. The legal knowledge base is for reference and research purposes only.
MIT License. See LICENSE for details.