config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config loads the optional per-repo `.matlatl.yml` configuration file that lives at the scan root (a sibling of `.matlatlignore`). v1 carries only additional reachability roots, which the CLI UNIONs into application.Config.Roots before the domain's source-agnostic graphmodel.ResolveRootSet consumes them. matlatl ships zero tool-specific knowledge; the repo's `.matlatl.yml` carries it (ADR 0011).

The loader is the durable forward-compat seam: a mistake in something matlatl UNDERSTANDS (malformed YAML, wrong types, unsupported version) is a HARD error the CLI maps to ExitUsage; a thing it does not understand yet (an unknown non-version key) is TOLERATED with a notice. See ADR 0011 for the full contract table.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	// Version is the declared schema version (assumed 1 when the field is absent
	// from a present file).
	Version int
	// Roots holds additional reachability root globs, matched against document
	// IDs (repo-root-relative, slash-separated) with the same path.Match
	// semantics as the --root flag. UNIONED with conventions and --root.
	Roots []string
	// InboundThreshold is the under-linked discoverability floor (ADR 0012). nil
	// when the key is absent (the CLI then keeps its own default/flag value); a
	// present value must be >= 0 (negative is a hard error).
	InboundThreshold *int
	// StructureFindingsSeverity selects the severity of the graduated structure
	// findings (under-linked, dead-end): "info" (default) or "warning". nil when
	// absent; a present value must be one of those two (anything else is a hard
	// error).
	StructureFindingsSeverity *string
	// LinkSuggestionMinShared is the shared-neighbour floor for the suggested-link
	// signal (ADR 0013). nil when absent (the domain default of 2 applies); a
	// present value must be >= 0 (negative is a hard error).
	LinkSuggestionMinShared *int
	// EmitExclude holds gitignore-syntax patterns (the SAME engine and semantics
	// as `.matlatlignore`) for documents that stay in the corpus — fully scanned,
	// link-checked, ranked — but are NOT rendered on the consumption surfaces
	// (llms.txt family, index.md, trails.json). Zero effect on `check`, the
	// terminal report, graph.json, findings.json, junit.xml (ADR 0019). Empty or
	// absent = no filtering.
	EmitExclude []string
}

File is the parsed, validated v1 configuration. The zero value is the no-config default (no extra roots) and is what Load returns for a missing or empty file.

func Load

func Load(scanRoot string) (File, []application.Notice, error)

Load reads <scanRoot>/.matlatl.yml and returns the parsed File plus any tolerated-condition notices. It returns a real error ONLY for the HARD-error rows of the ADR 0011 contract (malformed YAML, wrong types, unsupported version); the CLI maps that error to ExitUsage. A missing or empty file is a silent no-op (zero File, no notices, nil error).

Security (ADR 0003): reads exactly <scanRoot>/.matlatl.yml — nothing outside the scan root. The globs it carries are only string-matched against in-corpus DocumentIDs by ResolveRootSet (never a filesystem read), so a hostile `roots: ["/etc/**"]` is inert.

Jump to

Keyboard shortcuts

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