# SessionJournal

**Kind:** Class

**Source:** [`atloria-monorepo/libs/agent-core/src/autonomous/session-journal.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/autonomous/session-journal.ts#L53)

## Methods

| Method | Signature | Returns |
|---|---|---|
| `add` | `add(turn: number, type: JournalEntryType, content: string)` | `JournalEntry` |
| `read` | `read()` | `string` |
| `format` | `format()` | `string` |
| `cleanup` | `cleanup()` | `void` |
| `getGoal` | `getGoal()` | `string` |
| `count` | `count()` | `number` |
| `getAll` | `getAll()` | `readonly JournalEntry[]` |
| `getFilePath` | `getFilePath()` | `string` |

## Where it refuses work

- `SessionJournal` stops the work with an early return when `fs.existsSync(this.filePath)`.
- `SessionJournal` stops the work with an early return when `this.entries.length === 0`.

## When something fails

- `SessionJournal` handles failure in 3 places: it discards it silently in all 3.
