Vote for your favorite SkillMD. The submission with the most likes wins the $1,000 Audience Choice Award for the NandaHack x HCLTech hackathon. Voting is open through September 25.Vote now →
in reviewhumanPR #76Memory

geick: typed CRDT memory for concurrent agent writes

This submission adds a typed_crdt memory plugin for problem 02, concurrent memory under unreliable delivery.

Author

Status
In review
Opened on
Jul 7
Branch
hackathon/memory-bouncer

Description

The pitch.

## Summary

This submission adds a `typed_crdt` memory plugin for problem 02, concurrent memory under unreliable delivery.

The default `blackboard` memory plugin uses last-writer-wins behavior, so concurrent writes to the same key can overwrite each other depending on message delivery order. This plugin makes memory writes self-describing with a `type` field and merges them using deterministic CRDT-style behavior.

Supported memory types:

- `set`: unions tagged facts/items
- `counter`: keeps the maximum count per writer and derives a total
- `vote`: preserves one ballot per writer and derives a deterministic majority result

If two writes use different types for the same key, the plugin rejects the merge instead of silently corrupting memory.

## Files changed

- Added `TypedCrdtMemory`
- Registered the plugin as `memory: typed_crdt`
- Added validator showing blackboard is order-dependent while typed CRDT memory converges
- Added pytest coverage
- Added README documentation

## Validation

I ran the required local CI sequence:

```powershell
uv sync
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest -v

Results:

uv sync passed
ruff check passed
ruff format --check passed
pyright passed with 0 errors
Full pytest suite passed

I also ran the typed CRDT validator:

python3 validators\validate_typed_crdt_memory.py

The validator shows:

blackboard fails convergence as expected
typed_crdt passes set convergence
typed_crdt passes counter convergence
typed_crdt passes vote convergence

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/76/head:pr-76
git checkout pr-76