Documentation
¶
Overview ¶
Package brief assembles the handoff brief (接手包, design 2026-10-10-handoff-brief-and-knowledge-loop §一): everything a fresh agent session needs to take over an issue or a plan, in one bounded text.
It reads the repository tracker, git and docs/ directly, and the server through the narrow Client interface; a section that needs the server is skipped with a note when there is none. Like internal/focusremote it sits between the command layer and tracker (tracker must not import client), so `gofer issue|plan brief` and the MCP gofer_issue_brief / gofer_plan_brief tools only bind inputs and print.
Index ¶
Constants ¶
const ClientTimeout = 8 * time.Second
ClientTimeout bounds every server request a brief makes, so an unreachable server costs seconds, not the client's default 30s per call. 3s proved too tight while the host was busy (a 200-job list timed out under a full test run); a refused connection still fails at once, so only a hung server pays the full bound.
const DefaultMaxLines = 400
DefaultMaxLines caps the rendered brief (`--max-lines`).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Brief ¶
type Brief struct {
Kind string `json:"kind"` // issue | plan
ID string `json:"id"`
Sections []Section `json:"sections"`
}
Brief is a rendered handoff brief.
func IssueBrief ¶
IssueBrief assembles the brief of one repository issue (design §一, sections in order: issue → 上下文树 → 设计稿 → 相关提交 → 相关 job / plan → 适用记忆 → 接手提示).
type Client ¶
type Client interface {
ListJobs(opts job.ListOpts) ([]job.JobResult, error)
ListPlans(opts client.PlanListOpts) (client.PlanList, error)
GetPlan(id string) (client.Plan, error)
GetPlanHandoff(id string, version int) (client.PlanHandoff, error)
ListScopedMemories(opts client.ScopedMemoryListOpts) ([]client.ScopedMemory, error)
}
Client is the slice of the server API a brief reads.
type Options ¶
type Options struct {
// Store is the repository tracker (required for an issue brief; optional for a
// plan brief, where it resolves the issues the todos mention).
Store *tracker.Store
// Root is the repository root for git and docs/ (default Store.RepoRoot()).
Root string
// Client is the server; nil skips the server sections with ClientNote.
Client Client
ClientNote string
// ProjectKey scopes job / plan / project-memory lookups ("" = all projects for
// jobs and plans, no project memories).
ProjectKey string
// AgentName filters `agent:<name>` tagged memories (tracker.MemoryForAgent).
AgentName string
MaxLines int
Now time.Time
}
Options are the inputs of a brief.
type Section ¶
type Section struct {
Title string `json:"title"`
Lines []string `json:"lines,omitempty"`
// Note says why the section is empty or partial (e.g. no server).
Note string `json:"note,omitempty"`
// More is the command that shows what the brief left out.
More string `json:"more,omitempty"`
// Truncated counts the lines cut to fit max-lines.
Truncated int `json:"truncated,omitempty"`
}
Section is one titled part of a brief.