Documentation
¶
Overview ¶
Package factory wires concrete dependencies for the github-update-go-agent binary.
All factory functions follow the Create* prefix convention and contain zero business logic — they compose constructors with config.
Index ¶
- func CreateAgent(claudeConfigDir claudelib.ClaudeConfigDir, agentDir claudelib.AgentDir, ...) *agentlib.Agent
- func CreateAgentProvider(claudeConfigDir claudelib.ClaudeConfigDir, agentDir claudelib.AgentDir, ...) agentlib.AgentProvider
- func CreateBuildFixAgent(claudeConfigDir claudelib.ClaudeConfigDir, agentDir claudelib.AgentDir, ...) *agentlib.Agent
- func CreateBuildFixChainEmitter(syncProducer libkafka.SyncProducer, topicPrefix base.TopicPrefix) updatepkg.CreateCommandFunc
- func CreateClaudeProber(claudeConfigDir claudelib.ClaudeConfigDir) updatepkg.ClaudeProber
- func CreateClaudeRunner(claudeConfigDir claudelib.ClaudeConfigDir, agentDir claudelib.AgentDir, ...) claudelib.ClaudeRunner
- func CreateFileResultDeliverer(filePath string) agentlib.ResultDeliverer
- func CreateGateRunner() updatepkg.GateRunner
- func CreateGhCli(ghToken string) updatepkg.GhCli
- func CreateGitOps() git.GitOps
- func CreateKafkaResultDeliverer(syncProducer libkafka.SyncProducer, topicPrefix base.TopicPrefix, ...) agentlib.ResultDeliverer
- func CreateSyncProducer(ctx context.Context, brokers libkafka.Brokers) (libkafka.SyncProducer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAgent ¶
func CreateAgent( claudeConfigDir claudelib.ClaudeConfigDir, agentDir claudelib.AgentDir, model claudelib.ClaudeModel, ghToken string, claudeEnv map[string]string, gitOps git.GitOps, ghCli updatepkg.GhCli, gateRunner updatepkg.GateRunner, claudeProber updatepkg.ClaudeProber, prTarget updatepkg.PRTarget, autoMergeLabel string, updateScope updatepkg.UpdateScope, ) *agentlib.Agent
CreateAgent assembles the three distinct phases (design § 4.2):
- planning: claude-auth + gh-token preflights + Claude planning step (clone @ ref, detect gate targets, classify findings) → ## Plan
- execution: claude-auth preflight + custom Go step embedding the Claude update sub-call (clone+branch, update+repair, gate verify, commit, push --no-follow-tags, gh pr create) → ## Result
- ai_review: pure-Go verifier (PR state checked against configured PRTarget, fresh-worktree gate re-run, CHANGELOG, tag audit) → ## Review → human_review
func CreateAgentProvider ¶
func CreateAgentProvider( claudeConfigDir claudelib.ClaudeConfigDir, agentDir claudelib.AgentDir, model claudelib.ClaudeModel, ghToken string, claudeEnv map[string]string, gitOps git.GitOps, ghCli updatepkg.GhCli, gateRunner updatepkg.GateRunner, claudeProber updatepkg.ClaudeProber, prTarget updatepkg.PRTarget, autoMergeLabel string, updateScope updatepkg.UpdateScope, createCmd updatepkg.CreateCommandFunc, ) agentlib.AgentProvider
CreateAgentProvider wires the per-task-type dispatch table.
- task_type: github-update-go → the 3-phase updater agent
- task_type: build-fix → the 3-phase build-fixer agent (second domain agent in this binary, per the 2026-08-22 architecture decision)
- task_type: healthcheck / oauth-probe → shared liveness agent
Pure plumbing; no conditional, no error.
func CreateBuildFixAgent ¶ added in v0.12.0
func CreateBuildFixAgent( claudeConfigDir claudelib.ClaudeConfigDir, agentDir claudelib.AgentDir, model claudelib.ClaudeModel, ghToken string, claudeEnv map[string]string, gitOps git.GitOps, ghCli updatepkg.GhCli, claudeProber updatepkg.ClaudeProber, createCmd updatepkg.CreateCommandFunc, ) *agentlib.Agent
CreateBuildFixAgent assembles the build-fixer's three phases (the second domain agent this binary hosts, per the 2026-08-22 architecture decision — shares the binary's core plumbing, no separate repo/deployment):
- planning: claude-auth preflight + fix diagnosis step (clone @ episode SHA, verify green at HEAD, fetch failed logs, Claude classification into no_fix_needed / chain_update / file_spec / needs_input) → ## Fix Plan
- execution: pure-Go hand-off step — chain_update emits a github-update-go task (CreateCommand), file_spec files the kind:bug spec on build-fixer/<sha-short>, dedup via branch existence → ## Fix Result
- ai_review: pure-Go verifier (branch landed on origin / hand-off recorded) → ## Review → human_review
func CreateBuildFixChainEmitter ¶ added in v0.12.0
func CreateBuildFixChainEmitter( syncProducer libkafka.SyncProducer, topicPrefix base.TopicPrefix, ) updatepkg.CreateCommandFunc
CreateBuildFixChainEmitter wires the build-fixer's chain-to-updater emission: a CreateCommandFunc that publishes a github-update-go task via the controller's Kafka command bus (task.CreateCommandSender), exactly as the github-build watcher does for build-fix tasks. The producer is passed in pre-built — main.go owns its lifecycle (created + closed there) and its nil decision (buildChainEmitter returns a nil createCmd when no brokers are configured), so the factory body stays pure composition with no error and no conditional. The Pattern B Job emits at most one downstream task per run.
func CreateClaudeProber ¶ added in v0.2.0
func CreateClaudeProber(claudeConfigDir claudelib.ClaudeConfigDir) updatepkg.ClaudeProber
CreateClaudeProber wires the claude-auth preflight prober.
func CreateClaudeRunner ¶
func CreateClaudeRunner( claudeConfigDir claudelib.ClaudeConfigDir, agentDir claudelib.AgentDir, allowedTools claudelib.AllowedTools, model claudelib.ClaudeModel, env map[string]string, ) claudelib.ClaudeRunner
CreateClaudeRunner constructs a ClaudeRunner pre-configured with tools, model, working directory, and CLI environment.
func CreateFileResultDeliverer ¶
func CreateFileResultDeliverer(filePath string) agentlib.ResultDeliverer
CreateFileResultDeliverer creates a ResultDeliverer that writes the agent's output back to a markdown file (local CLI mode). Uses the passthrough content generator (same rationale as Kafka).
func CreateGateRunner ¶ added in v0.2.0
func CreateGateRunner() updatepkg.GateRunner
CreateGateRunner wires the os/exec make gate runner.
func CreateGhCli ¶ added in v0.2.0
CreateGhCli wires the os/exec gh CLI seam with the resolved GitHub token.
func CreateGitOps ¶ added in v0.2.0
CreateGitOps wires the os/exec GitOps seam.
func CreateKafkaResultDeliverer ¶
func CreateKafkaResultDeliverer( syncProducer libkafka.SyncProducer, topicPrefix base.TopicPrefix, taskID agentlib.TaskIdentifier, originalContent string, currentDateTime libtime.CurrentDateTimeGetter, ) agentlib.ResultDeliverer
CreateKafkaResultDeliverer creates a ResultDeliverer that publishes task updates to Kafka via CQRS commands. Uses the passthrough content generator — the agent framework's StepRunner already produces the full marshaled task in result.Output; the deliverer publishes it as-is and overrides status/phase frontmatter based on the result Status.
func CreateSyncProducer ¶
func CreateSyncProducer( ctx context.Context, brokers libkafka.Brokers, ) (libkafka.SyncProducer, error)
CreateSyncProducer creates a Kafka sync producer.
Types ¶
This section is empty.