Documentation
¶
Overview ¶
Package gate implements the entry gate of §6.3: the four checks a task must pass before devclean spends a single token on it.
- el contrato es válido (version, id, límites)
- listo_cuando existe y se ejecuta
- el comando falla hoy (si ya pasa, la tarea no tiene sentido)
- tocar_solo se declara si hace falta y no se cruza con el de otra
- tocar_solo no incluye zonas prohibidas globales ni rutas de prueba
All checks are pure code: no model is involved in verification.
Index ¶
Constants ¶
View Source
const DefaultTimeout = 5 * time.Minute
DefaultTimeout is the maximum time check 2 gives listo_cuando to run.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
Nombre string `json:"nombre"`
OK bool `json:"ok"`
Motivo string `json:"motivo,omitempty"`
}
Check is the result of one gate check.
type Result ¶
type Result struct {
ID string `json:"id"`
Aprobada bool `json:"aprobada"`
Chequeos []Check `json:"chequeos"`
Aviso string `json:"aviso,omitempty"`
}
Result is the outcome of running the gate on one task.
func Run ¶
func Run(ctx context.Context, root string, cfg config.Config, t task.Task, otras []task.Task, timeout time.Duration) Result
Run executes the five checks in order. Check 2 runs listo_cuando for real, with timeout, in the repository root. otras carries only the tasks already en_curso, which is what decides whether tocar_solo may stay empty (adenda A.4).
func (Result) PrimerMotivo ¶
PrimerMotivo returns the reason of the first failed check.
Click to show internal directories.
Click to hide internal directories.