chainresolver

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package chainresolver resolves the ordered list of files that form the chain for a given target logical name.

Spec ref: ROOT/tech_design/internal/chain_resolver § "Intent"

The chain is split into three parts:

  • Ancestors: ancestor nodes from ROOT down to (but not including) the target.
  • Target: the target node itself.
  • Dependencies: nodes/files referenced via depends_on in the target's frontmatter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Ancestors    []ChainItem
	Target       ChainItem
	Dependencies []ChainItem
}

Chain holds the resolved chain for a target logical name, separated into ancestors, the target itself, and its dependencies.

Spec ref: ROOT/tech_design/internal/chain_resolver § "Types"

func ResolveChain

func ResolveChain(targetLogicalName string) (*Chain, error)

ResolveChain builds the full chain for the given targetLogicalName.

The algorithm is:

  1. Walk upward via ParentLogicalName to collect all ancestor logical names plus the target itself, then sort alphabetically. The last entry is the Target; the rest are Ancestors.
  2. Read the target's frontmatter (and, for TEST/ nodes, also the parent leaf node's frontmatter) to collect depends_on entries, then build Dependencies.

Spec ref: ROOT/tech_design/internal/chain_resolver § "Algorithm"

type ChainItem

type ChainItem struct {
	LogicalName string
	FilePaths   []string
}

ChainItem represents one node in the chain, identified by its logical name and associated file paths.

Spec ref: ROOT/tech_design/internal/chain_resolver § "Types"

Jump to

Keyboard shortcuts

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