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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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