Documentation
¶
Overview ¶
Package move is the one place a ticket changes lanes. Four write-sites grew up around the board — the CLI's move, the TUI's gated and forced moves, and the sign-off accept — and every rule that had to run "after a move" needed all four found by hand; a review caught the fourth only by searching. The gate check, the claim-on-pull, the status write and the lane's settle now run here, and the callers keep what is genuinely theirs: flags, staging, wording, and the pending/confirm dance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Moved, when set, is called after every move that wrote: the CLI's, the TUI's and any later caller's alike, so a plugin subscribed to moves hears about each of them however it was made. from is the lane the ticket left. It is set once at startup by the binary (internal/cli), which owns what a plugin is told; a nil Moved calls nothing.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
To string
Actor string
ActorAliases []string
// Interactive marks a human pressing a key — the one thing an agent
// cannot claim, and the signal requires-human-exit listens for.
Interactive bool
// Force writes despite refusals; what was overridden is returned, the
// caller says it out loud. Nothing marks the ticket itself (deliberate).
Force bool
// Question and Reason ride into the gate check: entering a question lane
// or a parking lane is judged on what the move brings along.
Question string
Reason string
// Stage is applied and PERSISTED before the gate runs — the CLI stages
// outcome, question and commits this way, and a refused move keeps them:
// requiring two commands to satisfy one move would be a poor contract for
// an agent. nil skips it.
Stage func(*ticket.Ticket) error
// Reload re-reads the gate env after Stage wrote to the board. nil keeps
// the env the caller passed.
Reload func() (gate.Env, error)
// ClaimOnPull stages assignee=Actor in memory for the gate and writes it
// in the move when the ticket is unassigned — capture belongs to nobody,
// the pull claims (invariant 12). The CLI claims inside Stage instead.
ClaimOnPull bool
// Folder is the logbook folder a settle files into (initials-date).
Folder string
// Prepare runs on each ticket a doorway files — the callers stamp commits
// there. nil skips it.
Prepare func(*ticket.Ticket) error
}
Request carries one lane change. The zero value of every optional field means "not this caller's behaviour": Stage is the CLI's persisted pre-gate write, ClaimOnPull is the TUI's in-memory claim, Reload refreshes the env after staging changed the board.
type Result ¶
type Result struct {
Ticket *ticket.Ticket
Refused gate.Violations
Overrode gate.Violations
Claimed bool
// The lane's settle, straight from lane.Settle: what left for the
// logbook, whether the doorway (true) or the cap ran, the cap's size for
// the caller's wording, and the never-silent partial error.
Trimmed []ticket.Trimmed
Filed bool
Holds int
SettleErr error
}
Result reports what happened. Refused non-empty means nothing was written (and Force was off); everything else describes the write that landed.