---
id: T-1258
name: "RCA: fw context add-learning truncates learnings.yaml (recurrence 3+ in one
  week)"
description: >
  RCA: fw context add-learning truncates learnings.yaml (recurrence 3+ in one week)

status: work-completed
workflow_type: inception
owner: human
horizon:
tags: []
components: [tests/unit/context_decision.bats, tests/unit/context_learning.bats]
related_tasks: []
created: 2026-04-14T22:05:42Z
last_update: '2026-06-11T22:23:43Z'
date_finished: 2026-04-18T22:43:23Z
target_blast_radius: 3   # T-2193 migration default (M=small-subsystem floor)
voi_score: 0.5            # T-2193 migration default (medium)
bvp_scores_proposed:
  - ts: '2026-06-11T22:23:43Z'
    estimator: bvp-estimator-v1-heuristic
    scores:
      D1: 2
      D2: 2
      D3: 2
      D4: 2
      F-RECALL: 2
      F-ORCH: 2
      F3: 2
      F1: 2
      F2: 2
    rationale: D1=2 (no-signal); D2=2 (no-signal); D3=2 (no-signal); D4=2 
      (no-signal); F-RECALL=2 (no-signal); F-ORCH=2 (no-signal); F3=2 
      (no-signal); F1=2 (no-signal); F2=2 (no-signal)
    rubric_sha: e4a00f38e801
---

# T-1258: RCA: fw context add-learning truncates learnings.yaml (recurrence 3+ in one week)

## Problem Statement

`.context/project/learnings.yaml` has been truncated from ~1688 lines (240+ entries) down to 17-24 lines on four separate commits in April 2026. Each truncation required manual restoration from git history (T-1242, T-1254, T-1257). The task name assumes `fw context add-learning` is the culprit, but root cause investigation shows it's a different write path — `add-learning` itself uses safe awk-passthrough.

## Assumptions

- A1: `add-learning` (learning.sh) is NOT the truncation mechanism (appends via awk) — CONFIRMED
- A2: The truncation happens at write-time, not commit-time (existing shrinkage guard is WARN-only) — CONFIRMED
- A3: The same operator is responsible in all four recurrences (agents during task-completion commits) — CONFIRMED by pattern
- A4: A structural PreToolUse hook can prevent recurrence (T-1115/T-1117 pattern)

## Exploration Plan

