{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://kicad-happy.local/datasheets/schemas/manifest.schema.json", "title": "DatasheetsManifest", "description": "Shape of datasheets/manifest.json. Tracks BOTH the legacy 'extractions' cache index (v1.3 compatible) AND the new 'pdfs' SHA-dedup section (v1.4 Tier 1). Consumers tolerate additional keys (additionalProperties: true).", "type": "object", "additionalProperties": true, "properties": { "version": { "type": ["integer", "string"], "description": "Manifest schema version. v1.3 used integer (EXTRACTION_VERSION); v1.4 emits string '1.0'. Readers accept both." }, "last_updated": { "type": "string", "description": "ISO-8601 timestamp of the most recent write." }, "pdfs": { "type": "object", "description": "Tier 1 PDF SHA dedup (v1.4+). Keyed by 'sha256:'. Multiple MPNs may point at the same PDF when datasheets are catalog-style (e.g. Yageo 0603 resistors).", "patternProperties": { "^sha256:[0-9a-f]{64}$": { "type": "object", "required": ["path", "mpns"], "additionalProperties": false, "properties": { "path": { "type": "string", "description": "Filesystem path relative to datasheets/ (e.g. 'yageo-rc0603.pdf')." }, "mpns": { "type": "array", "minItems": 1, "items": {"type": "string"}, "description": "All MPNs represented by this PDF. Grows as new parts from the same family are pulled." }, "source_url": { "type": ["string", "null"], "description": "Origin URL the PDF was downloaded from (e.g. a manufacturer product page or direct datasheet URL). null for offline or locally-sourced PDFs." }, "is_family": { "type": ["boolean", "null"], "description": "True when scout flags this as a catalog-style datasheet. Reserved for Tier 2 family extraction; always null today." } } } }, "additionalProperties": false }, "extractions": { "type": "object", "description": "Legacy v1.3 cache index. Retained for backward compatibility — the v1.3->v1.4 consumer API wrappers read this section. New writes prefer the per-MPN .json files referenced via the 'pdfs' section.", "additionalProperties": { "type": "object", "required": ["file", "mpn"], "properties": { "file": {"type": "string"}, "mpn": {"type": "string"}, "category": {"type": ["string", "null"]}, "source_pdf": {"type": ["string", "null"]}, "source_pdf_hash": {"type": ["string", "null"]}, "extraction_date": {"type": ["string", "null"]}, "extraction_score": {"type": ["number", "null"]}, "extraction_version": {"type": ["integer", "null"]}, "pin_count": {"type": ["integer", "null"]} } } } } }