layout

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 8 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 layout locates the f10 configuration layers for a working directory. bin/f10-load-project.sh is the semantics oracle: the parity test runs both against the same fixtures, so a change to either side fails until both move.

Index

Constants

View Source
const (
	LayeringExtends  = "extends"
	LayeringReplaces = "replaces"
)

Layering modes: a worktree layer either extends main's instructions or replaces them wholesale.

Variables

This section is empty.

Functions

func SplitFrontmatter added in v0.58.0

func SplitFrontmatter(data []byte) ([]byte, []byte, bool)

SplitFrontmatter returns the YAML between a leading `---` line and the next `---` line, and the body after it. Without a leading block, ok is false and the body is the whole input; an opened block that never closes is not a block.

Types

type Layer

type Layer struct {
	Label string `json:"label"` // "main", "checkout", "worktree" or "out-of-tree"
	Dir   string `json:"dir"`
}

A Layer is one instructions directory contributing configuration. Layers are ordered by precedence: a later layer's field beats an earlier one's.

type Layout

type Layout struct {
	Cwd              string       // where the run started
	CheckoutRoot     string       // root of the checkout the run started in
	MainRoot         string       // root of the main checkout; empty when git cannot name one
	Project          string       // basename of the main checkout, or of the cwd outside git
	StorageRoot      storage.Root // where plans, reviews, verdicts and lore live: main's .f10 for every checkout, or the out-of-tree root
	Layering         string       // LayeringExtends or LayeringReplaces
	LayeringDeclared bool         // a worktree project.md declares Layering
	Layers           []Layer      // precedence order: later wins
	Source           string       // human description; wording matches f10-load-project.sh
	NestedIgnored    string       // a .f10/instructions below the root, noted and ignored
}

A Layout names where configuration lives for one working directory. Path fields are physical (symlinks resolved), matching f10-load-project.sh.

func Locate

func Locate(ctx context.Context, cwd string) *Layout

Locate finds the configuration layout for cwd. It never fails - absence is a valid result, same charter as the script.

Jump to

Keyboard shortcuts

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