Documentation
¶
Overview ¶
Package derive owns M5's pure derivation seam and C-P5 dirty-set drain loop. Classification policy remains outside the sync engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PullRequestIdentity ¶
PullRequestIdentity returns the stable C-D3 identity for a loose pull request.
func StackIdentity ¶
StackIdentity returns the stable C-D3 identity for a repository stack.
Types ¶
type Deriver ¶
type Deriver interface {
Derive(Snapshot) []ScopeResult
}
Deriver is the pure C-D1 seam. Implementations may inspect only Snapshot and must perform no I/O.
type NoopDeriver ¶
type NoopDeriver struct{}
NoopDeriver is the default M5 implementation. It proves the drain loop and leaves classification to the future derivation project.
func (NoopDeriver) Derive ¶
func (NoopDeriver) Derive(snapshot Snapshot) []ScopeResult
Derive returns one empty, scope-owned result per input and performs no I/O.
type Options ¶
type Options struct {
Pool *pgxpool.Pool
Deriver Deriver
DirtyCap int
PollInterval time.Duration
Observer Observer
InstallationID int64
Tracer trace.Tracer
}
Options configures the dirty-set loop.
type ScopeResult ¶
type ScopeResult struct {
ScopeKey string `json:"scope_key"`
WorkItems []WorkItem `json:"work_items"`
}
ScopeResult is the complete derived output owned by one claimed C-D2 scope. Returning an empty WorkItems set removes every prior item for that scope.
type ScopeSnapshot ¶
type ScopeSnapshot struct {
ScopeKey string
OrgID int64
RepoID int64
Data json.RawMessage
}
ScopeSnapshot contains a dirty scope and its cache rows encoded as one stable JSON document for the pure deriver. Data contains only live cache rows; a loose-PR scope never contains a PR currently owned by a stack.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service drains dirty scopes and applies each derivation batch atomically.
func New ¶
New constructs a C-D2/C-P5 derivation service. NoopDeriver is wired when no implementation is supplied.
func (*Service) Run ¶
Run drains full batches immediately, then uses dirty-set NOTIFY as a latency hint with interval polling as the correctness path.
type Snapshot ¶
type Snapshot struct {
Scopes []ScopeSnapshot
}
Snapshot is one snapshot-consistent cache view for an entire claimed dirty set (C-D2/C-P5).
type SnapshotLoader ¶
type SnapshotLoader struct{}
SnapshotLoader loads all cache state for a claimed C-D2 scope set with one set-oriented query inside the derivation transaction.