Documentation
¶
Overview ¶
Package task implements the task contract of §6.1: one markdown file per task under .devclean/tasks/, with a frontmatter block in the same yaml subset as config.yml and a free notes body.
Index ¶
Constants ¶
const ( DefaultLimiteIntentos = 3 DefaultLimiteLineas = 200 )
Defaults for the optional contract fields (§6.1).
const Version = 1
Version is the contract version this binary understands (adenda A.1). A file declaring a higher one is read tolerantly and reported.
Variables ¶
This section is empty.
Functions ¶
func NombreDeFirma ¶ added in v0.2.5
NombreDeFirma reduce una firma de `expone`/`usa` al identificador que tiene que aparecer sí o sí en el código: "wol.Send(mac string) error" → "Send", "POST /wake" → "/wake".
Deliberadamente no compara la firma completa. El lenguaje reescribe los nombres de parámetros y el orden de los tipos, así que exigir el texto literal rechazaría implementaciones correctas. Lo que sí atrapa es el fallo real: que la tarea no haya implementado la pieza, o la haya bautizado distinto de lo que su hermana espera. La verificación por AST completo es v0.2 (§6.8).
Types ¶
type Task ¶
type Task struct {
Version int `json:"version"`
ID string `json:"id"`
Titulo string `json:"titulo"`
Porque string `json:"porque"`
ListoCuando string `json:"listo_cuando"`
TocarSolo []string `json:"tocar_solo"`
NoTocar []string `json:"no_tocar"`
DependeDe []string `json:"depende_de,omitempty"`
// Expone son las firmas públicas que esta tarea produce y que otras
// consumen: "wol.Send(mac, addr string) error", "POST /wake".
// Usa son las que consume de sus hermanas (§6.10). Congelarlas en
// ambos contratos es lo que deja que dos tareas de la misma oleada,
// que corren ciegas en cuartos separados, se encuentren.
Expone []string `json:"expone,omitempty"`
Usa []string `json:"usa,omitempty"`
LimiteIntentos int `json:"limite_intentos"`
LimiteLineas int `json:"limite_lineas"`
Riesgos string `json:"riesgos"`
Peso string `json:"peso,omitempty"` // liviana | media | pesada ("" = estrategia global)
// Notas is the free body after the frontmatter.
Notas string `json:"notas,omitempty"`
// Aviso carries the warning of a contract written by a newer
// devclean: it parsed, but fields were skipped.
Aviso string `json:"aviso,omitempty"`
}
Task is the task contract. ListoCuando is the only mandatory field beyond id and titulo; the rest carry defaults.
func List ¶
List returns every task in dir, sorted by ID. A malformed file fails the whole listing: the tasks directory must stay clean.