T-MVK5-wire-config-explain-doctor-provenance
State: closed/done · Impact: low · Complexity: medium
Make sdlc config explain workflows.<name> and sdlc config explain hooks.<hookname> show the real {layer, mode} resolution instead of the
generic local | project | default | unset VALUE_SOURCES answer every
other config key still uses.
resolveKeyValue (config-file.ts:286) answers every dotted config key,
including workflows.*/hooks.*/chain.stages.*, through the generic
local/project/default/unset lookup — it can report only whether the
workflows map was touched in local/project, not which layer actually
produced check’s effective step list, nor whether a project-set list came
from an override or a wrap.
Proposed
Section titled “Proposed”resolveKeyValue special-cases a dotted key rooted at
workflows./hooks./chain.stages.: instead of the generic lookup, it
calls resolveWorkflow/resolveHook/resolveChain and projects their
per-step (or per-stage) provenance into the existing source/value/
ignored output shape. explain’s renderer grows a branch that prints one
layer/mode line per step for a lifecycle key. Every other config key’s
resolution is untouched.
Approach
Section titled “Approach”lib/services/config/config-file.ts:resolveKeyValuegains a special case for a dotted key rooted atworkflows./hooks./chain.stages.: instead of the generic local/project/default/unset lookup, callresolveWorkflow/resolveHook/resolveChain(T-4OUZ/T-4KYN/T-Q65Q) and project their per-step (or per-stage) provenance into the existingsource/value/ignoredoutput shape — one line per resolved step when there is more than one, or the single scalar{layer}for a chain stage. Every other key’s resolution is untouched.lib/services/config/ops/explain.ts’srendergrows a branch that prints onelayer/modeline per step for aworkflows.*/hooks.*key, instead of the singleeffective: ... (from ...)line.lib/services/project/ops/doctor.ts’s drift section: grep first — update its own output strings only if it namesVerbSource/WorkflowStepSourceliterally anywhere; if it only reports trust state, not provenance, this file needs no change.
| Area | Note |
|---|---|
solutions/ontological/lib/services/config/config-file.ts | resolveKeyValue special-case for lifecycle keys |
solutions/ontological/lib/services/config/ops/explain.ts | Render per-step provenance |
solutions/ontological/lib/services/config/ops/list.ts | Same special-case if list also surfaces per-key source |
solutions/ontological/lib/services/project/ops/doctor.ts | Update citations if any (verify by grep) |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
sdlc config explain workflows.checkagainst a project that setsworkflows.checkinsdlc.yamlonly prints aproject/replace(or equivalent rendered form) provenance line per step, not the generic(from project)single-value line. - AC-2:
sdlc config explain orchestrator.max_implementations(an ordinary scalar key, untouched by this decision) renders exactly as it does today — proving the special-case is additive, not a rewrite of the generic path. - AC-3: Existing
config/ops/explain.test.ts/list.test.tscases for non-lifecycle keys pass unmodified; new cases cover theworkflows.*/hooks.*branch. - AC-4:
sdlc config explain workflows.nonexistent-namerenders the envelope’slayer: 'none'distinctly (e.g. “not configured — no builtin, project, local, or env entry”), not as an empty resolved list with no explanation.
Out of scope
Section titled “Out of scope”- Redesigning
VALUE_SOURCESfor every other config key.
Dependencies
Section titled “Dependencies”T-4OUZ, T-4KYN, T-Q65Q (needs the final provenance shape and
resolveChain signature settled).
Discovery context
Section titled “Discovery context”Drawn from D-LSLH-collapse-verbs-workflows-chain-hooks’s “Provenance
shape” section.
Depends on
Section titled “Depends on”T-4OUZ, T-4KYN, T-Q65Q