Add configuration source reports

This commit is contained in:
2026-10-07 14:05:26 +00:00
parent bbd862311e
commit 25b412ea93
8 changed files with 330 additions and 9 deletions

View File

@@ -147,6 +147,32 @@ one comment line. A provider failure leaves the output stream empty. A rendering
or output failure may leave an aggregate prefix, and the outcome reports
incomplete report delivery.
### List configuration sources
`config sources` reports the source inventory captured during the selected
scope's acquisition. It reads the source facet once and does not reload
configuration. The default scope is `app`; `--scope all` is unsupported. Text is
the default format, and `--format yaml` returns a structured report:
```yaml
scope: app
sources:
- id: source-1
label: "application config"
path: /etc/example/config.yml
layer: base
kind: file
underlay_index: 0
imported_from: null
```
Each source includes `id`, `label`, `path`, `layer`, `kind`, `underlay_index`,
and `imported_from`. The import location is null when absent; otherwise it has
`source_id`, `line`, and `column`. Owning values and source order are preserved,
including empty fields, zero coordinates, and synthetic sources without paths.
An empty inventory is `sources: []`. Text output begins with the scope heading
and then prints the same source fields, quoting labels and paths.
## Outcome status
CommandKit usage failures use status `2`; operational failures use status `1`.

View File

@@ -5,8 +5,8 @@ decisions, implementation plans, identity and outcome primitives, typed command
declarations, an instance-owned registry, a Cobra-backed routing and parsing
adapter, public `App.Execute` coordination, and generated help/version commands.
Configuration suite registration, scope discovery, ConfigKit integration,
validation, and native effective YAML display are implemented; other
configuration and PromptKit operations remain pending. The
validation, native effective YAML display, and source inventory reports are
implemented; other configuration and PromptKit operations remain pending. The
[README](../README.md) provides project orientation; the
[documentation policy](policy/documentation.md#canonical-ownership) assigns
canonical documentation owners.

View File

@@ -1,6 +1,6 @@
# Initial CommandKit implementation plan
Status: implementation underway; Stages 1-9 complete and Stages 10-14 pending.
Status: implementation underway; Stages 1-10 complete and Stages 11-14 pending.
Date: 2026-10-07.
@@ -645,7 +645,7 @@ passes; README, development orientation, and CLI reference describe the feature.
## Stage 10: implement source inventory reports
**Status:** pending. **Prerequisite:** Stage 9.
**Status:** complete. **Prerequisite:** Stage 9.
1. Implement single-scope `config sources`, default text with yaml alternative.
Read the captured SourceReader once. Never reload sources for this report.
@@ -664,6 +664,16 @@ one captured acquisition, YAML field types and import correlation, empty invento
unsupported all usage preflight, writer failure. Update the source-report CLI
reference with the implemented shape.
**Completion evidence:** installed `config sources` for scopes declaring the
capability. The command reads the acquired source facet once and renders explicit
snake-case YAML DTOs or a quoted text inventory, preserving source order, empty
and zero values, synthetic paths, and import locations. Checks use a real
ConfigKit filesystem root, import, overlay, and mapping underlay; they verify the
YAML field types and import correlation, captured acquisition, empty inventory,
text quoting, unsupported aggregate preflight, and partial writer failure.
`go test ./...` passes; README, development orientation, and CLI reference
describe the report.
## Stage 11: implement path explanation reports
**Status:** pending. **Prerequisite:** Stage 10.