All spikes executed 2026-04-15 via direct investigation:
- Spike A: Trace add-learning code path (ruled out as cause)
- Spike B: Audit all writers to learnings.yaml across codebase (only consolidate.py, doesn't match schema)
- Spike C: Analyze truncation commit shapes (matches "fresh file rewrite" hypothesis)
- Spike D: Identify which agent action produces the observed output (Write/Edit tool bypass)
- Spike E: Check existing guards (commit-msg hook is WARN-only, advisory)

## Scope Fence

**IN:** RCA root cause, four-layer structural fix proposal (B1-B7), build decomposition, interim workaround
**OUT:** Actual fix (post-GO build tasks), auto-recovery mechanism, migration of other YAML files (B1 covers them as a family)

## Acceptance Criteria

### Agent
- [x] Root cause identified: `tests/unit/context_learning.bats:60-73` destroys real learnings.yaml via PROJECT_ROOT=FRAMEWORK_ROOT redirect + `rm -f` + do_add_learning
- [x] Live reproduction confirmed: bats test → 1709 lines → 10 lines (this session, 20:04Z)
- [x] Same bug-class found in `tests/unit/context_decision.bats:60-73` (would destroy decisions.yaml)
- [x] Evidence documented for 4 truncation commits (41264a3a, 5d90f655, 96cd1080, 4eb23e81) + restoration cycle
- [x] Ruled-out mechanisms documented (add-learning itself, consolidate.py, init.sh heredoc, episodic.sh, completion flow, audit)
- [x] Fix applied: both tests alias FRAMEWORK_ROOT=TEST_TEMP_DIR instead of setting PROJECT_ROOT=FRAMEWORK_ROOT
- [x] Fix verified: 21/21 tests pass, learnings.yaml and decisions.yaml unchanged post-run
- [x] Research artifact updated: `docs/reports/T-1258-add-learning-truncation-rca.md`
- [x] Recommendation section updated (GO with confirmed root cause + structural fix)

### Human
- [x] [REVIEW] Review exploration findings and approve go/no-go decision
  **Steps:**
  1. Run: `fw task review T-1258` (opens Watchtower with recommendation + research artifact link)
  2. Review the Recommendation section and evidence
  3. Record decision via Watchtower form or the command shown alongside the QR code
  **Expected:** Decision recorded, task completed
  **If not:** Ask agent for clarification on specific findings

## Go/No-Go Criteria

**GO if:**
- Root cause identified with bounded fix path
- Fix is scoped, testable, reversible

**NO-GO if:**
- Problem requires fundamental redesign
- Fix cost exceeds benefit given current evidence

## Verification

# For inception tasks, verification is not needed (decisions, not code).

## Recommendation

**Recommendation:** GO (root cause definitively identified and fixed)

**Update 2026-04-15T20:05Z — ROOT CAUSE CONFIRMED:**

The truncation is caused by `tests/unit/context_learning.bats:60-73` (test: "creates first entry with L-001 ID in framework project"). The test explicitly:
1. Saves PROJECT_ROOT
2. Sets `export PROJECT_ROOT="$FRAMEWORK_ROOT"` to simulate "framework mode"
3. Sets `CONTEXT_DIR="$PROJECT_ROOT/.context"`
4. Runs `rm -f "$learnings_file"` on the REAL `.context/project/learnings.yaml` (234 entries destroyed)
5. Creates a fresh file with L-001 = "First learning" and today's date
6. Does NOT restore the file in cleanup

Reproduction:
```
wc -l .context/project/learnings.yaml            # 1709 pre
bats tests/unit/context_learning.bats -f "creates first entry with L-001 ID"
wc -l .context/project/learnings.yaml            # 10 post — DESTROYED
```

The same bug-class exists in `tests/unit/context_decision.bats:60-73` (would destroy decisions.yaml — confirmed by code read).

**Trigger in past sessions:** When the agent runs `bats tests/unit/` or `fw test unit` during a session (e.g., T-1259 added CLAUDECODE tests to lib_inception.bats; full suite runs included context_learning.bats), the framework's real learnings.yaml is destroyed. The agent does not notice; later commits (e.g. 41264a3a) sweep the truncation into git. Matches the EXACT observed shape: L-001 "First learning" unsorted-key format — which is what `do_add_learning` produces on an empty file.

**Fix applied this session:**
- `tests/unit/context_learning.bats:60-76` — test now aliases FRAMEWORK_ROOT to TEST_TEMP_DIR instead of redirecting PROJECT_ROOT to the real framework. id_prefix=L branch still taken, but all writes land in the bats temp dir.
- `tests/unit/context_decision.bats:60-76` — same fix applied (prevents decisions.yaml destruction).

**Verification:**
- Both tests run; learnings.yaml 1709→1709 (unchanged), decisions.yaml 24→24 (unchanged)
- All 21 tests pass (10 learning + 11 decision)
- Commit-history pattern match: 4 prior truncations (41264a3a, 5d90f655, 96cd1080, 4eb23e81) all show the "L-001 First learning unsorted-keys" shape

**Rationale (GO):** Root cause is a 2-line test bug (wrong env var direction). Fix is surgical (~12 lines across 2 test files) and structurally correct — tests now simulate framework mode without touching the real framework. No side effects, no policy changes, no hook needed. This replaces the previous (over-designed) B1-B7 defence-in-depth proposal.

**Evidence:**
- `tests/unit/context_learning.bats:67` (pre-fix) — `rm -f "$learnings_file"` against $FRAMEWORK_ROOT/.context/project/learnings.yaml
- Reproduction: 1709 lines → 10 lines on single bats run (this session)
- Commit 41264a3a shows 1691 deletions from learnings.yaml in a commit that only legitimately touched CLAUDE.md and the T-1257 task file
- 4 separate truncation/restore cycles in 10 days (April 2026) — same failure mode each time
- File format at truncation (unsorted keys, L-001="First learning") matches `do_add_learning` output on empty file — cannot come from any other writer
- `lib/init.sh:288-295` heredoc produces `learnings:` (empty list), not L-001 with "First learning" — rules out init.sh as culprit
- `agents/context/lib/episodic.sh` has NO references to learnings.yaml — rules out generate-episodic

**Research artifact:** `docs/reports/T-1258-add-learning-truncation-rca.md` (to be updated with corrected RCA).

**Original (incorrect) rationales retained below for history:**

**Rationale:** Fourth recurrence confirms the existing WARN-only guard is insufficient. Root cause identified: agents using Write tool directly on learnings.yaml instead of `fw context add-learning`. The write-time PreToolUse hook (B1) closes the gap structurally — agents cannot accidentally overwrite the file; they receive an immediate redirect to the correct command. Same structural pattern as T-1115/T-1117 (block TodoWrite et al.) — proven to work. Layered with commit-msg BLOCK (B3) and invariant test (B4), recurrence is prevented by construction rather than by warning.

**Evidence:**
- `git log --oneline -- .context/project/learnings.yaml | head -15` shows 4 truncation/restore cycles in 10 days
- `agents/context/lib/learning.sh do_add_learning` confirmed correct (awk passthrough preserves entries)
- `.git/hooks/commit-msg:151-172` confirmed WARN-only: `exit 0` after warning message
- `agents/context/consolidate.py:351` is the only other writer, uses sort_keys=False (not matching observed schema)
- `lib/init.sh:294` matches the regenerated L-001 default text "First learning" exactly — confirming the FRESH file hypothesis
- Truncation shape (L-001 with today's date + new L-002) matches "Write tool overwrite, then add-learning appends" — NOT any single code path
- Comprehensive codebase grep found no other production writer producing this schema

**Research artifact:** `docs/reports/T-1258-add-learning-truncation-rca.md` (full investigation trail + B1-B7 build decomposition).

**Interim workaround (until B1-B3 ship):**
> When capturing learnings, ONLY use `fw context add-learning "text" --task T-XXX --source P-001`. NEVER use Write/Edit tools on `.context/project/learnings.yaml` (or patterns.yaml, practices.yaml, decisions.yaml, gaps.yaml).

## Decisions

<!-- Record decisions ONLY when choosing between alternatives.
     Skip for tasks with no meaningful choices.
     Format:
     ### [date] — [topic]
     - **Chose:** [what was decided]
     - **Why:** [rationale]
     - **Rejected:** [alternatives and why not]
-->

## Updates

### 2026-04-14T22:05:42Z — task-created [task-create-agent]
- **Action:** Created task via task-create agent
- **Output:** /opt/999-Agentic-Engineering-Framework/.tasks/active/T-1258-rca-fw-context-add-learning-truncates-le.md
- **Context:** Initial task creation

### 2026-04-15T15:31:24Z — status-update [task-update-agent]
- **Change:** workflow_type: build → inception
- **Reason:** RCA task — inception is the correct workflow type per T-1115/T-1117 pattern

### 2026-04-15T20:05:00Z — ROOT CAUSE CONFIRMED + FIX APPLIED

**Culprit:** `tests/unit/context_learning.bats:60-73` — the test "creates first entry with L-001 ID in framework project" explicitly sets `PROJECT_ROOT=$FRAMEWORK_ROOT` and runs `rm -f "$learnings_file"` against the REAL framework `.context/project/learnings.yaml`, then calls `do_add_learning "First learning"` which creates a fresh L-001 entry with today's date in unsorted-keys format.

**Trigger:** Any `bats tests/unit/` or `fw test unit` invocation from this session or earlier sessions destroys learnings.yaml. The agent does not notice; next `git commit -a` sweeps the truncation into version control.

**Reproduction (this session, 20:04Z):**
- Pre: 1709 lines / 234 entries
- Run: `bats tests/unit/context_learning.bats -f "creates first entry with L-001 ID in framework project"`
- Post: 10 lines / 1 entry — exactly matches 41264a3a commit shape

**Fix:** Applied (both tests) — aliased `FRAMEWORK_ROOT=TEST_TEMP_DIR` instead of redirecting PROJECT_ROOT to the real framework. Same bug-class existed in `tests/unit/context_decision.bats:60-73` for decisions.yaml — fixed in same commit.

**Post-fix verification:**
- All 21 tests pass (10 learning + 11 decision)
- learnings.yaml 1709→1709 (unchanged)
- decisions.yaml 24→24 (unchanged)

**Previously-incorrect Update (2026-04-15T19:15Z) retained below for history:**

### 2026-04-15T19:15:00Z — RCA CORRECTION — reproduced bug live

Previous RCA was WRONG. Root cause is NOT agents using Write/Edit tool.
Reproduced the truncation in real time during this session:

1. Committed T-1262 at 676136a2 (learnings.yaml: 241 entries intact)
2. Ran `bin/fw task update T-1262 --status work-completed`
3. Flow triggered: auto-capture decisions, generate-episodic, fabric refresh
4. After flow completed, learnings.yaml was at 1 entry (L-001, regenerated with today's date)
5. Subsequent `fw fix-learned T-1262` added L-002 on top of the truncation

The completion flow (update-task.sh lines 790-855) is the culprit, NOT any
Write/Edit tool call. Something in:
- `auto-capture decisions from task file` (calls `add-decision` — uses awk, should be safe)
- `generate-episodic` (calls `context.sh generate-episodic` → `lib/episodic.sh`)
- `fabric-enrich` (via fabric.sh)

...rewrites learnings.yaml with just L-001.

Supporting evidence:
- decisions.yaml was ALSO modified: D-001 date updated from 2026-04-13 to 2026-04-15, D-002 appended
- Same "first entry date updated" pattern on both files
- decisions.yaml preserved remaining entries; learnings.yaml did not (because decisions.yaml only had 1 entry, so no loss to measure)

**NEXT-SESSION ACTION:** spike the completion flow (update-task.sh lines 790-855) with strace or by disabling each handler one at a time to identify the truncation line. The B1-B7 structural fix (PreToolUse hook) may still help as defence in depth, but the PRIMARY fix is elsewhere.

Learnings.yaml has been RESTORED (git checkout HEAD) and L-242 added via add-learning. Commit to follow.

### 2026-04-18T22:43:23Z — inception-decision [inception-workflow]
- **Action:** Recorded inception decision
- **Decision:** GO
- **Rationale:** Recommendation: GO (root cause definitively identified and fixed)

Update 2026-04-15T20:05Z — ROOT CAUSE CONFIRMED:

The truncation is caused by `tests/unit/context_learning.bats:60-73` (test: "creates first entry with L-001 ID in framework project"). The test explicitly:
1. Saves PROJECT_ROOT
2. Sets `export PROJECT_ROOT="$FRAMEWORK_ROOT"` to simulate "framework mode"
3. Sets `CONTEXT_DIR="$PROJECT_ROOT/.context"`
4. Runs `rm -f "$learnings_file"` on the REAL `.context/project/learnings.yaml` (234 entries destroyed)
5. Creates a fresh file with L-001 = "First learning" and today's date
6. Does NOT restore the file in cleanup

Reproduction:
```
wc -l .context/project/learnings.yaml            # 1709 pre
bats tests/unit/context_learning.bats -f "creates first entry with L-001 ID"
wc -l .context/project/learnings.yaml            # 10 post — DESTROYED
```

The same bug-class exists in `tests/unit/context_decision.bats:60-73` (would destroy decisions.yaml — confirmed by code read).

Trigger in past sessions: When the agent runs `bats tests/unit/` or `fw test unit` during a session (e.g., T-1259 added CLAUDECODE tests to lib_inception.bats; full suite runs included context_learning.bats), the framework's real learnings.yaml is destroyed. The agent does not notice; later commits (e.g. 41264a3a) sweep the truncation into git. Matches the EXACT observed shape: L-001 "First learning" unsorted-key format — which is what `do_add_learning` produces on an empty file.

Fix applied this session:
- `tests/unit/context_learning.bats:60-76` — test now aliases FRAMEWORK_ROOT to TEST_TEMP_DIR instead of redirecting PROJECT_ROOT to the real framework. id_prefix=L branch still taken, but all writes land in the bats temp dir.
- `tests/unit/context_decision.bats:60-76` — same fix applied (prevents decisions.yaml destruction).

Verification:
- Both tests run; learnings.yaml 1709→1709 (unchanged), decisions.yaml 24→24 (unchanged)
- All 21 tests pass (10 learning + 11 decision)
- Commit-history pattern match: 4 prior truncations (41264a3a, 5d90f655, 96cd1080, 4eb23e81) all show the "L-001 First learning unsorted-keys" shape

Rationale (GO): Root cause is a 2-line test bug (wrong env var direction). Fix is surgical (~12 lines across 2 test files) and structurally correct — tests now simulate framework mode without touching the real framework. No side effects, no policy changes, no hook needed. This replaces the previous (over-designed) B1-B7 defence-in-depth proposal.

Evidence:
- `tests/unit/context_learning.bats:67` (pre-fix) — `rm -f "$learnings_file"` against $FRAMEWORK_ROOT/.context/project/learnings.yaml
- Reproduction: 1709 lines → 10 lines on single bats run (this session)
- Commit 41264a3a shows 1691 deletions from learnings.yaml in a commit that only legitimately touched CLAUDE.md and the T-1257 task file
- 4 separate truncation/restore cycles in 10 days (April 2026) — same failure mode each time
- File format at truncation (unsorted keys, L-001="First learning") matches `do_add_learning` output on empty file — cannot come from any other writer
- `lib/init.sh:288-295` heredoc produces `learnings:` (empty list), not L-001 with "First learning" — rules out init.sh as culprit
- `agents/context/lib/episodic.sh` has NO references to learnings.yaml — rules out generate-episodic

Research artifact: `docs/reports/T-1258-add-learning-truncation-rca.md` (to be updated with corrected RCA).

Original (incorrect) rationales retained below for history:

Rationale: Fourth recurrence confirms the existing WARN-only guard is insufficient. Root cause identified: agents using Write tool directly on learnings.yaml instead of `fw context add-learning`. The write-time PreToolUse hook (B1) closes the gap structurally — agents cannot accidentally overwrite the file; they receive an immediate redirect to the correct command. Same structural pattern as T-1115/T-1117 (block TodoWrite et al.) — proven to work. Layered with commit-msg BLOCK (B3) and invariant test (B4), recurrence is prevented by construction rather than by warning.

Evidence:
- `git log --oneline -- .context/project/learnings.yaml | head -15` shows 4 truncation/restore cycles in 10 days
- `agents/context/lib/learning.sh do_add_learning` confirmed correct (awk passthrough preserves entries)
- `.git/hooks/commit-msg:151-172` confirmed WARN-only: `exit 0` after warning message
- `agents/context/consolidate.py:351` is the only other writer, uses sort_keys=False (not matching observed schema)
- `lib/init.sh:294` matches the regenerated L-001 default text "First learning" exactly — confirming the FRESH file hypothesis
- Truncation shape (L-001 with today's date + new L-002) matches "Write tool overwrite, then add-learning appends" — NOT any single code path
- Comprehensive codebase grep found no other production writer producing this schema

Research artifact: `docs/reports/T-1258-add-learning-truncation-rca.md` (full investigation trail + B1-B7 build decomposition).

Interim workaround (until B1-B3 ship):
> When capturing learnings, ONLY use `fw context add-learning "text" --task T-XXX --source P-001`. NEVER use Write/Edit tools on `.context/project/learnings.yaml` (or patterns.yaml, practices.yaml, decisions.yaml, gaps.yaml).

### 2026-04-18T22:43:23Z — status-update [task-update-agent]
- **Change:** status: started-work → work-completed
- **Reason:** Inception decision: GO

### 2026-04-19T08:56:39Z — inception-decision [inception-workflow]
- **Action:** Recorded inception decision
- **Decision:** GO
- **Rationale:** Recommendation: GO (root cause definitively identified and fixed)

Update 2026-04-15T20:05Z — ROOT CAUSE CONFIRMED:

The truncation is caused by `tests/unit/context_learning.bats:60-73` (test: "creates first entry with L-001 ID in framework project"). The test explicitly:
1. Saves PROJECT_ROOT
2. Sets `export PROJECT_ROOT="$FRAMEWORK_ROOT"` to simulate "framework mode"
3. Sets `CONTEXT_DIR="$PROJECT_ROOT/.context"`
4. Runs `rm -f "$learnings_file"` on the REAL `.context/project/learnings.yaml` (234 entries destroyed)
5. Creates a fresh file with L-001 = "First learning" and today's date
6. Does NOT restore the file in cleanup

Reproduction:
```
wc -l .context/project/learnings.yaml            # 1709 pre
bats tests/unit/context_learning.bats -f "creates first entry with L-001 ID"
wc -l .context/project/learnings.yaml            # 10 post — DESTROYED
```

The same bug-class exists in `tests/unit/context_decision.bats:60-73` (would destroy decisions.yaml — confirmed by code read).

Trigger in past sessions: When the agent runs `bats tests/unit/` or `fw test unit` during a session (e.g., T-1259 added CLAUDECODE tests to lib_inception.bats; full suite runs included context_learning.bats), the framework's real learnings.yaml is destroyed. The agent does not notice; later commits (e.g. 41264a3a) sweep the truncation into git. Matches the EXACT observed shape: L-001 "First learning" unsorted-key format — which is what `do_add_learning` produces on an empty file.

Fix applied this session:
- `tests/unit/context_learning.bats:60-76` — test now aliases FRAMEWORK_ROOT to TEST_TEMP_DIR instead of redirecting PROJECT_ROOT to the real framework. id_prefix=L branch still taken, but all writes land in the bats temp dir.
- `tests/unit/context_decision.bats:60-76` — same fix applied (prevents decisions.yaml destruction).

Verification:
- Both tests run; learnings.yaml 1709→1709 (unchanged), decisions.yaml 24→24 (unchanged)
- All 21 tests pass (10 learning + 11 decision)
- Commit-history pattern match: 4 prior truncations (41264a3a, 5d90f655, 96cd1080, 4eb23e81) all show the "L-001 First learning unsorted-keys" shape

Rationale (GO): Root cause is a 2-line test bug (wrong env var direction). Fix is surgical (~12 lines across 2 test files) and structurally correct — tests now simulate framework mode without touching the real framework. No side effects, no policy changes, no hook needed. This replaces the previous (over-designed) B1-B7 defence-in-depth proposal.

Evidence:
- `tests/unit/context_learning.bats:67` (pre-fix) — `rm -f "$learnings_file"` against $FRAMEWORK_ROOT/.context/project/learnings.yaml
- Reproduction: 1709 lines → 10 lines on single bats run (this session)
- Commit 41264a3a shows 1691 deletions from learnings.yaml in a commit that only legitimately touched CLAUDE.md and the T-1257 task file
- 4 separate truncation/restore cycles in 10 days (April 2026) — same failure mode each time
- File format at truncation (unsorted keys, L-001="First learning") matches `do_add_learning` output on empty file — cannot come from any other writer
- `lib/init.sh:288-295` heredoc produces `learnings:` (empty list), not L-001 with "First learning" — rules out init.sh as culprit
- `agents/context/lib/episodic.sh` has NO references to learnings.yaml — rules out generate-episodic

Research artifact: `docs/reports/T-1258-add-learning-truncation-rca.md` (to be updated with corrected RCA).

Original (incorrect) rationales retained below for history:

Rationale: Fourth recurrence confirms the existing WARN-only guard is insufficient. Root cause identified: agents using Write tool directly on learnings.yaml instead of `fw context add-learning`. The write-time PreToolUse hook (B1) closes the gap structurally — agents cannot accidentally overwrite the file; they receive an immediate redirect to the correct command. Same structural pattern as T-1115/T-1117 (block TodoWrite et al.) — proven to work. Layered with commit-msg BLOCK (B3) and invariant test (B4), recurrence is prevented by construction rather than by warning.

Evidence:
- `git log --oneline -- .context/project/learnings.yaml | head -15` shows 4 truncation/restore cycles in 10 days
- `agents/context/lib/learning.sh do_add_learning` confirmed correct (awk passthrough preserves entries)
- `.git/hooks/commit-msg:151-172` confirmed WARN-only: `exit 0` after warning message
- `agents/context/consolidate.py:351` is the only other writer, uses sort_keys=False (not matching observed schema)
- `lib/init.sh:294` matches the regenerated L-001 default text "First learning" exactly — confirming the FRESH file hypothesis
- Truncation shape (L-001 with today's date + new L-002) matches "Write tool overwrite, then add-learning appends" — NOT any single code path
- Comprehensive codebase grep found no other production writer producing this schema

Research artifact: `docs/reports/T-1258-add-learning-truncation-rca.md` (full investigation trail + B1-B7 build decomposition).

Interim workaround (until B1-B3 ship):
> When capturing learnings, ONLY use `fw context add-learning "text" --task T-XXX --source P-001`. NEVER use Write/Edit tools on `.context/project/learnings.yaml` (or patterns.yaml, practices.yaml, decisions.yaml, gaps.yaml).

## Reviewer Verdict (v1.5)

- **Scan ID:** R-6d5e767a
- **Timestamp:** 2026-06-02T14:56:16Z
- **Catalogue:** v1.3-seed
- **Overall:** CONCERN
- **Needs Human:** yes
- **Findings:** 2

**Per-AC findings:**

- **AC#1 (Agent)** — Root cause identified: `tests/unit/context_learning.bats:60-73` destroys real learnings.yaml via PROJECT_ROOT=FRAMEWORK_ROOT redirect + `rm -f` + do_add_learning
  - **AC-verify-mismatch** (narrow, heuristic) — `path=tests/unit/context_learning.bats in: Root cause identified: `tests/unit/context_learning.bats:60-73` destroys real learnings.yaml via PROJECT_ROOT=FRAMEWORK_ROOT redirect + `rm -f` + do_a`
- **AC#3 (Agent)** — Same bug-class found in `tests/unit/context_decision.bats:60-73` (would destroy decisions.yaml)
  - **AC-verify-mismatch** (narrow, heuristic) — `path=tests/unit/context_decision.bats in: Same bug-class found in `tests/unit/context_decision.bats:60-73` (would destroy decisions.yaml)`

- **Layer-1 escalations:** 1
  1. **destructive-action** (high) — Destructive operation in verification or AC
     - matched: `destroy`
