---
id: TASK-21.2
title: Update config resolution + command args to use project.args
status: Done
assignee:
  - codex
created_date: '2026-02-27 18:15'
updated_date: '2026-02-27 18:38'
labels: []
dependencies: []
references:
  - src/core/config.rs
  - src/core/cmd.rs
parent_task_id: TASK-21
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Update `ResolvedConfig` arg derivation and command handlers to use `project.args` as the global layer before profile args, and ensure CLI extras append per command. Remove any references to top-level args.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 ResolvedConfig phase args built from `project.args` then profile args
- [x] #2 Command handlers append CLI extras for the active command only
- [x] #3 No references to top-level `args` remain in code
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
- Update `ResolvedConfig` arg derivation to use `cfg.project.args` as the global layer and verify no leftovers.
- Update command dispatch/handlers so CLI `--` extras append only for the active phase (conf/build/flash/run).
- Confirm no remaining references to top-level `[args]`/`cfg.args`.
- Run `just check`.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Updated command dispatch to merge resolved config args with CLI extras per phase (conf/build/flash/run) via `merge_args`. Verified no remaining top-level `args` references outside legacy rejection in load tests. `just check` passes.
<!-- SECTION:NOTES:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Updated command dispatch to merge resolved config args with CLI extras per phase via `merge_args`, ensuring per-command append behavior. Verified no remaining top-level args references outside legacy rejection tests. Tests: `just check`.
<!-- SECTION:FINAL_SUMMARY:END -->
