# add_learning_id_allocator

> Regression test — add-learning ID allocator handles BOTH legacy indented format ('  id: L-XXX') and new dash-prefix format ('- id: L-XXX'). Pre-fix grep for '^- id: L-' missed 234 legacy entries, causing new IDs to collide with historical ones.

**Type:** script | **Subsystem:** tests | **Location:** `tests/unit/add_learning_id_allocator.bats`

**Tags:** `test`, `learning`, `id-allocator`, `T-1369`

## What It Does

T-1369: add-learning ID allocator handles BOTH legacy indented-format
(`  id: L-XXX`, where `- application:` opens the list item) and new
dash-prefix format (`- id: L-XXX`).
Before the fix, grep for `^- id: L-` missed 234 legacy entries, so every
new add-learning call issued an ID that collided with historical IDs.

## Dependencies (3)

| Component | Relationship | Description |
|-----------|--------------|-------------|
| [add-learning](/docs/generated/add-learning) | calls | Add a learning entry to project memory (learnings.yaml). Assigns next L-XXX ID, formats YAML, inserts before candidates section. |
| [learnings-data](/docs/generated/learnings-data) | reads | Persistent store of all project learnings. Read by web UI and audit. Written by add-learning command. |
| [fw](/docs/generated/bin-fw) | tests | Single entry point for all framework operations. Reads .framework.yaml from the project directory to resolve FRAMEWORK_ROOT, then routes commands to the appropriate agent. Supports both in-repo and shared tooling modes. |

---
*Auto-generated from Component Fabric. Card: `tests-unit-add_learning_id_allocator.yaml`*
*Last verified: 2026-04-24*
