The `DecisionLedger.append` operation in the AI agent's memory system, specifically its non-atomic read-modify-write behavior leading to data loss under concurrency.
Raw Developer Origin & Technical Request
GitHub Issue
Sep 6, 2026
# DecisionLedger.append is a non-atomic read-modify-write
**Severity:** Medium
**File:** `packages/core/src/agent_memory/core/ledger.py:63`
`append()` reads the entire ledger file, appends one line, and writes the whole thing
back. Two concurrent `sleep` processes (or a `sleep` and a `decide` CLI call) can both
read the same content, each append their own decision, and the second write silently
drops the first decision. The file-level `store_lock` in `Store.write()` does not cover
the ledger, which lives under `dream_reports/`, not the truth directories.
```python
def append(self, decision: Decision) -> Decision:
self._path.parent.mkdir(parents=True, exist_ok=True)
head = self._path.read_text(encoding="utf-8") if self._path.exists() else HEADING + "\n\n"
self._path.write_text(head + decision.render() + "\n", encoding="utf-8")
return decision
```
### Why it matters
The ledger is truth, not cache (its own docstring says so). Losing a rejection verdict
means the same proposal re-appears on the next sleep and may get accepted by a reasoner
that sees it for the first time — the operator's explicit refusal is silently forgotten.
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from tigerless-labs/agent-memory.
Frequently Asked Questions
Market intelligence mapped to The `DecisionLedger.append` operation in the AI agent's memory system, specifically its non-atomic read-modify-write behavior leading to data loss under concurrency..
What problem does The `DecisionLedger.append` operation in the AI agent's memory system, specifically its non-atomic read-modify-write behavior leading to data loss under concurrency. solve?
Which technical concepts are associated with The `DecisionLedger.append` operation in the AI agent's memory system, specifically its non-atomic read-modify-write behavior leading to data loss under concurrency.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like non-atomic read-modify-write and Severity: Medium by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics