Documentation
¶
Overview ¶
Package projection computes the user-facing projections — Current Understanding (§5), Recommended Next Move (§6), and What Changed (§7) — deterministically from relational state. They are projections, not a source of truth, and every statement retains provenance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeGroup ¶
ChangeGroup is one grouped category of changes.
type Changed ¶
type Changed struct {
Groups []ChangeGroup `json:"groups"`
Through int64 `json:"through"`
}
Changed is the grouped What Changed projection. Through is the highest event sequence actually consumed by this projection (or the caller's cursor when no events matched) — the client echoes it back to the read-cursor write so that exactly what was shown is marked seen, never events that arrived mid-read.
type DecisionView ¶
type DecisionView struct {
ID string `json:"id"`
Code string `json:"code"`
Question string `json:"question"`
Recommendation string `json:"recommendation"`
Options []string `json:"options"`
Resolution string `json:"resolution,omitempty"`
Status domain.DecisionStatus `json:"status"`
HasDissent bool `json:"has_dissent"`
Dissents []DissentView `json:"dissents"`
Synthesis string `json:"synthesis,omitempty"`
}
DecisionView is a decision in the projection (with dissent presence).
type DissentView ¶
type DissentView struct {
ProponentRole string `json:"proponent_role"`
Position string `json:"position"`
}
DissentView is one dissenting position on a decision (§8).
type Guidance ¶
type Guidance struct {
Action string `json:"action"`
Why string `json:"why"`
Affected []string `json:"affected"`
}
Guidance is the Recommended Next Move projection.
func BuildGuidance ¶
func BuildGuidance(ini domain.Initiative, understanding Understanding) Guidance
BuildGuidance computes the Recommended Next Move with deterministic precedence: judgment items outrank stage advancement (§6, §9).
type QuestionView ¶
type QuestionView struct {
ID string `json:"id"`
Question string `json:"question"`
Status domain.QuestionStatus `json:"status"`
}
QuestionView is an open question in the projection.
type RequirementView ¶
type RequirementView struct {
ID string `json:"id"`
Code string `json:"code"`
Statement string `json:"statement"`
Priority domain.RequirementPriority `json:"priority"`
Status domain.RequirementStatus `json:"status"`
AcceptanceCriteria []domain.AcceptanceCriterion `json:"acceptance_criteria"`
}
RequirementView is a requirement in the projection.
type Understanding ¶
type Understanding struct {
Title string `json:"title"`
Description string `json:"description"`
Status domain.InitiativeStatus `json:"status"`
FailureReason string `json:"failure_reason,omitempty"`
Summary string `json:"summary"`
NeedsJudgment []string `json:"needs_judgment"`
Assertions []UnderstandingItem `json:"assertions"`
Requirements []RequirementView `json:"requirements"`
Decisions []DecisionView `json:"decisions"`
Questions []QuestionView `json:"questions"`
}
Understanding is the Current Understanding projection.
func BuildUnderstanding ¶
func BuildUnderstanding(ctx context.Context, db *store.DB, ini domain.Initiative) (Understanding, error)
BuildUnderstanding assembles the Current Understanding projection.
type UnderstandingItem ¶
type UnderstandingItem struct {
ID string `json:"id"`
Type domain.AssertionType `json:"type"`
Status domain.AssertionStatus `json:"status"`
Statement string `json:"statement"`
Confidence domain.Confidence `json:"confidence"`
Source string `json:"source"`
Provenance []domain.ProvenanceRef `json:"provenance"`
ProducedByRun string `json:"produced_by_run"`
}
UnderstandingItem is one provenance-backed statement.