Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler serves GET /api/v1/plan: the target DAG magus derives for plain work, with live per-node state. Every run has a plan - the engine computes one to dispatch at all - and this is that plan, not a document anybody authored.
With no ?target the server picks the anchor itself, because the question a reader has in front of a running build is "what is happening", not "what would happen if I ran ci": the in-flight run's target, else the most recent captured output's, else "ci". ?target=<name> overrides that; an unknown one is a 400 rather than an empty graph, since an empty plan and a misspelled target render identically and only one of them is the reader's mistake.
It REPORTS and never gates: a red node is a fact on the wire, not a reason to refuse.
func NewHandler ¶
NewHandler returns the GET /api/v1/plan handler. root is the workspace this daemon fronts, used to drop pool entries belonging to another workspace; empty disables that filter (every pool entry then counts, which is the honest degradation for a caller that cannot say which tree it is serving).
type Source ¶
type Source interface {
TargetGraph(ctx context.Context) (types.TargetGraphOutput, error)
StatusReport(ctx context.Context) types.StatusReport
}
Source is the narrow consumer contract the plan handler needs from the console service: the statically extracted target graph (the plan's STRUCTURE) and the live status report (its STATE). Both are satisfied by *console.Service; the handler package holds no concrete service, matching insightSource and diffSource above.
TargetGraph is the same call `magus describe graph -o json` makes and the same bytes gen/target-graph.json holds, read from the loaded workspace rather than from that file - a generated snapshot is only as fresh as the last `generate`, and this route reports live.