identity

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package identity answers "who is acting" the same way for every caller — the CLI, the TUI, and the core gate — so a ticket is attributed and owned consistently no matter which one wrote to it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aliases added in v0.1.1

func Aliases(dir string) []string

Aliases lists every string that means "me", starting with Current(dir) so the canonical name is always first. git's user.email is included without being configured, because a ticket assigned by a teammate's tooling routinely carries an address rather than a name, and nobody should have to discover that by being refused.

The result is deduplicated case-insensitively and never empty.

func AliasesPath added in v0.1.1

func AliasesPath() string

AliasesPath is the file listing the other names that mean you: one per line, blank lines and # comments ignored. It exists because jaira knew an identity as exactly one string, while a person is several — a git user.name on one machine, a work email in a ticket's assignee, a personal email in another repository. The ownership rail compared those strings and concluded that your own tickets were not yours, which trained the habit of passing --force to every move. $JAIRA_HOME relocates it, as it does the rest of the per-user state.

func Current

func Current(dir string) string

Current determines who is acting, preferring git's configured name so tickets are attributed the same way commits are. dir scopes the git lookup to a particular repository.

func Initials added in v0.1.1

func Initials(name string) string

Initials renders name as the first letter of each word, lowercased — the form used to stamp a sync folder, so a teammate can tell whose sweep it was at a glance rather than reading a full slug. A name with only one word has no initials to take, so its whole Slug is used instead: a folder named "b-20260823" tells a teammate nothing, but one named "berk-20260823" does. Reuses Slug for that single-word case and for the empty-name fallback, so there is one definition of "no usable characters" rather than two.

func IsMe added in v0.1.1

func IsMe(dir, who string) bool

IsMe reports whether who names the person acting in dir, under any of their aliases.

func Same added in v0.1.1

func Same(a, b string) bool

Same is the one comparison every caller uses for "are these the same person": case-insensitive, ignoring surrounding space. Two empty strings are not the same person — an unassigned ticket belongs to nobody, not to everybody.

func Slug

func Slug(name string) string

Slug reduces name to a string safe as a path component: lowercase, [a-z0-9-] only, with runs of anything else collapsed to a single dash and no leading or trailing dash. A name that reduces to nothing gets a non-empty fallback, since an empty path component would silently write to the parent directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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