# app.studynext.plan

> A study plan with goals, scheduling, and progress tracking. rkey is the client's localId (see the `localId` property below), written via putRecord — this makes a retried push idempotent (a network-timeout retry overwrites the same rkey instead of creating a duplicate) rather than requiring the client to track which pushes already succeeded.

- Kind: record
- Record key: any
- Authority: studynext.app
- Lexicon: 1
- Published by [studynext.app](https://lexicon.garden/identity/did:plc:nstib2qjcu3tyun7cxz4dxcm), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.plan)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.plan/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.plan/analytics)

## Record (`app.studynext.plan`)

Type: record · key any

### Properties

- `accent` (string, required): Accent color (hex code)
  - Constraints: maxLength: 7
- `ankiDeckId` (string): Dedicated flashcard deck id for a 'problem-by-problem' plan. Absent for standard plans; legacy clients drop it on rewrite and current clients restore it from the local copy.
  - Constraints: maxLength: 100
- `baselineDoneUnits` (integer)
  - Constraints: minimum: 0
- `baselineRanges` (array)
  - Constraints: maxLength: 1000
  - `items` (ref)
    - Reference: `#baselineRange`
- `createdAt` (string, required): Plan creation date (YYYY-MM-DD)
- `currentRound` (integer, required): Current round number
  - Constraints: minimum: 1
- `dailyQuota` (integer, required): Daily study quota (units per day)
  - Constraints: minimum: 1
- `deadline` (string): Target completion date (YYYY-MM-DD)
- `difficulty` (string, required): Difficulty level
  - Constraints: knownValues: easy | normal | hard
- `doneUnits` (integer, required): Units already completed
  - Constraints: minimum: 0
- `dynamicDeadline` (string): Auto-calculated deadline date (YYYY-MM-DD), based on pace
- `expectedMinPerUnit` (integer, required): Expected minutes required per unit
- `expectedSecPerUnit` (integer): Expected seconds per unit; optional for legacy records. expectedMinPerUnit remains the rounded minutes projection (minimum 1).
  - Constraints: minimum: 1
- `generateReviewTasks` (boolean): Whether review tasks are auto-generated for this plan (default: true). Only written when explicitly false.
- `isbn` (string): ISBN of the tracked book. The cover image itself is never stored here; it is resolved on-device from this ISBN.
  - Constraints: maxLength: 20
- `isbnRemoved` (boolean)
- `itemSpec` (ref): Problem specification for a 'problem-by-problem' plan (generation source of truth). Absent for standard plans.
  - Reference: `#itemSpec`
- `localId` (string, required): Matches local StudyPlan.id and equals this record's own rkey (see the record-level description above).
  - Constraints: maxLength: 100
- `materialId` (string): Associated material ID if any
  - Constraints: maxLength: 100
- `maxDailyReviewUnits` (integer)
  - Constraints: minimum: 1
- `maxDailyReviewUnitsRemoved` (boolean): 復習上限を明示的に解除した印。旧版端末のフィールド省略と区別する。
- `pdsRkey` (string · tid): Canonical migrated TID rkey. It points to a create-only copy while the legacy source record remains readable.
- `problemTaskSkipDates` (array): Dates (YYYY-MM-DD) on which the synthesized daily task of a 'problem-by-problem' plan was skipped. Absent for standard plans; legacy clients drop it on rewrite and current clients restore it from the local copy.
  - Constraints: maxLength: 400
  - `items` (string)
- `recordOnly` (boolean): Whether this plan is a pure logging material without generated tasks
- `reviewCount` (integer)
  - Constraints: minimum: 1, maximum: 5
- `reviewIntervalDays` (integer)
  - Constraints: minimum: 1
- `reviewLoadBalancing` (boolean): Use review-aware daily study allocation. Absent for legacy plans.
- `short` (string, required): Short title or abbreviation
  - Constraints: maxLength: 150
- `sortOrder` (integer)
- `startUnit` (integer): Starting unit number; zero is allowed for a not-yet-started plan
  - Constraints: minimum: 0
- `status` (string, required): Current plan status
  - Constraints: knownValues: active | paused | completed
- `studyDayWeights` (array)
  - Constraints: minLength: 7, maxLength: 7
  - `items` (integer)
    - Constraints: minimum: 0
- `studyDays` (array, required): Days of week to study (0=Sunday, 6=Saturday)
  - Constraints: maxLength: 7
  - `items` (integer)
    - Constraints: minimum: 0, maximum: 6
- `studyIntervalDays` (integer)
  - Constraints: minimum: 1
- `subjectId` (string): Associated subject ID if any
  - Constraints: maxLength: 100
- `subjectIdRemoved` (boolean): 科目の明示的な解除印。フィールド欠落の旧版レコードと区別する。
- `subjectName` (string): Subject name snapshot
  - Constraints: maxLength: 300
- `targetRounds` (integer, required): Target number of review rounds
  - Constraints: minimum: 1
- `thumbnail` (blob)
  - Constraints: maxSize: 1000000, accept: image/*
- `title` (string, required): Plan title
  - Constraints: maxLength: 600
- `totalUnits` (integer, required): Total number of units to complete
  - Constraints: minimum: 1
- `unit` (string, required): Unit name (e.g., '章', 'pages')
  - Constraints: maxLength: 60
- `updatedAt` (string · datetime, required): Last update timestamp

## #baselineRange (`app.studynext.plan#baselineRange`)

Type: object

### Properties

- `from` (integer, required)
  - Constraints: minimum: 0
- `to` (integer, required)
  - Constraints: minimum: 0

## #itemSegment (`app.studynext.plan#itemSegment`)

Type: object

One chapter segment of a 'problem-by-problem' plan's item spec. Item identity is the (segment, number) pair, so numbering may restart per segment.

### Properties

- `end` (integer, required): Last item number in this segment (inclusive)
  - Constraints: minimum: 0
- `excluded` (array): Item numbers excluded from generation
  - Constraints: maxLength: 100000
  - `items` (integer)
    - Constraints: minimum: 0
- `label` (string, required): Segment label, e.g. a chapter name. May be empty.
  - Constraints: maxLength: 300
- `start` (integer, required): First item number in this segment
  - Constraints: minimum: 0

## #itemSpec (`app.studynext.plan#itemSpec`)

Type: object

Problem specification of a 'problem-by-problem' plan: unit label plus chapter segments.

### Properties

- `segments` (array, required)
  - Constraints: minLength: 1, maxLength: 200
  - `items` (ref)
    - Reference: `#itemSegment`
- `unit` (string, required): Item unit label, e.g. '問' or 'ページ'
  - Constraints: maxLength: 60

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "baselineRange": {
      "properties": {
        "from": {
          "minimum": 0,
          "type": "integer"
        },
        "to": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "from",
        "to"
      ],
      "type": "object"
    },
    "itemSegment": {
      "description": "One chapter segment of a 'problem-by-problem' plan's item spec. Item identity is the (segment, number) pair, so numbering may restart per segment.",
      "properties": {
        "end": {
          "description": "Last item number in this segment (inclusive)",
          "minimum": 0,
          "type": "integer"
        },
        "excluded": {
          "description": "Item numbers excluded from generation",
          "items": {
            "minimum": 0,
            "type": "integer"
          },
          "maxLength": 100000,
          "type": "array"
        },
        "label": {
          "description": "Segment label, e.g. a chapter name. May be empty.",
          "maxLength": 300,
          "type": "string"
        },
        "start": {
          "description": "First item number in this segment",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "label",
        "start",
        "end"
      ],
      "type": "object"
    },
    "itemSpec": {
      "description": "Problem specification of a 'problem-by-problem' plan: unit label plus chapter segments.",
      "properties": {
        "segments": {
          "items": {
            "ref": "#itemSegment",
            "type": "ref"
          },
          "maxLength": 200,
          "minLength": 1,
          "type": "array"
        },
        "unit": {
          "description": "Item unit label, e.g. '問' or 'ページ'",
          "maxLength": 60,
          "type": "string"
        }
      },
      "required": [
        "unit",
        "segments"
      ],
      "type": "object"
    },
    "main": {
      "description": "A study plan with goals, scheduling, and progress tracking. rkey is the client's localId (see the `localId` property below), written via putRecord — this makes a retried push idempotent (a network-timeout retry overwrites the same rkey instead of creating a duplicate) rather than requiring the client to track which pushes already succeeded.",
      "key": "any",
      "record": {
        "properties": {
          "accent": {
            "description": "Accent color (hex code)",
            "maxLength": 7,
            "type": "string"
          },
          "ankiDeckId": {
            "description": "Dedicated flashcard deck id for a 'problem-by-problem' plan. Absent for standard plans; legacy clients drop it on rewrite and current clients restore it from the local copy.",
            "maxLength": 100,
            "type": "string"
          },
          "baselineDoneUnits": {
            "minimum": 0,
            "type": "integer"
          },
          "baselineRanges": {
            "items": {
              "ref": "#baselineRange",
              "type": "ref"
            },
            "maxLength": 1000,
            "type": "array"
          },
          "createdAt": {
            "description": "Plan creation date (YYYY-MM-DD)",
            "type": "string"
          },
          "currentRound": {
            "description": "Current round number",
            "minimum": 1,
            "type": "integer"
          },
          "dailyQuota": {
            "description": "Daily study quota (units per day)",
            "minimum": 1,
            "type": "integer"
          },
          "deadline": {
            "description": "Target completion date (YYYY-MM-DD)",
            "type": "string"
          },
          "difficulty": {
            "description": "Difficulty level",
            "knownValues": [
              "easy",
              "normal",
              "hard"
            ],
            "type": "string"
          },
          "doneUnits": {
            "description": "Units already completed",
            "minimum": 0,
            "type": "integer"
          },
          "dynamicDeadline": {
            "description": "Auto-calculated deadline date (YYYY-MM-DD), based on pace",
            "type": "string"
          },
          "expectedMinPerUnit": {
            "description": "Expected minutes required per unit",
            "type": "integer"
          },
          "expectedSecPerUnit": {
            "description": "Expected seconds per unit; optional for legacy records. expectedMinPerUnit remains the rounded minutes projection (minimum 1).",
            "minimum": 1,
            "type": "integer"
          },
          "generateReviewTasks": {
            "description": "Whether review tasks are auto-generated for this plan (default: true). Only written when explicitly false.",
            "type": "boolean"
          },
          "isbn": {
            "description": "ISBN of the tracked book. The cover image itself is never stored here; it is resolved on-device from this ISBN.",
            "maxLength": 20,
            "type": "string"
          },
          "isbnRemoved": {
            "type": "boolean"
          },
          "itemSpec": {
            "description": "Problem specification for a 'problem-by-problem' plan (generation source of truth). Absent for standard plans.",
            "ref": "#itemSpec",
            "type": "ref"
          },
          "localId": {
            "description": "Matches local StudyPlan.id and equals this record's own rkey (see the record-level description above).",
            "maxLength": 100,
            "type": "string"
          },
          "materialId": {
            "description": "Associated material ID if any",
            "maxLength": 100,
            "type": "string"
          },
          "maxDailyReviewUnits": {
            "minimum": 1,
            "type": "integer"
          },
          "maxDailyReviewUnitsRemoved": {
            "description": "復習上限を明示的に解除した印。旧版端末のフィールド省略と区別する。",
            "type": "boolean"
          },
          "pdsRkey": {
            "description": "Canonical migrated TID rkey. It points to a create-only copy while the legacy source record remains readable.",
            "format": "tid",
            "type": "string"
          },
          "problemTaskSkipDates": {
            "description": "Dates (YYYY-MM-DD) on which the synthesized daily task of a 'problem-by-problem' plan was skipped. Absent for standard plans; legacy clients drop it on rewrite and current clients restore it from the local copy.",
            "items": {
              "type": "string"
            },
            "maxLength": 400,
            "type": "array"
          },
          "recordOnly": {
            "description": "Whether this plan is a pure logging material without generated tasks",
            "type": "boolean"
          },
          "reviewCount": {
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "reviewIntervalDays": {
            "minimum": 1,
            "type": "integer"
          },
          "reviewLoadBalancing": {
            "description": "Use review-aware daily study allocation. Absent for legacy plans.",
            "type": "boolean"
          },
          "short": {
            "description": "Short title or abbreviation",
            "maxLength": 150,
            "type": "string"
          },
          "sortOrder": {
            "type": "integer"
          },
          "startUnit": {
            "description": "Starting unit number; zero is allowed for a not-yet-started plan",
            "minimum": 0,
            "type": "integer"
          },
          "status": {
            "description": "Current plan status",
            "knownValues": [
              "active",
              "paused",
              "completed"
            ],
            "type": "string"
          },
          "studyDayWeights": {
            "items": {
              "minimum": 0,
              "type": "integer"
            },
            "maxLength": 7,
            "minLength": 7,
            "type": "array"
          },
          "studyDays": {
            "description": "Days of week to study (0=Sunday, 6=Saturday)",
            "items": {
              "maximum": 6,
              "minimum": 0,
              "type": "integer"
            },
            "maxLength": 7,
            "type": "array"
          },
          "studyIntervalDays": {
            "minimum": 1,
            "type": "integer"
          },
          "subjectId": {
            "description": "Associated subject ID if any",
            "maxLength": 100,
            "type": "string"
          },
          "subjectIdRemoved": {
            "description": "科目の明示的な解除印。フィールド欠落の旧版レコードと区別する。",
            "type": "boolean"
          },
          "subjectName": {
            "description": "Subject name snapshot",
            "maxLength": 300,
            "type": "string"
          },
          "targetRounds": {
            "description": "Target number of review rounds",
            "minimum": 1,
            "type": "integer"
          },
          "thumbnail": {
            "accept": [
              "image/*"
            ],
            "maxSize": 1000000,
            "type": "blob"
          },
          "title": {
            "description": "Plan title",
            "maxLength": 600,
            "type": "string"
          },
          "totalUnits": {
            "description": "Total number of units to complete",
            "minimum": 1,
            "type": "integer"
          },
          "unit": {
            "description": "Unit name (e.g., '章', 'pages')",
            "maxLength": 60,
            "type": "string"
          },
          "updatedAt": {
            "description": "Last update timestamp",
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "localId",
          "title",
          "short",
          "unit",
          "totalUnits",
          "doneUnits",
          "createdAt",
          "targetRounds",
          "currentRound",
          "dailyQuota",
          "expectedMinPerUnit",
          "difficulty",
          "studyDays",
          "status",
          "accent",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "app.studynext.plan",
  "lexicon": 1
}
```
