Canon Boundary Guard tracks session context in a JSON state file. This guide explains the state model, how to keep state durable across ChatGPT sessions, and how to recover when the state is unavailable. Understanding the state lifecycle is essential for any session longer than a single conversation.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xxyoudeadpunkxx/canon-boundary-guard-for-gpt-project/llms.txt
Use this file to discover all available pages before exploring further.
The working state file
Canon Boundary Guard maintains a working copy of the session state at/mnt/data/_SESSION_STATE.json. This file is written and updated during the session but is not durable by itself — when the chat ends or the file runtime resets, it is gone.
The schema-minimal shape of a SESSION_STATE object is:
This is the schema-minimal shape only — it is not a valid first-install template. After bootstrap,
active_l0_sources must contain entries for every inspected bootstrap surface. A state file with an empty active_l0_sources array is not a completed first-install state.canon-boundary-guard-gpt/schemas/SESSION_STATE.schema.json. Use scripts/validate_state.py to validate a state file against this schema.
First-install state creation
The first-install rule controls when a new working state may be initialised. ChatGPT may create a new state at/mnt/data/_SESSION_STATE.json only when:
- The operator explicitly declares a fresh install, or
- The current task is the initial bundle installation and there is no prior-state claim.
canon-boundary-guard-gpt/SKILL.mdcanon-boundary-guard-gpt/references/protocol.mdcanon-boundary-guard-gpt/references/gpt-project-adapter.mdcanon-boundary-guard-gpt/references/state-and-recovery.mdcanon-boundary-guard-gpt/schemas/SESSION_STATE.schema.json
active_l0_sources must be populated with an entry for each inspected bootstrap surface. Each entry records only the surface that was actually inspected in this session — not the whole bundle. If scripts/validate_state.py is available, the created state must be validated before it is treated as available.
The initialized state at /mnt/data/_SESSION_STATE.json is working state only. It becomes durable only after explicit export and re-upload, or after a Project Source save through the simulated gate.
Making state durable
- Download and re-upload
- Save as Project Source
- Keep a CANON_STATE_DELTA
At the end of a session, ask ChatGPT to make the current Save the file locally. At the start of the next session, upload it as a file attachment before your first message. ChatGPT will detect it during Status Check and use it to restore context.This is the simplest option and works even without Projects access.
SESSION_STATE.json available as a download:CANON_STATE_DELTA
ACANON_STATE_DELTA is a self-contained snapshot delta emitted after every Mode B or Mode C state-changing decision. It is the primary unit of portable state.
A valid CANON_STATE_DELTA must include all of the following fields:
| Field | Description |
|---|---|
type | Always CANON_STATE_DELTA. |
seq | Monotonically increasing sequence number relative to the session. |
timestamp | ISO-8601 timestamp of the delta. |
basis | Reference to the SESSION_STATE state_seq this delta was computed from. |
decision | Human-readable description of the state-changing decision. |
current_state | Full SESSION_STATE object at the time of the delta, validating against SESSION_STATE.schema.json. |
operator_action_required | Boolean — whether operator approval is still pending. |
current_state object, cannot be used to restore session context. ChatGPT will reject it as a recovery source and treat it as L1 text only.
Validate deltas against canon-boundary-guard-gpt/schemas/CANON_STATE_DELTA.schema.json using scripts/validate_state.py.
Recovery mode
If this is not a fresh install and no valid SESSION_STATE is available, ChatGPT enters read-only recovery mode. This applies when the state file is missing, cannot be validated, or when a supplied CANON_STATE_DELTA is invalid.- Allowed in recovery mode
- Forbidden in recovery mode
- Inspect Project Sources
- Inspect uploaded files
- List which state is missing and why
- Explain recovery options to the operator
- Prepare a recovery plan
Accepted recovery sources
ChatGPT accepts exactly three sources for exiting recovery mode:- Uploaded
SESSION_STATE.json— a previously exported state file uploaded as a file attachment. ChatGPT validates it against the schema before restoring. - Pasted
CANON_STATE_DELTAwith validcurrent_state— the full delta block pasted in chat. Thecurrent_stateobject must be complete and schema-valid. - Explicit operator reconstruction marked as L1A — the operator explicitly authorises a reconstruction from available evidence, and the result is recorded as an L1A delta in the current turn.
Invalid delta behavior
When a supplied CANON_STATE_DELTA is found to be invalid — missing required fields, failing schema validation, or containing only differential data without a fullcurrent_state — ChatGPT will:
- Reject the delta as a recovery source.
- Treat the pasted block as L1 recovery text only — available for reference but not admitted as state.
- Not reconstruct state from the invalid delta unless the operator explicitly authorises an L1A reconstruction.
SESSION_STATE Schema
Full JSON Schema reference for the SESSION_STATE object, including all required fields and enum values.
CANON_STATE_DELTA Schema
Full JSON Schema reference for CANON_STATE_DELTA, including delta metadata and current_state requirements.