projection

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type ChangeGroup struct {
	Category string   `json:"category"`
	Items    []string `json:"items"`
}

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.

func BuildChanged

func BuildChanged(ctx context.Context, db *store.DB, sinceSeq int64, limit int) (Changed, error)

BuildChanged summarizes events since sinceSeq into grouped, narrated items (§7). The raw event timeline is served separately via /activity.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL