Versions in this module Expand all Collapse all v0 v0.1.0 Nov 27, 2026 Changes in this version + const BundleSignatureHeader + const DefaultCommentEvery + const DefaultCommentsPerPerson + const DefaultCommentsPerTicket + const DefaultDraftsKept + const DefaultImportsPerDay + const DefaultMaxBundle + const DefaultMaxCheckTime + const DefaultMaxOrganization + const DefaultOperationsKept + const DefaultPage + const DefaultSweepEvery + const DefaultUploadsKept + const DefaultUploadsPerPerson + const FindLongest + const FindMost + const FindShown + const MaxBundleFiles + const MaxOrgFiles + const MaxOrgProblems + const MaxOutputs + const MaxPage + const MaxReason + const ShownProblems + const WasmForm + var Contracts = []int + var ErrBundleTooLarge = errors.New("the bundle is too large") + var ErrConflict = errors.New("the ticket moved since it was read") + var ErrKeyTaken = errors.New("the operation's key was used before") + var ErrNoPerson = errors.New("no person") + var ErrNotFound = errors.New("not found") + var ErrOrganizationTooLarge = errors.New("the organization's data is too large") + var ErrTooManyImports = errors.New("server: the imports are as many as the server takes in a day") + var ErrTooManyUploads = errors.New(...) + var Statuses = []string + func AcceptLanguages(header string) []string + func Busy(err error) bool + func CheckOwnAnswer(method, path string, status int, body []byte) error + func FindWords(q string) []string + func Fold(s string) string + func KindFailed(err error) bool + func LogStop(log *slog.Logger, msg string, err error) + func NewID() string + func RetryAfter(d time.Duration) string + func SameJSON(a, b []byte) bool + func UnfitChar(c rune) bool + func WholeNumber(n json.Number) (int64, bool) + type AdminParts struct + Bundles bool + Kinds bool + Organization bool + Records bool + func (a AdminParts) Any() bool + type Agents interface + Ask func(ctx context.Context, a Ask) error + type Answer struct + Failed bool + Outputs json.RawMessage + Reason string + Verdict string + type Ask struct + Args json.RawMessage + Flow string + Key EffectKey + Kind string + Note bool + Stage string + Ticket string + type AuditEntry struct + At time.Time + Event json.RawMessage + ID string + Key string + Kind string + Operation string + Outcome string + Person string + Refused string + Ticket string + Via string + type AuditLog interface + Record func(ctx context.Context, e AuditEntry) error + type Authenticator interface + Authenticate func(r *http.Request) (Person, error) + type Begun struct + At time.Time + Attempt string + Digest string + Key string + Person string + Ticket string + type BookAnswer struct + Outcome string + Reason string + ReasonJa string + type BookCall struct + Args []NamedValue + Book string + Call string + Key EffectKey + Kind string + Ticket string + Transfer string + func (c BookCall) Arg(name string) (NamedValue, bool) + type Books interface + Call func(ctx context.Context, tx any, c BookCall) (BookAnswer, error) + type Bundle struct + Adds []BundleVersion + Decided *BundleAct + Digest string + Hid *BundleAct + Hidden bool + Holds []KindVersion + Key string + PerKind []BundleVectorCount + Ritsu string + Signature string + Signed bool + Size int64 + Source string + State string + Uploaded BundleAct + Vectors int + Worked int + type BundleAct struct + At time.Time + Person string + Reason string + type BundleChange struct + Archive []byte + Bundle Bundle + Forget bool + Was string + WasHidden bool + type BundleFile struct + Archive []byte + Name string + Signature []byte + type BundleVectorCount struct + Kind string + Nexts int + Starts int + type BundleVersion struct + Kind string + New bool + Owner string + Title string + Version int + type Call struct + Body []byte + Bundle string + Draft string + Key string + Kind string + Languages []string + Operation string + Person Person + Query url.Values + Signature []byte + Ticket string + Upload io.Reader + Version int + Via string + type Change struct + At time.Time + Bundle *BundleChange + ChangesMax int + Digest string + Draft string + ImportsMax int + ImportsSince time.Time + Kept []Start + Key string + LastImport *string + Latest string + Outcome Outcome + Person string + Record *Record + Records []*Record + Reply json.RawMessage + Snapshot *OrgSnapshot + Start *Start + type Checker interface + Check func() error + type Choice struct + Name string + Other string + Value string + func Find(choices []Choice, q string, limit int) (found []Choice, more bool) + func PeopleChoices(people []OrgPerson, lang string) []Choice + func TeamChoices(teams []Team, lang string) []Choice + func (c Choice) Found(lang string) Found + type Clock interface + Now func() time.Time + type Config struct + Agents Agents + AuditLog AuditLog + Authenticator Authenticator + Books Books + BooksApart bool + BundleKeys []ed25519.PublicKey + Bundles []BundleFile + Clock Clock + CommentEvery time.Duration + CommentsPerPerson int + CommentsPerTicket int + DraftsKept time.Duration + Files Files + Flows Flows + Gate Gate + ImportsPerDay int + LoadBundle func(ctx context.Context, requests fs.FS) (*Package, error) + Logger *slog.Logger + MaxBody int64 + MaxBundle int64 + MaxCheckTime time.Duration + MaxOrganization int64 + NewAttempt func() string + NewRecordID func() string + NewTicketID func() string + Notifier Notifier + OperationsKept time.Duration + Organization OrgSource + Packages []*Package + Store Store + SweepEvery time.Duration + UploadsKept time.Duration + UploadsPerPerson int + type Delivery struct + Event json.RawMessage + Kind string + Ticket string + type Draft struct + At time.Time + Data json.RawMessage + ID string + Person string + Source string + type EffectKey struct + Round int64 + Serial int64 + Ticket string + func ParseEffectKey(s string) (EffectKey, error) + func (k EffectKey) String() string + type FileInfo struct + At time.Time + By string + ContentType string + Name string + Size int64 + type Files interface + Delete func(ctx context.Context, id string) error + Open func(ctx context.Context, id string) (io.ReadCloser, FileInfo, error) + Put func(ctx context.Context, info FileInfo, r io.Reader) (id string, err error) + Stat func(ctx context.Context, id string) (FileInfo, error) + URL func(ctx context.Context, id string) (string, error) + type FindAnswer struct + Found []Found + More bool + type FindError struct + Param string + Why string + func (e *FindError) Error() string + type FindQuery struct + Lang string + Limit int + On string + Q string + func ReadFind(query url.Values, languages []string, master bool) (FindQuery, error) + func (q FindQuery) Answer(choices []Choice) FindAnswer + type Flows interface + Launch func(ctx context.Context, l Launch) error + type Found struct + Label string + Name string + Value string + type Gate interface + Allow func(ctx context.Context, q Question) (bool, error) + var AllowAll Gate = allowAll{} + type GeneratedKind interface + type HistoryLine struct + At int64 + By *string + Cleared []string + Comment *string + Did string + Note *string + OnceWith *string + Organization *string + ProxyOf *string + Stage *string + To []string + type Kind struct + Name string + Next func(ticket, event, organization json.RawMessage, now int64) (json.RawMessage, error) + Start func(submit, organization json.RawMessage, now int64) (json.RawMessage, error) + Version int + Worked func(in json.RawMessage) (json.RawMessage, error) + type KindVersion struct + Kind string + Version int + type LanguageChoice struct + Accept string + Chosen string + Kind []string + Person string + func (c LanguageChoice) Choose(ok func(string) bool) string + type Launch struct + Args json.RawMessage + Flow string + Key EffectKey + Kind string + Ticket string + type Line struct + Move *MoveRecord + Record *Record + func (l Line) At() time.Time + func (l Line) ID() string + type MasterLayout struct + Data string + Fields []string + Key string + Name string + NameField string + Optional map[string]bool + Written map[string]string + type Member struct + Person string + Position string + Primary bool + Team string + type MineCount struct + SentBack int + Status map[string]int + type MineCounter interface + CountMine func(ctx context.Context, person string) (map[string]MineCount, error) + type MineQuery struct + Before string + Kind string + Limit int + Status string + type Move struct + At time.Time + Body json.RawMessage + Books func(ctx context.Context, tx any) error + Cancel []TimerKey + Digest string + Effects json.RawMessage + Event json.RawMessage + Key string + Kind string + Number int64 + Org string + Outcome Outcome + Own []string + People []string + Person string + Rang *Timer + Reply json.RawMessage + Set []Timer + Since time.Time + Status string + Ticket string + ToDo []ToDo + Uploads []string + Version int + Via string + Waiting []string + type MoveRecord struct + At time.Time + Effects json.RawMessage + Event json.RawMessage + Key string + Kind string + Number int64 + Org string + Person string + Ticket string + Version int + Via string + type Name struct + Name string + NameJa string + type NamedValue struct + Name string + Value json.RawMessage + func NamedNumber(name string, n int64) NamedValue + func NamedText(name, text string) NamedValue + func NamedTruth(name string, b bool) NamedValue + func (v NamedValue) Num() (int64, bool) + func (v NamedValue) Str() (string, bool) + func (v NamedValue) Truth() (bool, bool) + type Notice struct + Key EffectKey + Kind string + Notice string + Owner string + Stage string + Ticket string + To []Recipient + Version int + type Notifier interface + Notify func(ctx context.Context, n Notice) error + type OperationRecord struct + At time.Time + Body json.RawMessage + Digest string + Key string + Outcome Outcome + Person string + type OrgData struct + Masters map[string][]map[string]string + Proxies []Proxy + Versions []OrgVersion + func ReadOrgFiles(fsys fs.FS, want OrgLayout) (*OrgData, error) + type OrgLayout struct + Data string + Masters []MasterLayout + Name string + Positions []string + TeamKinds []string + Written OrgWritten + type OrgPerson struct + Email string + ID string + Language string + Name string + NameJa string + type OrgProblem struct + At string + Text string + TextJa string + type OrgProblems struct + Problems []OrgProblem + Stopped bool + func (e *OrgProblems) Error() string + func (e *OrgProblems) Shown() (shown []OrgProblem, more int) + type OrgSnapshot struct + At time.Time + Data json.RawMessage + ID string + type OrgSource interface + Read func(ctx context.Context, want OrgLayout) (*OrgData, error) + type OrgUnread struct + Day string + NoVersion bool + Person string + func (e *OrgUnread) Error() string + type OrgVersion struct + Day string + Members []Member + People []OrgPerson + Teams []Team + func (v *OrgVersion) TeamOf(person, kind string) string + type OrgWritten struct + Positions map[string]string + TeamKinds map[string]string + type Outcome string + const Invalid + const Limited + const NotFound + const OK + const Refused + const TooLarge + const Unavailable + type Package struct + func LoadKinds(contract int, lang string, kinds []Kind, requests fs.FS) (*Package, error) + func Load[K GeneratedKind](contract int, lang string, kinds []K, requests fs.FS) (*Package, error) + func (p *Package) Bundle() string + func (p *Package) CheckAnswer(operation string, status int, body []byte) error + func (p *Package) Contract() int + func (p *Package) Files() fs.FS + func (p *Package) Kinds() []Kind + func (p *Package) Lang() string + type Person struct + ID string + Roles []string + type Proxy struct + From string + Kind string + Person string + Proxy string + Requests []string + To string + type Question struct + Action string + Approvers []string + Kind string + Now time.Time + Org *OrgVersion + Owner string + Person Person + Requester string + Requesters []string + SelfApproval bool + Stage string + Ticket string + Version int + type Recipient struct + Email string + ID string + Language string + Name string + type Record struct + Added bool + After json.RawMessage + At time.Time + Before json.RawMessage + ID string + Kind string + Person string + Reason string + Snapshot string + Source string + Version int + Via string + What string + type RecordQuery struct + Before string + From time.Time + Kind string + Limit int + Organization bool + Person string + Ticket string + To time.Time + Versions []KindVersion + What string + type Reply struct + Body []byte + From string + MoreProblems int + Next string + NotAsked []BookCall + Outcome Outcome + Problem string + Problems []OrgProblem + RetryAfter time.Duration + Stopped bool + type Server struct + func New(cfg Config) (*Server, error) + func (s *Server) AddPackageCheck(check func(packages []*Package) error) + func (s *Server) AdminParts(ctx context.Context, p Person) (AdminParts, error) + func (s *Server) Administers(ctx context.Context, p Person) bool + func (s *Server) Answered(ctx context.Context, key EffectKey, a Answer) (Reply, error) + func (s *Server) Authenticate(r *http.Request) (Person, error) + func (s *Server) Can(ctx context.Context, p Person, ticket string, events []string) ([]string, error) + func (s *Server) CheckOrganization(d *OrgData) error + func (s *Server) CountMine(ctx context.Context, p Person) (map[string]MineCount, error) + func (s *Server) CountWaiting(ctx context.Context, p Person) (map[string]int, error) + func (s *Server) Current(kind string, at time.Time) (version int, ok bool) + func (s *Server) Deliver(ctx context.Context, d Delivery) (Reply, error) + func (s *Server) Do(ctx context.Context, c Call) (Reply, error) + func (s *Server) Files() Files + func (s *Server) FindChoices(ctx context.Context, p Person, among, lang, on string) ([]Choice, error) + func (s *Server) FindValues(ctx context.Context, p Person, among string, query url.Values, ...) (FindAnswer, error) + func (s *Server) FormAt(ctx context.Context, p Person, ticket string, revision json.RawMessage) (form json.RawMessage, ok bool, err error) + func (s *Server) Import(ctx context.Context, ticket json.RawMessage) error + func (s *Server) ImportOrganization(ctx context.Context) error + func (s *Server) InOrganization(ctx context.Context, id string) (bool, error) + func (s *Server) KindsSeen(ctx context.Context, p Person) ([]string, error) + func (s *Server) MasterRows(ctx context.Context, master string) (MasterLayout, []map[string]string, error) + func (s *Server) MaxBody() int64 + func (s *Server) MaxBundle() int64 + func (s *Server) MaxOrganization() int64 + func (s *Server) Mine(ctx context.Context, p Person, q MineQuery) ([]json.RawMessage, error) + func (s *Server) Names(ctx context.Context, ids []string) (map[string]Name, error) + func (s *Server) Now() time.Time + func (s *Server) Offered(ctx context.Context, p Person, kind string) (from string, ok bool, err error) + func (s *Server) OpenAPI() ([]byte, error) + func (s *Server) Operations() []string + func (s *Server) Packages() []*Package + func (s *Server) PackagesChanged() <-chan struct{} + func (s *Server) People(ctx context.Context) ([]OrgPerson, error) + func (s *Server) PersonLanguage(ctx context.Context, person string) (string, error) + func (s *Server) ReadBundles(ctx context.Context) error + func (s *Server) Replay(ctx context.Context, ticket string) ([]json.RawMessage, error) + func (s *Server) Replied(ctx context.Context, c Call) (Reply, bool, error) + func (s *Server) Run(ctx context.Context) error + func (s *Server) RunTimers(ctx context.Context) (int, error) + func (s *Server) RunToDo(ctx context.Context) (int, error) + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) SignedBundles() bool + func (s *Server) Submitting(ctx context.Context, p Person, kind string) (Submitting, error) + func (s *Server) Sweep(ctx context.Context) (files, operations int, err error) + func (s *Server) TakesBundles() bool + func (s *Server) Teams(ctx context.Context) ([]Team, error) + func (s *Server) TicketFiles(ctx context.Context, p Person, ticket string) ([]string, error) + func (s *Server) Tickets(ctx context.Context, p Person, q TicketsQuery) ([]json.RawMessage, error) + func (s *Server) Title(kind string, version int, lang string) (title, in string) + func (s *Server) Try(ctx context.Context, c Call) (Reply, error) + func (s *Server) Unpackaged(ctx context.Context) ([]TicketCount, error) + func (s *Server) Upload(ctx context.Context, p Person, info FileInfo, r io.Reader) (string, error) + func (s *Server) UploadOnce(ctx context.Context, p Person, key string, info FileInfo, r io.Reader) (string, error) + func (s *Server) VersionPackage(kind string, version int) *Package + func (s *Server) Waiting(ctx context.Context, p Person, q WaitingQuery) ([]json.RawMessage, error) + func (s *Server) WorkEnded(ctx context.Context, key EffectKey, o WorkEnd) (Reply, error) + func (s *Server) Worked(kind string, version int, in json.RawMessage) (out json.RawMessage, problem string, ok bool, err error) + func (s *Server) Works(ctx context.Context, p Person, ticket string) ([]Work, error) + func (s *Server) Zone(kind string, version int) *time.Location + type Start struct + At time.Time + Day string + How string + Kind string + Number int64 + Record string + Version int + type Store interface + Begin func(ctx context.Context, b Begun) (Begun, error) + BundleArchive func(ctx context.Context, digest string) ([]byte, error) + Bundles func(ctx context.Context) ([]Bundle, error) + CountTickets func(ctx context.Context, versions []KindVersion) ([]TicketCount, error) + DoneToDo func(ctx context.Context, id string, at time.Time) error + Draft func(ctx context.Context, person, id string) (Draft, error) + DueTimers func(ctx context.Context, now time.Time, lease time.Duration, limit int) ([]Timer, error) + DueToDo func(ctx context.Context, now time.Time, lease time.Duration, limit int) ([]ToDo, error) + ForgetDrafts func(ctx context.Context, before time.Time, limit int) (int, error) + ForgetOperations func(ctx context.Context, before time.Time, limit int) (int, error) + Imports func(ctx context.Context, since time.Time) ([]time.Time, error) + KeepDraft func(ctx context.Context, d Draft, max int) error + KeepOutcome func(ctx context.Context, id string, at time.Time, outcome json.RawMessage) error + KeepToDo func(ctx context.Context, t ToDo) error + KeepUpload func(ctx context.Context, u Upload, max int) (id string, err error) + KeptVersions func(ctx context.Context) ([]TicketCount, error) + LastImport func(ctx context.Context) (Record, error) + LatestOrganization func(ctx context.Context) (OrgSnapshot, error) + LetGoUploads func(ctx context.Context, before time.Time, limit int) ([]Upload, error) + Lock func(ctx context.Context, ticket string) (locked context.Context, unlock func(), err error) + Mine func(ctx context.Context, person string, q MineQuery) ([]TicketRecord, error) + Moves func(ctx context.Context, ticket string) ([]MoveRecord, error) + OpenUploads func(ctx context.Context, person string) (int, error) + Operation func(ctx context.Context, person, key string) (OperationRecord, error) + Organization func(ctx context.Context, id string) (OrgSnapshot, error) + PutOffTimer func(ctx context.Context, k TimerKey, try time.Time) error + Record func(ctx context.Context, id string) (Record, error) + Records func(ctx context.Context, q RecordQuery) ([]Line, error) + Renew func(ctx context.Context, b Begun) error + RetryToDo func(ctx context.Context, id string, try time.Time, why string) error + Save func(ctx context.Context, m *Move) error + SaveChange func(ctx context.Context, c *Change) error + SaveOrganization func(ctx context.Context, s OrgSnapshot) error + Starts func(ctx context.Context) ([]Start, error) + Ticket func(ctx context.Context, id string) (TicketRecord, error) + Tickets func(ctx context.Context, q TicketsQuery) ([]TicketRecord, error) + Timers func(ctx context.Context, ticket string) ([]Timer, error) + ToDoItem func(ctx context.Context, id string) (ToDo, error) + ToDoList func(ctx context.Context, ticket string) ([]ToDo, error) + UploadOf func(ctx context.Context, person, key string) (id string, err error) + UploadsDeleted func(ctx context.Context, ids []string) error + Waiting func(ctx context.Context, people []string, q WaitingQuery) ([]TicketRecord, error) + type Submitting struct + For []string + Self bool + Version int + type Team struct + Head string + ID string + Kind string + Name string + NameJa string + Parent string + type TicketCount struct + Kind string + N int + Status string + Version int + type TicketRecord struct + Body json.RawMessage + ID string + Kind string + Number int64 + People []string + Since time.Time + Status string + Updated time.Time + Version int + type TicketsQuery struct + Before string + Kind string + Limit int + Status string + Versions []int + type Timer struct + At time.Time + TryAt time.Time + type TimerKey struct + Stage string + Ticket string + Timer string + type ToDo struct + Body json.RawMessage + Created time.Time + Done bool + DoneAt time.Time + ID string + LastError string + Outcome json.RawMessage + OutcomeAt time.Time + Ticket string + Tries int + TryAt time.Time + What string + type TooManyUploads struct + Kept time.Duration + Max int + func (e *TooManyUploads) Error() string + func (e *TooManyUploads) Is(target error) bool + type TrialStore interface + Trial func(ctx context.Context) (tx any, end func(), err error) + type UnpackagedError struct + Counts []TicketCount + func (e *UnpackagedError) Error() string + type Upload struct + At time.Time + By string + ID string + Key string + type UploadGone struct + ID string + func (e *UploadGone) Error() string + type VectorCheck struct + Kinds []VectorCount + func CheckVectors(ctx context.Context, p *Package) VectorCheck + func (v VectorCheck) Agree() bool + func (v VectorCheck) Vectors() int + func (v VectorCheck) Worked() int + type VectorCount struct + Agree int + Failures []string + Kind string + Missing bool + Nexts int + Starts int + Vectors int + Worked int + type WaitingCounter interface + CountWaiting func(ctx context.Context, person string) (map[string]int, error) + type WaitingQuery struct + Before string + Kind string + Limit int + type Work struct + At time.Time + Flow string + Key EffectKey + Outputs []NamedValue + Reason string + State string + Tries int + type WorkEnd struct + Failed bool + Outputs []NamedValue + Reason string