whynot-design/ir/schema/lock.schema.json

49 lines
2.1 KiB
JSON
Raw Normal View History

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://whynot.design/ir/schema/lock.schema.json",
"title": "whynot-design — Consumer Sync-Point Lock",
"description": ".whynot-design.lock lives in a CONSUMING repo (not in whynot-design) and records which IR state that repo has adopted. It is the consumer-side mirror of designbook/.design-sync.json. Created on first adopt and advanced only by `whynot-design drift --update`. The drift check compares this against a target ir/manifest.json to report what changed since the consumer's adopted sync-point.",
"type": "object",
"required": ["designVersion", "adoptedAt", "manifestSchemaVersion", "manifestHashes"],
"additionalProperties": false,
"properties": {
"designVersion": {
"type": "string",
"description": "The @whynot/design version whose manifest was adopted (e.g. matches the installed package / tag vX.Y.Z)."
},
"adoptedAt": {
"type": "string",
"format": "date-time",
"description": "ISO-8601 timestamp this sync-point was adopted (first adopt or last `drift --update`)."
},
"manifestSchemaVersion": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
"description": "The adopted manifest's schemaVersion. If a target manifest has a different schemaVersion the drift check warns that hashes may not be directly comparable."
},
"manifestHashes": {
"type": "object",
"description": "The subset of ir/manifest.json the consumer has reconciled against.",
"required": ["tokens", "components"],
"additionalProperties": false,
"properties": {
"tokens": {
"$ref": "#/$defs/hash",
"description": "Adopted value of the manifest's tokensHash."
},
"components": {
"type": "object",
"description": "Map of component name → adopted content hash.",
"additionalProperties": { "$ref": "#/$defs/hash" }
}
}
}
},
"$defs": {
"hash": {
"type": "string",
"pattern": "^sha256:[0-9a-f]{16}$"
}
}
}