Skip to content

Commit 5b3534c

Browse files
authored
Merge pull request #91 from LAA-Software-Engineering/docs/clarify-normalize-vs-env-79
docs(spec): clarify NormalizeProjectGraph vs ApplyEnvironment (#79)
2 parents 07dcaf6 + 4d535d4 commit 5b3534c

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

internal/runtime/local/runtime.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ func (r *Runtime) now() time.Time {
2929
return time.Now().UTC()
3030
}
3131

32-
// ApplyEnvironment returns a shallow copy of g with Environment overrides applied (design doc section 7.6 MVP).
32+
// ApplyEnvironment returns a shallow copy of g with Environment overrides applied (design doc §7.6 MVP).
33+
// Call after spec.NormalizeProjectGraph so Project.spec.defaults are merged first; agentctl and
34+
// [Runtime.ExecuteWorkflow] use that order before spec.ValidateProjectGraph.
3335
func ApplyEnvironment(g *spec.ProjectGraph, envName string) (*spec.ProjectGraph, error) {
3436
envName = strings.TrimSpace(envName)
3537
if envName == "" || g == nil {

internal/spec/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Package spec defines resource envelopes, MVP kind structs (§6–§7), YAML loading,
22
// project-level defaults ([NormalizeProjectGraph]), reference resolution ([ResolveReferences]),
33
// and graph validation ([ValidateProjectGraph], §9.1–§9.5 MVP subset).
4+
// Environment-specific overrides (§7.6) are applied by [github.com/LAA-Software-Engineering/agentic-control-plane/internal/runtime/local.ApplyEnvironment]
5+
// after [NormalizeProjectGraph] in CLI and local-runtime flows.
46
package spec

internal/spec/normalize.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import "strings"
1212
// - Workflow.spec.policy ← defaults.policy when the workflow omits policy.
1313
// - Workflow.spec.runtime ← defaults.runtime when the workflow omits runtime (issue #76).
1414
//
15-
// Environment overrides are out of scope (issue #4). Mutates graphs in place.
15+
// Environment overlays (design doc §7.6) are not applied here. Typical pipelines load the graph,
16+
// run NormalizeProjectGraph, then apply the selected environment with ApplyEnvironment in
17+
// internal/runtime/local (e.g. agentctl validate/plan/apply/run, local ExecuteWorkflow), and
18+
// finally validate. Mutates g in place.
1619
func NormalizeProjectGraph(g *ProjectGraph) {
1720
if g == nil {
1821
return

0 commit comments

Comments
 (0)