---
id: TASK-10.2
title: Improve unit tests for core configuration resolution
status: Done
assignee:
  - codex
created_date: '2026-02-26 12:52'
updated_date: '2026-02-26 13:01'
labels: []
dependencies: []
references:
  - src/core/config.rs
  - src/config/schema.rs
  - src/config/load.rs
  - tests/integration_tests.rs
parent_task_id: TASK-10
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Increase test coverage in configuration resolution and selection logic to reduce untested branches in `core/config.rs`.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 `just coverage` reports >=90% line coverage for `src/core/config.rs`.
- [x] #2 Tests exercise both success and error outcomes for configuration discovery and profile selection.
- [x] #3 No CLI/config behavior changes; only tests are added or adjusted.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
Plan:
1) Extend `src/core/config.rs` tests to cover `discover` (Init/Boards bypass, missing config), `find_upwards` hit/miss, `select_profile` when no profiles and default missing fallback, and `resolve_single` branches for Init/Boards and args merging.
2) Add helper builders for temp project roots + `Cli` variants inside the existing test module.
3) Run `just coverage` to confirm `src/core/config.rs` line coverage >=90%, then `just test`.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added tests in `src/core/config.rs` covering `discover` init/boards bypass and missing config, `find_upwards` hit/miss, `select_profile` no profiles and default fallback, `resolve_single` init-without-board and phase args merge, and `resolve_all` no-profiles path. `just coverage` now reports `src/core/config.rs` line coverage 94.34%.
<!-- SECTION:NOTES:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Expanded `src/core/config.rs` unit tests to cover discovery success/error paths, upward search hits/misses, profile selection edge cases, init/boards board handling, phase argument merging, and resolve-all without profiles. `just coverage` now shows 94.34% line coverage for `src/core/config.rs`.

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