---
id: TASK-19
title: Add unit tests for uncovered functions from coverage report
status: Done
assignee:
  - codex
created_date: '2026-02-27 10:35'
updated_date: '2026-02-27 10:44'
labels: []
dependencies: []
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Run `just coverage`, identify functions with 0 coverage, and add unit tests to raise function coverage above 90% without regressing existing behavior. Focus on real functions (not generic instantiation artifacts) in config/cmd/exec modules.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 `just coverage` shows function coverage >90% and no new regressions in line/region coverage
- [x] #2 New unit tests cover previously missed functions listed by the latest coverage report
- [x] #3 Tests pass via `just test`
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
- Run `just coverage` and capture the missed-function list.
- Parse coverage report to identify real missed functions (skip generic instantiation artifacts).
- Add unit tests targeting those functions in `src/config`/`src/core` modules.
- Re-run `just coverage` and `just test`; iterate until functions/lines/regions all >90%.
- Update task notes and check acceptance criteria.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Ran `just coverage`: functions 96.67%, lines 96.99%, regions 95.85%. Missed functions reduced to 6 overall; new tests cover default build root + error conversions/Display/Source paths.

Ran `just test` (nextest) all 83 tests passed.
<!-- SECTION:NOTES:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Added targeted unit tests to cover previously missed functions: default build root deserialization in `BuildCfg`, KazeError conversion paths, and Config/Resolve error display/source handling. Coverage now exceeds 90% for functions/lines/regions (96.67% functions, 96.99% lines, 95.85% regions). Tests: `just coverage`, `just test`.
<!-- SECTION:FINAL_SUMMARY:END -->
