Documentation
¶
Overview ¶
Package teamintegration composes captured Coding Team results and applies an approved typed manifest without changing parent Git metadata.
Index ¶
- Variables
- func SortedManifestPaths(manifest Manifest) []string
- type ApplyResult
- type ApprovalBinding
- type Artifact
- type AttemptBase
- type AttemptBaseCleanupRequest
- type AttemptBaseRequest
- type AttemptBaseRetainedError
- type BlobReader
- type Cleanup
- type CleanupRequest
- type Composition
- type Conflict
- type ConflictError
- type ConflictKind
- type Entry
- type FileKind
- type FileState
- type Limits
- type Manager
- func (m *Manager) Apply(ctx context.Context, id, token string) (ApplyResult, error)
- func (m *Manager) Cleanup(ctx context.Context, request CleanupRequest) (Cleanup, error)
- func (m *Manager) CleanupAttemptBase(ctx context.Context, request AttemptBaseCleanupRequest) error
- func (m *Manager) Discover(ctx context.Context) ([]RecoveryCandidate, error)
- func (m *Manager) Prepare(ctx context.Context, request PrepareRequest) (Preview, error)
- func (m *Manager) PrepareAttemptBase(ctx context.Context, request AttemptBaseRequest) (AttemptBase, error)
- func (m *Manager) Recover(ctx context.Context, id string, action RecoveryAction) (ApplyResult, error)
- func (m *Manager) Reject(id, token string) error
- func (m *Manager) Resource(id string) (Resource, error)
- type Manifest
- type ManifestEntry
- type Operation
- type Options
- type PathState
- type PrepareRequest
- type Preview
- type RecoveryAction
- type RecoveryCandidate
- type Resource
- type RetainedError
- type RolledBackError
- type Selection
- type TokenRegistry
- type Verification
- type VerificationRequest
- type VerificationStatus
- type Verifier
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalid reports malformed or incomplete integration evidence. ErrInvalid = errors.New("coding team integration: invalid value") // ErrConflict reports captured deltas that cannot be composed exactly. ErrConflict = errors.New("coding team integration: conflict") // ErrLimit reports a configured integration evidence budget exhaustion. ErrLimit = errors.New("coding team integration: limit exceeded") // ErrStale reports a changed approval or repository binding. ErrStale = errors.New("coding team integration: stale approval") // ErrConsumed reports a one-shot approval token that is no longer usable. ErrConsumed = errors.New("coding team integration: approval consumed") // ErrRecovery reports an apply state that cannot be recovered automatically. ErrRecovery = errors.New("coding team integration: recovery required") // ErrRetained reports cleanup evidence intentionally preserved for review. ErrRetained = errors.New("coding team integration: resource retained") )
Functions ¶
func SortedManifestPaths ¶
SortedManifestPaths returns an owned, stable path list for preview callers.
Types ¶
type ApplyResult ¶
ApplyResult reports the terminal parent transaction without exposing private paths.
type ApprovalBinding ¶
type ApprovalBinding struct {
IntegrationID string `json:"integration_id"`
WorkspaceIdentity string `json:"workspace_identity"`
CommonIdentity string `json:"common_identity"`
BranchRef string `json:"branch_ref"`
HeadOID string `json:"head_oid"`
StatusDigest string `json:"status_digest"`
IndexDigest string `json:"index_digest"`
ResourceRevision uint64 `json:"resource_revision"`
SelectionDigest string `json:"selection_digest"`
IntegrationCommit string `json:"integration_commit"`
IntegrationTree string `json:"integration_tree"`
ManifestDigest string `json:"manifest_digest"`
DiffDigest string `json:"diff_digest"`
Verification Verification `json:"verification"`
ExpiresAt time.Time `json:"expires_at"`
}
ApprovalBinding contains every value authorized by one preview.
type Artifact ¶
type Artifact struct {
TaskID string `json:"task_id"`
AttemptID string `json:"attempt_id"`
BaseOID string `json:"base_oid"`
ResultOID string `json:"result_oid"`
ResultRef string `json:"result_ref"`
Base []Entry `json:"base"`
Result []Entry `json:"result"`
}
Artifact is one captured Attempt delta and its immutable identity.
type AttemptBase ¶
type AttemptBase struct {
CommitOID string
TreeOID string
Ref string
CompositionDigest string
DependencyDigest string
DependencyCount int
}
AttemptBase is the immutable Git evidence used before a Worker Worktree is created. Ref is non-empty only when this manager published an Attempt-owned multi-dependency base.
type AttemptBaseCleanupRequest ¶
type AttemptBaseCleanupRequest struct {
Workspace string
TeamID string
AttemptID string
Ref string
CommitOID string
}
AttemptBaseCleanupRequest binds deletion to the exact derived owned ref.
type AttemptBaseRequest ¶
type AttemptBaseRequest struct {
Workspace string
AttemptID string
Timestamp time.Time
Selection Selection
DirectResultOID string
}
AttemptBaseRequest identifies one deterministic dependency base for a consuming Team Attempt. DirectResultOID preserves the single-dependency fast path while still verifying the complete captured closure.
type AttemptBaseRetainedError ¶
type AttemptBaseRetainedError struct {
Base AttemptBase
Cause error
}
AttemptBaseRetainedError reports uncertain publication after an owned ref mutation. Base is durable evidence that callers must persist before retry.
func (*AttemptBaseRetainedError) Error ¶
func (e *AttemptBaseRetainedError) Error() string
func (*AttemptBaseRetainedError) Unwrap ¶
func (e *AttemptBaseRetainedError) Unwrap() []error
type BlobReader ¶
BlobReader returns exact raw Git blob bytes without filters.
type Cleanup ¶
type Cleanup struct {
WorktreeRemoved bool
BranchDeleted bool
IntegrationRefDeleted bool
JournalRemoved bool
}
Cleanup reports exact artifact deletion. Captured Attempt result refs are outside this boundary and are never removed here.
type CleanupRequest ¶
CleanupRequest binds non-force artifact cleanup to one exact Team and prepared Integration resource.
type Composition ¶
type Composition struct {
Entries []Entry `json:"entries"`
Conflicts []Conflict `json:"conflicts"`
Duplicates int `json:"duplicates"`
Digest string `json:"digest"`
}
Composition is an immutable-by-convention composed tree and its evidence.
type Conflict ¶
type Conflict struct {
TaskID string `json:"task_id"`
AttemptID string `json:"attempt_id"`
Path string `json:"path"`
Kind ConflictKind `json:"kind"`
}
Conflict is bounded evidence that a Task delta could not be applied exactly.
type ConflictError ¶
type ConflictError struct {
IntegrationID string
AttemptIDs []string
Composition Composition
}
ConflictError carries bounded deterministic composition evidence. No parent or Integration Worktree mutation has occurred when this error is returned.
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
func (*ConflictError) Unwrap ¶
func (e *ConflictError) Unwrap() error
type ConflictKind ¶
type ConflictKind string
ConflictKind classifies an exact entry-level composition conflict.
const ( ConflictUnknown ConflictKind = "unknown" ConflictAddAdd ConflictKind = "add_add" ConflictModifyModify ConflictKind = "modify_modify" ConflictDeleteModify ConflictKind = "delete_modify" ConflictMode ConflictKind = "mode" ConflictSymlink ConflictKind = "symlink" ConflictPath ConflictKind = "file_directory" )
Supported conflict classifications.
type FileState ¶
type FileState struct {
Kind FileKind `json:"kind"`
Mode string `json:"mode,omitempty"`
OID string `json:"oid,omitempty"`
Size int64 `json:"size,omitempty"`
SHA256 string `json:"sha256,omitempty"`
Binary bool `json:"binary,omitempty"`
}
FileState is one content-addressed manifest side.
type Limits ¶
Limits bounds tree composition, manifest construction, and preview evidence.
func DefaultLimits ¶
func DefaultLimits() Limits
DefaultLimits returns conservative production integration budgets.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager owns immutable Integration artifacts and process-local approvals.
func (*Manager) Cleanup ¶
Cleanup removes one exact clean Integration Worktree and its owned refs. It validates a terminal journal before mutation and never uses force, recursive deletion, prune, or heuristic identity recovery.
func (*Manager) CleanupAttemptBase ¶
func (m *Manager) CleanupAttemptBase( ctx context.Context, request AttemptBaseCleanupRequest, ) error
CleanupAttemptBase CAS-deletes only the exact derived Attempt-owned base ref. A missing ref is an idempotent success; prerequisite result refs cannot satisfy the derivation check.
func (*Manager) Discover ¶
func (m *Manager) Discover(ctx context.Context) ([]RecoveryCandidate, error)
Discover returns non-terminal journals without mutating their state.
func (*Manager) PrepareAttemptBase ¶
func (m *Manager) PrepareAttemptBase( ctx context.Context, request AttemptBaseRequest, ) (AttemptBase, error)
PrepareAttemptBase verifies a captured dependency closure and either returns the exact single dependency result or publishes one deterministic multi-dependency base ref. It never changes the parent Worktree or index.
func (*Manager) Recover ¶
func (m *Manager) Recover( ctx context.Context, id string, action RecoveryAction, ) (ApplyResult, error)
Recover explicitly completes or rolls back one interrupted journal.
type Manifest ¶
type Manifest struct {
Entries []ManifestEntry `json:"entries"`
Added int `json:"added"`
Changed int `json:"changed"`
Deleted int `json:"deleted"`
Binary int `json:"binary"`
Digest string `json:"digest"`
}
Manifest is the canonical Team-base to Integration-tree transition.
func BuildManifest ¶
func BuildManifest( ctx context.Context, reader BlobReader, baseEntries []Entry, targetEntries []Entry, limits Limits, ) (Manifest, error)
BuildManifest creates a canonical Team-base to composed-tree manifest.
type ManifestEntry ¶
type ManifestEntry struct {
Path string `json:"path"`
Operation Operation `json:"operation"`
Base FileState `json:"base"`
Target FileState `json:"target"`
}
ManifestEntry is one exact parent Workspace path transition.
type Options ¶
type Options struct {
GitPath string
ProductRoot string
WorktreesRoot string
IntegrationsRoot string
Limits Limits
ApprovalTTL time.Duration
}
Options configures the trusted Team integration boundary.
type PathState ¶
type PathState string
PathState classifies one recovery path against its journal evidence.
type PrepareRequest ¶
PrepareRequest identifies one exact parent Workspace and result selection.
type Preview ¶
type Preview struct {
ID string
AttemptIDs []string
CommitOID string
TreeOID string
Manifest Manifest
DiffDigest string
Verification Verification
ApprovalToken string
ApprovalTokenHash string
ExpiresAt time.Time
}
Preview is the bounded evidence presented before applying parent changes.
type RecoveryAction ¶
type RecoveryAction string
RecoveryAction selects an explicit convergence direction.
const ( RecoveryComplete RecoveryAction = "complete" RecoveryRollback RecoveryAction = "rollback" )
Supported explicit recovery actions.
type RecoveryCandidate ¶
type RecoveryCandidate struct {
ID string
State string
Base int
Target int
Unknown int
JournalHash string
}
RecoveryCandidate is a bounded read-only interrupted transaction projection.
type Resource ¶
type Resource struct {
ID string
Workspace workspace.Identity
Directory workspace.Identity
GitDir workspace.Identity
CommonDir workspace.Identity
ObjectFormat string
BranchRef string
IntegrationRef string
BaseOID string
CommitOID string
LockReason string
}
Resource is the private application projection of one prepared Worktree. Frontends should use Preview instead.
type RetainedError ¶
RetainedError reports an artifact that was intentionally left inspectable.
func (*RetainedError) Error ¶
func (e *RetainedError) Error() string
func (*RetainedError) Unwrap ¶
func (e *RetainedError) Unwrap() []error
type RolledBackError ¶
RolledBackError reports an apply attempt that wrote parent paths but safely restored every one to its exact base state. The Integration artifact remains retained for inspection.
func (*RolledBackError) Error ¶
func (e *RolledBackError) Error() string
func (*RolledBackError) Unwrap ¶
func (e *RolledBackError) Unwrap() error
type Selection ¶
type Selection struct {
TeamID string `json:"team_id"`
ResourceRevision uint64 `json:"resource_revision"`
BaseOID string `json:"base_oid"`
Base []Entry `json:"base"`
Artifacts []Artifact `json:"artifacts"`
}
Selection is the stable dependency-closed result order chosen for one gate.
type TokenRegistry ¶
type TokenRegistry struct {
// contains filtered or unexported fields
}
TokenRegistry owns process-local, one-shot integration approvals.
func NewTokenRegistry ¶
func NewTokenRegistry() *TokenRegistry
NewTokenRegistry returns an empty approval registry.
func (*TokenRegistry) Available ¶
func (r *TokenRegistry) Available(token string) bool
Available reports whether token is still process-local and unconsumed. The result grants no authority; Consume remains the only authorization boundary.
func (*TokenRegistry) Consume ¶
func (r *TokenRegistry) Consume(token string, current ApprovalBinding) error
Consume invalidates token before reporting whether current still matches it.
func (*TokenRegistry) Issue ¶
func (r *TokenRegistry) Issue(binding ApprovalBinding) (string, string, error)
Issue creates one opaque approval token bound to the complete preview.
func (*TokenRegistry) Reject ¶
func (r *TokenRegistry) Reject(token string) error
Reject invalidates a token without granting any mutation.
type Verification ¶
type Verification struct {
Status VerificationStatus `json:"status"`
TreeOID string `json:"tree_oid"`
CommandFingerprint string `json:"command_fingerprint,omitempty"`
OutputDigest string `json:"output_digest,omitempty"`
ExitCode int `json:"exit_code,omitempty"`
Signal string `json:"signal,omitempty"`
DurationMillis int64 `json:"duration_millis,omitempty"`
Truncated bool `json:"truncated,omitempty"`
Digest string `json:"digest"`
}
Verification is bounded evidence for one immutable Integration tree.
type VerificationRequest ¶
type VerificationRequest struct {
IntegrationID string
Workspace workspace.Workspace
TreeOID string
}
VerificationRequest identifies the immutable isolated tree to validate.
type VerificationStatus ¶
type VerificationStatus string
VerificationStatus is the normalized validation outcome.
const ( VerificationNotRun VerificationStatus = "not_run" VerificationPassed VerificationStatus = "passed" VerificationFailed VerificationStatus = "failed" VerificationTimeout VerificationStatus = "timeout" VerificationApprovalNeeded VerificationStatus = "approval_required" )
Supported verification outcomes.
type Verifier ¶
type Verifier interface {
Verify(context.Context, VerificationRequest) (Verification, error)
}
Verifier runs ordinary policy-controlled validation in the isolated Integration Workspace. It must not mutate the Integration tree.