Documentation
¶
Overview ¶
Package status implements `lifecycle status` (spec-lifecycle.md §5/§9.1, implementation-plan.md §2.6): the read-only gate-state reporter over the records internal/approve writes. For one change folder, Change derives:
- pending: a recognized stage with no recorded gate entry at all (spec-lifecycle.md §5: "pending is DERIVED, never persisted").
- skipped: design has no entry, but the LATEST refine entry carries designSkipped:true (spec-lifecycle.md §3.2/§5 — "absent + upstream designSkipped" is legitimately-absent, not pending).
- approved / rejected: the latest entry per stage-name (internal/approve.LatestPerStage — highest approvedAt, ties broken by array order).
- post-gate artifact drift: for every APPROVED gate, its recorded artifact hashes are re-checked against the change folder's current content (internal/approve.HashDrift) — spec-lifecycle.md §5/§6.2.
Bug-vs-feature stage set (spec-lifecycle.md §8/§2.11) ¶
The relevant stage set is derived from the change TYPE recorded at intake (internal/validate.ReadProposalMeta's Type field — see that package's doc comment for where/why): feature ⇒ refine/design/plan; bug ⇒ repro/fix. A promoted bug's gates[] may ALSO carry design/plan entries in the same folder (spec-lifecycle.md §8's promotion hatch) — Change reports the type's base stage set UNIONED with whatever stage names actually appear in approval-state.json, so a promoted bug's mixed gates are never silently dropped from the report.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeStatus ¶
type ChangeStatus struct {
Change string `json:"change"`
Type string `json:"type"`
Issue string `json:"issue"`
Gates []GateStatus `json:"gates"`
}
ChangeStatus is one change folder's full gate-state report.
func Change ¶
func Change(dir string) (ChangeStatus, error)
Change derives the full gate-state report for the change folder at dir. dir need not exist yet in the trivial sense of having any gate records — a change with only a proposal.md (or nothing at all yet) reports every base stage as pending.
type GateStatus ¶
type GateStatus struct {
Stage approve.Stage `json:"stage"`
State StageState `json:"state"`
DesignSkipped bool `json:"designSkipped,omitempty"`
ApprovedBy string `json:"approvedBy,omitempty"`
ApprovedAt string `json:"approvedAt,omitempty"`
Notes string `json:"notes,omitempty"`
// Drifted lists artifact paths (relative to the change folder) whose
// recorded hash no longer matches current content. Only populated for
// an approved gate; nil means no drift (or the gate isn't approved).
Drifted []string `json:"drifted,omitempty"`
}
GateStatus is one stage's derived state within a ChangeStatus.
type StageState ¶
type StageState string
StageState is one gate's derived reporting state (doc.go).
const ( StatePending StageState = "pending" StateApproved StageState = "approved" StateRejected StageState = "rejected" StateSkipped StageState = "skipped" )
The four recognized StageState values (doc.go).