# Import a complete organization run

The animation and Inspector can read a portable static replay package. Import an
existing run by giving the exporter its full directory path (or its `replay.json`
path). The exporter reads recorded JSON; it does not execute a checkpoint, call
a model, or rerun an experiment.

From the `relic-website` checkout in PowerShell:

```powershell
python scripts/export-organization-replay.py `
  'C:\Users\18201\OneDrive\Documents\ChatGPT\relic-website\.research\main-replay-sources\20260809-120000_org_bl3_b3_seed1401_llm' `
  --out public/replay/cases/my-organization-run `
  --id my-organization-run `
  --variant B3 `
  --title-en 'My recorded organization run' `
  --title-zh '我的组织运行存档'
```

With the website running locally, open:

```text
http://localhost:5173/relic/replay/index.html?manifest=/relic/replay/cases/my-organization-run/manifest.json
```

The package can also be selected by its manifest URL in the Experience page's
replay loader. A browser cannot read arbitrary local disk paths from a URL:
the local exporter converts the filesystem path into files served by the site.

To put a run in the case selector, add its ID, bilingual title/description,
relative manifest path, tick range, category (`main`, `transfer` or `guided`)
and `inspector: true` to
`public/replay/cases/catalog.json`. Importing does not publish or deploy it.

## Input and coverage

- Required: `replay.json`, either a native `org-delta-v1` envelope or legacy
  `{ "frames": [...] }` snapshots with unique increasing integer ticks.
- Optional sibling files: `meta.json`, `experiment_run_record.json`,
  `summary.txt`, `organizational_capability_evidence.json`, and final evaluator
  JSON under `evaluations/`.
- `summary.txt` supplies recorded member action verbs. If absent, the Inspector
  still has its snapshots but the exporter marks actions as unavailable; it
  does not invent animation movements.
- The manifest lists every retained tick and every missing tick. A sparse
  archive stays sparse. The Inspector refuses requests for an absent exact
  snapshot. No final-state fallback fills earlier ticks.
- T0 is the retained initial state; T1 onward are work ticks. The included
  main and transfer cases retain T0–T336 (337 exact snapshots), not 337 work rounds.
- Private checkpoint pickle files are intentionally unsupported. Use an
  existing JSON replay export. Archives lacking one cannot acquire missing
  historical workspaces from a final snapshot.

## Included cases

| Package | Source run | Identity |
| --- | --- | --- |
| `mini-blobstore-main-b3-1401` | `20260809-120000_org_bl3_b3_seed1401_llm` | Main experiment; Mini Blobstore; B3; seed 1401; default case |
| `cattrs-main-b3-1401` | `20260809-024653_org_cattrs_b3_all_b3_seed1401_llm` | Main experiment; cattrs; B3; seed 1401 |
| `mini-blobstore-f-exec-1401` | `20260830-020355_org_baseline_F_Exec_b3_seed1401_llm` | Mini Blobstore; F_Exec; fresh roster; inherited executable protocols; seed 1401 |
| `mini-blobstore-r-exec-1401` | `20260829-182928_org_baseline_R_Exec_b3_seed1401_llm` | Mini Blobstore; R_Exec; retained roster; inherited executable protocols; seed 1401 |

The first two are complete main-experiment archives. Their run metadata and
summary headers record GPT-5.6 Terra and LLM-driven actions. Their original
native replays were recovered from
`ubuntu24_root_livedagents_log_20260911.tar` into the website's ignored research
directory. Their exact source run IDs match the main matrix cells
`mini_blobstore_v1|B3|1401` and `cattrs_v2510_to_v2610|B3|1401`.

The last two are completed capability-transfer archives with GPT-5.6 Terra
cognition and policy-selected actions. They test previously formed executable protocols
under new versus original membership and are shown under additional cases.
They are not additional main-experiment conditions or newly executed model runs.
The original DeepSeek cattrs animation remains
its own case, with its existing guided chapters; that compact package does not
contain a complete historical workspace archive.

## Package contract

`manifest.json` has schema `relic-organization-replay-v1`:

```json
{
  "id": "my-organization-run",
  "identity": { "run_id": "exact-source-run-folder", "workload": "mini_blobstore_v1", "variant": "B3", "seed": 1401 },
  "ticks": { "first": 0, "last": 336, "count": 337, "available": [0, 1, 2], "missing": [], "complete": true },
  "animation": "animation.json",
  "detail": "detail.json",
  "inspector": {
    "format": "relic-observer-delta-v1",
    "trace": "inspector/trace.json.gz",
    "trace_format": "relic-shared-trace-v1",
    "trace_encoding": "gzip",
    "index": "inspector/index.json"
  }
}
```

The example truncates `available` for readability; real manifests list all
ticks. Paths resolve relative to the JSON file that declares them.

`animation.json` retains recorded per-tick actions and checkpoint counts.
`detail.json` retains messages and compact task/protocol histories. Its task and
protocol `versions` are dated exact snapshot values, so a later title, owner or
rule amendment need not appear at an earlier tick.

`detail.mechanism_events` contains all recorded proposal, adoption, use,
amendment and enforcement events. Each item carries its original tick,
protocol ID, event ID, actor and context. `blocked` is true only if the source
record explicitly sets `data.blocked` to true. `action_type` remains null when
the archive does not name an action; the exporter does not guess one from a
room, actor or operation count. Equal records within one tick can be grouped
with `count` and `event_ids` while retaining their original identity.

The recorded metadata fields remain distinguishable: `llm_drives_actions` is
copied from the run's `meta.json`, while `action_selection_mode` comes from the
native replay metadata. The older main-run archives retain `profile_policy` in
that latter field even though their run metadata and summary say actions were
LLM-driven. These are preserved source fields, not a retroactive relabeling of
the run.

The Inspector trace contains the existing frontend's `organization.agents`,
`tasks`, `proposals`, `protocols`, `artifacts`, episodes, current events and
governance events. It uses a shared-record dictionary to avoid repeating large
episode histories hundreds of times. Decode `relic-shared-trace-v1` with
`hydrateInspectorTrace()` from `public/replay/observer-archive.js`.

The observer index groups exact member workspaces, local files, repository
mainline files, branches, commits, pull requests, checks and patches into
24-tick gzip chunks. Large chunks use the same shared-record dictionary as the
trace; call `hydrateInspectorTrace()` before applying the delta codec. Both
plain and shared chunks decode into an `org-delta-v1` packet:

- `base`: full observer projection at the chunk's first tick.
- `ticks`: all exact ticks represented in the chunk.
- `deltas`: one structural change per later tick.
- Delta operations: `["=", value]` replaces; `["a", items]` appends;
  `["d", {key: childDelta}, [deletedKeys]]` patches an object; `null` is unchanged.

`openObserverArchive(archive).loadFrame(tick)` validates both tick and run
identity and keeps at most four decoded chunks. Observer chunks preserve the
original projection's complete allowed file contents; the code does not rerun
or reconstruct unrecorded work.

## Publication and source boundaries

The source run directories are read only. Exported member identities use
`los_xi` / `Losxi` throughout, including references and file content. The
exporter omits private reflections, raw model conversations, credentials,
private transport configuration, restricted paths and derived native
graphs/logs/timeline. The manifest states the source recorder's keyframe
interval for those omitted derived sections. Member/repository projections are
from the exact retained tick.

The exporter refuses to write into the input archive. It also refuses a
nonempty output directory unless `--overwrite` is supplied. `--chunk-size`
controls observer grouping (1–96; default 24). `--review-snapshots <directory>`
can optionally save local QA projections for T0, T168 and T336.
