Documentation
¶
Overview ¶
Package explain answers "where is this project and what can I do next" in one pass, and renders that answer as text for a person or as JSON for an agent.
One gather, two renderings, on purpose. `orch explain` and the MCP server's `orch_context` tool exist to tell the same story to different readers, and the way that story drifts is by being assembled twice — the migration has already turned up a duplicated `dashboard:` block and two spellings of `burndown_by_day`, both the same shape of mistake.
It does not live in internal/project: that package is deliberately the narrow "tasks.json plus the runtime row plus what the event log says" layer that `orch status` depends on, and pulling the budget guardrail into it would make every consumer of Hydrate depend on the gate. Imports project, graph, budget, model; imported by cli and mcp, never the other way.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Budget ¶
type Budget struct {
Enabled bool `json:"enabled"`
Providers map[string]budget.ProviderSnapshot `json:"providers"`
}
Budget is the rolling window per provider.
Shape and spelling are `orch_budget`'s, which are `/api/budgets`'s, which are Python's — one spelling of a provider's window across every surface. `Providers` is an empty map rather than null when nothing is configured, so a caller iterates it without branching on a case that does not exist.
type BudgetReporter ¶
type BudgetReporter interface {
Disabled() bool
Snapshot(ctx context.Context) (map[string]budget.ProviderSnapshot, error)
}
BudgetReporter is the slice of *budget.Gate this needs.
An interface rather than the concrete gate so a project with no budgets.yaml passes nil and gets "not configured", instead of this package having to build a disabled gate in order to ask. Same shape `internal/mcp` already uses for `orch_budget`.
type Options ¶
type Options struct {
ProjectID string
ProjectRoot string
SpecRoot string
Tasks []model.Task
// Budget may be nil, which means the project has no budgets.yaml.
Budget BudgetReporter
}
Options is what Gather needs.
Tasks arrive already loaded and hydrated, rather than being read here: the MCP server has them in hand by the time it asks, and reading them twice per call to keep this function self-contained would be paying for tidiness with the caller's round trips.
type Overview ¶
type Overview struct {
Project Project `json:"project"`
Ready []ReadyTask `json:"ready"`
Budget Budget `json:"budget"`
}
Overview is the whole answer.
func (Overview) Text ¶
Text renders the overview for a person: what this project is, where the DAG stands, what could run right now, what the guardrail thinks, and the commands that are safe to type next.
It is deliberately about thirty lines. The point of `orch explain` is to be read in full by somebody who has just walked in — an operator returning to a project after a week, or an agent that has been handed a repository and no context. A screen that scrolls is a screen that gets skimmed, so anything that only matters once you have a question is left to the command that answers that question.
type Project ¶
type Project struct {
ID string `json:"id"`
Root string `json:"root"`
// SpecRoot is what a task's spec_ref is relative to.
SpecRoot string `json:"spec_root"`
// Counts is tasks per status. EVERY status is present, zero included: an
// agent comparing "how many are blocked" against a missing key would read
// it as none.
Counts map[string]int `json:"counts"`
Total int `json:"total"`
}
Project is the frame: which project, where, and how its tasks stand.
The JSON names are the ones `orch_context` already publishes. They are a contract with the agents reading that tool, not a fresh choice.
type ReadyTask ¶
type ReadyTask struct {
ID string `json:"id"`
Title string `json:"title"`
Phase int `json:"phase"`
Model string `json:"model"`
// EstimateHours is the plan's guess, not a measurement.
EstimateHours float64 `json:"estimate_hours"`
}
ReadyTask is one task that could be dispatched right now.