# net.anisota.chronicle.fieldwork

> Published by [anisota.net](https://lexicon.garden/identity/did:plc:lcieujcfkv4jx7gehsvok3pr)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:lcieujcfkv4jx7gehsvok3pr/net.anisota.chronicle.fieldwork)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lcieujcfkv4jx7gehsvok3pr/net.anisota.chronicle.fieldwork/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lcieujcfkv4jx7gehsvok3pr/net.anisota.chronicle.fieldwork/examples)

## Definitions

### `net.anisota.chronicle.fieldwork`

**Type**: `record`

Signed quest completion record. rkey is the quest ID (e.g. 'first-post', 'make-camp'). Created once with createRecord when the quest is completed. Immutable.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | No | Display title of the quest |
| `track` | `string` | Yes | Quest track this quest belongs to (e.g. 'field-basics', 'observatory', 'expedition', 'craft') |
| `context` | `ref` → `#questContext` | No |  |
| `questId` | `string` | Yes | Unique identifier for the quest (e.g. 'first-post'). Matches the record's rkey. |
| `createdAt` | `string` (datetime) | Yes | When the quest record was created |
| `signature` | `ref` → `#chronicleSignature` | Yes |  |
| `xpAwarded` | `integer` | Yes | XP awarded for completing this quest |
| `completedAt` | `string` (datetime) | Yes | When the quest was completed |
| `description` | `string` | No | Description of what was accomplished |
| `retroactive` | `boolean` | No | Whether the quest was completed retroactively from existing activity rather than live |

### `net.anisota.chronicle.fieldwork#questContext`

**Type**: `object`

Contextual data at the time of quest completion

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `level` | `integer` | No | Player level when the quest was completed |
| `appMode` | `string` | No | App mode ('story' or 'open') when the quest was completed |
| `totalXP` | `integer` | No | Total XP when the quest was completed |

### `net.anisota.chronicle.fieldwork#chronicleSignature`

**Type**: `object`

ES256 cryptographic signature proving record authenticity. The signature itself proves legitimacy - no separate verification lexicons needed.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `alg` | `string` | Yes | Signing algorithm (ES256) |
| `kid` | `string` | Yes | Key identifier for the signing key |
| `sig` | `string` | Yes | Base64-encoded ES256 signature |
| `nonce` | `string` | Yes | Unique random nonce to prevent replay |
| `version` | `integer` | Yes | Signature schema version |
| `signedAt` | `string` (datetime) | Yes | When the record was signed |

## Raw Schema

```json
{
  "id": "net.anisota.chronicle.fieldwork",
  "defs": {
    "main": {
      "key": "any",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "questId",
          "track",
          "xpAwarded",
          "completedAt",
          "signature",
          "createdAt"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "description": "Display title of the quest"
          },
          "track": {
            "type": "string",
            "maxLength": 50,
            "description": "Quest track this quest belongs to (e.g. 'field-basics', 'observatory', 'expedition', 'craft')"
          },
          "context": {
            "ref": "#questContext",
            "type": "ref"
          },
          "questId": {
            "type": "string",
            "maxLength": 100,
            "description": "Unique identifier for the quest (e.g. 'first-post'). Matches the record's rkey."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "When the quest record was created"
          },
          "signature": {
            "ref": "#chronicleSignature",
            "type": "ref"
          },
          "xpAwarded": {
            "type": "integer",
            "minimum": 0,
            "description": "XP awarded for completing this quest"
          },
          "completedAt": {
            "type": "string",
            "format": "datetime",
            "description": "When the quest was completed"
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "description": "Description of what was accomplished"
          },
          "retroactive": {
            "type": "boolean",
            "description": "Whether the quest was completed retroactively from existing activity rather than live"
          }
        }
      },
      "description": "Signed quest completion record. rkey is the quest ID (e.g. 'first-post', 'make-camp'). Created once with createRecord when the quest is completed. Immutable."
    },
    "questContext": {
      "type": "object",
      "properties": {
        "level": {
          "type": "integer",
          "minimum": 1,
          "description": "Player level when the quest was completed"
        },
        "appMode": {
          "type": "string",
          "description": "App mode ('story' or 'open') when the quest was completed"
        },
        "totalXP": {
          "type": "integer",
          "minimum": 0,
          "description": "Total XP when the quest was completed"
        }
      },
      "description": "Contextual data at the time of quest completion"
    },
    "chronicleSignature": {
      "type": "object",
      "required": [
        "sig",
        "alg",
        "kid",
        "signedAt",
        "nonce",
        "version"
      ],
      "properties": {
        "alg": {
          "type": "string",
          "description": "Signing algorithm (ES256)"
        },
        "kid": {
          "type": "string",
          "description": "Key identifier for the signing key"
        },
        "sig": {
          "type": "string",
          "description": "Base64-encoded ES256 signature"
        },
        "nonce": {
          "type": "string",
          "description": "Unique random nonce to prevent replay"
        },
        "version": {
          "type": "integer",
          "description": "Signature schema version"
        },
        "signedAt": {
          "type": "string",
          "format": "datetime",
          "description": "When the record was signed"
        }
      },
      "description": "ES256 cryptographic signature proving record authenticity. The signature itself proves legitimacy - no separate verification lexicons needed."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
