Documentation
¶
Overview ¶
Package application is the persistence-neutral facade shared by the CLI, the TUI, and the HTTP API — the Go counterpart of lib/tasks/application.rb and the operation objects it composes.
It accepts typed Go inputs and returns typed results. Adapter concerns — argv, terminal rendering, HTTP status mapping — deliberately stay outside it, and so does everything the store owns: validation, transactions, rollback, eligibility, the claim compare-and-set. What lives here is COMPOSITION: the operation objects, argument normalization, the creation defaults that belong to the runtime rather than to persistence, the WAITING default behind a human delegation, the blocker note behind a release, and the project commands that run several store calls and must report one outcome.
The rule that keeps the boundary honest: if a behavior can be expressed as a rule about the FILE, it belongs to the store. If it can only be expressed as a rule about two store calls, or about what a caller asked for, it belongs here.
Index ¶
- Constants
- Variables
- func PatchFieldSupported(target Store, field store.PatchField) bool
- type ActivateCommand
- type Application
- func (a *Application) ActivateTask(command ActivateCommand, operation *OperationContext) Outcome
- func (a *Application) ApproveAndCompleteTask(id, expectedRevision string, operation *OperationContext) Outcome
- func (a *Application) ApproveTask(id, expectedRevision string, operation *OperationContext) Outcome
- func (a *Application) ArchivePreview(operation *OperationContext) (store.ArchivePreview, bool)
- func (a *Application) ArchiveProject(id string, operation *OperationContext) Outcome
- func (a *Application) ArchiveSweep(expected *store.ArchivePreview, operation *OperationContext) (ArchiveOutcome, bool)
- func (a *Application) ArchiveSweepMatching(fingerprint string, operation *OperationContext) (ArchiveOutcome, bool)
- func (a *Application) Baseline(id string, field store.PatchField) (string, bool, error)
- func (a *Application) ClaimTask(command DelegationCommand, operation *OperationContext) Outcome
- func (a *Application) CompleteProject(id string, operation *OperationContext) Outcome
- func (a *Application) CreateProject(title string, operation *OperationContext) Outcome
- func (a *Application) CreateTask(command CreateCommand, operation *OperationContext) Outcome
- func (a *Application) DecideProposal(decision ProposalDecision, operation *OperationContext) Outcome
- func (a *Application) DelegateTask(command DelegationCommand, operation *OperationContext) Outcome
- func (a *Application) DelegationModes() record.ModeVocabulary
- func (a *Application) DeleteTask(command DeleteCommand, _ *OperationContext) Outcome
- func (a *Application) DocLinkPatterns() []string
- func (a *Application) DropProject(id string, operation *OperationContext) Outcome
- func (a *Application) ExpandFormalLink(raw string) (links.FormalLink, bool)
- func (a *Application) GetProject(id string, operation *OperationContext) (taskquery.ProjectView, bool, error)
- func (a *Application) GetTask(id string, includeArchive bool, operation *OperationContext) (store.Item, bool, error)
- func (a *Application) GetTaskResult(id string, source store.Source, operation *OperationContext) ReadResult[store.Item]
- func (a *Application) GuardedHistoryStep(delta int, expectedRevision string) (store.HistoryStepResult, bool)
- func (a *Application) HistoryPeek() (store.HistoryPeek, bool)
- func (a *Application) HistoryStep(delta int) (store.HistoryOutcome, string, bool)
- func (a *Application) HostContext() string
- func (a *Application) LinkShorthands() map[string]string
- func (a *Application) LinkSystems() map[string]string
- func (a *Application) ListProjects(operation *OperationContext) ([]taskquery.ProjectView, error)
- func (a *Application) ListProjectsResult(operation *OperationContext) ReadResult[[]taskquery.ProjectView]
- func (a *Application) ListSections(operation *OperationContext) ([]record.Record, error)
- func (a *Application) ListSectionsResult(operation *OperationContext) ReadResult[[]record.Record]
- func (a *Application) ListTasks(filter query.Filter, operation *OperationContext) ([]store.Item, error)
- func (a *Application) ListTasksResult(filter query.Filter, operation *OperationContext) ReadResult[[]store.Item]
- func (a *Application) MoveTask(id string, placement store.Placement, label string, ...) (Outcome, bool)
- func (a *Application) PatchTask(patch Patch, operation *OperationContext) Outcome
- func (a *Application) PrepareCreateTask(command CreateCommand) CreateCommand
- func (a *Application) ProjectResult(id string, operation *OperationContext) ReadResult[taskquery.ProjectView]
- func (a *Application) Queries(includeArchive bool, operation *OperationContext) (*taskquery.Queries, error)
- func (a *Application) ReadStatusResult(operation *OperationContext) ReadResult[struct{}]
- func (a *Application) ReadTasks(operation *OperationContext) (*ReadModel, error)
- func (a *Application) RejectTask(id, expectedRevision string, notes []string, operation *OperationContext) Outcome
- func (a *Application) ReleaseTask(command DelegationCommand, operation *OperationContext) Outcome
- func (a *Application) RenameProject(id, title string, operation *OperationContext) Outcome
- func (a *Application) ReopenProject(id string, operation *OperationContext) Outcome
- func (a *Application) SectionTargetResult(id string, operation *OperationContext) ReadResult[SectionTarget]
- func (a *Application) SetDelegationNote(command DelegationCommand, operation *OperationContext) Outcome
- func (a *Application) SetWorkRef(command DelegationCommand, operation *OperationContext) Outcome
- func (a *Application) StoreRevision() (string, error)
- func (a *Application) TaskResultFromMutation(outcome Outcome, id string, operation *OperationContext) (ReadResult[store.Item], error)
- func (a *Application) UndelegateTask(command DelegationCommand, operation *OperationContext) Outcome
- func (a *Application) UnrejectTask(id, expectedRevision string, operation *OperationContext) Outcome
- func (a *Application) UpdateTask(id string, changes []store.Change, label string, operation *OperationContext) (Outcome, bool)
- func (a *Application) ViewTasks(name string, operation *OperationContext) ([]store.Item, error)
- type ArchiveOutcome
- type ArchiveSweeper
- type CoalescingPatcher
- type CreateCommand
- type DelegationAction
- type DelegationCommand
- type DelegationSummary
- type DelegationWriter
- type DeleteCommand
- type Deleter
- type Effects
- type FieldPatcher
- type HistoryPlanner
- type HistoryStepper
- type OperationContext
- func (c *OperationContext) Actor() string
- func (c *OperationContext) OperationID() string
- func (c *OperationContext) Source() OperationSource
- func (c *OperationContext) TemporalContext() (temporal.Context, bool)
- func (c *OperationContext) WithTemporalContext(context temporal.Context) *OperationContext
- type OperationSource
- type Options
- type Outcome
- type Patch
- type Placement
- type Placer
- type ProjectSummary
- type ProjectWriter
- type ProposalAction
- type ProposalApproveCompleter
- type ProposalDecider
- type ProposalDecision
- type ProposalUnrejecter
- type ReadModel
- func (m *ReadModel) FieldBaselines(id string, fields []store.PatchField) (map[store.PatchField]string, bool)
- func (m *ReadModel) Items() []store.Item
- func (m *ReadModel) NodeFor(item store.Item) *taskquery.Node
- func (m *ReadModel) Queries() *taskquery.Queries
- func (m *ReadModel) Sections() []record.Record
- func (m *ReadModel) Snapshot() *store.Snapshot
- func (m *ReadModel) Stale() bool
- func (m *ReadModel) TaskFor(id string) (store.Item, bool)
- func (m *ReadModel) ViewTasks(name string) ([]store.Item, error)
- type ReadResult
- type ReadStatus
- type Releaser
- type RevisionReader
- type Roll
- type SectionTarget
- type Store
- type StoreFactory
- type TypedPatcher
- type Undelegator
- type WorkRefWriter
Constants ¶
const DefaultUrgentDays = 3
DefaultUrgentDays is Quadrants::DEFAULT_URGENT_DAYS, passed through so a caller that does not care can supply 0.
const FieldBody = store.FieldBody
FieldBody is the body patch the release-note composition needs.
const NoteEncodingError = "release note is not valid UTF-8 text"
NoteEncodingError is the typed refusal for note bytes this process cannot even trim.
The blocker note is the whole point of a blocked agent's escape hatch, and it is appended AFTER the release has already been written. So unusable text has to degrade to a "not applied" the caller already handles, never to a panic on top of a completed, half-composed write.
Variables ¶
var NamedViews = []string{"agenda", "next", "quadrants", "inbox"}
NamedViews is TaskQueries::NAMED_VIEWS.
Functions ¶
func PatchFieldSupported ¶
func PatchFieldSupported(target Store, field store.PatchField) bool
PatchFieldSupported reports whether a store can patch a field at all.
Asking BEFORE the transaction is what keeps an unimplemented field from falling through the store's switch and returning a status no vocabulary contains — a failure that would reach the user as an empty error.
Types ¶
type ActivateCommand ¶ added in v1.18.0
type ActivateCommand struct {
ID string
ExpectedRevision string
// HistoryLabel names the undo step; empty takes the store's
// "activate: <title>", which is the CLI's spelling.
HistoryLabel string
}
ActivateCommand makes one task available now — `tasks activate`, the TUI's `z now`, and `POST /tasks/{id}/activate`.
ExpectedRevision is the whole-task revision the caller read. The CLI reads its own just before the write; HTTP carries the client's If-Match. Empty means no precondition, which only a caller with its own guard should send.
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application is the facade. It holds only immutable construction settings; a mutable store is built per operation and never retained.
func New ¶
func New(options Options) (*Application, error)
New validates the options and builds an application.
func NewWithStore ¶
NewWithStore is the convenience for the common case: one live/archive pair, one clock, no injected seams.
func (*Application) ActivateTask ¶ added in v1.18.0
func (a *Application) ActivateTask(command ActivateCommand, operation *OperationContext) Outcome
ActivateTask releases a task's own hold in one write and one undo step: the indefinite marker goes, a FUTURE available-from date goes with it, and a past one stays, because it is history rather than a gate. A lead or recurring task keeps every date and records a one-occurrence release instead (`lead_skip`), since its anchor is what the next window is measured from.
All of that is the store's `activate` field. This operation exists so every surface names the same one, rather than each composing its own approximation out of `deferred` and `scheduled` — which drops a past start date and cannot express the lead release at all.
func (*Application) ApproveAndCompleteTask ¶ added in v1.11.0
func (a *Application) ApproveAndCompleteTask(id, expectedRevision string, operation *OperationContext) Outcome
ApproveAndCompleteTask accepts a proposal and completes the accepted task in a SINGLE undoable step — the answer to "this was worth doing, and it is already done", which approve-then-complete can only spell as two writes and rejecting spells as a decline that never happened.
It is one application command rather than two calls from a surface on purpose: a partial failure must leave the proposal exactly as it was, and `undo` must put it back as PROPOSED in one step.
func (*Application) ApproveTask ¶
func (a *Application) ApproveTask(id, expectedRevision string, operation *OperationContext) Outcome
ApproveTask accepts a proposal.
func (*Application) ArchivePreview ¶
func (a *Application) ArchivePreview(operation *OperationContext) (store.ArchivePreview, bool)
ArchivePreview is what a sweep would move right now.
func (*Application) ArchiveProject ¶
func (a *Application) ArchiveProject(id string, operation *OperationContext) Outcome
ArchiveProject sweeps a project's subtree into the archive and reports the moved stable ids. Undecided proposals block the sweep: a proposal archived without a decision is a decision nobody made.
func (*Application) ArchiveSweep ¶
func (a *Application) ArchiveSweep(expected *store.ArchivePreview, operation *OperationContext) (ArchiveOutcome, bool)
ArchiveSweep moves every fully closed subtree to the archive file, pinned to the preview the caller showed the user.
func (*Application) ArchiveSweepMatching ¶ added in v1.18.0
func (a *Application) ArchiveSweepMatching(fingerprint string, operation *OperationContext) (ArchiveOutcome, bool)
ArchiveSweepMatching sweeps only while the preview still carries the fingerprint a caller was shown.
A remote caller holds a fingerprint, not a preview value, so this composes the two halves the store already guarantees: a fresh preview is compared against the fingerprint here, and then handed to ArchiveSweep, which re-plans under the exclusive lock and refuses if anything moved since that preview. Together they refuse any sweep whose moved set differs from the one the fingerprint names — including one prepared either side of local midnight, since the day stamp is part of the fingerprint.
func (*Application) Baseline ¶
func (a *Application) Baseline(id string, field store.PatchField) (string, bool, error)
Baseline is the value a caller reads before proposing a patch, and false when the task or the field has none.
It is exported because the conflict check is only meaningful when the SAME expression produces the value on both sides of the decision.
func (*Application) ClaimTask ¶
func (a *Application) ClaimTask(command DelegationCommand, operation *OperationContext) Outcome
ClaimTask is the atomic pickup. A lost race is a conflict naming the winning holder and its timestamp; a win carries the full canonical task, so a worker claims and reads its authority in one step.
func (*Application) CompleteProject ¶
func (a *Application) CompleteProject(id string, operation *OperationContext) Outcome
CompleteProject closes a project's open tasks and reports how many.
Zero closed is a CLEAN result for a project that was already fully closed — and the same zero the store returns after a rollback. Only the latter records a rollback, so asking for one is what keeps a reverted write from masquerading as a no-op success, with its stage intact so a failed write is not reported as a validation failure.
func (*Application) CreateProject ¶
func (a *Application) CreateProject(title string, operation *OperationContext) Outcome
CreateProject creates a new empty project: a section under the top-level "Projects" root.
When no root exists yet — an empty or rootless store — it is created first, top-level and appended at the end, then the project beneath it, so an agent is never stranded. A blank title is refused, and so is a title that duplicates an existing project or area: those names are the project-ref candidate set, so a duplicate would make later refs ambiguous.
func (*Application) CreateTask ¶
func (a *Application) CreateTask(command CreateCommand, operation *OperationContext) Outcome
CreateTask creates one live task in one checked store transaction.
func (*Application) DecideProposal ¶
func (a *Application) DecideProposal(decision ProposalDecision, operation *OperationContext) Outcome
DecideProposal is the typed decision seam both verbs share.
A malformed decision is a REFUSAL rather than a panic. Ruby raises ArgumentError from the command constructor and the application rescues it into an :invalid result; the rescue is the behavior that matters, so this build simply never raises.
func (*Application) DelegateTask ¶
func (a *Application) DelegateTask(command DelegationCommand, operation *OperationContext) Outcome
DelegateTask hands a task to a person (kind "human" plus an email assignee) or to the agent pool (kind "agent" plus refine/research/implement).
A human delegation moves the task to WAITING — the next action is genuinely outside the owner's control, which is what WAITING means — unless KeepState opts out.
func (*Application) DelegationModes ¶ added in v1.11.0
func (a *Application) DelegationModes() record.ModeVocabulary
DelegationModes is the delegation mode vocabulary the store behind this application enforces. Surfaces ask for it AT USE TIME — a package-level var built during init would freeze the built-in set before the store the process actually writes through was ever constructed, and a user's configured modes would then be silently missing from the prompts and refusals that quote them.
It is an optional store capability rather than a method on the Store interface so a caller's own store double is not forced to answer it.
func (*Application) DeleteTask ¶
func (a *Application) DeleteTask(command DeleteCommand, _ *OperationContext) Outcome
DeleteTask is the undoable hard delete of one live task.
A task with descendants is refused unless Cascade is set. ExpectedRevision is optional — empty skips the concurrency check, which is the CLI convenience, and a supplied value guards the whole subtree.
func (*Application) DocLinkPatterns ¶ added in v1.19.0
func (a *Application) DocLinkPatterns() []string
DocLinkPatterns is a copy of the configured `doc_link_patterns`.
func (*Application) DropProject ¶ added in v1.17.0
func (a *Application) DropProject(id string, operation *OperationContext) Outcome
DropProject cancels a project's open tasks and stamps the section CANCELLED.
func (*Application) ExpandFormalLink ¶ added in v1.18.0
func (a *Application) ExpandFormalLink(raw string) (links.FormalLink, bool)
ExpandFormalLink resolves one formal-link input — a web URL, or a configured shorthand such as `jira:OPS-1234` — into the link a write stores. A shorthand's raw token becomes the default label. ok=false means the input is neither, and the caller refuses it.
func (*Application) GetProject ¶
func (a *Application) GetProject(id string, operation *OperationContext) (taskquery.ProjectView, bool, error)
GetProject is one project or area section, and false when the id is neither.
func (*Application) GetTask ¶
func (a *Application) GetTask(id string, includeArchive bool, operation *OperationContext) (store.Item, bool, error)
GetTask resolves a STABLE ID. Fuzzy title and L<line> resolution are CLI-only conveniences and deliberately absent: a missing id is an ordinary "not found" so a transport maps it to its own response rather than to an error.
func (*Application) GetTaskResult ¶
func (a *Application) GetTaskResult(id string, source store.Source, operation *OperationContext) ReadResult[store.Item]
GetTaskResult is the exact-source resource read.
func (*Application) GuardedHistoryStep ¶ added in v1.18.0
func (a *Application) GuardedHistoryStep(delta int, expectedRevision string) (store.HistoryStepResult, bool)
GuardedHistoryStep applies one undo (-1) or redo (+1) only while the store is still at expectedRevision. An empty expectedRevision is unguarded.
func (*Application) HistoryPeek ¶ added in v1.18.0
func (a *Application) HistoryPeek() (store.HistoryPeek, bool)
HistoryPeek is the next undo and redo labels plus the revision they apply to.
func (*Application) HistoryStep ¶
func (a *Application) HistoryStep(delta int) (store.HistoryOutcome, string, bool)
HistoryStep applies one undo (-1) or redo (+1).
func (*Application) HostContext ¶
func (a *Application) HostContext() string
HostContext is the configured machine context, or "" when there is none.
func (*Application) LinkShorthands ¶ added in v1.18.0
func (a *Application) LinkShorthands() map[string]string
LinkShorthands is a copy of the configured `link.<name>` templates.
func (*Application) LinkSystems ¶ added in v1.18.0
func (a *Application) LinkSystems() map[string]string
LinkSystems is a copy of the configured `system.<name>` host rows.
func (*Application) ListProjects ¶
func (a *Application) ListProjects(operation *OperationContext) ([]taskquery.ProjectView, error)
ListProjects is projects and areas rolled up over their open tasks. It lives here so the CLI and a transport share one definition of what a project is and how the list is ordered.
func (*Application) ListProjectsResult ¶
func (a *Application) ListProjectsResult(operation *OperationContext) ReadResult[[]taskquery.ProjectView]
ListProjectsResult is ListProjects with the change token.
func (*Application) ListSections ¶
func (a *Application) ListSections(operation *OperationContext) ([]record.Record, error)
ListSections is every live section record, in file order.
func (*Application) ListSectionsResult ¶
func (a *Application) ListSectionsResult(operation *OperationContext) ReadResult[[]record.Record]
ListSectionsResult is ListSections with the change token.
func (*Application) ListTasks ¶
func (a *Application) ListTasks(filter query.Filter, operation *OperationContext) ([]store.Item, error)
ListTasks answers a parsed filter. The archive half is captured exactly when the filter's scope reaches it, so an ordinary read never pays for it.
func (*Application) ListTasksResult ¶
func (a *Application) ListTasksResult(filter query.Filter, operation *OperationContext) ReadResult[[]store.Item]
ListTasksResult is ListTasks with the change token. An empty list is `ok`, not `not_found`: the question had an answer.
func (*Application) MoveTask ¶
func (a *Application) MoveTask(id string, placement store.Placement, label string, operation *OperationContext) (Outcome, bool)
MoveTask relocates one subtree, guarded by the revision the caller read.
func (*Application) PatchTask ¶
func (a *Application) PatchTask(patch Patch, operation *OperationContext) Outcome
PatchTask applies one field-owned semantic change.
func (*Application) PrepareCreateTask ¶
func (a *Application) PrepareCreateTask(command CreateCommand) CreateCommand
PrepareCreateTask applies the creation defaults that belong to the application RUNTIME rather than to persistence: the host context, and the two link conveniences — configured shorthands in Links expand to their URLs, and a title that ends in a URL lifts it into a formal link (links.LiftTitleURL). The store receives a complete command and stays unaware of hostnames and configuration.
It is exported for the same reason Ruby exports it: the CLI's dry-run path must use the SAME preparation a real create uses, so its preview cannot disagree with what the store would persist. Preparing a prepared command is a no-op, so a caller that previews and then creates the same value gets one preparation, not two — which also means a prepared command must be submitted as returned: fields changed afterwards are not prepared again.
func (*Application) ProjectResult ¶
func (a *Application) ProjectResult(id string, operation *OperationContext) ReadResult[taskquery.ProjectView]
ProjectResult is GetProject with the change token, mapped to not_found when the id is not a project or area.
func (*Application) Queries ¶
func (a *Application) Queries(includeArchive bool, operation *OperationContext) (*taskquery.Queries, error)
Queries builds a read model over ONE fresh snapshot. Every read method here goes through it, so no application read can mix fields from two reads.
func (*Application) ReadStatusResult ¶
func (a *Application) ReadStatusResult(operation *OperationContext) ReadResult[struct{}]
ReadStatusResult is the safe foundation for /meta and readiness: store health and its change token, and nothing a transport would have to be told about.
func (*Application) ReadTasks ¶
func (a *Application) ReadTasks(operation *OperationContext) (*ReadModel, error)
ReadTasks captures one live read. It deliberately gets a fresh store like every other application read, so a long-lived presenter cannot retain anything the next read would have to invalidate.
func (*Application) RejectTask ¶
func (a *Application) RejectTask(id, expectedRevision string, notes []string, operation *OperationContext) Outcome
RejectTask declines a proposal into CANCELLED. Notes append withdrawal rationale to the body in the same write — the application-level mirror of the repeatable CLI `reject --note`.
func (*Application) ReleaseTask ¶
func (a *Application) ReleaseTask(command DelegationCommand, operation *OperationContext) Outcome
ReleaseTask hands a claim back to the agent-ready queue. A worker must supply the id matching the live claim; the owner passes Force to clear a stale one. A Note appends a blocker line to the body in the same undo step.
func (*Application) RenameProject ¶
func (a *Application) RenameProject(id, title string, operation *OperationContext) Outcome
RenameProject renames a project or area section. A blank title is invalid; a missing section is not_found; the Inbox and the Projects heading are a conflict (see taskquery.SectionActionRefusal), as they are for complete, drop and archive.
func (*Application) ReopenProject ¶ added in v1.17.0
func (a *Application) ReopenProject(id string, operation *OperationContext) Outcome
ReopenProject clears the lifecycle stamps from a section, leaving its tasks untouched.
func (*Application) SectionTargetResult ¶ added in v1.18.0
func (a *Application) SectionTargetResult(id string, operation *OperationContext) ReadResult[SectionTarget]
SectionTargetResult resolves a section action's target with the change token. It accepts every live section the Outline shows as a row — nested sub-sections, saved lists, and areas with no open work today, as well as the projects and areas the Projects listing admits — so an HTTP client can act on exactly the sections the TUI can. A section the listing admits reads through ProjectView, so a project's kind and rollups are the same through either route; everything else reads through SectionView.
Resolution is not permission: the Inbox and the Projects heading resolve, and Refusal is what turns an action on them away.
func (*Application) SetDelegationNote ¶ added in v1.11.0
func (a *Application) SetDelegationNote(command DelegationCommand, operation *OperationContext) Outcome
SetDelegationNote rewrites the receiver-facing briefing on an existing delegation. It is an OWNER decision — unlike a work reference, which the holding worker may also write — because the note is the instruction, and a worker rewriting its own instructions is not a thing the model allows. An empty note (or "off"/"none") clears it.
func (*Application) SetWorkRef ¶
func (a *Application) SetWorkRef(command DelegationCommand, operation *OperationContext) Outcome
SetWorkRef records where the work lives. One reference: setting overwrites, and an empty ref (or "off"/"none") clears it. The owner may always write it; a worker only while its claim matches.
func (*Application) StoreRevision ¶ added in v1.18.0
func (a *Application) StoreRevision() (string, error)
StoreRevision is the current global store revision, as cheaply as the store can answer it. It says nothing about whether the store is valid.
func (*Application) TaskResultFromMutation ¶
func (a *Application) TaskResultFromMutation(outcome Outcome, id string, operation *OperationContext) (ReadResult[store.Item], error)
TaskResultFromMutation rebuilds a canonical resource from the immutable post-mutation snapshot a write produced.
This is what keeps a response and its global revision tied to the exact write instead of racing a second read after the lock is released.
func (*Application) UndelegateTask ¶
func (a *Application) UndelegateTask(command DelegationCommand, operation *OperationContext) Outcome
UndelegateTask clears the marker, revoking any live claim. Lifecycle state is untouched: undelegating does not automatically leave WAITING, the owner decides when to.
func (*Application) UnrejectTask ¶ added in v1.9.0
func (a *Application) UnrejectTask(id, expectedRevision string, operation *OperationContext) Outcome
UnrejectTask restores a declined proposal to PROPOSED in place, keeping its id and everything it was captured with. It is the undo of a decision rather than a third decision, so it has its own seam rather than a third ProposalAction.
func (*Application) UpdateTask ¶
func (a *Application) UpdateTask(id string, changes []store.Change, label string, operation *OperationContext) (Outcome, bool)
UpdateTask applies several field changes to one task ATOMICALLY, guarded by the revision the caller read.
Atomicity is the point, not a convenience. `z now` clears the hold AND the available-from date; landing those as two patches would leave an observable intermediate state where the task is released but still dated, and would cost the user two undos for one keystroke.
func (*Application) ViewTasks ¶
func (a *Application) ViewTasks(name string, operation *OperationContext) ([]store.Item, error)
ViewTasks answers one named selection. The names live here rather than in each adapter so a CLI, an HTTP handler, and the TUI cannot each invent their own idea of what "next" means.
type ArchiveOutcome ¶
type ArchiveOutcome struct {
store.ArchiveResult
RollbackReason string
RollbackStage store.RollbackStage
}
ArchiveOutcome is a sweep plus the rollback record a failed one leaves.
type ArchiveSweeper ¶
type ArchiveSweeper interface {
ArchivePreviewFor(today string) store.ArchivePreview
ArchiveSweep(today string, expected *store.ArchivePreview) store.ArchiveResult
}
ArchiveSweeper is the list-wide archive: preview what a sweep would move, then move it, pinned to the preview the user was shown.
The pin is the whole safety property. A user reads "would move 3 roots and 7 descendants", walks away, comes back, and presses y — and by then the list may have changed. Passing the preview back means the store refuses rather than archiving a set the user never saw.
type CoalescingPatcher ¶
type CoalescingPatcher interface {
PatchTaskCoalesced(id string, field store.PatchField, value, expected, label, today, coalesceKey string) store.MutationResult
}
CoalescingPatcher is a patch that carries a journal coalesce key.
This is the single most load-bearing gap. Every composed application operation — the WAITING default behind a human delegation, the blocker note behind a release — is a SECOND write that must land in the SAME undo step as the first. Ruby does that with `coalesce_key:`; without it here, one user action costs two undos.
type CreateCommand ¶
type CreateCommand struct {
Title string
Priority string
Tags []string
Deferred bool
Scheduled string
Deadline string
State string
Project string
ParentID string
Recurrence string
Lead string
Body string
Notes []string
// Links are formal links the create installs in its own transaction, in
// caller order. They exist so a context URL is part of the create rather
// than a follow-up `link add` a caller can forget — and because they land in
// the same write, one undo removes the task and its links together.
Links []links.FormalLink
// ScheduledValue and DeadlineValue carry a COMPLETE temporal value — the
// date, the local time, its zone and its fold — for a caller that has
// already parsed one.
//
// `Scheduled` and `Deadline` above stay the primary spelling, because a
// transport supplies text and turning text into a value is this layer's job.
// What they cannot express is a time of DAY: `createTemporalValues` builds
// `temporal.Value{Date: date}` from them and there is nowhere to put 17:00,
// Europe/London, or a fold. So an HTTP client asking for a 17:00 deadline
// used to get an all-day one, and the API had to refuse the request outright
// rather than store a value the client did not ask for.
//
// These are optional and pointer-typed so absent stays distinguishable from
// "the zero value", and when one is set it WINS over the string for its
// field: it is strictly more information about the same thing. The pointee is
// copied when the command is accepted, so a caller that reuses its value
// cannot change what was submitted.
ScheduledValue *temporal.Value
DeadlineValue *temporal.Value
// SkipHostContext opts out of the configured host context. Ruby spells this
// `apply_host_context: true`, whose default is the interesting value; the
// polarity is flipped here so the ZERO VALUE is the default behavior and a
// caller building a command with a struct literal gets the host context
// without having to know it must ask for it.
SkipHostContext bool
// contains filtered or unexported fields
}
CreateCommand is one immutable, transport-neutral request to create a live task — lib/tasks/create_task.rb.
`Body` and `Notes` are the two spellings of the initial note: one string with embedded newlines, or an ordered list. Supplying both is refused, so the persisted order is never implicit.
type DelegationAction ¶
type DelegationAction string
DelegationAction is the closed five-verb vocabulary — DelegationCommand::ACTIONS.
const ( ActionDelegate DelegationAction = "delegate" ActionUndelegate DelegationAction = "undelegate" ActionClaim DelegationAction = "claim" ActionRelease DelegationAction = "release" ActionWorkRef DelegationAction = "work_ref" // ActionDelegationNote rewrites the receiver-facing briefing on a delegation // that already exists, without restating who holds it or in what mode. The // note gets its own verb for the same reason work_ref has one: an owner // correcting a briefing should not have to re-send the delegation. ActionDelegationNote DelegationAction = "delegation_note" )
The five delegation verbs.
type DelegationCommand ¶
type DelegationCommand struct {
ID string
Action DelegationAction
Kind string
Mode string
Assignee string
Worker string
// WorkRef is the reference to record. An empty string CLEARS it — that is
// the same instruction Ruby spells as nil, `off`, or `none`, and the two
// clear words normalize to it. There is deliberately no way to set a work
// ref to the empty string: the store refuses a blank reference anyway, so
// the only meaning "" could carry is the one it has here.
WorkRef string
// Note carries text whose meaning depends on the verb, and the two meanings
// are deliberately not merged into one field: they are both "the note the
// caller typed", and a surface that has one text box should not have to pick
// a field name based on the verb behind it.
//
// delegate / delegation_note — the receiver-facing briefing STORED in the
// marker. SetNote must be true for it to be written at all, so a
// delegation that says nothing about the note leaves the existing one
// alone rather than erasing it. "off" and "none" clear.
// release — the blocker line APPENDED to the task body in the release's
// own undo step. It is not stored in the marker and needs no SetNote:
// an empty note simply appends nothing.
Note string
SetNote bool
KeepState bool
Force bool
ExpectedRevision string
}
DelegationCommand is one immutable delegation intent — lib/tasks/delegation_command.rb.
KeepState and Note are the two composition flags, and they are the reason this object belongs to the application rather than to the store: a human delegation moves the task to WAITING unless the owner keeps the state, and a release may carry a blocker note appended in the same undo step. Both compose two writes; everything else here the store owns.
func (DelegationCommand) Agent ¶
func (c DelegationCommand) Agent() bool
Agent reports a delegation to the agent pool.
func (DelegationCommand) ClearsNote ¶ added in v1.11.0
func (c DelegationCommand) ClearsNote() bool
ClearsNote reports a stored-note instruction that removes the briefing.
func (DelegationCommand) ClearsWorkRef ¶
func (c DelegationCommand) ClearsWorkRef() bool
ClearsWorkRef reports the clearing form of the work_ref verb.
func (DelegationCommand) Human ¶
func (c DelegationCommand) Human() bool
Human reports a delegation to a named person.
type DelegationSummary ¶
type DelegationSummary struct {
// Action is the verb performed, and TaskID the stable id it touched. Both
// are always set, including on a refusal.
Action DelegationAction
TaskID string
// Previous is the delegation marker as it stood BEFORE the write, and nil
// when the task carried none.
Previous map[string]string
// Delegation is the marker after the write, and nil when it was cleared.
Delegation map[string]string
// Task is the canonical post-write task, and nil only when the task
// vanished under a concurrent write. State is its lifecycle state.
Task *store.Item
State string
// StateChanged reports that this operation moved the task to (or out of)
// WAITING as the composed half of a delegation.
StateChanged bool
// NoteRequested reports that a release carried a blocker note at all;
// NoteApplied whether that note was appended. The pair is Ruby's
// conditionally-present `note_applied` key made explicit: a false
// NoteApplied means something different when no note was asked for.
NoteRequested bool
NoteApplied bool
// Holder and At describe the claim that BLOCKED this operation. They are
// the whole content of a conflict.
Holder string
At string
}
DelegationSummary is the composed outcome of one delegation verb, rich enough that a CLI, HTTP, or TUI adapter TRANSLATES rather than re-derives.
type DelegationWriter ¶ added in v1.11.0
type DelegationWriter interface {
WriteDelegation(request store.DelegationRequest) store.MutationResult
}
DelegationWriter is the whole delegation surface in one call: every verb, the three-part marker including its note, and the optimistic-concurrency token an HTTP If-Match carries.
It supersedes the four narrow interfaces below for a store that has it. They stay because a store that implements only some of them is still usefully better than one that implements none, and because dropping them would be an unrelated breaking change to a seam this package owns.
Two capabilities exist ONLY here. Writing the delegation note in the same store transaction as the delegation is what makes a three-part delegate one undo step instead of two writes an adapter composed; and honouring ExpectedRevision is what lets the HTTP delegation routes keep their mandatory If-Match rather than refuse.
type DeleteCommand ¶
DeleteCommand is one immutable request to hard-delete a live task — lib/tasks/delete_task.rb.
ExpectedRevision is an opaque store-produced value: nil-equivalent ("") skips the optimistic-concurrency check, which is the CLI convenience, while a supplied value guards the whole subtree. Cascade opts into removing a task that still has descendants; deleting never reparents children.
type Deleter ¶
type Deleter interface {
DeleteTask(id string, cascade bool, expectedRevision, historyLabel string) store.MutationResult
}
Deleter is the undoable hard delete of one live task.
type Effects ¶ added in v1.18.0
type Effects struct {
// Rolled is the recurrence roll, or nil when the write rolled nothing.
Rolled *Roll
// TouchedIDs is every task id the write changed, the subject first. It is
// set only when that list names a task OTHER than the subject, which is the
// case a client showing more than one row needs to hear about.
TouchedIDs []string
}
Effects is what a write changed BEYOND the one task a surface shows for it.
Two writes do more than their response resource says. Completing a recurring task does not close it: the store rolls its anchor forward and leaves it open, so the returned task looks merely re-dated. Completing a parent cascades DONE over its open descendants in the same undo step. Both facts are the store's own, reported inside the transaction; surfacing them here means an adapter translates them rather than re-deriving them by diffing two reads.
type FieldPatcher ¶
type FieldPatcher interface {
PatchesField(field store.PatchField) bool
}
FieldPatcher is a store that publishes its own patchable field set. A store that implements it is believed over the default above, which is what lets the vocabulary widen from the side that owns it — as *store.Store now does, across all fourteen fields it patches.
type HistoryPlanner ¶ added in v1.18.0
type HistoryPlanner interface {
PeekHistory() store.HistoryPeek
GuardedHistoryStep(delta int, expectedRevision string) store.HistoryStepResult
}
HistoryPlanner is the journal read a remote client needs before it acts: the next labels in both directions and the revision they were read at, plus a step pinned to that revision.
A local surface can act on the journal as it stands, because what it shows and what it undoes are the same moment. A client across HTTP cannot: between its peek and its click another surface may write, and an unguarded undo would revert THAT write instead of the one the button named.
type HistoryStepper ¶
type HistoryStepper interface {
HistoryStep(delta int) (store.HistoryOutcome, string)
}
HistoryStepper is undo and redo over the journal.
type OperationContext ¶
type OperationContext struct {
// contains filtered or unexported fields
}
OperationContext is immutable metadata identifying where an operation came from — lib/tasks/operation_context.rb — plus the temporal context that operation reads its clock from.
Passing one is optional at every entry point: a nil *OperationContext is the "no context supplied" case Ruby spells as `context: nil`. What Ruby cannot express and this can is that an invalid context is refused at CONSTRUCTION rather than at every call site, so no application method needs a validate_operation_context of its own.
func NewOperationContext ¶
func NewOperationContext(operationID string, source OperationSource, actor string) (*OperationContext, error)
NewOperationContext validates and builds a context. The operation id is required and the source must be one of cli/tui/api.
func (*OperationContext) Actor ¶
func (c *OperationContext) Actor() string
Actor is the optional acting identity.
func (*OperationContext) OperationID ¶
func (c *OperationContext) OperationID() string
OperationID is the caller-supplied correlation id.
func (*OperationContext) Source ¶
func (c *OperationContext) Source() OperationSource
Source is the originating surface.
func (*OperationContext) TemporalContext ¶
func (c *OperationContext) TemporalContext() (temporal.Context, bool)
TemporalContext is the pinned clock, and false when this context carries none.
func (*OperationContext) WithTemporalContext ¶
func (c *OperationContext) WithTemporalContext(context temporal.Context) *OperationContext
WithTemporalContext returns a copy that pins the clock this operation reads.
type OperationSource ¶
type OperationSource string
OperationSource names where a domain operation originated.
const ( SourceCLI OperationSource = "cli" SourceTUI OperationSource = "tui" SourceAPI OperationSource = "api" )
The three surfaces.
type Options ¶
type Options struct {
// Factory is required.
Factory StoreFactory
// TemporalContext is the clock every operation reads. nil means "now, UTC",
// which is the same default Ruby falls back to when no factory is injected.
TemporalContext func() temporal.Context
// HostContext is the machine's own @context, applied to a capture unless
// the command opts out. It must be an @-prefixed word or empty.
HostContext string
// DelegationKeySource mints the per-operation journal coalescing token.
// It is injectable for exactly the reason the store's IDSource is: the
// token is persisted into journal bytes, so an unpinnable one makes two
// identical runs produce different journals.
DelegationKeySource func() string
// QueryOptions are passed to every taskquery built here — the link
// shorthand and system configuration a read surface needs.
QueryOptions []taskquery.Option
// LinkShorthands are the configured `link.<name>` URL templates
// (`jira` → `https://jira.example/browse/%s`). Every formal-link input the
// application accepts expands through them, so `jira:OPS-1234` means the
// same URL whichever surface it was typed into.
LinkShorthands map[string]string
// LinkSystems are the configured `system.<name>` host rows that extend link
// classification. The application only carries them so a surface can
// publish the resolved configuration; classification itself is the read
// model's, configured through QueryOptions.
LinkSystems map[string]string
// DocLinkPatterns are the configured `doc_link_patterns`, carried for the
// same reason as LinkSystems.
DocLinkPatterns []string
}
Options is the immutable construction settings of one application.
type Outcome ¶
type Outcome struct {
store.MutationResult
// Delegation is the rich per-operation summary of a delegation verb, or nil
// for every other operation.
Delegation *DelegationSummary
// Project is the count a project lifecycle command reports, or nil.
Project *ProjectSummary
}
Outcome is the application-level result of a mutation.
It embeds the store's MutationResult unchanged — status, errors, touched ids, the post-write snapshot, the global revision, and the rollback record all keep one vocabulary across the whole system — and adds only what the application itself composed.
Ruby merges the composed facts into MutationResult's untyped `summary` Hash. That is not available here: the store's Summary is a typed struct this package does not own and must not widen. Naming the composed half separately is also the more honest shape — Delegation is present exactly when a delegation verb produced it.
func (Outcome) EffectsFor ¶ added in v1.18.0
EffectsFor reports the effects of a successful write on the task id it was aimed at. A refusal has none.
func (Outcome) NoChange ¶
The refusal predicates an adapter branches on. The store publishes OK, Changed, ExitCode and FirstError; these are the remaining members of the same vocabulary, named here so no surface has to compare status strings.
func (Outcome) RolledBackValidation ¶
RolledBackValidation reports the write that LANDED and was refused by the post-write check. `check` is the actionable next step only in this case.
func (Outcome) RolledBackWrite ¶
type Patch ¶
type Patch struct {
ID string
Field store.PatchField
Value string
Expected string
// HistoryLabel names the undo step. Empty means the store's default.
HistoryLabel string
// CoalesceKey merges this write into a neighbouring journal entry — the
// editor-session behavior, where a burst of field saves is one undo step.
CoalesceKey string
// Typed carries the value's REAL shape for the fields a string cannot
// express: `deferred` (a bool) and `contexts`/`tags` (ordered lists).
//
// When it is set, Value is ignored. Both spellings exist because the CLI
// and the API only ever send text, and making them construct a typed value
// would be ceremony; the editor genuinely cannot.
Typed *store.PatchValue
}
Patch is one single-field command — the Go shape of lib/tasks/task_patch.rb.
A single-field command keeps the field-owned expectation while sharing the store transaction a whole-task changeset uses. That is what lets an editor save one field without turning an unrelated concurrent edit into a whole-task conflict.
Expected is the baseline the caller read before deciding. Ruby carries it inside an EditSnapshot that also holds every other field and the task's revision; here it is the one value the conflict check actually compares, which is also the only value the store publishes for the purpose.
func TypedPatch ¶
func TypedPatch(id string, field store.PatchField, value store.PatchValue, expected, label, coalesceKey string) Patch
TypedPatch builds a patch carrying a value shape a string cannot express.
type Placement ¶
Placement is an immutable structural destination for one task subtree — lib/tasks/task_placement.rb. The store resolves these stable ids under its mutation lock; an adapter must not translate them into record indexes. An empty BeforeID means append as the destination parent's last child.
type Placer ¶
type Placer interface {
ApplyChangeset(changeset store.Changeset) store.MutationResult
TaskRevision(id string) (string, bool)
}
Placer is a whole-task atomic changeset plus the revision that guards it.
Ordering needs both: a move is a `location` change guarded by the revision the caller read, so a task that changed underneath refuses instead of landing somewhere the user did not choose.
type ProjectSummary ¶
ProjectSummary is what a project lifecycle command counted: the tasks a completion closed, or the records an archive sweep moved.
type ProjectWriter ¶
type ProjectWriter interface {
CreateProject(title string) store.MutationResult
RenameSection(id, title string) (touched string, found bool)
CompleteProject(id, today string) (closed int, found bool)
DropProject(id, today string) (closed int, found bool)
ReopenProject(id string) (reopened bool, found bool)
ArchiveProject(id, today string) (moved []string, proposedDescendants bool, found bool)
LastRollback() (reason string, stage store.RollbackStage)
LastLockError() string
}
ProjectWriter is the four project lifecycle operations.
They are the only store calls in the whole application layer that report failure through a bare boolean or count rather than a MutationResult, which is why LastRollback exists: for these, the store's recorded rollback is the ONLY evidence that a mutation wrote and reverted.
type ProposalAction ¶
type ProposalAction string
ProposalAction is the closed approve/reject vocabulary.
const ( ProposalApprove ProposalAction = "approve" ProposalReject ProposalAction = "reject" )
The two decisions.
type ProposalApproveCompleter ¶ added in v1.11.0
type ProposalApproveCompleter interface {
ApproveAndCompleteProposal(id, expectedRevision, today string) store.MutationResult
}
ProposalApproveCompleter accepts a proposal and completes it in one write.
type ProposalDecider ¶
type ProposalDecider interface {
DecideProposal(id, action string, notes []string, expectedRevision, today string) store.MutationResult
}
ProposalDecider approves or declines one proposal.
type ProposalDecision ¶
type ProposalDecision struct {
ID string
Action ProposalAction
ExpectedRevision string
Notes []string
}
ProposalDecision is one immutable intent to accept or decline a proposal — lib/tasks/proposal_decision.rb. Notes are only meaningful on reject, where they are withdrawal rationale appended to the body in the same write.
type ProposalUnrejecter ¶ added in v1.9.0
type ProposalUnrejecter interface {
UnrejectProposal(id, expectedRevision, today string) store.MutationResult
}
ProposalUnrejecter returns a declined proposal to PROPOSED in place.
type ReadModel ¶
type ReadModel struct {
// contains filtered or unexported fields
}
ReadModel is ONE coherent live read for presentation adapters — the Go counterpart of Tasks::TaskReadModel.
It is not a store wrapper. It is built from a single snapshot and exposes no store and no persistence operation, so a TUI that holds one across a paint cannot accidentally write through it or re-read half of it.
func (*ReadModel) FieldBaselines ¶
func (m *ReadModel) FieldBaselines(id string, fields []store.PatchField) (map[store.PatchField]string, bool)
FieldBaselines exposes field expectations from the same coherent snapshot that supplied Items and Queries.
func (*ReadModel) Queries ¶
Queries is the read model over the same snapshot, for every derived answer — availability, links, the tree, body lines.
func (*ReadModel) Stale ¶
Stale reports that the live file no longer matches the snapshot this model was built from.
A long-lived presenter must gate refreshes on THIS rather than on a mutating store's own change detection: any read that lets a store self-reload consumes its change signal, and a model kept until the next tick would then stay stale forever.
type ReadResult ¶
type ReadResult[T any] struct { Status ReadStatus Data T StoreRevision string Errors []store.Entry Warnings []store.Entry }
ReadResult is the immutable outcome of a coherent application read — lib/tasks/application_read_result.rb.
Ruby's version carries an untyped `data` and deep-freezes it. This one is generic instead: the immutability Ruby buys with freeze is bought here by the data being a value the caller owns a copy of, and what is gained is that a caller reading `result.Data.Title` is checked by the compiler rather than by a test.
func (ReadResult[T]) NotFound ¶
func (r ReadResult[T]) NotFound() bool
NotFound reports a well-formed read whose subject does not exist.
func (ReadResult[T]) StoreInvalid ¶
func (r ReadResult[T]) StoreInvalid() bool
StoreInvalid reports bytes that parsed but failed validation.
func (ReadResult[T]) Unavailable ¶
func (r ReadResult[T]) Unavailable() bool
Unavailable reports a store that could not be read at all.
func (ReadResult[T]) UnsupportedSchema ¶
func (r ReadResult[T]) UnsupportedSchema() bool
UnsupportedSchema reports a store this build must not interpret.
type ReadStatus ¶
type ReadStatus string
ReadStatus is ApplicationReadResult::STATUSES.
const ( ReadOK ReadStatus = "ok" ReadNotFound ReadStatus = "not_found" ReadUnsupportedSchema ReadStatus = "unsupported_schema" ReadStoreInvalid ReadStatus = "store_invalid" )
The read vocabulary. An HTTP adapter maps these to 200/404/503 without ever receiving a store, a path, or a second change-token read.
type Releaser ¶
type Releaser interface {
Release(id, worker string, force bool, coalesceKey string) store.MutationResult
}
Releaser hands a claim back to the agent-ready queue.
type RevisionReader ¶ added in v1.18.0
RevisionReader answers "has anything changed?" without a full checked read: the digest of the bytes, no parse, no validation. A store that lacks it is still answered, through CheckedReadSnapshot, only more expensively.
type Roll ¶ added in v1.18.0
Roll is one recurrence advance: the anchor date before and after. The anchor is the deadline when the task has one, else its available-from date.
type SectionTarget ¶ added in v1.18.0
type SectionTarget struct {
View taskquery.ProjectView
Role string
}
SectionTarget is what a section action — rename, complete, drop, reopen, archive — acts on: the rolled-up view a response reports, and the section's structural role (taskquery.Section*), which decides whether the action is allowed at all.
func (SectionTarget) Refusal ¶ added in v1.18.0
func (t SectionTarget) Refusal(action string) string
Refusal is why this target cannot take the action, or "" when it can.
type Store ¶
type Store interface {
// Org and Archive are the resolved paths. The application needs Org to
// answer ReadModel.Stale, which is a question about the file rather than
// about any snapshot.
Org() string
Archive() string
ReadSnapshot(includeArchive bool) (*store.Snapshot, error)
CheckedReadSnapshot() (store.CheckedRead, error)
CreateTask(command store.CreateCommand, today string) store.MutationResult
PatchTask(id string, field store.PatchField, value, expected, label, today string) store.MutationResult
ExpectedFor(id string, field store.PatchField) (string, bool)
Delegate(id, kind, mode, assignee, coalesceKey string) store.MutationResult
Claim(id, worker, coalesceKey string) store.MutationResult
}
Store is the persistence seam every application operation runs through.
It is deliberately an interface owned by THIS package rather than a concrete *store.Store. The application layer composes store operations; it must never re-implement the store's validation, transaction, or rollback rules, and an interface it declares is the cheapest way to keep that honest — anything the application could only do by reaching past this interface is, by construction, store work.
The method set here is what `*store.Store` implements TODAY. Capabilities the store is still growing are declared below as small optional interfaces the application type-asserts for, so a store that gains one is picked up without a change here, and a store that lacks one produces an explicit typed refusal rather than a silently different behavior.
type StoreFactory ¶
type StoreFactory func() Store
StoreFactory builds a FRESH store for every application operation.
Ruby's StoreFactory exists because Store keeps read caches for interactive clients, so one long-lived instance in an HTTP or CLI application object would let request-local reads leak into later calls. The Go store has no such cache today, and the factory is kept anyway for two reasons that outlive that: an operation that gets its own store cannot be handed a stale one by a neighbour, and a future concurrent API surface gets per-request isolation by construction rather than by review.
type TypedPatcher ¶
type TypedPatcher interface {
Patch(request store.PatchRequest) store.MutationResult
}
TypedPatcher applies a patch whose value is not a string.
The string spelling `Store.PatchTask` takes covers every field whose value IS a string, with "" meaning nil for the clearable ones. It cannot express the three shapes the task editor needs: `deferred` is a bool, and `contexts` and `tags` are ordered lists. Sending those as text reaches the store's own refusal ("contexts must be a list of tags") about a value the user never typed — so the editor either has to refuse the field, which is half-work, or the application layer has to carry the value's real shape.
This is the narrow way to carry it: `store.PatchRequest` is the store's OWN typed entry point and already exists, so no store file changes and no existing string caller moves. A store that lacks the method produces a typed refusal rather than a silently different behavior, exactly like every other optional capability here.
type Undelegator ¶
type Undelegator interface {
Undelegate(id, coalesceKey string) store.MutationResult
}
Undelegator clears a delegation marker, revoking any live claim.
type WorkRefWriter ¶
type WorkRefWriter interface {
SetWorkRef(id, workRef, worker, coalesceKey string) store.MutationResult
}
WorkRefWriter records (or, with an empty ref, clears) where the work lives.