app

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package app assembles Ripen from its parts and answers the reads. Every surface — CLI, MCP, Web UI — builds the same App, so they cannot answer the same question differently.

Reads need only the policy and the state store. The network clients and credentials live behind Updater, which the read paths never call: that is what lets a read-only surface run without loading a single secret.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAuditRequest = errors.New("invalid audit request")

ErrInvalidAuditRequest identifies invalid audit pagination parameters.

Functions

func NeedsAttention

func NeedsAttention(report updater.Report) bool

NeedsAttention reports whether a run is one a person has to look at: an open breaker or a failed rollback, and nothing else.

func ProposedPayload

func ProposedPayload(result updater.Result, runID string) response.Proposed

ProposedPayload renders a Proposal on the wire.

func RunPayload

func RunPayload(report updater.Report) response.Run

RunPayload renders a run report on the wire. Every surface renders it the same way, because they all call this.

func Versions

func Versions() response.Versions

Versions reports every independently moving version.

Types

type App

type App struct {
	Policy *config.Policy
	Store  *state.Store
	Clock  updater.Clock
}

App is a loaded policy and an open state store.

func Open

func Open(configPath string) (*App, error)

Open loads the policy and opens the state store it names.

func (*App) Audit

func (a *App) Audit(request AuditRequest) (response.Audit, error)

Audit answers `ripen audit` from the attempts table — the record of what Ripen did, never the Event stream.

func (*App) Candidates

func (a *App) Candidates() (response.Candidates, error)

Candidates answers `ripen candidates`: every Candidate under observation, with whether it has matured.

func (*App) Close

func (a *App) Close() error

Close releases the state store.

func (*App) Events

func (a *App) Events(actor domain.Actor, stream io.Writer) (*event.Stream, *notifier.Webhook, error)

Events builds the Event stream for one surface: the structured sink, which is always on and writes every Event, plus the webhook Notifier when the policy configures one. The returned Webhook is nil when no Notifier is configured; close it to drain what is queued.

func (*App) Explain

func (a *App) Explain(stack string) (response.Explain, error)

Explain answers `ripen explain <stack>`: what the next run would do with this stack, and what is standing in the way. It reads policy and state only — no backend, no registry, no network.

func (*App) NotifierHealth

func (a *App) NotifierHealth(dropped int) (response.NotifierHealth, error)

NotifierHealth reports what is durable about Notifier delivery, plus this process's in-memory drop count.

func (*App) Services

func (a *App) Services() []ServiceRef

Services enumerates every configured Service in policy order.

func (*App) Status

func (a *App) Status() (response.Status, error)

Status answers `ripen status`: policy-driven, with every configured Service present whether or not it has ever been observed.

func (*App) Updater

func (a *App) Updater(actor domain.Actor, events updater.EventSink) (*updater.Updater, error)

Updater builds the write path: backend clients, the registry client, health checks, and the forge adapter. Calling this is what loads credentials, so a read-only surface must not.

type AuditRequest added in v1.2.0

type AuditRequest struct {
	Limit   string
	Cursor  string
	RunID   string
	Backend string
	Stack   string
	Service string
	Result  string
}

AuditRequest selects and pages recorded attempts using transport input values. Empty pagination values select the newest 50 attempts.

type ServiceRef

type ServiceRef struct {
	Key       state.Key
	Stack     config.StackPolicy
	Enabled   bool
	AutoApply bool
	Health    config.HealthPolicy
}

ServiceRef is one Service the policy declares: the state Key it is recorded under, plus the rules that apply to it. Reads are driven by this list, not by what the state store happens to contain, so a configured-but-never-observed Service still appears.

Jump to

Keyboard shortcuts

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