> ## Documentation Index
> Fetch the complete documentation index at: https://engineering.datarelay.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Session Continuity

> How GitHub AI Work Packets and Cursor /resume replace giant handoffs and repeated prompt copy/paste.

# Session continuity

The system treats chat history as temporary workspace.

Active engineering state is kept in a small GitHub Issue called an **AI Work Packet**.

## Why this was needed

```mermaid theme={null}
flowchart LR
    subgraph BEFORE["Before"]
      A1["Long ChatGPT conversation"] --> A2["Giant Cursor prompt"]
      A2 --> A3["Copy Cursor result"]
      A3 --> A4["Giant ChatGPT handoff"]
      A4 --> A5["New conversation"]
    end

    subgraph AFTER["Now"]
      B1["ChatGPT"] --> B2["GitHub AI Work Packet"]
      B2 --> B3["Cursor /resume"]
      B3 --> B2
      B2 --> B4["ChatGPT continues"]
    end
```

The earlier loop consumed tokens and required repeated manual copy/paste. The current loop keeps resumable state in the repository-scoped Work Packet.

## One packet per workstream

A repository can have several independent active workstreams.

Examples:

```text theme={null}
[AI Work] v2.4.0 Release Closure
[AI Work] Website Refresh
[AI Work] Connector Expansion
```

A Work Packet is not a project diary. It is a current-state record.

## Required identity

```text theme={null}
PACKET_VERSION=1
TARGET_REPO=owner/repository
WORKSTREAM=stable-slug
STATUS=ACTIVE|PAUSED|BLOCKED|COMPLETE
BRANCH=branch-name|N/A
LAST_VERIFIED_HEAD=sha
```

Its main sections are:

```text theme={null}
Goal
Current State
Next Action
Constraints
Canonical References
Latest Evidence
Blockers
```

## Packet lifecycle

```text theme={null}
ACTIVE   -> open Issue
PAUSED   -> open Issue
BLOCKED  -> open Issue
COMPLETE -> close Issue
```

A new independent workstream gets a new Issue. A new chat window does not.

Do not create a central cross-project handoff repository. The product repository is the namespace boundary for its own Work Packets.

## Fail-closed resume

```mermaid theme={null}
flowchart TD
    A["Resolve Repository"] --> B["Resolve Branch"]
    B --> C["Search open [AI Work] Issues"]
    C --> D{"Exactly one ACTIVE match?"}
    D -- "Yes" --> E["Re-verify HEAD / Dirty / PR / CI"]
    E --> F["Execute Next Action"]
    D -- "Zero or multiple" --> G["STOP / Ask minimum clarification"]
```

Cursor and ChatGPT do not guess when the current workstream is ambiguous.

The resolver first determines the repository, then requires the matching active packet. If there are zero or multiple valid matches, it stops and asks for the minimum clarification needed.

LAST\_VERIFIED\_HEAD is advisory only. Current Git state must always be rechecked.

## Why GitHub Issue instead of HANDOFF.md

Updating a committed handoff file changes the product source HEAD.

For release candidates that require exact-HEAD qualification, that can invalidate evidence.

Updating an Issue preserves the qualified source revision.

## Conversation handoff

When a chat becomes too long, no special Handoff Issue is created and no giant continuation prompt is required.

The active Work Packet is updated, and the next conversation can begin with a short request such as:

```text theme={null}
DRLink 계속
```

The new conversation reloads the active Work Packet and current GitHub state instead of replaying the old chat.
