# nyc.noirot.cad.source

> Published by [franknoirot.co](https://lexicon.garden/identity/did:plc:5dwcnpy3p6afki4rwv7gqegd)

✓ This is the authoritative definition for this NSID.

## Description

A sidecar record for one CAD source file or artifact.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:5dwcnpy3p6afki4rwv7gqegd/nyc.noirot.cad.source)
- [Documentation](https://lexicon.garden/lexicon/did:plc:5dwcnpy3p6afki4rwv7gqegd/nyc.noirot.cad.source/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:5dwcnpy3p6afki4rwv7gqegd/nyc.noirot.cad.source/examples)

## Definitions

### `nyc.noirot.cad.source`

**Type**: `record`

Source file content or content references for a CAD project or release.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | No | CID for this source file, if content-addressed. |
| `path` | `string` | Yes | Path within the project archive or source tree. |
| `role` | `string` | No | Role this source file plays in the project. |
| `format` | `string` | No | CAD source or artifact format. |
| `sha256` | `string` | Yes | Lowercase hex SHA-256 digest of the source file bytes. |
| `subject` | `ref` → `nyc.noirot.cad.defs#projectRef` | Yes | Project or release record this source file belongs to. |
| `mimeType` | `string` | No |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `lineCount` | `integer` | No | Line count for text-native source files. |
| `sizeBytes` | `integer` | No | Size of this source file in bytes. |
| `updatedAt` | `string` (datetime) | No |  |
| `sourceBlob` | `blob` | No | Blob reference for source bytes, especially large text files and binary CAD artifacts. |
| `sourceText` | `string` | No | Inline UTF-8 source text for compact text-native CAD files such as KCL. |
| `externalUri` | `string` (uri) | No | External content URL, such as a Zoo project file or archive download URL. |
| `textEncoding` | `string` | No | Text encoding for sourceText, when present. |

## Raw Schema

```json
{
  "id": "nyc.noirot.cad.source",
  "defs": {
    "main": {
      "key": "any",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "subject",
          "path",
          "sha256",
          "createdAt"
        ],
        "properties": {
          "cid": {
            "type": "string",
            "format": "cid",
            "description": "CID for this source file, if content-addressed."
          },
          "path": {
            "type": "string",
            "maxLength": 2048,
            "description": "Path within the project archive or source tree."
          },
          "role": {
            "type": "string",
            "maxLength": 64,
            "description": "Role this source file plays in the project.",
            "knownValues": [
              "entrypoint",
              "source",
              "import",
              "asset",
              "library",
              "derived"
            ]
          },
          "format": {
            "type": "string",
            "maxLength": 128,
            "description": "CAD source or artifact format.",
            "knownValues": [
              "kcl",
              "solidworks-part",
              "solidworks-assembly",
              "step",
              "stl",
              "parasolid",
              "obj",
              "gltf",
              "archive",
              "unknown"
            ]
          },
          "sha256": {
            "type": "string",
            "maxLength": 64,
            "minLength": 64,
            "description": "Lowercase hex SHA-256 digest of the source file bytes."
          },
          "subject": {
            "ref": "nyc.noirot.cad.defs#projectRef",
            "type": "ref",
            "description": "Project or release record this source file belongs to."
          },
          "mimeType": {
            "type": "string",
            "maxLength": 256
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "lineCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Line count for text-native source files."
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 0,
            "description": "Size of this source file in bytes."
          },
          "updatedAt": {
            "type": "string",
            "format": "datetime"
          },
          "sourceBlob": {
            "type": "blob",
            "accept": [
              "text/*",
              "model/*",
              "application/octet-stream",
              "application/zip"
            ],
            "maxSize": 10000000,
            "description": "Blob reference for source bytes, especially large text files and binary CAD artifacts."
          },
          "sourceText": {
            "type": "string",
            "maxLength": 200000,
            "description": "Inline UTF-8 source text for compact text-native CAD files such as KCL."
          },
          "externalUri": {
            "type": "string",
            "format": "uri",
            "description": "External content URL, such as a Zoo project file or archive download URL."
          },
          "textEncoding": {
            "type": "string",
            "maxLength": 64,
            "description": "Text encoding for sourceText, when present.",
            "knownValues": [
              "utf-8"
            ]
          }
        }
      },
      "description": "Source file content or content references for a CAD project or release."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "A sidecar record for one CAD source file or artifact."
}
```
