From 1c93aa09473782ab1a519bce2306b017ad7b1c82 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Wed, 18 Nov 2026 00:32:13 +0000 Subject: [PATCH] Verify record inheritance through pipeline resolution --- docs/config.md | 8 +++ docs/roadmap/remediation.md | 7 ++- .../config/collection_composition_test.go | 49 ++++++++++++++++++- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/docs/config.md b/docs/config.md index 5f9dfc6e..337524c9 100644 --- a/docs/config.md +++ b/docs/config.md @@ -186,6 +186,14 @@ step requirement. Validator chains are not automatically identified. Authors may declare identities for other lists when needed. CLI list assignment replaces the complete decoded list. +Record inheritance does not create template-only steps: every record in the +final step list executes and must have artifact lanes. A child that inherits +its parent's named lanes also conflicts with the requirement that lane IDs be +unique across steps; adding differently named lanes does not remove inherited +ones. Use pipeline-level inheritance with step upsert for pipeline variants. +Native identified-record inheritance is also available in compatible collections, +such as an author-identified validator list, subject to ordinary domain validation. + For example, an overlay can opt into replacing a pipeline's steps: ~~~yaml diff --git a/docs/roadmap/remediation.md b/docs/roadmap/remediation.md index 39ca3447..2f18d8af 100644 --- a/docs/roadmap/remediation.md +++ b/docs/roadmap/remediation.md @@ -360,7 +360,12 @@ was identified. One additional test/documentation integration gap remains. ### Finding CK-3 — Verify Identified-Record Inheritance At The Runtime Boundary -Priority: P3. Category: integration coverage and support-scope clarity. Status: open. +Priority: P3. Category: integration coverage and support-scope clarity. Status: complete. + +Completed 2026-11-18: reframed the reference-only step fixture as a negative +resolution case and added compatible validator-record inheritance that reaches +Config.Resolve and verifies inherited options. Documented step/lane constraints +without relaxing them. Core configuration and CLI/example suites pass. Affected stages: 4, 9, and 11. `TestIdentifiedStepRecordInheritance` in diff --git a/internal/core/config/collection_composition_test.go b/internal/core/config/collection_composition_test.go index 2e45c203..a37bc9b5 100644 --- a/internal/core/config/collection_composition_test.go +++ b/internal/core/config/collection_composition_test.go @@ -3,6 +3,7 @@ package config import ( "os" "path/filepath" + "strings" "testing" configkit "go.maximumdirect.net/configkit" @@ -179,7 +180,7 @@ pipelines: } } -func TestIdentifiedStepRecordInheritance(t *testing.T) { +func TestIdentifiedStepInheritanceDoesNotCreateTemplateSteps(t *testing.T) { main := filepath.Join(t.TempDir(), "main.yml") if err := os.WriteFile(main, []byte(`version: 5 pipelines: @@ -205,6 +206,52 @@ pipelines: if err := loaded.Config.Validate(); err != nil { t.Fatalf("validate inherited steps: %v", err) } + if _, err := loaded.Config.Resolve(ResolveInput{PipelineID: "session", Catalog: effectiveCatalog(t)}); err == nil || !strings.Contains(err.Error(), `step "parent" must declare at least one artifact lane`) { + t.Fatalf("expected non-executable parent rejection, got %v", err) + } +} + +func TestIdentifiedValidatorRecordInheritanceResolves(t *testing.T) { + main := filepath.Join(t.TempDir(), "main.yml") + if err := os.WriteFile(main, []byte(`version: 5 +config: + sequences: + - destination: [pipelines, session, artifacts, result, extract, validators] + key: module +pipelines: + session: + input: {module: input} + artifacts: + result: + extract: + module: extract + validators: + - module: configured-a + options: {nested: {inherited: true}} + - module: configured-b + extends: {module: configured-a} +`), 0600); err != nil { + t.Fatal(err) + } + loaded, err := Load(main, LoadOptions{}) + if err != nil { + t.Fatal(err) + } + effective, err := loaded.Config.Resolve(ResolveInput{PipelineID: "session", Catalog: effectiveCatalog(t)}) + if err != nil { + t.Fatal(err) + } + for _, chain := range effective.ResolvedPipeline.ValidatorChains { + for _, validator := range chain.Validators { + if validator.Binding.Module == "configured-b" { + if nested, ok := validator.Binding.Options["nested"].(map[string]any); !ok || nested["inherited"] != true { + t.Fatalf("inherited options = %#v", validator.Binding.Options) + } + return + } + } + } + t.Fatal("inheriting validator missing from resolved pipeline") } func TestEmptyStepOperationsAndOptionalImports(t *testing.T) {