card

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package card is what a brief's writers hold every brief to before it leaves: its PATHS computed from its START files, never typed by a hand, and the card checks (docs/SPEC-CARD-CONTRACT.md section 6). nova-card generate computes and checks every brief it renders, nova-card lint checks a brief on file, and nova-sprint add holds every brief it admits to the same checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Answered

func Answered(c cardgen.Card, glob string) bool

Answered says a PATHS entry names nothing at the base because the card creates it (its NEW: line). A package's Go files are not answered by a test file the card creates: a package with no Go file at the base is not there.

func Checks

func Checks(id, brief string, o Options) []cardgen.LintFinding

Checks are the card checks, past the add's own lint:

  • tier-line: line 1 names a tier (`tier: flash|pro|heavy|frontier`);
  • test-outside-paths: the TEST line's package is a directory PATHS names, so the test the card lands with is one it may edit;
  • personal-name: no name of o.Names outside a double-quoted span (the owner's words, quoted, keep theirs), the card's own id, or the WHO: line that pins a friend;
  • dropped-card: no id of o.Dropped but the card's own;
  • author-name: no `By:` followed by a name of o.Names, quoted or not: a brief never names its author, the friend who does the work signs with their own name (cardgen.Attribution), and the WHO: line stays a preference.

The tier and TEST checks hold a card brief, one with a PATHS: line; a brief with none is a free task.

func Docs

func Docs(paths []string) []string

Docs are the entries of a planned PATHS that are neither Go nor a glob nor a directory: the ledger, docs/CLI.md. They ride beside the START packages.

func Lint

func Lint(id, brief string, o Options) []cardgen.LintFinding

Lint is cardgen.Lint and Checks under o: everything a brief is held to before it leaves its writer.

func PackagePaths

func PackagePaths(start, docs []string) []string

PackagePaths is a card's PATHS computed from what it starts from: every directory a START file lives in, as that package's Go files and its tests (<dir>/*.go, <dir>/*_test.go); a START entry that is a directory, the same; and each doc the card names, as itself. A START file that is no Go file (a ledger, a manifest) is kept as itself, and a bare word (no slash and no suffix: a tool name, a namedpaths word) names no path. A package is the unit a change lives in: a typed file list one file short holds the card at land (E12).

func Paths

func Paths(h cardgen.Header, c cardgen.Card) []string

Paths is the PATHS of the brief c renders to under h, computed: PackagePaths of the START line that brief carries, and the docs the planner named. No hand types the PATHS of a generated brief.

func Shared

func Shared(cards []cardgen.Card) bool

Shared says two cards name one PATHS entry and neither needs the other: the add wants --allow-shared-paths.

func Start

func Start(brief string) []string

Start is a brief's START: line, its entries split on commas and blanks; nil when the brief has none.

func TestPackage

func TestPackage(brief string) string

TestPackage is the package a brief's TEST line names, repository-relative with no ./ and no trailing slash: the first field that is a path (`internal/bus TestY`, `./internal/bus TestY`, `./tools TestY`, `go test ./internal/bus -run TestY`); "" for TEST: none or a line that names none.

Types

type Options

type Options struct {
	Names   []string
	Dropped []string
}

Options are what the checks read from outside the brief: the names of the people, friends and machines of the deployment (none is written in this tree, internal/ci TestGeneralityText) and the ids of the cards dropped off the table.

Jump to

Keyboard shortcuts

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