# social.dracome.library.goal

> Published by [dracome.social](https://lexicon.garden/identity/did:plc:66dyrt2bmghwlmdteyizs5l3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:66dyrt2bmghwlmdteyizs5l3/social.dracome.library.goal)
- [Documentation](https://lexicon.garden/lexicon/did:plc:66dyrt2bmghwlmdteyizs5l3/social.dracome.library.goal/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:66dyrt2bmghwlmdteyizs5l3/social.dracome.library.goal/examples)

## Definitions

### `social.dracome.library.goal`

**Type**: `record`

A repeatable consumption-goal record for an actor, targeting a metric over a half-open time period `[periodStart, periodEnd)` (periodStart is inclusive, periodEnd is exclusive). Fulfillment progress against the goal is not stored on this record — it is computed at read time by filtering the actor's `library.state` records that fall within the period, per the metric named in `metric`.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes | Canonical UTC instant serialized as ISO 8601 with a trailing Z suffix. |
| `formatScope` | `ref` → `social.dracome.library.defs#goalFormatScope` | No | Optional restriction of this goal to one format category (e.g. only audiobooks). Unset means the goal counts consumption of all formats. Only meaningful when `metric` is `completed_state_count` — never populated alongside a sum metric. |
| `metric` | `ref` → `social.dracome.library.defs#goalMetric` | Yes | The consumption metric this goal targets. |
| `periodEnd` | `string` (datetime) | Yes | Canonical UTC instant marking the exclusive end of the goal's period `[periodStart, periodEnd)`, serialized as ISO 8601 with a trailing Z suffix. |
| `periodLabel` | `string` | No | Optional free-text label for the goal's period (e.g. '2026 Reading Challenge'), for display only. Not used to compute the period boundaries — periodStart/periodEnd remain authoritative. |
| `periodStart` | `string` (datetime) | Yes | Canonical UTC instant marking the inclusive start of the goal's period, serialized as ISO 8601 with a trailing Z suffix. |
| `targetValue` | `integer` | Yes | The target value to reach for `metric` within the goal's period. The maximum is 999,999 hours expressed in seconds (999999 * 3600) — the field is not per-metric here, so it is bounded to the widest unit's ceiling; `completed_state_count`/`page_count_sum` goals are additionally capped at 999,999. |
| `updatedAt` | `string` (datetime) | No | Canonical UTC instant serialized as ISO 8601 with a trailing Z suffix. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A repeatable consumption-goal record for an actor, targeting a metric over a half-open time period `[periodStart, periodEnd)` (periodStart is inclusive, periodEnd is exclusive). Fulfillment progress against the goal is not stored on this record — it is computed at read time by filtering the actor's `library.state` records that fall within the period, per the metric named in `metric`.",
      "key": "tid",
      "record": {
        "properties": {
          "createdAt": {
            "description": "Canonical UTC instant serialized as ISO 8601 with a trailing Z suffix.",
            "format": "datetime",
            "type": "string"
          },
          "formatScope": {
            "description": "Optional restriction of this goal to one format category (e.g. only audiobooks). Unset means the goal counts consumption of all formats. Only meaningful when `metric` is `completed_state_count` — never populated alongside a sum metric.",
            "ref": "social.dracome.library.defs#goalFormatScope",
            "type": "ref"
          },
          "metric": {
            "description": "The consumption metric this goal targets.",
            "ref": "social.dracome.library.defs#goalMetric",
            "type": "ref"
          },
          "periodEnd": {
            "description": "Canonical UTC instant marking the exclusive end of the goal's period `[periodStart, periodEnd)`, serialized as ISO 8601 with a trailing Z suffix.",
            "format": "datetime",
            "type": "string"
          },
          "periodLabel": {
            "description": "Optional free-text label for the goal's period (e.g. '2026 Reading Challenge'), for display only. Not used to compute the period boundaries — periodStart/periodEnd remain authoritative.",
            "maxGraphemes": 64,
            "maxLength": 256,
            "type": "string"
          },
          "periodStart": {
            "description": "Canonical UTC instant marking the inclusive start of the goal's period, serialized as ISO 8601 with a trailing Z suffix.",
            "format": "datetime",
            "type": "string"
          },
          "targetValue": {
            "description": "The target value to reach for `metric` within the goal's period. The maximum is 999,999 hours expressed in seconds (999999 * 3600) — the field is not per-metric here, so it is bounded to the widest unit's ceiling; `completed_state_count`/`page_count_sum` goals are additionally capped at 999,999.",
            "maximum": 3599996400,
            "minimum": 1,
            "type": "integer"
          },
          "updatedAt": {
            "description": "Canonical UTC instant serialized as ISO 8601 with a trailing Z suffix.",
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "metric",
          "targetValue",
          "periodStart",
          "periodEnd",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "social.dracome.library.goal",
  "lexicon": 1
}
```
