---
id: TASK-10.3
title: Raise coverage for config loading and CLI parsing
status: Done
assignee:
  - codex
created_date: '2026-02-26 12:52'
updated_date: '2026-02-26 13:08'
labels: []
dependencies: []
references:
  - src/config/load.rs
  - src/core/cli.rs
  - src/config/schema.rs
parent_task_id: TASK-10
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Add targeted unit tests to cover remaining untested branches in config loading and CLI parsing.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 `just coverage` reports >=90% line coverage for `src/config/load.rs` and `src/core/cli.rs`.
- [x] #2 Tests cover error handling and edge cases for config parsing and CLI option combinations.
- [x] #3 No changes to CLI surface or config schema; tests only.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
Plan:
1) Review existing tests in `src/config/load.rs` and `src/core/cli.rs` to identify uncovered branches.
2) Add small, hermetic unit tests for error formatting and CLI argument combinations without changing CLI or schema behavior.
3) Run `just coverage` to confirm both files reach >=90% line coverage; then `just test`.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added tests in `src/config/load.rs` for error sources, parsing project fields, and cleaned temp dir reuse; added CLI alias/defaults coverage in `src/core/cli.rs`. `just coverage` now reports `src/config/load.rs` line coverage 96.25% and `src/core/cli.rs` line coverage 91.92%.
<!-- SECTION:NOTES:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Expanded tests in `src/config/load.rs` to cover error sources, project field parsing, and temp dir cleanup; added CLI alias/default parsing coverage in `src/core/cli.rs`. `just coverage` now shows 96.25% line coverage for `src/config/load.rs` and 91.92% for `src/core/cli.rs`.

Tests: `just coverage`
<!-- SECTION:FINAL_SUMMARY:END -->
