Add complete Traceable, Transparent, Trustworthy framework for ContractGuard legal service compliance, ensuring every legal document can be traced to authoritative source with cryptographic verification. Core IF.TTT Components: * Traceable: Unique if://citation/[uuid] identifiers with git commit references * Transparent: Full audit trail in PROVENANCE_CHAIN.md with chain of custody * Trustworthy: SHA-256 verification, automated validation, 100% verification status Implementation: - Add legal citation schema v1.0 with all required metadata fields - Generate citations for all 59 existing documents in corpus - Create comprehensive PROVENANCE_CHAIN.md audit trail - Add citation validation tool with 8-point integrity checks - Enhance Chroma ingestion to preserve citation metadata - Update README with IF.TTT compliance documentation Verification Results: - Total Citations Generated: 59 - Verification Status: 59/59 PASSED (100%) - Jurisdictions Covered: UK, US, CA, AU, DE, EU, INT - Document Types: statutes, regulations, datasets, industry standards Legal Service Requirements Met: - All documents sourced from authoritative government repositories - Complete hash verification and file integrity checks - Provenance chain documents download → validation → ingestion - Citation metadata embedded in Chroma for RAG queries - Legal disclaimers and verification timestamps preserved Files Added: - schemas/legal-citation-v1.0.json: JSON schema specification - citations/legal-corpus-citations-2025-11-28.json: 59 citation records - audit/PROVENANCE_CHAIN.md: Complete chain of custody (1200+ lines) - audit/validation-report-2025-11-28.json: Automated verification report - tools/generate_citations.py: Python script to generate citations - tools/validate_legal_citations.py: Citation validation tool Files Modified: - README.md: Added IF.TTT Compliance section with usage documentation - scripts/ingest_chromadb.py: Enhanced to load and preserve citation metadata This framework ensures ContractGuard can demonstrate full legal compliance, provide verifiable source attribution, and support secure contract analysis. Generated with Claude Code
174 lines
5.7 KiB
JSON
174 lines
5.7 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"$id": "if://schema/legal-citation/v1.0",
|
|
"title": "IF.TTT Legal Citation Schema",
|
|
"description": "Traceable, Transparent, Trustworthy citation schema for legal documents in ContractGuard corpus",
|
|
"type": "object",
|
|
"required": [
|
|
"citation_id",
|
|
"citation_type",
|
|
"document_name",
|
|
"jurisdiction",
|
|
"authoritative_source",
|
|
"local_verification",
|
|
"provenance_chain",
|
|
"citation_status",
|
|
"verification_date",
|
|
"verifier"
|
|
],
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"citation_id": {
|
|
"type": "string",
|
|
"pattern": "^if://citation/[a-f0-9\\-]{36}$",
|
|
"description": "Unique citation identifier using if:// URI scheme with UUID v4"
|
|
},
|
|
"citation_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"legal_statute",
|
|
"legal_regulation",
|
|
"case_law",
|
|
"legal_dataset",
|
|
"industry_standard",
|
|
"legislative_guidance"
|
|
],
|
|
"description": "Classification of legal document type"
|
|
},
|
|
"document_name": {
|
|
"type": "string",
|
|
"description": "Official or common name of the legal document"
|
|
},
|
|
"jurisdiction": {
|
|
"type": "string",
|
|
"enum": ["UK", "US", "EU", "CA", "AU", "DE", "FR", "INT"],
|
|
"description": "Jurisdiction where statute/regulation applies"
|
|
},
|
|
"authoritative_source": {
|
|
"type": "object",
|
|
"required": ["url", "accessed_date", "verification_method"],
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"url": {
|
|
"type": "string",
|
|
"format": "uri",
|
|
"description": "Official government or authoritative source URL"
|
|
},
|
|
"accessed_date": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO 8601 timestamp when source was accessed"
|
|
},
|
|
"archive_url": {
|
|
"type": "string",
|
|
"format": "uri",
|
|
"description": "Web Archive or alternative backup URL for source preservation"
|
|
},
|
|
"verification_method": {
|
|
"type": "string",
|
|
"enum": ["sha256_hash", "api_verified", "web_scrape", "manual_review", "official_dataset"],
|
|
"description": "How the authenticity of source was verified"
|
|
},
|
|
"source_type": {
|
|
"type": "string",
|
|
"enum": ["government_website", "official_gazette", "legislation_database", "api_endpoint", "pdf_download"],
|
|
"description": "Category of source location"
|
|
}
|
|
}
|
|
},
|
|
"local_verification": {
|
|
"type": "object",
|
|
"required": ["local_path", "sha256", "file_size_bytes", "ingested_date", "git_commit"],
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"local_path": {
|
|
"type": "string",
|
|
"description": "Relative path within corpus"
|
|
},
|
|
"sha256": {
|
|
"type": "string",
|
|
"pattern": "^[a-f0-9]{64}$",
|
|
"description": "SHA-256 hash of file for integrity verification"
|
|
},
|
|
"file_size_bytes": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Size of file in bytes for consistency checks"
|
|
},
|
|
"ingested_date": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO 8601 timestamp when document was added to corpus"
|
|
},
|
|
"git_commit": {
|
|
"type": "string",
|
|
"pattern": "^[a-f0-9]{7,40}$",
|
|
"description": "Git commit hash where document was added to repository"
|
|
},
|
|
"file_format": {
|
|
"type": "string",
|
|
"enum": ["html", "pdf", "text", "markdown", "json", "xml"],
|
|
"description": "Format of the stored file"
|
|
}
|
|
}
|
|
},
|
|
"provenance_chain": {
|
|
"type": "array",
|
|
"minItems": 3,
|
|
"description": "Complete audit trail from source through ingestion",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["step", "timestamp"],
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"step": {
|
|
"type": "string",
|
|
"enum": ["download", "validation", "transformation", "ingestion", "review", "verification"],
|
|
"description": "Stage in the provenance chain"
|
|
},
|
|
"agent": {
|
|
"type": "string",
|
|
"description": "Name of agent, system, or human who performed this step"
|
|
},
|
|
"timestamp": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO 8601 timestamp of when this step occurred"
|
|
},
|
|
"verification": {
|
|
"type": "string",
|
|
"description": "Details of how this step was verified or what was checked"
|
|
},
|
|
"result": {
|
|
"type": "string",
|
|
"enum": ["verified", "passed", "completed", "failed", "disputed"],
|
|
"description": "Outcome of this provenance step"
|
|
},
|
|
"notes": {
|
|
"type": "string",
|
|
"description": "Additional notes about this step"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"legal_metadata": {
|
|
"type": "object",
|
|
"description": "Legal-specific metadata",
|
|
"additionalProperties": true
|
|
},
|
|
"citation_status": {
|
|
"type": "string",
|
|
"enum": ["unverified", "verified", "disputed", "revoked", "superseded"],
|
|
"description": "Current status of citation accuracy and currency"
|
|
},
|
|
"verification_date": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO 8601 timestamp when document was last verified for accuracy"
|
|
},
|
|
"verifier": {
|
|
"type": "string",
|
|
"description": "Name of person or system that verified this citation"
|
|
}
|
|
}
|
|
}
|