---
id: TASK-2.2
title: Improve coverage for config load/schema edge cases
status: Done
assignee:
  - codex
created_date: '2026-02-23 13:34'
updated_date: '2026-02-23 13:59'
labels:
  - tests
  - coverage
dependencies: []
references:
  - src/config/load.rs
  - src/config/schema.rs
parent_task_id: TASK-2
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Add unit tests to cover missing branches/lines in `src/config/load.rs` and any remaining schema edge cases not exercised by current tests.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Coverage increases for config load/schema paths (load errors, overlay edge cases, arg parsing).
- [x] #2 Tests are behavior-driven and avoid shallow line hits.
- [x] #3 Tests remain hermetic (temp dirs only).
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1) Identify remaining untested paths in `src/config/load.rs` and `src/config/schema.rs` (error formatting, overlay behavior with empty RHS, ArgAtom::Many deserialization edge cases).
2) Add hermetic unit tests using temp dirs where needed, focusing on behavior (not shallow line hits).
3) Run `just test` and `just coverage` to confirm improvement.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Plan approved by user on 2026-02-23.

Added schema tests for build/root overlay edge, profile insertion when missing, and ArgAtom::Many deserialization in `src/config/schema.rs`.

Added load error display test in `src/config/load.rs`.

Ran `just test` and `just coverage`. Coverage improved (config/load ~88% regions, schema ~97%), overall now ~85% due to core modules and main.rs.
<!-- SECTION:NOTES:END -->
