Documentation
¶
Overview ¶
Package projectsync synchronizes preserved project replicas. Immutable, content-addressed checkpoints are the common base; no source is ever moved, reset, or deleted. Imports use a durable journal and the registry's path gates.
Index ¶
- Constants
- func NormalizeIncludes(paths []string) ([]string, error)
- func ProtocolVersion() int
- type Chat
- type Checkpoint
- type Conflict
- type Entry
- type Git
- type IgnoredPath
- type Manifest
- type ObjectPage
- type Operation
- type Preview
- type PreviewRequest
- type Request
- type Resource
- type RunGuard
- type Service
- func (s *Service) AcceptCheckpoint(ctx context.Context, c Checkpoint) error
- func (s *Service) ActiveCount() int
- func (s *Service) Cancel(id string) (Operation, error)
- func (s *Service) Checkpoint(id string) (Checkpoint, error)
- func (s *Service) Close()
- func (s *Service) Get(id string) (Operation, error)
- func (s *Service) GetObject(id string) ([]byte, error)
- func (s *Service) List() ([]Operation, error)
- func (s *Service) Missing(ids []string) ([]string, error)
- func (s *Service) Objects(id string, cursor int) (ObjectPage, error)
- func (s *Service) Preview(ctx context.Context, req PreviewRequest) (Preview, error)
- func (s *Service) PutObject(id string, b []byte) error
- func (s *Service) Retry(id string) (Operation, error)
- func (s *Service) Start(kind string, req Request) (Operation, error)
- func (s *Service) Wait(ctx context.Context, id string) (Operation, error)
- type Write
Constants ¶
const ChunkSize = 256 << 10
const Version = 2
Variables ¶
This section is empty.
Functions ¶
func NormalizeIncludes ¶
Literal, portable relative paths. These are not shell arguments or glob rules.
func ProtocolVersion ¶
func ProtocolVersion() int
Directory fsync and native file replacement currently have end-to-end support on macOS and Linux. Other hosts must not advertise a durability guarantee.
Types ¶
type Chat ¶
type Chat struct {
ID string `json:"id"` // shared logical chat ID, never a workspace-local cache ID
Harness string `json:"harness"`
ProfileName string `json:"profileName"`
Title string `json:"title"`
NativeTitle string `json:"nativeTitle,omitempty"`
TitleIsUserSet bool `json:"titleIsUserSet,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt,omitempty"`
SessionID string `json:"sessionId,omitempty"`
ArchiveVersion int `json:"archiveVersion"`
NativeFiles []string `json:"nativeFiles,omitempty"` // keys in Manifest.Entries
}
type Checkpoint ¶
type IgnoredPath ¶
type Manifest ¶
type Manifest struct {
Version int `json:"version"`
ProjectID string `json:"projectId"` // logical identity
Name string `json:"name"`
RepoURL string `json:"repoUrl,omitempty"`
IconPath *string `json:"iconPath,omitempty"`
CreatedAt string `json:"createdAt"`
Parents []string `json:"parents"`
Entries map[string]Entry `json:"entries"` // files/, native/<harness>/, records/<logical chat>
Chats map[string]Chat `json:"chats"`
Artifacts map[string]artifact.Record `json:"artifacts,omitempty"`
Git *Git `json:"git,omitempty"`
// Excluded paths are outside this checkpoint's file scope, never deletions.
Excluded []string `json:"excluded,omitempty"`
// A filtered historical checkpoint retains its original merge identity.
Origin string `json:"origin,omitempty"`
}
type ObjectPage ¶
type Operation ¶
type Operation struct {
Request
Kind string `json:"kind"`
Status string `json:"status"`
Phase string `json:"phase"`
Progress float64 `json:"progress"`
ResultProjectID string `json:"resultProjectId,omitempty"`
ResultCheckpointID string `json:"resultCheckpointId,omitempty"`
RecoveryCheckpointID string `json:"recoveryCheckpointId,omitempty"`
Conflicts []Conflict `json:"conflicts,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type Preview ¶
type Preview struct {
Version int `json:"version"`
FileCount int `json:"fileCount"`
Bytes int64 `json:"bytes"` // working files only; Git history/chats are additional
IgnoredCount int `json:"ignoredCount"`
Ignored []IgnoredPath `json:"ignored"`
IncludeIgnored []string `json:"includeIgnored"`
Next int `json:"next,omitempty"`
SelectionToken string `json:"selectionToken"`
}
type PreviewRequest ¶
type Request ¶
type Request struct {
ID string `json:"id"` // idempotency key, retained across retries/disconnects
ProjectID string `json:"projectId,omitempty"` // local project, for export
CheckpointID string `json:"checkpointId,omitempty"` // incoming checkpoint, for import
Path string `json:"path,omitempty"` // needed only when this workspace has no replica
IncludeIgnored []string `json:"includeIgnored,omitempty"` // explicit project-relative Git-ignore overrides
SelectionToken string `json:"selectionToken,omitempty"` // binds an optional preview to its reviewed scope
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AcceptCheckpoint ¶
func (s *Service) AcceptCheckpoint(ctx context.Context, c Checkpoint) error
func (*Service) ActiveCount ¶
func (*Service) Checkpoint ¶
func (s *Service) Checkpoint(id string) (Checkpoint, error)
type Write ¶
type Write struct {
Path string `json:"path"`
Before *Entry `json:"before,omitempty"`
After *Entry `json:"after,omitempty"`
CWD string `json:"cwd,omitempty"`
Private bool `json:"private,omitempty"`
Resource *Resource `json:"resource,omitempty"`
}
Recovery journal owns only changed paths. Expected and desired content are immutable objects, so interrupted writes are replayable without a hard reset.