legacy

package
v2.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package legacy reads manifests stored in an earlier release's shape: it rewrites retired names and shapes into the current ones, in place, and says which deprecated fields a document still holds. It is pure: it knows a document's fields, never a store or a codec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rewrite

func Rewrite(kind string, doc map[string]any) []string

Rewrite mutates a parsed manifest document in place for one release's worth of backward compatibility with names two earlier schemas retired: Goal's level value "team" (the first one's retired name, and its predecessor "functional", the second one's retired name) both become "strategic"; a Goal at "strategic" with no parent (the first one's root level, before the second split it into Pillar and Strategic) becomes "pillar"; and the KeyResult/KPI baseline and target date fields ("asOf"/"by", now plain "date" on both, since the parent object already names the grouping). The admitted-unknown baseline shape ({unknownReason, expectedBy}) is untouched: there the date means something different (when the baseline will be set), and neither earlier schema ever renamed it.

Returns one human-readable note per field actually rewritten (empty when the document was already in the current shape), so ImportDir can print what changed, once per file.

Types

type Field

type Field struct {
	Path    string
	Message string
}

Field is a deprecated field a document still holds, at its path.

func Deprecated

func Deprecated(kind string, doc map[string]any) []Field

Deprecated refuses, in a draft being written, a field that is read from older manifests but never written. Accepted, it would be checked as what it once meant and fail later with a message about something else: a gap's measuredBy is read as a data source, so an agent that meant the KPI measuring the gap heard about a missing data source at propose. Saved manifests are still read and folded as before.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL