Documentation
¶
Index ¶
- Constants
- Variables
- func AtomicCreate(path string, b []byte, mode os.FileMode) error
- func AtomicCreateOwned(root *os.Root, path string, b []byte, mode os.FileMode) error
- func AtomicWrite(path string, b []byte, mode os.FileMode) error
- func Detached(c *exec.Cmd)
- func Discover(ctx context.Context, path string) (common, root, branch string, err error)
- func E(code, message string, exit int) error
- func Encode(v any) []byte
- func Fingerprint(p Project, env map[string]string) string
- func Git(ctx context.Context, path string, args ...string) (result string, err error)
- func Hash(b []byte) string
- func ID() string
- func PrivateDir(path string) error
- func PrivateFile(path string) error
- func ProcessAlive(p Process) bool
- func PublicEnvironment(p Project) (map[string]string, error)
- func ReadOwned(root, relative string, limit int64) ([]byte, error)
- func ReconcileProcess(p Process) error
- func Redact(b []byte, secrets []string) []byte
- func ResolveCommit(ctx context.Context, path, ref string) (commit string, err error)
- func SafeRelative(p string) bool
- func SupportedTarget() bool
- func SystemEnvironment() map[string]string
- func ValidID(id string) bool
- func ValidateSource(ctx context.Context, path, sha string) error
- func VerifyReleaseFile(path, bundlePath string) error
- func Wrap(code string, err error) error
- type API
- func (a *API) Acknowledge(_ context.Context, r *connect.Request[pb.AcknowledgeRequest]) (*connect.Response[pb.AcknowledgeResponse], error)
- func (a *API) Cancel(_ context.Context, r *connect.Request[pb.CancelRequest]) (*connect.Response[pb.CancelResponse], error)
- func (a *API) Compare(_ context.Context, r *connect.Request[pb.CompareRequest]) (*connect.Response[pb.CompareResponse], error)
- func (a *API) GetChanges(ctx context.Context, r *connect.Request[pb.GetChangesRequest]) (*connect.Response[pb.GetChangesResponse], error)
- func (a *API) GetFailures(_ context.Context, r *connect.Request[pb.GetFailuresRequest]) (*connect.Response[pb.GetFailuresResponse], error)
- func (a *API) GetLogs(_ context.Context, r *connect.Request[pb.GetLogsRequest]) (*connect.Response[pb.GetLogsResponse], error)
- func (a *API) GetReport(_ context.Context, r *connect.Request[pb.GetReportRequest]) (*connect.Response[pb.GetReportResponse], error)
- func (a *API) GetRun(_ context.Context, r *connect.Request[pb.GetRunRequest]) (*connect.Response[pb.GetRunResponse], error)
- func (a *API) GetVersion(context.Context, *connect.Request[pb.GetVersionRequest]) (*connect.Response[pb.GetVersionResponse], error)
- func (a *API) ListBranches(ctx context.Context, r *connect.Request[pb.ListBranchesRequest]) (*connect.Response[pb.ListBranchesResponse], error)
- func (a *API) ListCommits(ctx context.Context, r *connect.Request[pb.ListCommitsRequest]) (*connect.Response[pb.ListCommitsResponse], error)
- func (a *API) ListRepositories(ctx context.Context, req *connect.Request[pb.ListRepositoriesRequest]) (*connect.Response[pb.ListRepositoriesResponse], error)
- func (a *API) ListRuns(_ context.Context, r *connect.Request[pb.ListRunsRequest]) (*connect.Response[pb.ListRunsResponse], error)
- func (a *API) Pair(context.Context, *connect.Request[pb.PairRequest]) (*connect.Response[pb.PairResponse], error)
- func (a *API) Rerun(_ context.Context, r *connect.Request[pb.RerunRequest]) (*connect.Response[pb.RerunResponse], error)
- type Branch
- type Changes
- type Check
- type Command
- type Commit
- type Comparison
- type Component
- type Credential
- type Diagnostic
- type EnvironmentInput
- type Error
- type Evidence
- type Failure
- type Gate
- type InstallResult
- type Installation
- type Lock
- type LogPage
- type MCPInput
- type Mode
- type Output
- type Page
- type Paths
- type Personal
- type Policy
- type Process
- type Project
- type PruneResult
- type PushPolicy
- type Receipt
- type Redactor
- type Report
- type ReportKind
- type Repository
- type Retention
- type Run
- type Service
- func (s *Service) Active() ([]Component, error)
- func (s *Service) Agent(client, scope, repo string, remove bool) (InstallResult, error)
- func (s *Service) ApplyUpdate() error
- func (s *Service) Close() error
- func (s *Service) Compare(id, previous string) (Comparison, error)
- func (s *Service) Doctor(ctx context.Context, path string) []Diagnostic
- func (s *Service) Enter(kind string) (Component, func(), error)
- func (s *Service) Gate(ctx context.Context, path, commit string) (Gate, error)
- func (s *Service) GateRun(r Run) Gate
- func (s *Service) Handler() http.Handler
- func (s *Service) Hook(ctx context.Context, repo string, prePush, remove bool) ([]InstallResult, error)
- func (s *Service) Init(ctx context.Context, path string) (Repository, Worktree, error)
- func (s *Service) Logs(run, check string, offset int64, limit int) (LogPage, error)
- func (s *Service) MCP(ctx context.Context) error
- func (s *Service) Plan(ctx context.Context, path, commit string) (Run, error)
- func (s *Service) PrePush(ctx context.Context, repo string, input io.Reader, override PushPolicy) ([]Gate, error)
- func (s *Service) Prune(dry bool, age int, maxBytes int64) (PruneResult, error)
- func (s *Service) Receipt(r Run) Receipt
- func (s *Service) RecoverUpdate() (map[string]string, error)
- func (s *Service) Report(run, id string, offset int64, limit int) (LogPage, error)
- func (s *Service) RepositoryID(ctx context.Context, path string) (string, error)
- func (s *Service) Rerun(id string, failedOnly bool) (Receipt, error)
- func (s *Service) RunOne(id string) error
- func (s *Service) SaveEvidence(run, name string, b []byte) (Evidence, error)
- func (s *Service) SelfUpdate(ctx context.Context, version string) (map[string]string, error)
- func (s *Service) Serve(ctx context.Context, daemon bool, ready func()) error
- func (s *Service) Start(mode Mode) error
- func (s *Service) Stop(force bool) error
- func (s *Service) Submit(ctx context.Context, path, commit string, automatic bool) (Receipt, error)
- func (s *Service) ValidateEvidence(run string, c Check) error
- func (s *Service) Wait(ctx context.Context, id string) (Run, error)
- func (s *Service) WebURL(run string) string
- func (s *Service) Work(ctx context.Context, persistent bool, component string) error
- func (s *Service) Worker(ctx context.Context) error
- type Shell
- type State
- type Store
- func (s *Store) Ack(id string) error
- func (s *Store) Cancel(id string, reason State) error
- func (s *Store) Cancellation(check string) State
- func (s *Store) Close() error
- func (s *Store) EvidencePath(run, id string) (string, error)
- func (s *Store) InsertRun(r *Run, auto string) (string, error)
- func (s *Store) List(repo string, inbox bool, cursor string, limit int) (Page, error)
- func (s *Store) ListFiltered(repo, worktree, branch string, detached, inbox bool, cursor string, limit int) (Page, error)
- func (s *Store) Pending() ([]string, error)
- func (s *Store) Prepare(ctx context.Context, r Run) (string, error)
- func (s *Store) Register(common, path, branch string) (Repository, Worktree, error)
- func (s *Store) Registered(common, path string) (Repository, Worktree, error)
- func (s *Store) Repositories() ([]Repository, error)
- func (s *Store) RepositoryPage(ctx context.Context, cursor string, limit int) ([]Repository, string, error)
- func (s *Store) Run(id string) (Run, error)
- func (s *Store) SaveCheck(c Check) error
- func (s *Store) SaveRun(r Run) error
- func (s *Store) Transaction(fn func(*sql.Tx) error) error
- type UpdateJournal
- type Worktree
Constants ¶
const DefaultProject = `` /* 254-byte string literal not displayed */
const ProjectFile = ".config/async-commit-hook.toml"
const ReleaseIdentity = "https://github.com/delinoio/oss/.github/workflows/release-async-commit-hook.yml@refs/heads/main"
const SchemaVersion = 1
const Version = "0.1.1"
Variables ¶
var AgentGuide string
Functions ¶
func AtomicCreateOwned ¶
func PrivateDir ¶
func PrivateFile ¶
func ProcessAlive ¶
func ReconcileProcess ¶
func ResolveCommit ¶
func SafeRelative ¶
func SupportedTarget ¶
func SupportedTarget() bool
func SystemEnvironment ¶
func VerifyReleaseFile ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) Acknowledge ¶
func (*API) GetChanges ¶
func (*API) GetFailures ¶
func (*API) GetVersion ¶
func (*API) ListBranches ¶
func (*API) ListCommits ¶
func (*API) ListRepositories ¶
type Changes ¶
type Check ¶
type Check struct {
ID string `json:"id"`
Name string `json:"name"`
State State `json:"state"`
Optional bool `json:"optional"`
Shell Shell `json:"shell"`
Group string `json:"group"`
Policy Policy `json:"policy"`
ExitCode *int `json:"exit_code,omitempty"`
Process Process `json:"process"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
Log Evidence `json:"log"`
Reports []Evidence `json:"reports"`
Failures []Failure `json:"failures"`
Diagnostics []Diagnostic `json:"diagnostics"`
InheritedFrom string `json:"inherited_from,omitempty"`
}
type Command ¶
type Command struct {
Command string `toml:"command" json:"command"`
DependsOn []string `toml:"depends_on" json:"depends_on"`
OS []string `toml:"os" json:"os"`
Shell Shell `toml:"shell" json:"shell"`
Optional bool `toml:"optional" json:"optional"`
Policy Policy `toml:"policy" json:"policy"`
Group string `toml:"group" json:"group,omitempty"`
Environment []EnvironmentInput `toml:"environment" json:"environment"`
Reports []Report `toml:"reports" json:"reports"`
}
func (Command) SelectedShell ¶
type Commit ¶
type Comparison ¶
type Credential ¶
type Diagnostic ¶
type EnvironmentInput ¶
type Error ¶
type Error struct {
Diagnostic
Exit int `json:"-"`
}
type Failure ¶
type Failure struct {
ID string `json:"id"`
Check string `json:"check"`
Test string `json:"test,omitempty"`
Command string `json:"command"`
Message string `json:"message"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
LogID string `json:"log_id"`
}
func ParseReport ¶
func ParseReport(kind ReportKind, b []byte, check, command, logID string) ([]Failure, error)
type InstallResult ¶
type Installation ¶
type Installation struct {
ID string `json:"id"`
Path string `json:"path"`
Hash string `json:"hash"`
Original []byte `json:"original,omitempty"`
Kind string `json:"kind"`
Entry string `json:"entry,omitempty"`
SkillPath string `json:"skill_path,omitempty"`
SkillHash string `json:"skill_hash,omitempty"`
}
type MCPInput ¶
type MCPInput struct {
Repo string `json:"repo,omitempty" jsonschema:"Registered worktree path; defaults to current directory"`
Commit string `json:"commit,omitempty" jsonschema:"Exact Git commit or local ref; defaults to HEAD"`
RunID string `json:"run_id,omitempty" jsonschema:"Receipt UUID v7"`
Check string `json:"check,omitempty" jsonschema:"Check name or ID belonging to the run"`
PreviousID string `json:"previous_id,omitempty" jsonschema:"Optional explicit comparison run"`
Cursor string `json:"cursor,omitempty"`
Offset int64 `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
TimeoutSeconds int `json:"timeout_seconds,omitempty" jsonschema:"Wait only; never an execution timeout"`
FailedOnly bool `json:"failed_only,omitempty"`
}
type Output ¶
type Output struct {
SchemaVersion int `json:"schema_version"`
Result any `json:"result,omitempty"`
Error *Diagnostic `json:"error,omitempty"`
}
type Paths ¶
func DefaultPaths ¶
type Personal ¶
type Personal struct {
Version int `toml:"version"`
Mode Mode `toml:"mode"`
APIPort int `toml:"api_port"`
StateDir string `toml:"state_dir"`
Credentials map[string]Credential `toml:"credentials"`
Retention Retention `toml:"retention"`
}
func ReadPersonal ¶
type Process ¶
type Process struct {
ScopeDir string `json:"scope_dir,omitempty"`
PID int `json:"pid"`
Birth string `json:"birth"`
Group int `json:"group"`
Members []Process `json:"members,omitempty"`
}
func ProcessIdentity ¶
type Project ¶
type Project struct {
Version int `toml:"version" json:"version"`
DiffBase string `toml:"diff_base" json:"diff_base,omitempty"`
PrePush PushPolicy `toml:"pre_push" json:"pre_push"`
Checks map[string]Command `toml:"checks" json:"checks"`
}
func CommitConfig ¶
func ParseProject ¶
func ReadProject ¶
ReadProject bounds allocation before TOML parsing, including growing inputs.
type PruneResult ¶
type PruneResult struct {
DryRun bool `json:"dry_run"`
RunIDs []string `json:"run_ids"`
Bytes int64 `json:"bytes"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
type PushPolicy ¶
type PushPolicy string
const ( PushBlock PushPolicy = "block" PushWait PushPolicy = "wait" PushRun PushPolicy = "run-and-wait" )
type Receipt ¶
type Receipt struct {
RunID string `json:"run_id"`
Commit string `json:"commit"`
State State `json:"state"`
StatusCommand string `json:"status_command"`
WaitCommand string `json:"wait_command"`
MCP string `json:"mcp"`
Guide string `json:"guide"`
URL string `json:"url,omitempty"`
UICommand string `json:"ui_command,omitempty"`
Diagnostic *Diagnostic `json:"diagnostic,omitempty"`
}
type Redactor ¶
type Redactor struct {
// contains filtered or unexported fields
}
Redactor holds enough suffix bytes to recognize a secret split between writes. Nothing from the held suffix reaches disk until it is known to be safe.
type Report ¶
type Report struct {
Kind ReportKind `toml:"kind" json:"kind"`
Path string `toml:"path" json:"path"`
}
type ReportKind ¶
type ReportKind string
const ( JUnit ReportKind = "junit" GoTest ReportKind = "go-test-json" )
type Repository ¶
type Run ¶
type Run struct {
SchemaVersion int `json:"schema_version"`
ID string `json:"id"`
Sequence int64 `json:"sequence"`
RepositoryID string `json:"repository_id"`
WorktreeID string `json:"worktree_id"`
Source string `json:"source"`
Branch string `json:"branch"`
Commit string `json:"commit"`
State State `json:"state"`
Config Project `json:"config"`
Environment map[string]string `json:"environment"`
Fingerprint string `json:"fingerprint"`
OS string `json:"os"`
Arch string `json:"arch"`
CreatedAt time.Time `json:"created_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
AcknowledgedAt *time.Time `json:"acknowledged_at,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Checks []Check `json:"checks"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
type Service ¶
func (*Service) Agent ¶
func (s *Service) Agent(client, scope, repo string, remove bool) (InstallResult, error)
func (*Service) ApplyUpdate ¶
func (*Service) Handler ¶
Handler serves the immutable UI and local RPCs from one loopback origin. Local processes are trusted; browser isolation is enforced before dispatch.
func (*Service) RepositoryID ¶
func (*Service) SaveEvidence ¶
func (*Service) SelfUpdate ¶
type State ¶
type State string
const ( Queued State = "queued" Preparing State = "preparing" Running State = "running" Collecting State = "collecting" Passed State = "passed" Failed State = "failed" Blocked State = "blocked" Cancelled State = "cancelled" Replaced State = "replaced" Interrupted State = "interrupted" Skipped State = "skipped" Expired State = "expired" )
type Store ¶
func (*Store) Cancellation ¶
func (*Store) ListFiltered ¶
func (*Store) Register ¶
func (s *Store) Register(common, path, branch string) (Repository, Worktree, error)
func (*Store) Registered ¶
func (s *Store) Registered(common, path string) (Repository, Worktree, error)
func (*Store) Repositories ¶
func (s *Store) Repositories() ([]Repository, error)
func (*Store) RepositoryPage ¶
func (s *Store) RepositoryPage(ctx context.Context, cursor string, limit int) ([]Repository, string, error)
RepositoryPage bounds worktrees, not just repositories: one repository can have many linked worktrees and must not make a single response unbounded.
type UpdateJournal ¶
type UpdateJournal struct {
Executable string `json:"executable"`
Candidate string `json:"candidate"`
Backup string `json:"backup"`
StateBackup string `json:"state_backup"`
SHA256 string `json:"sha256"`
OriginalSHA256 string `json:"original_sha256"`
Phase string `json:"phase"`
Parent Process `json:"parent"`
}
Source Files
¶
- agent_files.go
- agents.go
- api.go
- birth_linux.go
- branches.go
- commits.go
- config.go
- credentials.go
- credentials_unix.go
- failure_summary.go
- files.go
- files_unix.go
- gate_selection.go
- git.go
- git_blobs.go
- git_lfs.go
- go_report.go
- hooks.go
- hooks_files.go
- hooks_read_unix.go
- lifecycle.go
- mcp.go
- model.go
- prepush.go
- process_scope_linux.go
- process_scope_unix.go
- process_unix.go
- query.go
- registry.go
- report_summary.go
- report_tail.go
- reports.go
- runner.go
- service.go
- source_representation.go
- state_directory.go
- store.go
- update.go
- update_cleanup.go
- update_version.go