Documentation
¶
Index ¶
- func CloneIfMissing(ctx context.Context, repoPath, remote string) error
- func PostCheckpointWithRetry(c *client.Client, ticketID string, phase, sha string, maxAttempts int) error
- func ReconstructState(ticketDir, worktreePath string, claim *client.ClaimResponse) error
- func RecoverTicket(ctx context.Context, claim *client.ClaimResponse, cfg *config.Config) error
- type Executor
- type GolemExecutor
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneIfMissing ¶
CloneIfMissing runs `git clone remote repoPath` if repoPath does not exist. CloneIfMissing runs `git clone remote repoPath` if repoPath does not exist. Only http/https/ssh/git URL schemes are permitted to prevent git ext:: injection.
func PostCheckpointWithRetry ¶
func PostCheckpointWithRetry(c *client.Client, ticketID string, phase, sha string, maxAttempts int) error
PostCheckpointWithRetry calls client.PostCheckpoint with up to maxAttempts total attempts (using the client's built-in exponential-backoff retry logic). It temporarily overrides the client's RetryAttempts field, restoring it on return so the client remains usable for other calls.
func ReconstructState ¶
func ReconstructState(ticketDir, worktreePath string, claim *client.ClaimResponse) error
ReconstructState writes state.json and log.jsonl into ticketDir from the data carried in the ClaimResponse. The directory is created if absent. worktreePath is the expected worktree path for the ticket (used by ticket.Load).
func RecoverTicket ¶
RecoverTicket ensures the local repo is in the correct state for resuming a checkpointed ticket, then reconstructs the ticket's local state files. Idempotent: safe to call on an already-present worktree.
Types ¶
type Executor ¶
type Executor interface {
RunTicket(ctx context.Context, cfg *config.Config, c *client.Client, claim *client.ClaimResponse) error
}
Executor is the interface for running a ticket.
type GolemExecutor ¶
type GolemExecutor struct {
// contains filtered or unexported fields
}
GolemExecutor runs tickets phase by phase with human approval gates.
func (*GolemExecutor) RunTicket ¶
func (e *GolemExecutor) RunTicket(ctx context.Context, cfg *config.Config, c *client.Client, claim *client.ClaimResponse) error
RunTicket executes a claimed ticket:
- Pre-creates the local ticket with `golem ticket new` (scaffolding only, no Claude).
- Ensures the repo is initialized and the code graph is current.
- Runs three separate `claude --print` sessions — brainstorm, plan, implement — pausing between brainstorm→plan and plan→implement for human approval via the orchestrator UI. Tickets are NOT closed automatically; humans close via the UI.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker polls for available tickets, claims them, and runs them via Executor.
func (*Worker) HandleMessage ¶
HandleMessage processes a WebSocket push message from the orchestrator.
func (*Worker) SetWSClient ¶
SetWSClient attaches a WebSocket client for heartbeat pings.