layout

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package layout locates the f10 configuration layers for a working directory: the checkout root, the instruction layers in precedence order, their layering mode, and the storage root. bin/f10-load-project.sh is the semantics oracle - the parity test in this package runs both against the same fixtures, so a change to either side fails loudly 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 HoldsTaskFiles added in v0.44.0

func HoldsTaskFiles(dotF10 string) bool

HoldsTaskFiles says a worktree's own .f10 holds the task files it kept before in-repo storage moved to main's: any one of these dirs keeps that worktree's root.

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      string  // where plans, reviews, verdicts and lore live: main's .f10 for every checkout, or the out-of-tree root
	LegacyStorage    bool    // a linked worktree keeps its own .f10, which held task files before storage moved to main's
	Layering         string  // LayeringExtends or LayeringReplaces
	LayeringDeclared bool    // a worktree project.md declares Layering
	LayeringFrom     string  // "frontmatter" or "prose", when declared
	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