T-KO35-config-sdlc-yaml
Status: closed/done · Impact: medium · Complexity: medium
sdlc.yaml is the project contract, and it is read three different ways
with no shared loader or schema. D-0007 names config/ a first-class
tier. Make lib/config the single way project configuration is loaded,
expanded, and validated, so the quality and lease ports read it one way.
| Location | Role today |
|---|---|
plugin/cli/lease_cli/_common.ts#resolveAuthority | reads sdlc.yaml inline; expands ~/relative lease_authority paths |
plugin/scripts/run_quality_checks.ts | reads sdlc.yaml inline for quality_checks:/worktree_init: |
plugin/validators/validate_sdlc_yaml.ts | ajv validation with python-style error translation; its own loader |
Proposed
Section titled “Proposed”lib/config/sdlc_yaml.ts (load, resolve, authority expansion) plus
lib/config/schema.ts (the validation schema, absorbed from
validate_sdlc_yaml.ts); the three readers import it. The
validate_sdlc_yaml CLI behavior is locked by golden test and rides the
shared loader.
Approach
Section titled “Approach”- Golden-snapshot
validate_sdlc_yaml.tsoutputs (valid, invalid, missing-file). - Create
lib/config/sdlc_yaml.ts+lib/config/schema.ts; port the validator core. - Re-point
lease_cli/_common.ts#resolveAuthorityandrun_quality_checks.tsto the loader. - Parity test the validator against the goldens;
bun testgreen.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/lib/config/sdlc_yaml.ts | new | single loader/resolver |
plugin/lib/config/schema.ts | new | sdlc.yaml schema + validation core |
plugin/validators/validate_sdlc_yaml.ts | modify | thin over lib/config (deletion is T-YBKU-shim-deletion-guard) |
plugin/cli/lease_cli/_common.ts | modify | resolveAuthority imports lib/config |
plugin/scripts/run_quality_checks.ts | modify | config read via lib/config |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: exactly one code path under
plugin/parses sdlc.yaml (grep for the filename shows lib/config + thin callers only). - AC-2:
validate_sdlc_yamlgolden parity — byte-identical output and exit codes. - AC-3: lease CLI authority resolution behavior unchanged (existing lease tests green).
- AC-4: full
bun test+ tsc green.
Out of scope
Section titled “Out of scope”- Deleting
validate_sdlc_yaml.ts(T-YBKU-shim-deletion-guard). - The
quality runop port (T-FNUT-quality-noun-ports) — it consumes this loader. - New config keys or schema changes.
Dependencies
Section titled “Dependencies”- none hard. Land before T-FNUT-quality-noun-ports and T-2W56-lease-noun-migration so they import lib/config.
Discovery context
Section titled “Discovery context”- docs/plans/op-substrate-full-sweep.md §1e (sdlc.yaml ×3 duplication); D-0007 §1 placement rules
(
config/is first-class, not util).