Documentation
¶
Overview ¶
Package cascade is the absorbed v1 composer: it composes AGENTS.COMPOSE.md doctrine sources into COMPOSED files, wires harness load-point symlinks, and emits the compiled repository plan convergence consumers read.
Index ¶
- Constants
- func AppendixRoles(cfg *Config) ([]string, error)
- func Check(paths Paths, stdout, stderr io.Writer) int
- func Compose(sources []string, overrides map[string]string, appendix []AppendixBlock, ...) (string, error)
- func ComposeParts(sources []string, overrides map[string]string, appendix []AppendixBlock, ...) (string, string, error)
- func ComposePartsDelivered(sources []string, overrides map[string]string, appendix []AppendixBlock, ...) (string, string, error)
- func ComposePartsScoped(sources []string, overrides map[string]string, appendix []AppendixBlock, ...) (string, string, error)
- func ConfiguredSources(cfg *Config) map[string]bool
- func DefaultLoadPoints() (map[string]string, error)
- func DefaultSkillLoadPoints() (map[string]string, error)
- func GatherSources(cfg *Config) ([]string, []string)
- func OperatingBase(cfg *Config, harness, role string) (string, error)
- func OperatingBaseParts(cfg *Config, harness, role string) (string, string, error)
- func RenderRepositoryPlan(cfg *Config, projects string) (string, error)
- func ResolveConfiguredPath(value, configPath, home string) string
- func ResolveLoadPoints(cfg *Config) (map[string]string, error)
- func ResolveSkillLoadPoints(cfg *Config) (map[string]string, error)
- func Run(paths Paths, opts RunOptions, stdout, stderr io.Writer) int
- func SelectByScope(sources []string, machineScopes []string, filtering bool) []string
- func ValidateSources(cfg *Config) error
- type AppendixBlock
- type AppendixEntry
- type Config
- type Paths
- type RawValue
- type RunOptions
Constants ¶
const ( DeliveryInline = "inline" DeliveryImport = "import" )
Inline copies a source body in; import emits an `@path` pointer so a source the repository cascade also delivers loads once. See docs/cascade.md.
const (
Banner = "<!-- generated by agent-compose from agent-compose.yaml; do not edit -->"
)
Variables ¶
This section is empty.
Functions ¶
func AppendixRoles ¶
AppendixRoles returns every distinct role slug the appendix scopes a block to, sorted. Cascade never loads a person, so a caller that has one checks these.
func Check ¶
Check verifies on-disk outputs match a fresh compose; drift prints a unified diff and fails, mirroring the v1 pre-commit hook.
func Compose ¶
func Compose( sources []string, overrides map[string]string, appendix []AppendixBlock, role string, ) (string, error)
Compose concatenates source bodies under the banner, each fenced by its source path, then the appendix blocks bound to role. See docs/cascade.md.
func ComposeParts ¶
func ComposeParts( sources []string, overrides map[string]string, appendix []AppendixBlock, role string, ) (string, string, error)
ComposeParts returns the source body and the role's appendix separately, because a bundle rewrites the body. See docs/cascade.md. agent-compose#6987.
func ComposePartsDelivered ¶
func ComposePartsDelivered( sources []string, overrides map[string]string, appendix []AppendixBlock, role string, delivery string, ) (string, string, error)
ComposePartsDelivered is ComposeParts with the source delivery mode chosen. Every source is import-eligible; ComposePartsScoped narrows that.
func ComposePartsScoped ¶
func ComposePartsScoped( sources []string, overrides map[string]string, appendix []AppendixBlock, role string, delivery string, importable map[string]bool, ) (string, string, error)
ComposePartsScoped limits import delivery to importable, keyed by absolute path; a nil set imports every source. Rationale: docs/cascade.md.
func ConfiguredSources ¶
ConfiguredSources keys the named `sources` entries by absolute path. Only these can be delivered twice, so only these answer to `source_delivery`.
func DefaultLoadPoints ¶
DefaultLoadPoints is each cascade harness's home native instructions path from the layouts table. Config opts others in.
func DefaultSkillLoadPoints ¶
DefaultSkillLoadPoints mirrors DefaultLoadPoints for skills. A harness reads only its own table entry; see docs/projection.md.
func GatherSources ¶
GatherSources resolves explicit entries in listed order, then discovered root entries sorted; duplicates collapse to first occurrence.
func OperatingBase ¶
OperatingBase renders the base for one harness and role: the load point's own sources, plus each appendix block bound to that role.
func OperatingBaseParts ¶
OperatingBaseParts splits that render into sources and appendix, for a caller that rewrites the sources before rendering them. See ComposeParts.
func RenderRepositoryPlan ¶
RenderRepositoryPlan compiles repository policy from trusted operating roots. It never infers availability from doctrine paths or harness load points.
func ResolveConfiguredPath ¶
ResolveConfiguredPath expands one host-config path against its config file and injectable home directory.
func ResolveLoadPoints ¶
ResolveLoadPoints merges config overrides over the defaults; falsy values (null, false, empty) opt a harness out entirely.
func ResolveSkillLoadPoints ¶
ResolveSkillLoadPoints merges config overrides over the skill defaults, with the same falsy opt-out as ResolveLoadPoints.
func Run ¶
func Run(paths Paths, opts RunOptions, stdout, stderr io.Writer) int
Run composes and wires symlinks; absent config is a documented no-op.
func SelectByScope ¶
SelectByScope keeps sources whose scopes intersect the machine's; nil machine scopes disables filtering, and untagged sources drop under it.
func ValidateSources ¶
ValidateSources refuses a named source that cannot carry doctrine. Discovered `roots` entries stay lenient, because nothing declared those. docs/cascade.md.
Types ¶
type AppendixBlock ¶
AppendixBlock is a resolved entry: provenance fence, body, binding roles.
func GatherAppendix ¶
func GatherAppendix(cfg *Config) ([]AppendixBlock, []string)
GatherAppendix resolves entries in listed order, returning the error strings GatherSources uses so a missing file warns rather than aborts.
type AppendixEntry ¶
type AppendixEntry struct {
Text string `yaml:"text"`
Path string `yaml:"path"`
Roles []string `yaml:"roles"`
}
AppendixEntry is one configured tail block: exactly one of Text or Path, and an empty Roles list makes it global.
type Config ¶
type Config struct {
Scopes *scopeList `yaml:"scopes"`
Sources []string `yaml:"sources"`
Roots []string `yaml:"roots"`
LoadPoints map[string]RawValue `yaml:"load_points"`
PersonPolicy string `yaml:"person_policy"`
PersonSource string `yaml:"person_source"`
PersonalityLibraries []string `yaml:"personality_libraries"`
RosterSources []string `yaml:"roster_sources"`
SkillLoadPoints map[string]RawValue `yaml:"skill_load_points"`
SkillCatalogManifest string `yaml:"skill_catalog_manifest"`
SkillRequests []string `yaml:"skill_requests"`
OperatingContext []string `yaml:"operating_context"`
SourceDelivery string `yaml:"source_delivery"`
Appendix []AppendixEntry `yaml:"appendix"`
Telemetry *telemetry.Config `yaml:"telemetry"`
// Kept so a relative appendix path resolves against the config file.
SourcePath string `yaml:"-"`
}
func LoadConfig ¶
LoadConfig reads one host config and fills the defaults that make a short file enough. See docs/cascade.md "Host config defaults".
type Paths ¶
Paths carries the injectable filesystem anchors so tests never touch the real home; DefaultPaths resolves the live locations.
func DefaultPaths ¶
func DefaultPaths() Paths
type RawValue ¶
type RawValue struct {
// contains filtered or unexported fields
}
RawValue keeps a load-point value's truthiness: null and false opt a harness out, a non-empty string sets its path.
type RunOptions ¶
RunOptions controls preview, forced application, and layout reporting.