{
  "$schema": "../../schemas/service.schema.json",
  "kind": "service",
  "name": "storage",
  "version": "1.0.0-draft.1",
  "purpose": "Storage And Files capability acquired through a declared System Service.",
  "declarationSchema": "../../../../Service.schema.json",
  "types": "types.json",
  "functions": {
    "root": {
      "parameters": [],
      "returns": "storage.Folder",
      "purpose": "Root Folder.",
      "statementOnly": false
    }
  },
  "rules": [
    "All paths are relative to the configured root. Absolute paths, parent traversal and links escaping that root fail. Generated files belong in System-owned folders, not platform upload or cdn areas.",
    "get returns an entry or null. File and Folder operations require the corresponding entry kind. newFile is exclusive and fails with Conflict when an entry exists.",
    "A listing visitor is a named one-argument helper returning no value. Listing order is unspecified.",
    "read returns up to the requested positive byte count or null at end of stream. Writes accept the documented content type. Explicitly close author-opened streams in finally; scope cleanup is a safety net.",
    "File metadata, storage handles and file bytes are distinct types. A handle cannot outlive its owning scope or become a serialized business result."
  ]
}
