cpld_c_drive_audit.schema.json 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "https://local.invalid/schemas/cpld_c_drive_audit.schema.json",
  4. "title": "CPLD C-drive read-only audit output",
  5. "oneOf": [
  6. {
  7. "type": "object",
  8. "properties": {
  9. "schema": {"const": "cpld-c-drive-audit-v1"},
  10. "command": {"const": "scan"},
  11. "generated_at": {"type": "string"},
  12. "roots": {"type": "array", "items": {"type": "string"}},
  13. "records": {"type": "array", "items": {"$ref": "#/$defs/record"}}
  14. },
  15. "required": ["schema", "command", "generated_at", "roots", "records"],
  16. "additionalProperties": true
  17. },
  18. {
  19. "type": "object",
  20. "properties": {
  21. "schema": {"const": "cpld-c-drive-audit-v1"},
  22. "command": {"const": "compare-archives"},
  23. "generated_at": {"type": "string"},
  24. "archive": {"$ref": "#/$defs/record"},
  25. "directory": {"$ref": "#/$defs/record"},
  26. "comparison": {
  27. "type": "object",
  28. "properties": {
  29. "status": {"enum": ["full_coverage", "mismatch", "unsafe"]},
  30. "recommended_action": {"type": "string"},
  31. "members": {"type": "array", "items": {"$ref": "#/$defs/member"}}
  32. },
  33. "required": ["status", "recommended_action", "members"],
  34. "additionalProperties": true
  35. }
  36. },
  37. "required": ["schema", "command", "generated_at", "archive", "directory", "comparison"],
  38. "additionalProperties": true
  39. }
  40. ],
  41. "$defs": {
  42. "record": {
  43. "type": "object",
  44. "properties": {
  45. "absolute_path": {"type": ["string", "null"]},
  46. "resolved_path": {"type": ["string", "null"]},
  47. "size": {"type": ["integer", "null"], "minimum": 0},
  48. "git_common_dir": {"type": ["string", "null"]},
  49. "worktree_dirty": {"type": "boolean"},
  50. "reparse_point": {"type": "boolean"},
  51. "ownership_evidence": {"type": "array", "items": {"type": "string"}},
  52. "sha256": {"type": ["string", "null"]},
  53. "comparison_target": {"type": ["string", "null"]},
  54. "comparison_result": {"type": "string"},
  55. "classification": {"type": "string"},
  56. "recommended_action": {"type": "string"},
  57. "reason": {"type": "string"}
  58. },
  59. "required": [
  60. "absolute_path", "resolved_path", "size", "git_common_dir", "worktree_dirty",
  61. "reparse_point", "ownership_evidence", "sha256", "comparison_target",
  62. "comparison_result", "classification", "recommended_action", "reason"
  63. ],
  64. "additionalProperties": true
  65. },
  66. "member": {
  67. "allOf": [
  68. {"$ref": "#/$defs/record"},
  69. {
  70. "type": "object",
  71. "properties": {
  72. "member_path": {"type": "string"},
  73. "target_size": {"type": ["integer", "null"], "minimum": 0}
  74. },
  75. "required": ["member_path", "target_size"]
  76. }
  77. ]
  78. }
  79. }
  80. }