# `.context/`

This directory is Remaind's local context substrate for a single project.

It is the durable state of long-running agent work: an append-only raw event
log, derived working state, a compact handover, schemas, configs, and (at
runtime) a SQLite memory index plus large-output artifacts.

## Layout

```
.context/
  README.md
  CONTRACT.md
  active/
    state.json         derived working state
    handover.md        compact continuity document
  logs/
    events.jsonl       append-only raw timeline (source of truth)
  schemas/
    event.schema.json
    state.schema.json
    memory.schema.json
    validation.schema.json
    thresholds.yaml
    redaction.yaml
    tools.yaml
    migrations/
      state/           write-time state migrations
      events/          read-time event adapters
```

Runtime-created (git-ignored): `active/resume_packet.md`,
`active/history/`, `db/context.sqlite`, `artifacts/`.

## Authority order

When sources disagree, resolve in this order:

1. Latest explicit user instruction
2. Raw event log (`logs/events.jsonl`)
3. `active/state.json`
4. `active/handover.md`
5. Derived memories

See `CONTRACT.md` for the full contract.
