CHANGELOG.md

# Changelog

All notable changes to macula-neuroevolution-esdb will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

---

## [0.2.0] - 2025-12-23

### Summary
**Dependency Update** - Align with macula-neuroevolution v0.18.2 release.

### Changed
- Updated macula_neuroevolution dependency to ~> 0.18.2
- Added publish-to-hex.sh script for streamlined releases

---

## [0.1.0] - 2025-12-23

### Summary
**Initial Release** - Bridge library between macula-neuroevolution lineage tracking and erl-esdb-gater.

### Added

#### esdb_lineage_backend.erl
Implementation of `neuroevolution_lineage_events` behaviour with:

- **Fire-and-forget persistence** - `persist_event/2` and `persist_batch/2` return immediately, I/O happens asynchronously via spawned processes
- **Stream routing** - Events automatically routed to streams based on entity type:
  - `individual-{id}` - Birth, death, fitness, mutation events
  - `species-{id}` - Speciation, lineage divergence/merge
  - `population-{id}` - Generation, capacity events
  - `coalition-{id}` - Coalition lifecycle
- **Read operations** - `read_stream/3` for recovery/replay
- **Pub/Sub integration** - `subscribe/3` and `unsubscribe/3` via esdb_channel_server

### Supported Event Types

**Individual Events:**
- Birth: `offspring_born`, `pioneer_spawned`, `clone_produced`, `immigrant_arrived`
- Death: `individual_culled`, `lifespan_expired`, `individual_perished`
- Lifecycle: `individual_matured`, `fertility_waned`
- Fitness: `fitness_evaluated`, `fitness_improved`, `fitness_declined`, `champion_crowned`
- Mutation: `mutation_applied`, `neuron_added`, `neuron_removed`, `connection_added`, `connection_removed`, `weight_perturbed`
- Knowledge: `knowledge_transferred`, `skill_imitated`, `behavior_cloned`, `weights_grafted`, `structure_seeded`, `mentor_assigned`, `mentorship_concluded`
- Epigenetic: `mark_acquired`, `mark_inherited`, `mark_decayed`

**Species Events:**
- `lineage_diverged`, `species_emerged`, `lineage_ended`, `lineage_merged`

**Population Events:**
- `generation_completed`, `population_initialized`, `population_terminated`
- `stagnation_detected`, `breakthrough_achieved`, `carrying_capacity_reached`, `catastrophe_occurred`

**Coalition Events:**
- `coalition_formed`, `coalition_dissolved`, `coalition_joined`

### Dependencies
- macula_neuroevolution ~> 0.18.2
- erl_esdb_gater ~> 0.6.4

---

[Unreleased]: https://github.com/macula-io/macula-neuroevolution-esdb/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/macula-io/macula-neuroevolution-esdb/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/macula-io/macula-neuroevolution-esdb/releases/tag/v0.1.0