factory

package
v0.9.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: BSD-2-Clause Imports: 11 Imported by: 0

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

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,
) agentlib.AgentProvider

CreateAgentProvider wires the per-task-type dispatch table.

  • task_type: github-update-go → the 3-phase domain agent
  • task_type: healthcheck / oauth-probe → shared liveness agent

Pure plumbing; no conditional, no error.

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

func CreateGhCli(ghToken string) updatepkg.GhCli

CreateGhCli wires the os/exec gh CLI seam with the resolved GitHub token.

func CreateGitOps added in v0.2.0

func CreateGitOps() git.GitOps

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL