Documentation
¶
Overview ¶
Package resultmerge consumes one bounded background result and applies it to the authoritative parent continuity branch. It owns no branch store or scheduler; both are deliberately consumed through the small interfaces below.
Index ¶
Constants ¶
const ( DefaultMaxCapsuleBytes = 1 << 20 DefaultMaxCapsuleTokens = 2_500 )
const DefaultCommitTimeout = time.Second
Variables ¶
var ( ErrInvalidJob = errors.New("resultmerge: invalid pending job") ErrInvalidParentState = errors.New("resultmerge: invalid parent state") ErrInvalidResult = errors.New("resultmerge: invalid collected result") ErrAwaitTimeout = errors.New("resultmerge: result await timed out") ErrStaleResult = errors.New("resultmerge: stale result") ErrRejected = errors.New("resultmerge: result rejected") )
Functions ¶
This section is empty.
Types ¶
type BackgroundClient ¶
type BackgroundClient interface {
Await(context.Context, auxiliary.JobID) (lipapi.Collected, error)
Forget(auxiliary.JobID)
}
BackgroundClient is intentionally smaller than auxiliary.BackgroundClient: late-result consumption cannot submit work and therefore cannot accidentally create a new billable job.
type Config ¶
Config bounds the next serialized capsule. Both dimensions are enforced independently by capsule.PruneWithLimits before parent commit.
type DecodeInput ¶
type DecodeInput struct {
Previous capsule.Envelope
ExpectedBranch string
SourceHighWatermark string
}
DecodeInput is built only after the parent capsule has been verified. It is the complete authority context required by a strict result parser.
type DeltaDecoder ¶
DeltaDecoder is implemented by the strict extractor-result parser. A successful return promises that the JSON/schema and semantic bounds have already been checked; Service still rechecks branch and revision bindings.
type ExtractorDecoder ¶
type ExtractorDecoder struct {
// contains filtered or unexported fields
}
ExtractorDecoder adapts the strict feature extractor parser to the late result seam. It deliberately parses against the verified parent supplied by Service rather than trusting child-provided branch or revision metadata.
func NewExtractorDecoder ¶
func NewExtractorDecoder(cfg ExtractorDecoderConfig) *ExtractorDecoder
func (*ExtractorDecoder) Decode ¶
func (d *ExtractorDecoder) Decode(collected lipapi.Collected, input DecodeInput) (capsule.Delta, error)
type ExtractorDecoderConfig ¶
ExtractorDecoderConfig captures only immutable parser policy for one generation/job. Source references are bounded sanitized-source handles, never transcript or branch identifiers.
type Outcome ¶
type Outcome struct {
Status Status
State ParentState
}
type ParentCoordinator ¶
type ParentCoordinator interface {
ValidatePendingJob(context.Context, string, auxiliary.JobID) (ParentState, error)
CommitCapsuleForJob(context.Context, string, auxiliary.JobID, string, uint64, []byte, [32]byte, string) (ParentState, error)
}
ParentCoordinator is an adapter seam for the process-owned coordinator. The branch binding is the only branch identity visible here; a child A-leg is never a lookup key. CommitCapsuleForJob must perform its own job-bound CAS.
type ParentState ¶
type ParentState struct {
BranchBinding string
Revision uint64
CapsuleJSON []byte
CapsuleDigest [32]byte
SourceHighWatermark string
PendingJobID auxiliary.JobID
PendingJobTargetRevision uint64
PendingJobBranchBinding string
}
ParentState is the opaque state needed by this feature-owned merger. The coordinator returns defensive copies, so this package never mutates a store snapshot in place.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(background BackgroundClient, parent ParentCoordinator, decoder DeltaDecoder, cfg Config) (*Service, error)