solutions: Solutions Guide engine (catalog, rules, wizard state, native config, knowledge index, CLI)
New nested module yetano.dev/yetano/core/solutions: loads the catalog in assets/solutions on top of the Big Picture, evaluates questions and conditions, resolves packages/modules/capabilities, generates native configuration from typed fragments with per-value origins, and builds architecture graph, plan, lock file and handbook. Knowledge index with yetano: references, search and lint (incl. manual sections). CLI with yet's conventions (solution, task, knowledge, open), standalone as yetano-solutions. No execution, no network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
586e76889c
commit
2481a0dd27
48 files changed
+10304
No files matched your search
@@ -0,0 +1,509 @@
|
||||
// Package catalog is the data model of Yetano Knowledge & Solutions: the
|
||||
// manifests under assets/solutions (Capability, Package, Profile,
|
||||
// Solution, Task, Example, KnowledgeSource) and the read-only view of the
|
||||
// Big Picture sources (topics, goals, programs) they build on.
|
||||
//
|
||||
// Everything here is data. Nothing in a catalog is ever executed: there
|
||||
// are no template functions, no commands run by the engine and no network
|
||||
// access (see docs/knowledge-solutions/SECURITY.md in the meta-repo).
|
||||
package catalog
|
||||
|
||||
import "gopkg.in/yaml.v3"
|
||||
|
||||
// APIVersion is the only manifest version this package reads.
|
||||
const APIVersion = "yetano.dev/v1"
|
||||
|
||||
// Manifest kinds.
|
||||
const (
|
||||
KindCatalog = "Catalog"
|
||||
KindCapabilities = "Capabilities"
|
||||
KindPackage = "Package"
|
||||
KindProfile = "Profile"
|
||||
KindSolution = "Solution"
|
||||
KindTask = "Task"
|
||||
KindExample = "Example"
|
||||
KindPreset = "Preset"
|
||||
KindInstance = "SolutionInstance"
|
||||
KindSession = "WizardSession"
|
||||
KindKnowledgeSource = "KnowledgeSource"
|
||||
)
|
||||
|
||||
// Support says how far an option, module or solution is backed by the
|
||||
// real programs (RULE-03). Only Supported, Experimental, Untested and
|
||||
// Discouraged can be selected; the others are shown with their reason.
|
||||
type Support string
|
||||
|
||||
const (
|
||||
Supported Support = "supported"
|
||||
Experimental Support = "experimental"
|
||||
Untested Support = "untested"
|
||||
Discouraged Support = "discouraged"
|
||||
NeedsPrereq Support = "needs-prerequisites"
|
||||
NotImplemented Support = "not-implemented"
|
||||
NotSupported Support = "not-supported"
|
||||
Impossible Support = "impossible"
|
||||
Insecure Support = "insecure"
|
||||
)
|
||||
|
||||
// Selectable reports whether an option with this support level may be chosen.
|
||||
func (s Support) Selectable() bool {
|
||||
switch s {
|
||||
case "", Supported, Experimental, Untested, Discouraged, NeedsPrereq:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Valid reports whether s is a known support level ("" means supported).
|
||||
func (s Support) Valid() bool {
|
||||
switch s {
|
||||
case "", Supported, Experimental, Untested, Discouraged, NeedsPrereq,
|
||||
NotImplemented, NotSupported, Impossible, Insecure:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Text is a translatable string set: the English base plus translations.
|
||||
type Translations map[string]map[string]string // lang -> field -> text
|
||||
|
||||
// Meta is the common metadata block.
|
||||
type Meta struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Name string `yaml:"name,omitempty" json:"name,omitempty"` // presets/instances
|
||||
Package string `yaml:"package,omitempty" json:"package,omitempty"`
|
||||
Version string `yaml:"version,omitempty" json:"version,omitempty"`
|
||||
Title string `yaml:"title,omitempty" json:"title,omitempty"`
|
||||
Summary string `yaml:"summary,omitempty" json:"summary,omitempty"`
|
||||
Description string `yaml:"description,omitempty" json:"description,omitempty"`
|
||||
Category string `yaml:"category,omitempty" json:"category,omitempty"`
|
||||
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
|
||||
Synonyms []string `yaml:"synonyms,omitempty" json:"synonyms,omitempty"`
|
||||
Difficulty string `yaml:"difficulty,omitempty" json:"difficulty,omitempty"`
|
||||
Status Support `yaml:"status,omitempty" json:"status,omitempty"`
|
||||
Audience []string `yaml:"audience,omitempty" json:"audience,omitempty"`
|
||||
Featured bool `yaml:"featured,omitempty" json:"featured,omitempty"`
|
||||
Origin string `yaml:"origin,omitempty" json:"origin,omitempty"` // official | local | org | community | ai
|
||||
Aliases []string `yaml:"aliases,omitempty" json:"aliases,omitempty"`
|
||||
Translations Translations `yaml:"translations,omitempty" json:"translations,omitempty"`
|
||||
}
|
||||
|
||||
// Header is the envelope every manifest file has.
|
||||
type Header struct {
|
||||
APIVersion string `yaml:"apiVersion"`
|
||||
Kind string `yaml:"kind"`
|
||||
Metadata Meta `yaml:"metadata"`
|
||||
Spec yaml.Node `yaml:"spec"`
|
||||
}
|
||||
|
||||
// ---- Catalog root -------------------------------------------------------
|
||||
|
||||
// CatalogSpec is catalog.yaml: where the other sources are.
|
||||
type CatalogSpec struct {
|
||||
// BigPicture is the directory with the Big Picture manifest.yaml,
|
||||
// relative to catalog.yaml.
|
||||
BigPicture string `yaml:"bigpicture"`
|
||||
// SourcesRoot is where repositories named in knowledge sources are
|
||||
// checked out, relative to catalog.yaml (optional; manuals are then
|
||||
// only referenced, not indexed).
|
||||
SourcesRoot string `yaml:"sourcesRoot,omitempty"`
|
||||
// WebBase resolves web references (https://yetano.app/).
|
||||
WebBase string `yaml:"webBase"`
|
||||
// Categories maps Big Picture topics to guide categories (order = display order).
|
||||
Categories []Category `yaml:"categories"`
|
||||
// Locales the catalog is (partly) translated into; English is the base.
|
||||
Locales []string `yaml:"locales,omitempty"`
|
||||
}
|
||||
|
||||
// Category is a guide category, normally one Big Picture topic.
|
||||
type Category struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Topic string `yaml:"topic,omitempty" json:"topic,omitempty"`
|
||||
Title string `yaml:"title,omitempty" json:"title,omitempty"`
|
||||
Summary string `yaml:"summary,omitempty" json:"summary,omitempty"`
|
||||
Translations Translations `yaml:"translations,omitempty" json:"translations,omitempty"`
|
||||
}
|
||||
|
||||
// ---- Capabilities ---------------------------------------------------------
|
||||
|
||||
// Capability is an abstract ability (mail.smtp.server); see CAPABILITIES.md.
|
||||
type Capability struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Title string `yaml:"title" json:"title"`
|
||||
Description string `yaml:"description,omitempty" json:"description,omitempty"`
|
||||
Requires []string `yaml:"requires,omitempty" json:"requires,omitempty"`
|
||||
Conflicts []string `yaml:"conflicts,omitempty" json:"conflicts,omitempty"`
|
||||
Translations Translations `yaml:"translations,omitempty" json:"translations,omitempty"`
|
||||
// Providers outside Yetano (an existing LDAP, PostgreSQL, ...).
|
||||
External []ExternalProvider `yaml:"external,omitempty" json:"external,omitempty"`
|
||||
}
|
||||
|
||||
// ExternalProvider is a provider that is not a Yetano package.
|
||||
type ExternalProvider struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Title string `yaml:"title" json:"title"`
|
||||
Description string `yaml:"description,omitempty" json:"description,omitempty"`
|
||||
Support Support `yaml:"support,omitempty" json:"support,omitempty"`
|
||||
}
|
||||
|
||||
// CapabilitiesSpec is a capabilities file.
|
||||
type CapabilitiesSpec struct {
|
||||
Capabilities []Capability `yaml:"capabilities"`
|
||||
}
|
||||
|
||||
// ---- Packages -------------------------------------------------------------
|
||||
|
||||
// PackageSpec describes a Yetano package for the guide. Its human summary
|
||||
// comes from the Big Picture program (BigPicture), never copied here.
|
||||
type PackageSpec struct {
|
||||
BigPicture string `yaml:"bigpicture,omitempty" json:"bigpicture,omitempty"` // product.<name>
|
||||
Registry string `yaml:"registry,omitempty" json:"registry,omitempty"` // yetano.app/yetano/<pkg>
|
||||
Microsite string `yaml:"microsite,omitempty" json:"microsite,omitempty"` // path below webBase
|
||||
Platforms []string `yaml:"platforms,omitempty" json:"platforms,omitempty"`
|
||||
Modules []Module `yaml:"modules" json:"modules"`
|
||||
// Sources back every claim about what the package can do (ANA-02).
|
||||
Sources []string `yaml:"sources" json:"sources"`
|
||||
}
|
||||
|
||||
// Module is one functional part of a package (a yamase-* program, ...).
|
||||
type Module struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Title string `yaml:"title" json:"title"`
|
||||
Description string `yaml:"description,omitempty" json:"description,omitempty"`
|
||||
Program string `yaml:"program,omitempty" json:"program,omitempty"` // binary name
|
||||
Kind string `yaml:"kind,omitempty" json:"kind,omitempty"` // daemon | cli | plugin | library
|
||||
Provides []string `yaml:"provides,omitempty" json:"provides,omitempty"`
|
||||
Requires []string `yaml:"requires,omitempty" json:"requires,omitempty"` // capabilities
|
||||
Support Support `yaml:"support,omitempty" json:"support,omitempty"`
|
||||
// Priority orders providers of the same capability (higher first).
|
||||
Priority int `yaml:"priority,omitempty" json:"priority,omitempty"`
|
||||
// Manual is the knowledge source with this module's manual, if any.
|
||||
Manual string `yaml:"manual,omitempty" json:"manual,omitempty"`
|
||||
Doctor []string `yaml:"doctor,omitempty" json:"doctor,omitempty"` // commands that check it
|
||||
Sources []string `yaml:"sources,omitempty" json:"sources,omitempty"`
|
||||
Translations Translations `yaml:"translations,omitempty" json:"translations,omitempty"`
|
||||
}
|
||||
|
||||
// ---- Profiles -------------------------------------------------------------
|
||||
|
||||
// ProfileSpec is a recommended way to run one package.
|
||||
type ProfileSpec struct {
|
||||
Extends string `yaml:"extends,omitempty" json:"extends,omitempty"`
|
||||
Modules map[string]string `yaml:"modules,omitempty" json:"modules,omitempty"` // module -> enabled|disabled
|
||||
Parameters []string `yaml:"parameters,omitempty" json:"parameters,omitempty"`
|
||||
Config []Fragment `yaml:"config,omitempty" json:"config,omitempty"`
|
||||
Recommendations []Recommendation `yaml:"recommendations,omitempty" json:"recommendations,omitempty"`
|
||||
Platforms []string `yaml:"platforms,omitempty" json:"platforms,omitempty"`
|
||||
References []string `yaml:"references,omitempty" json:"references,omitempty"`
|
||||
}
|
||||
|
||||
// Recommendation names something worth adding, with the reason.
|
||||
type Recommendation struct {
|
||||
Package string `yaml:"package,omitempty" json:"package,omitempty"`
|
||||
Capability string `yaml:"capability,omitempty" json:"capability,omitempty"`
|
||||
Reason string `yaml:"reason" json:"reason"`
|
||||
}
|
||||
|
||||
// Fragment is a typed YAML piece for one generated file (ADR-0005).
|
||||
type Fragment struct {
|
||||
ID string `yaml:"id,omitempty" json:"id,omitempty"`
|
||||
File string `yaml:"file" json:"file"`
|
||||
// Module: the fragment only applies while this module of the file's
|
||||
// package is enabled (a disabled program gets no configuration).
|
||||
Module string `yaml:"module,omitempty" json:"module,omitempty"`
|
||||
When Cond `yaml:"when,omitempty" json:"when,omitempty"`
|
||||
Set yaml.Node `yaml:"set" json:"-"`
|
||||
}
|
||||
|
||||
// ---- Solutions and tasks ----------------------------------------------------
|
||||
|
||||
// SolutionSpec is a complete use case. Tasks use the same structure.
|
||||
type SolutionSpec struct {
|
||||
BigPicture string `yaml:"bigpicture,omitempty" json:"bigpicture,omitempty"`
|
||||
Kind string `yaml:"kind,omitempty" json:"kind,omitempty"` // tasks: read-only|generate|diagnostic|planning|mutating|deployment|maintenance
|
||||
Goals []string `yaml:"goals,omitempty" json:"goals,omitempty"`
|
||||
Scenarios []string `yaml:"scenarios,omitempty" json:"scenarios,omitempty"`
|
||||
NotFor []string `yaml:"notFor,omitempty" json:"notFor,omitempty"`
|
||||
AppliesTo *AppliesTo `yaml:"appliesTo,omitempty" json:"appliesTo,omitempty"`
|
||||
Capabilities CapSets `yaml:"capabilities,omitempty" json:"capabilities"`
|
||||
Packages []PackageUse `yaml:"packages,omitempty" json:"packages"`
|
||||
Questions []Question `yaml:"questions,omitempty" json:"questions"`
|
||||
Rules []Rule `yaml:"rules,omitempty" json:"rules,omitempty"`
|
||||
Config []Fragment `yaml:"configuration,omitempty" json:"-"`
|
||||
Steps []Step `yaml:"steps,omitempty" json:"steps,omitempty"`
|
||||
Requirements []Check `yaml:"requirements,omitempty" json:"requirements,omitempty"`
|
||||
Architecture Architecture `yaml:"architecture,omitempty" json:"architecture"`
|
||||
References References `yaml:"references,omitempty" json:"references"`
|
||||
Related []string `yaml:"related,omitempty" json:"related,omitempty"`
|
||||
Operations []string `yaml:"operations,omitempty" json:"operations,omitempty"`
|
||||
Lifecycle Lifecycle `yaml:"lifecycle,omitempty" json:"lifecycle"`
|
||||
Platforms []string `yaml:"platforms,omitempty" json:"platforms,omitempty"`
|
||||
Sources []string `yaml:"sources,omitempty" json:"sources,omitempty"`
|
||||
}
|
||||
|
||||
// AppliesTo limits a task to solutions/capabilities (applicableWhen).
|
||||
type AppliesTo struct {
|
||||
Solutions []string `yaml:"solutions,omitempty" json:"solutions,omitempty"`
|
||||
Capabilities []string `yaml:"capabilities,omitempty" json:"capabilities,omitempty"`
|
||||
}
|
||||
|
||||
// CapSets are the capabilities a solution needs.
|
||||
type CapSets struct {
|
||||
Required []string `yaml:"required,omitempty" json:"required,omitempty"`
|
||||
Recommended []string `yaml:"recommended,omitempty" json:"recommended,omitempty"`
|
||||
Optional []string `yaml:"optional,omitempty" json:"optional,omitempty"`
|
||||
}
|
||||
|
||||
// PackageUse puts a package into a solution, optionally under a condition.
|
||||
type PackageUse struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Profile string `yaml:"profile,omitempty" json:"profile,omitempty"`
|
||||
When Cond `yaml:"when,omitempty" json:"when,omitempty"`
|
||||
Role string `yaml:"role,omitempty" json:"role,omitempty"` // core | optional
|
||||
Recommended bool `yaml:"recommended,omitempty" json:"recommended,omitempty"`
|
||||
Reason string `yaml:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// Level orders the wizard modes.
|
||||
type Level string
|
||||
|
||||
const (
|
||||
LevelQuick Level = "quick"
|
||||
LevelGuided Level = "guided"
|
||||
LevelAdvanced Level = "advanced"
|
||||
)
|
||||
|
||||
// Rank is the order of the modes (quick < guided < advanced).
|
||||
func (l Level) Rank() int {
|
||||
switch l {
|
||||
case LevelGuided:
|
||||
return 1
|
||||
case LevelAdvanced:
|
||||
return 2
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Question is one wizard question.
|
||||
type Question struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Type string `yaml:"type" json:"type"`
|
||||
Item string `yaml:"item,omitempty" json:"item,omitempty"` // list element type
|
||||
Group string `yaml:"group,omitempty" json:"group,omitempty"`
|
||||
Level Level `yaml:"level,omitempty" json:"level,omitempty"`
|
||||
Title string `yaml:"title" json:"title"`
|
||||
Help string `yaml:"help,omitempty" json:"help,omitempty"`
|
||||
Description string `yaml:"description,omitempty" json:"description,omitempty"`
|
||||
Decide string `yaml:"decide,omitempty" json:"decide,omitempty"` // "Help me decide" text
|
||||
Placeholder string `yaml:"placeholder,omitempty" json:"placeholder,omitempty"`
|
||||
Examples []string `yaml:"examples,omitempty" json:"examples,omitempty"`
|
||||
Default any `yaml:"default,omitempty" json:"default,omitempty"`
|
||||
DefaultWhen []CondValue `yaml:"defaultWhen,omitempty" json:"defaultWhen,omitempty"`
|
||||
Recommended any `yaml:"recommended,omitempty" json:"recommended,omitempty"`
|
||||
Reason string `yaml:"reason,omitempty" json:"reason,omitempty"`
|
||||
Required bool `yaml:"required,omitempty" json:"required,omitempty"`
|
||||
RequiredWhen Cond `yaml:"requiredWhen,omitempty" json:"requiredWhen,omitempty"`
|
||||
VisibleWhen Cond `yaml:"visibleWhen,omitempty" json:"visibleWhen,omitempty"`
|
||||
InstanceSpecific bool `yaml:"instanceSpecific,omitempty" json:"instanceSpecific,omitempty"`
|
||||
Options []Option `yaml:"options,omitempty" json:"options,omitempty"`
|
||||
Validation Validation `yaml:"validation,omitempty" json:"validation"`
|
||||
ValidateWhen []CondCheck `yaml:"validateWhen,omitempty" json:"validateWhen,omitempty"`
|
||||
References []string `yaml:"references,omitempty" json:"references,omitempty"`
|
||||
Warnings []CondText `yaml:"warnings,omitempty" json:"warnings,omitempty"`
|
||||
Platforms []string `yaml:"platforms,omitempty" json:"platforms,omitempty"`
|
||||
Translations Translations `yaml:"translations,omitempty" json:"translations,omitempty"`
|
||||
}
|
||||
|
||||
// Option is one choice of a select/multiselect question.
|
||||
type Option struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Title string `yaml:"title" json:"title"`
|
||||
Description string `yaml:"description,omitempty" json:"description,omitempty"`
|
||||
Recommended bool `yaml:"recommended,omitempty" json:"recommended,omitempty"`
|
||||
Reason string `yaml:"reason,omitempty" json:"reason,omitempty"`
|
||||
Support Support `yaml:"support,omitempty" json:"support,omitempty"`
|
||||
SupportNote string `yaml:"supportNote,omitempty" json:"supportNote,omitempty"`
|
||||
EnabledWhen Cond `yaml:"enabledWhen,omitempty" json:"enabledWhen,omitempty"`
|
||||
Effects Effects `yaml:",inline" json:"effects"`
|
||||
References []string `yaml:"references,omitempty" json:"references,omitempty"`
|
||||
Translations Translations `yaml:"translations,omitempty" json:"translations,omitempty"`
|
||||
}
|
||||
|
||||
// Effects are what a rule or a chosen option does (RULE-01).
|
||||
type Effects struct {
|
||||
Requires *Targets `yaml:"requires,omitempty" json:"requires,omitempty"`
|
||||
Excludes *Targets `yaml:"excludes,omitempty" json:"excludes,omitempty"`
|
||||
Conflicts *Targets `yaml:"conflicts,omitempty" json:"conflicts,omitempty"`
|
||||
Implies *Targets `yaml:"implies,omitempty" json:"implies,omitempty"`
|
||||
Recommends *Targets `yaml:"recommends,omitempty" json:"recommends,omitempty"`
|
||||
Discourages *Targets `yaml:"discourages,omitempty" json:"discourages,omitempty"`
|
||||
Provides []string `yaml:"provides,omitempty" json:"provides,omitempty"` // capabilities provided outside Yetano
|
||||
}
|
||||
|
||||
// Targets lists packages, capabilities, modules and option answers.
|
||||
type Targets struct {
|
||||
Packages []string `yaml:"packages,omitempty" json:"packages,omitempty"`
|
||||
Capabilities []string `yaml:"capabilities,omitempty" json:"capabilities,omitempty"`
|
||||
Modules []string `yaml:"modules,omitempty" json:"modules,omitempty"` // pkg/module
|
||||
Answers map[string]any `yaml:"answers,omitempty" json:"answers,omitempty"` // question -> option
|
||||
}
|
||||
|
||||
// Rule is a declarative rule of a solution or task.
|
||||
type Rule struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
When Cond `yaml:"when,omitempty" json:"when,omitempty"`
|
||||
Effects Effects `yaml:",inline" json:"effects"`
|
||||
Severity string `yaml:"severity,omitempty" json:"severity,omitempty"` // for warnings: info|warning|error
|
||||
Message string `yaml:"message,omitempty" json:"message,omitempty"`
|
||||
Reason string `yaml:"reason,omitempty" json:"reason,omitempty"`
|
||||
Source string `yaml:"source,omitempty" json:"source,omitempty"`
|
||||
}
|
||||
|
||||
// Validation constrains an answer.
|
||||
type Validation struct {
|
||||
Min *float64 `yaml:"min,omitempty" json:"min,omitempty"`
|
||||
Max *float64 `yaml:"max,omitempty" json:"max,omitempty"`
|
||||
MinItems int `yaml:"minItems,omitempty" json:"minItems,omitempty"`
|
||||
MaxItems int `yaml:"maxItems,omitempty" json:"maxItems,omitempty"`
|
||||
MinLength int `yaml:"minLength,omitempty" json:"minLength,omitempty"`
|
||||
MaxLength int `yaml:"maxLength,omitempty" json:"maxLength,omitempty"`
|
||||
Pattern string `yaml:"pattern,omitempty" json:"pattern,omitempty"`
|
||||
Message string `yaml:"message,omitempty" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// CondValue is a conditional default.
|
||||
type CondValue struct {
|
||||
When Cond `yaml:"when" json:"when"`
|
||||
Value any `yaml:"value" json:"value"`
|
||||
}
|
||||
|
||||
// CondText is a conditional message.
|
||||
type CondText struct {
|
||||
When Cond `yaml:"when,omitempty" json:"when,omitempty"`
|
||||
Severity string `yaml:"severity,omitempty" json:"severity,omitempty"`
|
||||
Text string `yaml:"text" json:"text"`
|
||||
}
|
||||
|
||||
// CondCheck is a conditional validation (validateWhen).
|
||||
type CondCheck struct {
|
||||
When Cond `yaml:"when" json:"when"`
|
||||
Validation Validation `yaml:"validation" json:"validation"`
|
||||
}
|
||||
|
||||
// Step is a setup step that is not configuration (yamase-ctl directory
|
||||
// domain add ...). The engine only lists steps; it never runs them.
|
||||
type Step struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Title string `yaml:"title" json:"title"`
|
||||
When Cond `yaml:"when,omitempty" json:"when,omitempty"`
|
||||
Package string `yaml:"package,omitempty" json:"package,omitempty"`
|
||||
Module string `yaml:"module,omitempty" json:"module,omitempty"`
|
||||
ForEach string `yaml:"forEach,omitempty" json:"forEach,omitempty"` // list parameter; ${item}
|
||||
Run string `yaml:"run,omitempty" json:"run,omitempty"`
|
||||
Note string `yaml:"note,omitempty" json:"note,omitempty"`
|
||||
Phase string `yaml:"phase,omitempty" json:"phase,omitempty"` // install | configure | data | dns | start | verify
|
||||
Mutating bool `yaml:"mutating,omitempty" json:"mutating,omitempty"`
|
||||
Reversible *bool `yaml:"reversible,omitempty" json:"reversible,omitempty"`
|
||||
References []string `yaml:"references,omitempty" json:"references,omitempty"`
|
||||
}
|
||||
|
||||
// Check is a requirement or doctor check (DR-01).
|
||||
type Check struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Title string `yaml:"title" json:"title"`
|
||||
Kind string `yaml:"kind" json:"kind"` // os | arch | port | dns | tls | program | command | manual
|
||||
When Cond `yaml:"when,omitempty" json:"when,omitempty"`
|
||||
Severity string `yaml:"severity,omitempty" json:"severity,omitempty"` // error | warning | info
|
||||
Local bool `yaml:"local,omitempty" json:"local,omitempty"` // needs the target system
|
||||
Params map[string]string `yaml:"params,omitempty" json:"params,omitempty"`
|
||||
Run string `yaml:"run,omitempty" json:"run,omitempty"` // command the operator can run
|
||||
Hint string `yaml:"hint,omitempty" json:"hint,omitempty"`
|
||||
References []string `yaml:"references,omitempty" json:"references,omitempty"`
|
||||
}
|
||||
|
||||
// Architecture adds solution-specific nodes and edges to the resolved graph.
|
||||
type Architecture struct {
|
||||
Nodes []ArchNode `yaml:"nodes,omitempty" json:"nodes,omitempty"`
|
||||
Edges []ArchEdge `yaml:"edges,omitempty" json:"edges,omitempty"`
|
||||
}
|
||||
|
||||
// ArchNode is an extra node (clients, external services, storage, ...).
|
||||
type ArchNode struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Type string `yaml:"type" json:"type"` // client | external | storage | network | identity | target
|
||||
Title string `yaml:"title" json:"title"`
|
||||
When Cond `yaml:"when,omitempty" json:"when,omitempty"`
|
||||
}
|
||||
|
||||
// ArchEdge connects two nodes; IDs are node IDs, "pkg:<id>", "mod:<pkg>/<id>" or "cap:<id>".
|
||||
type ArchEdge struct {
|
||||
From string `yaml:"from" json:"from"`
|
||||
To string `yaml:"to" json:"to"`
|
||||
Type string `yaml:"type" json:"type"`
|
||||
Label string `yaml:"label,omitempty" json:"label,omitempty"`
|
||||
When Cond `yaml:"when,omitempty" json:"when,omitempty"`
|
||||
}
|
||||
|
||||
// References are typed yetano: references.
|
||||
type References struct {
|
||||
Manuals []string `yaml:"manuals,omitempty" json:"manuals,omitempty"`
|
||||
Microsites []string `yaml:"microsites,omitempty" json:"microsites,omitempty"`
|
||||
BigPicture []string `yaml:"bigpicture,omitempty" json:"bigpicture,omitempty"`
|
||||
Other []string `yaml:"other,omitempty" json:"other,omitempty"`
|
||||
}
|
||||
|
||||
// All returns every reference in a stable order.
|
||||
func (r References) All() []string {
|
||||
var out []string
|
||||
out = append(out, r.Manuals...)
|
||||
out = append(out, r.Microsites...)
|
||||
out = append(out, r.BigPicture...)
|
||||
out = append(out, r.Other...)
|
||||
return out
|
||||
}
|
||||
|
||||
// Lifecycle says which lifecycle operations a solution supports.
|
||||
type Lifecycle struct {
|
||||
Configure bool `yaml:"configure,omitempty" json:"configure"`
|
||||
Validate bool `yaml:"validate,omitempty" json:"validate"`
|
||||
Plan bool `yaml:"plan,omitempty" json:"plan"`
|
||||
Deploy string `yaml:"deploy,omitempty" json:"deploy,omitempty"` // no | optional | yes
|
||||
Doctor bool `yaml:"doctor,omitempty" json:"doctor"`
|
||||
Update string `yaml:"update,omitempty" json:"update,omitempty"`
|
||||
}
|
||||
|
||||
// ---- Examples, presets, instances ------------------------------------------
|
||||
|
||||
// ExampleSpec is a curated answer set for a solution (EX-01). Examples
|
||||
// are generated by the engine like any session, so they cannot drift.
|
||||
type ExampleSpec struct {
|
||||
Solution string `yaml:"solution" json:"solution"`
|
||||
Mode Level `yaml:"mode,omitempty" json:"mode,omitempty"`
|
||||
Scenario string `yaml:"scenario,omitempty" json:"scenario,omitempty"`
|
||||
Parameters map[string]any `yaml:"parameters" json:"parameters"`
|
||||
Tested bool `yaml:"tested,omitempty" json:"tested"`
|
||||
}
|
||||
|
||||
// ---- Knowledge sources --------------------------------------------------------
|
||||
|
||||
// KnowledgeSourceSpec points at existing documentation (KNOW-04/06): the
|
||||
// documents stay where they are; sections are extracted from headings.
|
||||
type KnowledgeSourceSpec struct {
|
||||
Package string `yaml:"package" json:"package"`
|
||||
Type string `yaml:"type" json:"type"` // manual
|
||||
Format string `yaml:"format" json:"format"` // markdown
|
||||
Repository string `yaml:"repository" json:"repository"`
|
||||
Root string `yaml:"root,omitempty" json:"root,omitempty"` // dir with README.md and docs/
|
||||
Program string `yaml:"program,omitempty" json:"program,omitempty"`
|
||||
Layout string `yaml:"layout,omitempty" json:"layout,omitempty"` // core-manual (README + docs/**) | docs-tree
|
||||
Web string `yaml:"web,omitempty" json:"web,omitempty"` // URL base for topics, {slug} placeholder
|
||||
Exclude []string `yaml:"exclude,omitempty" json:"exclude,omitempty"`
|
||||
Topics []SourceTopic `yaml:"topics,omitempty" json:"topics,omitempty"`
|
||||
}
|
||||
|
||||
// SourceTopic attaches capabilities/modules to one manual topic.
|
||||
type SourceTopic struct {
|
||||
Slug string `yaml:"slug" json:"slug"`
|
||||
Capabilities []string `yaml:"capabilities,omitempty" json:"capabilities,omitempty"`
|
||||
Modules []string `yaml:"modules,omitempty" json:"modules,omitempty"`
|
||||
}
|
||||
Reference in new issue
Block a user