From 24ab623cb2f43e72c2f7a4ced9780a7d47757446 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Tue, 27 Oct 2026 15:18:57 +0000 Subject: [PATCH] Rename the retained history limit diagnostic --- docs/roadmap/implementation.md | 4 ++-- internal/engine/history_budget_test.go | 2 +- internal/engine/inheritance_history_test.go | 2 +- internal/engine/inheritance_walk.go | 2 +- internal/engine/load.go | 2 +- internal/engine/records.go | 3 +-- records.go | 3 +-- records_test.go | 1 + 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index f8a85a4..81762f8 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -1,6 +1,6 @@ # Pre-v1 Public API Cleanup Implementation Plan -Status: in progress; Stages 1–7 are complete and Stages 8–11 are pending. +Status: in progress; Stages 1–8 are complete and Stages 9–11 are pending. Baseline: `07e4ae5d9236935389e81b207d4a8f00543fafce`. Audience: a Luna coding agent executing the stages sequentially. @@ -326,7 +326,7 @@ and spelling without attribution/precedence changes. ## Stage 8 — Rename The History Diagnostic And Remove The Unused Code -Status: pending. Implements N3 and D8. +Status: complete. Implements N3 and D8. 1. Replace root/engine `CodeExplainLimitExceeded` with `CodeHistoryLimitExceeded = "history.limit_exceeded"`. Update every producer, diff --git a/internal/engine/history_budget_test.go b/internal/engine/history_budget_test.go index ffb0ae4..e86dbcb 100644 --- a/internal/engine/history_budget_test.go +++ b/internal/engine/history_budget_test.go @@ -274,7 +274,7 @@ func hasHistoryLimitDiagnostic(t *testing.T, err error) bool { t.Fatalf("error type = %T, want *LoadError", err) } for _, diagnostic := range loadErr.Diagnostics() { - if diagnostic.Code == CodeExplainLimitExceeded { + if diagnostic.Code == CodeHistoryLimitExceeded { return true } } diff --git a/internal/engine/inheritance_history_test.go b/internal/engine/inheritance_history_test.go index 04bce84..e8b9964 100644 --- a/internal/engine/inheritance_history_test.go +++ b/internal/engine/inheritance_history_test.go @@ -422,7 +422,7 @@ func TestHistoryNodeBudgetCountsSharedInheritanceRootsOnce(t *testing.T) { func TestInheritanceExpansionEnforcesRetainedHistoryBudget(t *testing.T) { input := parseCompositionDocument(t, "source-1", "parent: {value: original}\nchild: {extends: parent, value: replacement}\n") - if _, diagnostics := expandInheritanceWithBudgets(input, nil, defaultProjectionLimits(), 2); len(diagnostics) != 1 || diagnostics[0].Code != CodeExplainLimitExceeded { + if _, diagnostics := expandInheritanceWithBudgets(input, nil, defaultProjectionLimits(), 2); len(diagnostics) != 1 || diagnostics[0].Code != CodeHistoryLimitExceeded { t.Fatalf("retained history limit = %#v", diagnostics) } if _, diagnostics := expandInheritanceWithBudgets(input, nil, defaultProjectionLimits(), 100); len(diagnostics) != 0 { diff --git a/internal/engine/inheritance_walk.go b/internal/engine/inheritance_walk.go index cf7fa13..1c9fc64 100644 --- a/internal/engine/inheritance_walk.go +++ b/internal/engine/inheritance_walk.go @@ -382,7 +382,7 @@ func inheritanceBudgetDiagnostic(path Path, location document.Location) Diagnost func inheritanceHistoryBudgetDiagnostic(path Path, location document.Location) Diagnostic { primary := publicLocation(location) return Diagnostic{ - Code: CodeExplainLimitExceeded, Severity: SeverityError, Path: path, + Code: CodeHistoryLimitExceeded, Severity: SeverityError, Path: path, Message: "retained inheritance history exceeds the node limit", Primary: &primary, } } diff --git a/internal/engine/load.go b/internal/engine/load.go index 71735e4..85c92f2 100644 --- a/internal/engine/load.go +++ b/internal/engine/load.go @@ -315,7 +315,7 @@ func executeLoadRequest[T any](request loadRequest[T], secrets SecretBinding, lo counter := newRetainedNodeCounter(historyLimit) inspection, admitted := prepareInspectionHistory(resolved, counter) if !admitted { - accumulator.add(Diagnostic{Code: CodeExplainLimitExceeded, Severity: SeverityError, Message: "retained configuration history exceeds the node limit"}) + accumulator.add(Diagnostic{Code: CodeHistoryLimitExceeded, Severity: SeverityError, Message: "retained configuration history exceeds the node limit"}) return nil, accumulator.loadError() } // Detach resolver-borrowed values before reference mutation or validation. diff --git a/internal/engine/records.go b/internal/engine/records.go index f9ecfbe..b8179b0 100644 --- a/internal/engine/records.go +++ b/internal/engine/records.go @@ -93,7 +93,6 @@ const ( CodeDecodeArrayLength Code = "decode.array_length" CodeOptionsInvalid Code = "options.invalid" - CodeOptionsUnavailable Code = "options.unavailable" CodeImportDisabled Code = "import.disabled" CodeImportInvalid Code = "import.invalid" @@ -163,7 +162,7 @@ const ( CodeOverrideVersion Code = "override.version" CodeOverrideLimitExceeded Code = "override.limit_exceeded" - CodeExplainLimitExceeded Code = "explain.limit_exceeded" + CodeHistoryLimitExceeded Code = "history.limit_exceeded" CodeInheritanceInvalid Code = "inheritance.invalid" CodeInheritanceMissing Code = "inheritance.missing" diff --git a/records.go b/records.go index 5f4f395..6eeabe4 100644 --- a/records.go +++ b/records.go @@ -94,7 +94,6 @@ const ( CodeDecodeArrayLength Code = "decode.array_length" CodeOptionsInvalid Code = "options.invalid" - CodeOptionsUnavailable Code = "options.unavailable" CodeImportDisabled Code = "import.disabled" CodeImportInvalid Code = "import.invalid" @@ -164,7 +163,7 @@ const ( CodeOverrideVersion Code = "override.version" CodeOverrideLimitExceeded Code = "override.limit_exceeded" - CodeExplainLimitExceeded Code = "explain.limit_exceeded" + CodeHistoryLimitExceeded Code = "history.limit_exceeded" CodeInheritanceInvalid Code = "inheritance.invalid" CodeInheritanceMissing Code = "inheritance.missing" diff --git a/records_test.go b/records_test.go index afafb9f..6bcc9a6 100644 --- a/records_test.go +++ b/records_test.go @@ -26,6 +26,7 @@ func TestOverlayPublicValues(t *testing.T) { CodeOverlayDirective: "overlay.directive", CodeOverlayVersion: "overlay.version", CodeOverlayLimitExceeded: "overlay.limit_exceeded", + CodeHistoryLimitExceeded: "history.limit_exceeded", } { if string(code) != value { t.Errorf("code = %q, want %q", code, value)