{ "$schema":                            "https://json-schema.org/draft/2020-12/schema",
  "$id":                                "https://schemas.mpai.community/PGM1/V1.0/data/AUSDirective.json",
  "title":                              "AUS Directive V1.0",
  "description":                        "Directive issued by AUC to AUS that establishes, for an A-User session, the storage scopes, the retention and lifecycle policy, and the access rights AUS enforces on the read and write operations performed by AUS-accessing AIMs.",
  "type":                               "object",
  "additionalProperties":               false,
  "required":                           ["Header", "MInstance", "UEnvironment", "AUSDirectiveID", "AUSDirectiveTime", "SessionID", "Lifecycle", "StorageScopes", "AccessRights", "DataXMData"],
  "properties":                         {

    "Header":                           { "type": "string", "pattern": "^PGM-ASD-V1.0", "description": "AUS Directive header identifier." },
    "MInstance":                        { "type": "string", "description": "Identifier of the M-Instance in which the directive applies." },
    "UEnvironment":                     { "type": "string", "description": "Identifier of the U-Environment associated with the directive." },
    "AUSDirectiveID":                   { "type": "string", "description": "Unique identifier for this AUS Directive instance." },
    "AUSDirectiveTime":                 { "$ref": "https://schemas.mpai.community/PTF/V1.0/data/SimpleTime.json", "description": "Timestamp indicating when the directive was produced." },
    
    "SessionID":                        { "type": "string", "description": "Identifier of the A-User session whose storage this directive governs." },

    "Lifecycle":                        { "type": "object", "additionalProperties": false, "description": "Container specifying the storage lifecycle command and retention policy.", "properties": {
        "Command":                      { "type": "string", "enum": ["Open", "Close", "Archive", "Delete"], "description": "Storage lifecycle command: Open | Close | Archive | Delete." },
        "RetentionPolicy":              { "type": "string", "description": "Retention policy applied to stored content for each scope." } } },

    "StorageScopes":                    { "type": "object", "additionalProperties": false, "description": "Container specifying the storage scopes active or available for the session.", "properties": {
        "SessionScope":                 { "type": "string", "enum": ["enabled", "disabled"], "description": "Whether session-scope storage is active: enabled | disabled." },
        "HistoricalScope":              { "type": "string", "enum": ["enabled", "disabled"], "description": "Whether historical-scope storage is available: enabled | disabled." } } },

    "AccessRights":                     { "type": "object", "additionalProperties": false, "description": "Container specifying the access rights A-User Storage enforces on incoming operations.", "properties": {
        "HistoricalReadAuthorisation":  { "type": "string", "enum": ["granted", "denied"], "description": "Whether AUS-accessing AIMs are permitted to read historical-scope content: granted | denied." },
        "WriteAuthorisation":           { "type": "string", "enum": ["granted", "denied"], "description": "Whether write operations to the active scope are permitted: granted | denied." } } },
        
    "DataXMData":                       { "$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json", "description": "Data Exchange Metadata compliant with MPAI-PTF V1.0." },
    "DescrMetadata":                    { "type": "string", "maxLength": 2048, "description": "Optional descriptive metadata providing additional human-readable context." } } }