Documentation
¶
Overview ¶
Package compose implements the spec→ship phase machine (ADR-0002) that enforces the house gates: grill → spec → implement → verify → review → finish. The machine's job is to make the gates unskippable — a phase cannot be left until its gate is satisfied, so "no code before an approved spec" and "no finish with an open Advisor finding" are structural rather than advisory.
Index ¶
- Variables
- type Finding
- type Phase
- type Session
- func (s *Session) AddFinding(id, detail string)
- func (s *Session) AddTask(id, title string) error
- func (s *Session) Advance() error
- func (s *Session) ApproveSpec() error
- func (s *Session) CompleteGrill(notes string) error
- func (s *Session) Current() Phase
- func (s *Session) GrillNotes() string
- func (s *Session) MarkTaskGreen(id string) error
- func (s *Session) OpenFindings() []Finding
- func (s *Session) RecordAdvisorRun() error
- func (s *Session) RecordFailingTest(id string) error
- func (s *Session) RecordProductionCode(id string) error
- func (s *Session) RecordVerifyPass() error
- func (s *Session) ResolveFinding(id string) bool
- func (s *Session) SpecPath() string
- func (s *Session) Tasks() []Task
- func (s *Session) WriteSpec(body string) error
- type Task
Constants ¶
This section is empty.
Variables ¶
var ( // ErrGateBlocked means the current phase's gate is not satisfied yet. ErrGateBlocked = errors.New("compose: phase gate blocked") // ErrTDDViolation means production code was attempted before a failing test. ErrTDDViolation = errors.New("compose: TDD violation") // ErrWrongPhase means the operation is not valid in the current phase. ErrWrongPhase = errors.New("compose: wrong phase") )
Sentinel errors. Callers use errors.Is to distinguish a blocked gate (retry after satisfying it) from a TDD violation (the caller did something in the wrong order).
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// Root is the project root; feature documents live under
// <Root>/docs/compose/spec/.
Root string
// Feature names the feature being composed.
Feature string
// contains filtered or unexported fields
}
Session is one feature's walk through the compose phases.
func NewSession ¶
NewSession starts a compose session for feature, rooted at root.
func (*Session) AddFinding ¶
AddFinding records an Advisor finding. Open findings block finish.
func (*Session) Advance ¶
Advance moves to the next phase if the current phase's gate is satisfied, otherwise returns ErrGateBlocked and stays put.
func (*Session) ApproveSpec ¶
ApproveSpec marks the written spec approved, opening the implement gate.
func (*Session) CompleteGrill ¶
CompleteGrill records the clarifying notes from the grill phase and advances to spec. Empty notes mean the grill did not actually happen.
func (*Session) GrillNotes ¶
GrillNotes returns the recorded grill notes.
func (*Session) MarkTaskGreen ¶
MarkTaskGreen records that a task's tests now pass. Requires production code, which in turn required a red test.
func (*Session) OpenFindings ¶
OpenFindings returns the unresolved findings.
func (*Session) RecordAdvisorRun ¶
RecordAdvisorRun records that the Advisor review pass actually ran. Zero findings only counts when the Advisor ran (T-081).
func (*Session) RecordFailingTest ¶
RecordFailingTest records that a failing (red) test was shown for a task — the precondition for writing production code.
func (*Session) RecordProductionCode ¶
RecordProductionCode records production code for a task. It is refused unless a failing test was recorded first (TDD gate, T-081).
func (*Session) RecordVerifyPass ¶
RecordVerifyPass records the verify phase's evidence (build/tests green).
func (*Session) ResolveFinding ¶
ResolveFinding marks a finding resolved, reporting whether the id was found.
type Task ¶
type Task struct {
ID string
Title string
// FailingTest records that a red test was shown for this task.
FailingTest bool
// ProductionCode records that production code was written (only legal after
// FailingTest).
ProductionCode bool
// Green records that the task's tests now pass.
Green bool
}
Task is one implementable unit inside the implement phase. The TDD gate tracks its red→green progression.