{"modulePath":"github.com/GoCodeAlone/workflow-plugin-agent","version":"v0.12.11","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package orchestrator\n\nPackage ratchetplugin is a workflow EnginePlugin that provides ratchet-specific module types, pipeline steps, and wiring hooks.\n\n## Variables\n\n```go\nvar ErrServiceUnavailable = errors.New(\"orchestrator: required service not available\")\n```\nErrServiceUnavailable is returned by a step when a required-stateful service resolves to its Null default (i.e. it is absent from the registry). Steps that classify a service as required-stateful MUST check IsNull(svc) and return this error.\n\n## Functions\n\n```go\nfunc DeleteVaultConfig(dir string) error\n```\nDeleteVaultConfig removes the vault config file.\n\n```go\nfunc EstimateTokens(messages []provider.Message) int\n```\nEstimateTokens estimates the number of tokens in a message slice. Uses a rough heuristic of 4 characters per token (standard for English text).\n\n```go\nfunc InjectBlackboardInput(ctx context.Context, app modular.Application, cfg InputFromBlackboard, pc *module.PipelineContext) (string, error)\n```\nInjectBlackboardInput reads the specified artifact(s) from the blackboard.\n\nInjection behaviour depends on cfg.InjectAs:\n\n  - \"system\\_prompt\\_append\" or \"user\\_message\": returns the artifact content as a formatted string so the caller can append it to the system prompt or add it as a user message. pc.Current is not modified.\n  - \"\" (default): stores the artifact(s) in pc.Current\\[\"blackboard\\_input\"] and returns an empty string.\n\nReturns (\"\", nil) if no blackboard is registered or no artifact is found.\n\n```go\nfunc IsNull(svc any) bool\n```\nIsNull reports whether the given service value is one of the Null defaults (i.e. the service was absent from the registry and resolveServices substituted a no-op). Concrete service implementations are never Null.\n\nA step guarding a required-stateful service writes:\n\n\tsvcs := resolveServices(s.app)\n\tif IsNull(svcs.Approval) {\n\t    return ErrServiceUnavailable\n\t}\n\n```go\nfunc NewContainerManagerAdapter(cm *ContainerManager) executor.ContainerExecutor\n```\nNewContainerManagerAdapter wraps a ContainerManager as an executor.ContainerExecutor.\n\n```go\nfunc SaveVaultConfig(dir string, cfg *VaultConfigFile) error\n```\nSaveVaultConfig writes vault config to dir/vault-config.json. The token is encrypted at rest using AES-256-GCM with a machine-local key.\n\n```go\nfunc TeamIDFromContext(ctx context.Context) string\n```\nTeamIDFromContext returns the team ID from context, if set.\n\n```go\nfunc WithTeamID(ctx context.Context, teamID string) context.Context\n```\nWithTeamID returns a context with the team ID set for policy enforcement.\n\n## Types\n\n```go\ntype AIProviderModule struct {\n\t// contains filtered or unexported fields\n}\n```\nAIProviderModule wraps an AI provider.Provider as a modular.Module. It registers itself in the service registry so steps can look it up by name.\n\n```go\nfunc (m *AIProviderModule) Agents() []AgentSeed\n```\nAgents returns the agent seeds configured for this provider module.\n\n```go\nfunc (m *AIProviderModule) Init(app modular.Application) error\n```\nInit registers this module as a named service. Returns an error if the module was constructed with an invalid provider type.\n\n```go\nfunc (m *AIProviderModule) Name() string\n```\nName implements modular.Module.\n\n```go\nfunc (m *AIProviderModule) Provider() provider.Provider\n```\nProvider returns the underlying AI provider.\n\n```go\nfunc (m *AIProviderModule) ProvidesServices() []modular.ServiceProvider\n```\nProvidesServices declares the provider service.\n\n```go\nfunc (m *AIProviderModule) RequiresServices() []modular.ServiceDependency\n```\nRequiresServices declares no dependencies.\n\n```go\nfunc (m *AIProviderModule) Start(_ context.Context) error\n```\nStart implements modular.Startable (no-op).\n\n```go\nfunc (m *AIProviderModule) Stop(_ context.Context) error\n```\nStop implements modular.Stoppable (no-op).\n\n```go\nfunc (m *AIProviderModule) TestHTTPSource() *HTTPSource\n```\nTestHTTPSource returns the HTTPSource if the provider is a test provider in HTTP mode.\n\n```go\ntype AgentExecuteStep struct {\n\t// contains filtered or unexported fields\n}\n```\nAgentExecuteStep runs the autonomous agent loop for a single task.\n\n```go\nfunc (s *AgentExecuteStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *AgentExecuteStep) Name() string\n```\n\n```go\ntype AgentPermissionCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nAgentPermissionCheck flags agents that have unrestricted tool access.\n\n```go\nfunc (c *AgentPermissionCheck) Name() string\n```\n\n```go\nfunc (c *AgentPermissionCheck) Run(ctx context.Context) []AuditFinding\n```\n\n```go\ntype AgentSeed struct {\n\tID           string `yaml:\"id\"`\n\tName         string `yaml:\"name\"`\n\tRole         string `yaml:\"role\"`\n\tSystemPrompt string `yaml:\"system_prompt\"`\n\tProvider     string `yaml:\"provider\"`\n\tModel        string `yaml:\"model\"`\n\tTeamID       string `yaml:\"team_id\"`\n\tIsLead       bool   `yaml:\"is_lead\"`\n}\n```\nAgentSeed holds the definition of an agent to seed into the database.\n\n```go\ntype Approval struct {\n\tID              string\n\tAgentID         string\n\tTaskID          string\n\tAction          string\n\tReason          string\n\tDetails         string\n\tStatus          ApprovalStatus\n\tReviewerComment string\n\tCreatedAt       time.Time\n\tResolvedAt      *time.Time\n\tTimeoutMinutes  int\n}\n```\nApproval represents a human approval request.\n\n```go\ntype ApprovalManager struct {\n\t// contains filtered or unexported fields\n}\n```\nApprovalManager manages approval records in the database and pushes SSE notifications.\n\n```go\nfunc NewApprovalManager(db *sql.DB) *ApprovalManager\n```\nNewApprovalManager creates a new ApprovalManager with default 30-minute timeout.\n\n```go\nfunc (am *ApprovalManager) Approve(ctx context.Context, id string, comment string) error\n```\nApprove marks an approval as approved and records the reviewer's comment.\n\n```go\nfunc (am *ApprovalManager) CheckTimeout(ctx context.Context) error\n```\nCheckTimeout marks any pending approvals that have exceeded their timeout.\n\n```go\nfunc (am *ApprovalManager) Create(ctx context.Context, approval Approval) error\n```\nCreate inserts a new approval record and optionally pushes an SSE event.\n\n```go\nfunc (am *ApprovalManager) CreateApproval(ctx context.Context, agentID, taskID, action, reason, details string) (string, error)\n```\nCreateApproval is a convenience method that satisfies the tools.ApprovalCreator interface. It creates an Approval via Create() and returns the generated ID.\n\n```go\nfunc (am *ApprovalManager) Get(ctx context.Context, id string) (*Approval, error)\n```\nGet retrieves an approval by ID.\n\n```go\nfunc (am *ApprovalManager) ListPending(ctx context.Context) ([]Approval, error)\n```\nListPending returns all approvals with status 'pending'.\n\n```go\nfunc (am *ApprovalManager) Reject(ctx context.Context, id string, comment string) error\n```\nReject marks an approval as rejected and records the reviewer's comment.\n\n```go\nfunc (am *ApprovalManager) SetSSEHub(hub *SSEHub)\n```\nSetSSEHub wires the SSE hub for push notifications.\n\n```go\nfunc (am *ApprovalManager) WaitForResolution(ctx context.Context, id string, timeout time.Duration) (*Approval, error)\n```\nWaitForResolution polls the database every 2 seconds until the approval is resolved or the given timeout elapses. Returns the resolved approval or an error.\n\n```go\ntype ApprovalResolveStep struct {\n\t// contains filtered or unexported fields\n}\n```\nApprovalResolveStep handles POST /api/approvals/:id/approve and /api/approvals/:id/reject.\n\n```go\nfunc (s *ApprovalResolveStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *ApprovalResolveStep) Name() string\n```\n\n```go\ntype ApprovalService interface {\n\tCreateApproval(ctx context.Context, agentID, taskID, action, reason, details string) (string, error)\n\tApprove(ctx context.Context, id, comment string) error\n\tReject(ctx context.Context, id, comment string) error\n\tGet(ctx context.Context, id string) (*Approval, error)\n\tWaitForResolution(ctx context.Context, id string, timeout time.Duration) (*Approval, error)\n}\n```\nApprovalService is the orchestrator-scoped approval gate.\n\nConsumers:\n\n  - step\\_approval (ApprovalResolveStep — REQUIRED-STATEFUL: Approve/Reject error if absent).\n  - step\\_agent\\_execute (TRULY-OPTIONAL — WaitForResolution in handleApprovalWait; agent continues without blocking when absent).\n\n```go\ntype ApprovalStatus string\n```\nApprovalStatus represents the resolution state of an approval.\n\n```go\nconst (\n\tApprovalPending  ApprovalStatus = \"pending\"\n\tApprovalApproved ApprovalStatus = \"approved\"\n\tApprovalRejected ApprovalStatus = \"rejected\"\n\tApprovalTimeout  ApprovalStatus = \"timeout\"\n)\n```\n\n```go\ntype Artifact struct {\n\tID        string\n\tPhase     string // \"design\", \"implement\", \"review\", \"security\", \"approve\"\n\tAgentID   string\n\tType      string // \"config_diff\", \"validation_report\", \"iac_plan\", \"review_findings\", \"approval_decision\", \"yaml_config\"\n\tContent   map[string]any\n\tTags      []string\n\tCreatedAt time.Time\n}\n```\nArtifact is a structured piece of data posted to the Blackboard by a pipeline phase.\n\n```go\ntype AuditCheck interface {\n\tName() string\n\tRun(ctx context.Context) []AuditFinding\n}\n```\nAuditCheck is implemented by each individual security check.\n\n```go\ntype AuditFinding struct {\n\tCheck       string\n\tSeverity    AuditSeverity\n\tTitle       string\n\tDescription string\n\tRemediation string\n}\n```\nAuditFinding represents a single security finding.\n\n```go\ntype AuditReport struct {\n\tTimestamp time.Time\n\tFindings  []AuditFinding\n\tSummary   map[AuditSeverity]int // count by severity\n\tScore     int                   // 0-100, higher is better\n}\n```\nAuditReport contains all findings from a security audit run.\n\n```go\ntype AuditSeverity string\n```\nAuditSeverity represents the severity of an audit finding.\n\n```go\nconst (\n\tSeverityCritical AuditSeverity = \"critical\"\n\tSeverityHigh     AuditSeverity = \"high\"\n\tSeverityMedium   AuditSeverity = \"medium\"\n\tSeverityLow      AuditSeverity = \"low\"\n\tSeverityInfo     AuditSeverity = \"info\"\n)\n```\n\n```go\ntype AuthCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nAuthCheck verifies that authentication is properly configured.\n\n```go\nfunc (c *AuthCheck) Name() string\n```\n\n```go\nfunc (c *AuthCheck) Run(_ context.Context) []AuditFinding\n```\n\n```go\ntype Blackboard struct {\n\t// contains filtered or unexported fields\n}\n```\nBlackboard is a SQLite-backed shared artifact exchange for pipeline phases. Subscribers can watch for new artifacts via channels returned by Subscribe.\n\n```go\nfunc NewBlackboard(db *sql.DB, sseHub *SSEHub) *Blackboard\n```\nNewBlackboard creates a Blackboard backed by db and optionally broadcasting to sseHub.\n\n```go\nfunc (b *Blackboard) Migrate(ctx context.Context) error\n```\nMigrate creates the blackboard\\_artifacts table if it doesn't exist.\n\n```go\nfunc (b *Blackboard) Post(ctx context.Context, artifact Artifact) error\n```\nPost inserts an artifact, notifies subscribers, and optionally broadcasts an SSE event.\n\n```go\nfunc (b *Blackboard) Read(ctx context.Context, phase, artifactType string) ([]Artifact, error)\n```\nRead returns all artifacts matching the given phase and artifact type. Pass an empty string for either field to skip that filter.\n\n```go\nfunc (b *Blackboard) ReadLatest(ctx context.Context, phase string) (*Artifact, error)\n```\nReadLatest returns the most recently posted artifact for the given phase. Returns nil, nil if no artifact exists for that phase.\n\n```go\nfunc (b *Blackboard) Subscribe(ctx context.Context, phase string) \u003c-chan Artifact\n```\nSubscribe returns a channel that receives new artifacts posted to the given phase. Pass \"\" to receive all artifacts regardless of phase. The channel is buffered (64). It is closed when ctx is done.\n\n```go\ntype BlackboardPostStep struct {\n\t// contains filtered or unexported fields\n}\n```\nBlackboardPostStep posts an artifact to the Blackboard. Config keys: phase, artifact\\_type, agent\\_id (all optional; fallback to pc.Current).\n\n```go\nfunc (s *BlackboardPostStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *BlackboardPostStep) Name() string\n```\n\n```go\ntype BlackboardReadStep struct {\n\t// contains filtered or unexported fields\n}\n```\nBlackboardReadStep reads artifacts from the Blackboard and returns them in step output. Config keys: phase, artifact\\_type (optional; fallback to pc.Current), latest\\_only (bool).\n\n```go\nfunc (s *BlackboardReadStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *BlackboardReadStep) Name() string\n```\n\n```go\ntype BlackboardService interface {\n\tPost(ctx context.Context, artifact Artifact) error\n\tRead(ctx context.Context, phase, artifactType string) ([]Artifact, error)\n\tReadLatest(ctx context.Context, phase string) (*Artifact, error)\n}\n```\nBlackboardService is the orchestrator-scoped shared artifact exchange.\n\nConsumers: step\\_blackboard (BlackboardPostStep/BlackboardReadStep — REQUIRED), step\\_self\\_improve\\_diff (postToBlackboard — OPTIONAL: only posts when output\\_to\\_blackboard=true).\n\nClassification:\n\n  - step\\_blackboard: REQUIRED-STATEFUL (errors if absent).\n  - step\\_self\\_improve\\_diff: TRULY-OPTIONAL (skips the post, step still produces the diff).\n\n```go\ntype BrowserManager struct {\n\t// contains filtered or unexported fields\n}\n```\nBrowserManager manages a shared Rod browser instance and per-agent pages. The browser is lazily initialized on first use to avoid consuming resources unless browser tools are actually invoked.\n\n```go\nfunc NewBrowserManager(headless bool) *BrowserManager\n```\nNewBrowserManager creates a BrowserManager. The browser is not started until GetPage is first called.\n\n```go\nfunc (bm *BrowserManager) GetPage(agentID string) (*rod.Page, error)\n```\nGetPage returns the page associated with agentID, creating one if needed. If the browser has not been started yet, it is started now.\n\n```go\nfunc (bm *BrowserManager) IsAvailable() bool\n```\nIsAvailable checks whether a Chrome/Chromium binary is accessible.\n\n```go\nfunc (bm *BrowserManager) ReleasePage(agentID string)\n```\nReleasePage closes the page associated with agentID and removes it from the map.\n\n```go\nfunc (bm *BrowserManager) Shutdown() error\n```\nShutdown closes all agent pages and then the browser itself.\n\n```go\ntype CORSCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nCORSCheck flags wildcard CORS configurations.\n\n```go\nfunc (c *CORSCheck) Name() string\n```\n\n```go\nfunc (c *CORSCheck) Run(_ context.Context) []AuditFinding\n```\n\n```go\ntype ChannelSource struct {\n\t// contains filtered or unexported fields\n}\n```\nChannelSource delivers interactions via Go channels, enabling test goroutines to drive the agent loop interactively from within a Go test.\n\n```go\nfunc NewChannelSource() (source *ChannelSource, interactionsCh \u003c-chan Interaction, responsesCh chan\u003c- InteractionResponse)\n```\nNewChannelSource creates a ChannelSource and returns the source along with the test-side channels:\n\n  - interactionsCh receives Interactions from the provider (test reads from this)\n  - responsesCh accepts InteractionResponses from the test (test writes to this)\n\n```go\nfunc (cs *ChannelSource) GetResponse(ctx context.Context, interaction Interaction) (*InteractionResponse, error)\n```\nGetResponse implements ResponseSource. It sends the interaction on the interactions channel and blocks until a response arrives on the responses channel or the context is cancelled.\n\n```go\ntype ContainerControlStep struct {\n\t// contains filtered or unexported fields\n}\n```\nContainerControlStep manages container lifecycle as a pipeline step. Actions: \"start\", \"stop\", \"remove\", \"status\".\n\n```go\nfunc (s *ContainerControlStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *ContainerControlStep) Name() string\n```\n\n```go\ntype ContainerManager struct {\n\t// contains filtered or unexported fields\n}\n```\nContainerManager manages Docker containers for project workspaces. It maintains a cache of projectID -\u003e containerID mappings and persists state to the workspace\\_containers table.\n\n```go\nfunc NewContainerManager(db *sql.DB) *ContainerManager\n```\nNewContainerManager creates a ContainerManager. It attempts to connect to the Docker daemon; if unavailable, the manager is marked as not available and all operations gracefully fall back.\n\n```go\nfunc (cm *ContainerManager) Close() error\n```\nClose stops all managed containers and closes the Docker client.\n\n```go\nfunc (cm *ContainerManager) EnsureContainer(ctx context.Context, projectID, workspacePath string, spec executor.SandboxConfig) (string, error)\n```\nEnsureContainer creates or reuses a container for the given project. The workspace path is bind-mounted at /workspace inside the container. spec is an executor.SandboxConfig so that ContainerManager satisfies executor.ContainerExecutor.\n\n```go\nfunc (cm *ContainerManager) ExecInContainer(ctx context.Context, projectID, command, workDir string, timeout int) (stdout, stderr string, exitCode int, err error)\n```\nExecInContainer executes a command inside the container for the given project.\n\n```go\nfunc (cm *ContainerManager) GetContainerStatus(ctx context.Context, projectID string) (string, error)\n```\nGetContainerStatus returns the status of the container for a project.\n\n```go\nfunc (cm *ContainerManager) IsAvailable() bool\n```\nIsAvailable returns true if the Docker daemon is reachable.\n\n```go\nfunc (cm *ContainerManager) RemoveContainer(ctx context.Context, projectID string) error\n```\nRemoveContainer stops and removes the container for a project.\n\n```go\nfunc (cm *ContainerManager) StopContainer(ctx context.Context, projectID string) error\n```\nStopContainer stops the container for a project.\n\n```go\ntype ContainerManagerAdapter struct {\n\t// contains filtered or unexported fields\n}\n```\nContainerManagerAdapter wraps ContainerManager to satisfy executor.ContainerExecutor.\n\n```go\nfunc (a *ContainerManagerAdapter) EnsureContainer(ctx context.Context, projectID, workspacePath string, spec executor.SandboxConfig) (string, error)\n```\n\n```go\nfunc (a *ContainerManagerAdapter) ExecInContainer(ctx context.Context, projectID, command, workDir string, timeout int) (string, string, int, error)\n```\n\n```go\nfunc (a *ContainerManagerAdapter) IsAvailable() bool\n```\n\n```go\ntype ContainerSecurityCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nContainerSecurityCheck inspects container configurations for security issues.\n\n```go\nfunc (c *ContainerSecurityCheck) Name() string\n```\n\n```go\nfunc (c *ContainerSecurityCheck) Run(ctx context.Context) []AuditFinding\n```\n\n```go\ntype ContainerService interface {\n\tIsAvailable() bool\n\tEnsureContainer(ctx context.Context, projectID, workspacePath string, spec sandboxSpec) (string, error)\n\tExecInContainer(ctx context.Context, projectID, command, workDir string, timeout int) (stdout, stderr string, exitCode int, err error)\n\tStopContainer(ctx context.Context, projectID string) error\n\tRemoveContainer(ctx context.Context, projectID string) error\n\tGetContainerStatus(ctx context.Context, projectID string) (string, error)\n}\n```\nContainerService is the orchestrator-scoped Docker sandbox manager.\n\nConsumer: step\\_container\\_control (TRULY-OPTIONAL — returns status= \"unavailable\" when absent or Docker is not present).\n\n```go\ntype ContextManager struct {\n\t// contains filtered or unexported fields\n}\n```\nContextManager tracks token usage across a message array and compacts the conversation when it approaches the model's context limit.\n\n```go\nfunc NewContextManager(providerName string, compactionThreshold float64) *ContextManager\n```\nNewContextManager creates a ContextManager for the given provider. The model name is used to look up the context window size. compactionThreshold sets the fraction of the context limit that triggers compaction; pass 0 to use the default (0.80).\n\n```go\nfunc (cm *ContextManager) Compact(\n\tctx context.Context,\n\tmessages []provider.Message,\n\taiProvider provider.Provider,\n) []provider.Message\n```\nCompact compresses the conversation history by:\n\n 1. Keeping the system message (index 0) and the most recent 2 exchanges.\n 2. Summarising the middle portion using the LLM provider.\n 3. Injecting the summary as a system-level context note.\n\nIf summarisation fails, the middle messages are replaced with a placeholder rather than aborting. Returns the compacted message slice.\n\n```go\nfunc (cm *ContextManager) Compactions() int\n```\nCompactions returns how many times compaction has been applied.\n\n```go\nfunc (cm *ContextManager) ContextLimitTokens() int\n```\nContextLimitTokens returns the model's context window size in tokens.\n\n```go\nfunc (cm *ContextManager) NeedsCompaction(messages []provider.Message) bool\n```\nNeedsCompaction returns true if the estimated token count exceeds the threshold.\n\n```go\nfunc (cm *ContextManager) SetModelLimit(model string, limit int)\n```\nSetModelLimit overrides the context token limit for a specific model name pattern. This allows module config to adjust limits without modifying the built-in defaults.\n\n```go\nfunc (cm *ContextManager) SetModelLimitFromProvider(limit int)\n```\nSetModelLimitFromProvider applies a context window size reported by the provider, overriding the hardcoded lookup. Use when the provider can report its own limit (e.g. Ollama context\\_window config). No-op if limit is zero or negative.\n\n```go\nfunc (cm *ContextManager) TokenUsage(messages []provider.Message) (estimated, limit int)\n```\nTokenUsage returns the current estimated tokens and the context limit.\n\n```go\ntype DatabaseSecurityCheck struct{}\n```\nDatabaseSecurityCheck checks the SQLite database file permissions.\n\n```go\nfunc (c *DatabaseSecurityCheck) Name() string\n```\n\n```go\nfunc (c *DatabaseSecurityCheck) Run(_ context.Context) []AuditFinding\n```\n\n```go\ntype DefaultCredentialCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nDefaultCredentialCheck looks for known default or weak credentials.\n\n```go\nfunc (c *DefaultCredentialCheck) Name() string\n```\n\n```go\nfunc (c *DefaultCredentialCheck) Run(_ context.Context) []AuditFinding\n```\n\n```go\ntype DeployStrategy string\n```\nDeployStrategy identifies the deployment approach.\n\n```go\nconst (\n\tDeployStrategyHotReload DeployStrategy = \"hot_reload\"\n\tDeployStrategyGitPR     DeployStrategy = \"git_pr\"\n\tDeployStrategyCanary    DeployStrategy = \"canary\"\n)\n```\n\n```go\ntype GuardrailsDefaults struct {\n\tEnableSelfImprovement bool          `yaml:\"enable_self_improvement\" json:\"enable_self_improvement\"`\n\tEnableIacModification bool          `yaml:\"enable_iac_modification\" json:\"enable_iac_modification\"`\n\tRequireHumanApproval  bool          `yaml:\"require_human_approval\" json:\"require_human_approval\"`\n\tRequireDiffReview     bool          `yaml:\"require_diff_review\" json:\"require_diff_review\"`\n\tMaxIterationsPerCycle int           `yaml:\"max_iterations_per_cycle\" json:\"max_iterations_per_cycle\"`\n\tDeployStrategy        string        `yaml:\"deploy_strategy\" json:\"deploy_strategy\"`\n\tAllowedTools          []string      `yaml:\"allowed_tools\" json:\"allowed_tools\"`\n\tBlockedTools          []string      `yaml:\"blocked_tools\" json:\"blocked_tools\"`\n\tCommandPolicy         safety.Policy `yaml:\"command_policy\" json:\"command_policy\"`\n}\n```\nGuardrailsDefaults holds the default rules applied when no scope matches.\n\n```go\ntype GuardrailsModule struct {\n\t// contains filtered or unexported fields\n}\n```\nGuardrailsModule implements the agent.guardrails module type. It provides hierarchical tool access control, command safety, and config immutability enforcement. It also implements executor.TrustEvaluator so it can be passed directly as TrustEngine in executor.Config.\n\n```go\nfunc NewGuardrailsModule(name string, defaults GuardrailsDefaults) *GuardrailsModule\n```\nNewGuardrailsModule creates a GuardrailsModule with the given name and defaults. Useful for testing and programmatic construction.\n\n```go\nfunc (g *GuardrailsModule) CheckCommand(cmd string) (bool, string)\n```\nCheckCommand checks whether a shell command is safe.\n\n```go\nfunc (g *GuardrailsModule) CheckImmutableSection(path string) (protected bool, override string)\n```\nCheckImmutableSection returns whether the given config path is immutable and what override mechanism is required.\n\n```go\nfunc (g *GuardrailsModule) CheckTool(toolName string) (bool, string)\n```\nCheckTool checks whether a tool is permitted by the default rules. Returns (allowed, reason).\n\n```go\nfunc (g *GuardrailsModule) CheckToolScoped(toolName string, sc ScopeContext) (bool, string)\n```\nCheckToolScoped checks tool access for the given scope context. Scope precedence: agent \u003e team \u003e model \u003e provider \u003e defaults.\n\n```go\nfunc (g *GuardrailsModule) Defaults() GuardrailsDefaults\n```\nDefaults returns a copy of the default guardrails configuration.\n\n```go\nfunc (g *GuardrailsModule) Evaluate(_ context.Context, toolName string, _ map[string]any) executor.Action\n```\nEvaluate implements executor.TrustEvaluator. Checks whether a tool call is allowed using only the default rules (no scope matching). Use CheckToolInScope for scope-aware evaluation.\n\n```go\nfunc (g *GuardrailsModule) EvaluateCommand(cmd string) executor.Action\n```\nEvaluateCommand implements executor.TrustEvaluator. Delegates to the command analyzer for shell AST safety analysis.\n\n```go\nfunc (g *GuardrailsModule) EvaluatePath(_ string) executor.Action\n```\nEvaluatePath implements executor.TrustEvaluator. Paths are allowed by default; use trust rules for path restrictions.\n\n```go\nfunc (g *GuardrailsModule) FilterTools(tools []provider.ToolDef) []provider.ToolDef\n```\nFilterTools returns only the tool definitions allowed by the guardrails default rules. Blocked tools are excluded first (blocked wins), then allowed patterns are applied. If neither list is configured, all tools are passed through.\n\n```go\nfunc (g *GuardrailsModule) Init(app modular.Application) error\n```\nInit registers the guardrails module as a named service.\n\n```go\nfunc (g *GuardrailsModule) Name() string\n```\nName implements modular.Module.\n\n```go\nfunc (g *GuardrailsModule) ProvidesServices() []modular.ServiceProvider\n```\nProvidesServices declares the guardrails service.\n\n```go\nfunc (g *GuardrailsModule) RequiresServices() []modular.ServiceDependency\n```\nRequiresServices declares no dependencies.\n\n```go\ntype HTTPSource struct {\n\t// contains filtered or unexported fields\n}\n```\nHTTPSource exposes pending interactions via an API so that humans or QA scripts can act as the LLM. When the agent calls Chat(), the interaction is stored as pending and an SSE event is broadcast. A subsequent API call provides the response, unblocking the waiting goroutine.\n\n```go\nfunc NewHTTPSource(hub *SSEHub) *HTTPSource\n```\nNewHTTPSource creates an HTTPSource. The optional SSEHub is used to push notifications when new interactions arrive.\n\n```go\nfunc (h *HTTPSource) GetInteraction(id string) (*Interaction, error)\n```\nGetInteraction returns the full interaction details for a given ID.\n\n```go\nfunc (h *HTTPSource) GetResponse(ctx context.Context, interaction Interaction) (*InteractionResponse, error)\n```\nGetResponse implements ResponseSource. It adds the interaction to the pending map, broadcasts an SSE event, and blocks until a response is submitted via Respond() or the context is cancelled.\n\n```go\nfunc (h *HTTPSource) ListPending() []InteractionSummary\n```\nListPending returns summaries of all pending interactions.\n\n```go\nfunc (h *HTTPSource) PendingCount() int\n```\nPendingCount returns the number of interactions awaiting responses.\n\n```go\nfunc (h *HTTPSource) Respond(id string, resp InteractionResponse) error\n```\nRespond submits a response for a pending interaction, unblocking the waiting GetResponse() call.\n\n```go\nfunc (h *HTTPSource) SetSSEHub(hub *SSEHub)\n```\nSetSSEHub sets or replaces the SSE hub for push notifications.\n\n```go\ntype HumanRequest struct {\n\tID              string\n\tAgentID         string\n\tTaskID          string\n\tProjectID       string\n\tRequestType     RequestType\n\tTitle           string\n\tDescription     string\n\tUrgency         string // \"low\", \"normal\", \"high\", \"critical\"\n\tStatus          RequestStatus\n\tResponseData    string // JSON: the human's answer\n\tResponseComment string\n\tResolvedBy      string\n\tTimeoutMinutes  int\n\tMetadata        string // JSON: extra context hints\n\tCreatedAt       time.Time\n\tResolvedAt      *time.Time\n}\n```\nHumanRequest represents an agent's request for human assistance.\n\n```go\ntype HumanRequestManager struct {\n\t// contains filtered or unexported fields\n}\n```\nHumanRequestManager manages human request records in the database and pushes SSE notifications.\n\n```go\nfunc NewHumanRequestManager(db *sql.DB) *HumanRequestManager\n```\nNewHumanRequestManager creates a new HumanRequestManager.\n\n```go\nfunc (m *HumanRequestManager) Cancel(ctx context.Context, id, comment string) error\n```\nCancel marks a human request as cancelled.\n\n```go\nfunc (m *HumanRequestManager) CheckExpired(ctx context.Context) error\n```\nCheckExpired marks any pending requests that have exceeded their timeout (timeout\\_minutes \u003e 0).\n\n```go\nfunc (m *HumanRequestManager) Create(ctx context.Context, req HumanRequest) error\n```\nCreate inserts a new human request record and pushes an SSE event.\n\n```go\nfunc (m *HumanRequestManager) CreateRequest(ctx context.Context, agentID, taskID, projectID, reqType, title, desc, urgency, metadata string) (string, error)\n```\nCreateRequest is a convenience method that satisfies the tools.HumanRequestCreator interface.\n\n```go\nfunc (m *HumanRequestManager) Get(ctx context.Context, id string) (*HumanRequest, error)\n```\nGet retrieves a human request by ID.\n\n```go\nfunc (m *HumanRequestManager) GetRequest(ctx context.Context, id string) (map[string]any, error)\n```\nGetRequest retrieves a human request by ID and returns it as a map\\[string]any. This satisfies the tools.HumanRequestChecker interface.\n\n```go\nfunc (m *HumanRequestManager) ListByAgent(ctx context.Context, agentID string) ([]HumanRequest, error)\n```\nListByAgent returns all human requests for a given agent.\n\n```go\nfunc (m *HumanRequestManager) ListPending(ctx context.Context) ([]HumanRequest, error)\n```\nListPending returns all human requests with status 'pending', ordered by urgency then creation time.\n\n```go\nfunc (m *HumanRequestManager) Resolve(ctx context.Context, id, responseData, comment, resolvedBy string) error\n```\nResolve marks a human request as resolved with the provided response data.\n\n```go\nfunc (m *HumanRequestManager) SetSSEHub(hub *SSEHub)\n```\nSetSSEHub wires the SSE hub for push notifications.\n\n```go\nfunc (m *HumanRequestManager) WaitForResolution(ctx context.Context, id string, timeout time.Duration) (*HumanRequest, error)\n```\nWaitForResolution polls the database every 2 seconds until the request is resolved or the given timeout elapses. Returns the resolved request or marks it expired.\n\n```go\ntype HumanRequestResolveStep struct {\n\t// contains filtered or unexported fields\n}\n```\nHumanRequestResolveStep handles POST /api/requests/:id/resolve and /api/requests/:id/cancel.\n\n```go\nfunc (s *HumanRequestResolveStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *HumanRequestResolveStep) Name() string\n```\n\n```go\ntype HumanRequestService interface {\n\tCreateRequest(ctx context.Context, agentID, taskID, projectID, reqType, title, desc, urgency, metadata string) (string, error)\n\tResolve(ctx context.Context, id, responseData, comment, resolvedBy string) error\n\tCancel(ctx context.Context, id, comment string) error\n\tGet(ctx context.Context, id string) (*HumanRequest, error)\n\tWaitForResolution(ctx context.Context, id string, timeout time.Duration) (*HumanRequest, error)\n}\n```\nHumanRequestService is the orchestrator-scoped human-request gate.\n\nConsumers:\n\n  - step\\_human\\_request (HumanRequestResolveStep — REQUIRED-STATEFUL: Resolve/Cancel/Get error if absent).\n  - step\\_agent\\_execute (TRULY-OPTIONAL — WaitForResolution in handleHumanRequestWait).\n\n```go\ntype ImmutabilityViolation struct {\n\tPath     string `json:\"path\"`\n\tOverride string `json:\"override\"`\n}\n```\nImmutabilityViolation describes a config path that was modified but is immutable.\n\n```go\ntype ImmutableSection struct {\n\tPath     string `yaml:\"path\" json:\"path\"`\n\tOverride string `yaml:\"override\" json:\"override\"` // \"challenge_token\"\n}\n```\nImmutableSection is a config path that agents cannot modify without an override token.\n\n```go\ntype InputFromBlackboard struct {\n\tPhase        string `yaml:\"phase\" json:\"phase\"`                 // blackboard phase to read from\n\tArtifactType string `yaml:\"artifact_type\" json:\"artifact_type\"` // optional artifact type filter\n\tLatestOnly   bool   `yaml:\"latest_only\" json:\"latest_only\"`     // if true, read only the latest artifact\n\t// InjectAs controls how the artifact is injected:\n\t//   \"system_prompt_append\" — appended to the agent's system prompt\n\t//   \"user_message\"         — added as a user message before the agent loop\n\t//   \"\"                     — stored in pc.Current[\"blackboard_input\"] (default)\n\tInjectAs string `yaml:\"inject_as\" json:\"inject_as\"`\n}\n```\nInputFromBlackboard specifies how to pull an artifact from the blackboard and inject it into an agent's context.\n\n```go\ntype Interaction struct {\n\tID        string             `json:\"id\"`\n\tMessages  []provider.Message `json:\"messages\"`\n\tTools     []provider.ToolDef `json:\"tools\"`\n\tCreatedAt time.Time          `json:\"created_at\"`\n}\n```\nInteraction represents a single LLM call that needs a response.\n\n```go\ntype InteractionResponse struct {\n\tContent   string              `json:\"content\"`\n\tToolCalls []provider.ToolCall `json:\"tool_calls,omitempty\"`\n\tError     string              `json:\"error,omitempty\"`\n\tUsage     provider.Usage      `json:\"usage,omitempty\"`\n}\n```\nInteractionResponse is the response supplied by a ResponseSource.\n\n```go\ntype InteractionSummary struct {\n\tID        string    `json:\"id\"`\n\tMsgCount  int       `json:\"msg_count\"`\n\tToolCount int       `json:\"tool_count\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n}\n```\nInteractionSummary is a brief view of a pending interaction for list endpoints.\n\n```go\ntype LLMProviderConfig struct {\n\tID         string `json:\"id\"`\n\tAlias      string `json:\"alias\"`\n\tType       string `json:\"type\"`        // provider type (e.g. \"anthropic\", \"openai\", \"openai_compatible\", \"anthropic_compatible\", \"openai_chatgpt\", \"copilot_models\", \"openai_azure\", \"anthropic_foundry\", \"anthropic_vertex\", \"bedrock\")\n\tModel      string `json:\"model\"`       // model identifier\n\tSecretName string `json:\"secret_name\"` // key in secrets provider for API key\n\tBaseURL    string `json:\"base_url\"`    // optional override\n\tMaxTokens  int    `json:\"max_tokens\"`  // optional override\n\tIsDefault  int    `json:\"is_default\"`  // 1 if this is the default provider\n\tSettings   string `json:\"settings\"`    // JSON object with provider-specific settings (resource, region, deployment_name, project_id, etc.)\n}\n```\nLLMProviderConfig represents a configured LLM provider stored in the database.\n\n```go\ntype LSPDiagnoseStep struct {\n\t// contains filtered or unexported fields\n}\n```\nLSPDiagnoseStep wraps LSP diagnostics as a pipeline step. It takes YAML content from current data (key: \"yaml\" or \"content\") and returns diagnostics. When no LSP provider is available, it returns an empty diagnostics list with a warning.\n\n```go\nfunc (s *LSPDiagnoseStep) Execute(_ context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *LSPDiagnoseStep) Name() string\n```\n\n```go\ntype LSPDiagnostic struct {\n\tSeverity string `json:\"severity\"` // \"error\", \"warning\", \"info\"\n\tMessage  string `json:\"message\"`\n\tRange    string `json:\"range\"`\n}\n```\nLSPDiagnostic is a single diagnostic returned by the LSP provider.\n\n```go\ntype LSPProvider interface {\n\tDiagnoseContent(yaml string) ([]LSPDiagnostic, error)\n}\n```\nLSPProvider is the interface for in-process LSP diagnostics.\n\n```go\ntype LoopDetector struct {\n\t// contains filtered or unexported fields\n}\n```\nLoopDetector detects agent execution loops using multiple heuristics.\n\n```go\nfunc NewLoopDetector(cfg LoopDetectorConfig) *LoopDetector\n```\nNewLoopDetector creates a LoopDetector with the given config. Zero values in cfg are replaced with defaults (MaxConsecutive=3, MaxErrors=2, MaxAlternating=3, MaxNoProgress=3).\n\n```go\nfunc (ld *LoopDetector) Check() (LoopStatus, string)\n```\nCheck evaluates the recorded history for loop patterns and returns the current status along with a human-readable explanation. Checks are evaluated in priority order: hard breaks take precedence over warnings.\n\n```go\nfunc (ld *LoopDetector) Record(toolName string, args map[string]any, result string, isError bool)\n```\nRecord appends a tool invocation to the history.\n\n```go\nfunc (ld *LoopDetector) Reset()\n```\nReset clears recorded history.\n\n```go\ntype LoopDetectorConfig struct {\n\t// MaxConsecutive is the number of identical consecutive tool calls before a loop is detected.\n\t// Default: 3.\n\tMaxConsecutive int\n\t// MaxErrors is the number of times the same tool call can return the same error before a loop is detected.\n\t// Default: 2.\n\tMaxErrors int\n\t// MaxAlternating is the number of A/B alternating cycles before a loop is detected.\n\t// Default: 3.\n\tMaxAlternating int\n\t// MaxNoProgress is the number of identical (same args + same result) non-error calls before a loop is detected.\n\t// Default: 3.\n\tMaxNoProgress int\n}\n```\nLoopDetectorConfig holds configurable thresholds for loop detection.\n\n```go\ntype LoopStatus int\n```\nLoopStatus represents the result of a loop check.\n\n```go\nconst (\n\t// LoopStatusOK means no loop detected.\n\tLoopStatusOK LoopStatus = iota\n\t// LoopStatusWarning means a potential loop pattern is forming.\n\tLoopStatusWarning\n\t// LoopStatusBreak means a definitive loop is detected; execution should stop.\n\tLoopStatusBreak\n)\n```\n\n```go\ntype MCPClientModule struct {\n\t// contains filtered or unexported fields\n}\n```\nMCPClientModule connects to external MCP servers.\n\n```go\nfunc (m *MCPClientModule) Init(app modular.Application) error\n```\n\n```go\nfunc (m *MCPClientModule) Name() string\n```\n\n```go\nfunc (m *MCPClientModule) ProvidesServices() []modular.ServiceProvider\n```\n\n```go\nfunc (m *MCPClientModule) ReloadServers(configs []mcpServerConfig) (int, []string)\n```\nReloadServers stops all existing MCP clients and starts new ones from the given configs. Returns the count of successfully started servers and any error messages.\n\n```go\nfunc (m *MCPClientModule) RequiresServices() []modular.ServiceDependency\n```\n\n```go\nfunc (m *MCPClientModule) Start(ctx context.Context) error\n```\n\n```go\nfunc (m *MCPClientModule) Stop(_ context.Context) error\n```\n\n```go\ntype MCPProvider interface {\n\tListTools() []string\n\tListToolSchemas() []wfmcp.ToolSchema\n\tCallTool(ctx context.Context, toolName string, args map[string]any) (any, error)\n}\n```\nMCPProvider is the interface for in-process MCP tool invocation. It matches github.com/GoCodeAlone/workflow/mcp.MCPProvider so callers can use either type interchangeably.\n\n```go\ntype MCPReloadStep struct {\n\t// contains filtered or unexported fields\n}\n```\nMCPReloadStep triggers a hot-reload of MCP server connections from the database.\n\n```go\nfunc (s *MCPReloadStep) Execute(ctx context.Context, _ *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *MCPReloadStep) Name() string\n```\n\n```go\ntype MCPServerCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nMCPServerCheck inspects MCP server configurations for risky capabilities.\n\n```go\nfunc (c *MCPServerCheck) Name() string\n```\n\n```go\nfunc (c *MCPServerCheck) Run(ctx context.Context) []AuditFinding\n```\n\n```go\ntype MCPServerModule struct {\n\t// contains filtered or unexported fields\n}\n```\nMCPServerModule exposes Ratchet APIs as MCP tools over HTTP/JSON-RPC.\n\n```go\nfunc (m *MCPServerModule) Init(app modular.Application) error\n```\n\n```go\nfunc (m *MCPServerModule) Name() string\n```\n\n```go\nfunc (m *MCPServerModule) Path() string\n```\nPath returns the configured MCP endpoint path.\n\n```go\nfunc (m *MCPServerModule) ProvidesServices() []modular.ServiceProvider\n```\n\n```go\nfunc (m *MCPServerModule) RequiresServices() []modular.ServiceDependency\n```\n\n```go\nfunc (m *MCPServerModule) ServeHTTP(w http.ResponseWriter, r *http.Request)\n```\nServeHTTP handles MCP JSON-RPC requests over HTTP POST.\n\n```go\nfunc (m *MCPServerModule) Start(_ context.Context) error\n```\n\n```go\nfunc (m *MCPServerModule) Stop(_ context.Context) error\n```\n\n```go\ntype MCPToolAdapter struct {\n\t// contains filtered or unexported fields\n}\n```\nMCPToolAdapter wraps an MCP tool as a ratchet plugin.Tool.\n\n```go\nfunc (t *MCPToolAdapter) Definition() provider.ToolDef\n```\n\n```go\nfunc (t *MCPToolAdapter) Description() string\n```\n\n```go\nfunc (t *MCPToolAdapter) Execute(ctx context.Context, args map[string]any) (any, error)\n```\n\n```go\nfunc (t *MCPToolAdapter) Name() string\n```\n\n```go\ntype MemoryEntry struct {\n\tID        string\n\tAgentID   string\n\tContent   string\n\tCategory  string    // e.g., \"decision\", \"fact\", \"preference\", \"general\"\n\tEmbedding []float32 // optional vector embedding\n\tCreatedAt time.Time\n}\n```\nMemoryEntry is a single piece of persistent agent memory.\n\n```go\ntype MemoryExtractStep struct {\n\t// contains filtered or unexported fields\n}\n```\nMemoryExtractStep extracts memories from completed task transcripts and saves them.\n\n```go\nfunc (s *MemoryExtractStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *MemoryExtractStep) Name() string\n```\n\n```go\ntype MemoryStore struct {\n\t// contains filtered or unexported fields\n}\n```\nMemoryStore provides persistent memory storage for agents using SQLite FTS5 and optional vector embeddings for hybrid semantic search.\n\n```go\nfunc NewMemoryStore(db *sql.DB) *MemoryStore\n```\nNewMemoryStore creates a new MemoryStore backed by the given database.\n\n```go\nfunc (ms *MemoryStore) ExtractAndSave(ctx context.Context, agentID, transcript string, embedder provider.Embedder) error\n```\nExtractAndSave extracts key facts from a conversation transcript and saves them. If an embedder is provided, embeddings are computed and stored.\n\n```go\nfunc (ms *MemoryStore) InitTables() error\n```\nInitTables creates the memory\\_entries table and FTS5 virtual table if they don't exist.\n\n```go\nfunc (ms *MemoryStore) Save(ctx context.Context, entry MemoryEntry) error\n```\nSave persists a memory entry. If entry.ID is empty, a new UUID is assigned.\n\n```go\nfunc (ms *MemoryStore) SaveMemory(ctx context.Context, agentID, content, category string) error\n```\nSaveMemory is a convenience method that satisfies tools.MemoryStoreSaver.\n\n```go\nfunc (ms *MemoryStore) Search(ctx context.Context, agentID, query string, limit int) ([]MemoryEntry, error)\n```\nSearch uses FTS5 BM25 ranking to find relevant memories for an agent.\n\n```go\nfunc (ms *MemoryStore) SearchHybrid(ctx context.Context, agentID, query string, queryEmbedding []float32, limit int) ([]MemoryEntry, error)\n```\nSearchHybrid combines 70% cosine similarity + 30% BM25 for hybrid semantic search. queryEmbedding is the embedding of the search query. Falls back to FTS-only if nil.\n\n```go\nfunc (ms *MemoryStore) SearchMemory(ctx context.Context, agentID, query string, limit int) ([]tools.MemoryEntryResult, error)\n```\nSearchMemory satisfies tools.MemoryStoreSearcher, returning lightweight result structs.\n\n```go\ntype MemoryStoreService interface {\n\tSearch(ctx context.Context, agentID, query string, limit int) ([]MemoryEntry, error)\n\tSave(ctx context.Context, entry MemoryEntry) error\n\tExtractAndSave(ctx context.Context, agentID, transcript string, embedder provider.Embedder) error\n}\n```\nMemoryStoreService is the orchestrator-scoped persistent memory store.\n\nDESIGN DECISION (P6 — MemoryEntry translation): the executor package defines its own MemoryStore interface backed by a 4-field MemoryEntry (ID/AgentID/Content/Category). The orchestrator's concrete MemoryStore uses a 6-field MemoryEntry (+Embedding \\[]float32 +CreatedAt time.Time) and its Search/Save/ExtractAndSave methods operate on that richer type.\n\nRather than write a lossy adapter that drops Embedding/CreatedAt, we define the orchestrator-scoped MemoryStoreService using the orchestrator's own MemoryEntry. The concrete \\*MemoryStore satisfies it directly — no adapter, no data loss. The executor's narrower MemoryStore remains a separate concern consumed by the executor loop (which constructs its own MemoryEntry values).\n\nConsumers:\n\n  - step\\_memory\\_extract (TRULY-OPTIONAL — ExtractAndSave; returns success= false when absent, step still completes).\n  - step\\_agent\\_execute (TRULY-OPTIONAL — Search for context injection; ExtractAndSave after the run).\n\n```go\ntype MountSpec struct {\n\tSource   string `json:\"source\"`\n\tTarget   string `json:\"target\"`\n\tReadOnly bool   `json:\"readonly,omitempty\"`\n}\n```\nMountSpec describes a single bind mount.\n\n```go\ntype NullApproval struct {\n\t// contains filtered or unexported fields\n}\n```\nNullApproval is a no-op ApprovalService. Approve/Reject/CreateApproval return ErrServiceUnavailable; WaitForResolution returns a Timeout approval so the agent loop's optional path degrades to \"no approval\" rather than blocking.\n\n```go\nfunc (NullApproval) Approve(_ context.Context, _, _ string) error\n```\n\n```go\nfunc (NullApproval) CreateApproval(_ context.Context, _, _, _, _, _ string) (string, error)\n```\n\n```go\nfunc (NullApproval) Get(_ context.Context, _ string) (*Approval, error)\n```\n\n```go\nfunc (NullApproval) Reject(_ context.Context, _, _ string) error\n```\n\n```go\nfunc (NullApproval) WaitForResolution(_ context.Context, _ string, _ time.Duration) (*Approval, error)\n```\n\n```go\ntype NullBlackboard struct {\n\t// contains filtered or unexported fields\n}\n```\nNullBlackboard is a no-op BlackboardService. Post is a no-op; Read/ReadLatest return empty/nil. Detect absence via IsNull.\n\n```go\nfunc (NullBlackboard) Post(_ context.Context, _ Artifact) error\n```\n\n```go\nfunc (NullBlackboard) Read(_ context.Context, _, _ string) ([]Artifact, error)\n```\n\n```go\nfunc (NullBlackboard) ReadLatest(_ context.Context, _ string) (*Artifact, error)\n```\n\n```go\ntype NullContainer struct {\n\t// contains filtered or unexported fields\n}\n```\nNullContainer is a no-op ContainerService. IsAvailable returns false; all lifecycle methods return ErrServiceUnavailable.\n\n```go\nfunc (NullContainer) EnsureContainer(_ context.Context, _, _ string, _ sandboxSpec) (string, error)\n```\n\n```go\nfunc (NullContainer) ExecInContainer(_ context.Context, _, _, _ string, _ int) (string, string, int, error)\n```\n\n```go\nfunc (NullContainer) GetContainerStatus(_ context.Context, _ string) (string, error)\n```\n\n```go\nfunc (NullContainer) IsAvailable() bool\n```\n\n```go\nfunc (NullContainer) RemoveContainer(_ context.Context, _ string) error\n```\n\n```go\nfunc (NullContainer) StopContainer(_ context.Context, _ string) error\n```\n\n```go\ntype NullHumanRequest struct {\n\t// contains filtered or unexported fields\n}\n```\nNullHumanRequest is a no-op HumanRequestService. Resolve/Cancel/CreateRequest return ErrServiceUnavailable; WaitForResolution returns an Expired request so the agent loop's optional path degrades to \"request expired\" rather than blocking.\n\n```go\nfunc (NullHumanRequest) Cancel(_ context.Context, _, _ string) error\n```\n\n```go\nfunc (NullHumanRequest) CreateRequest(_ context.Context, _, _, _, _, _, _, _, _ string) (string, error)\n```\n\n```go\nfunc (NullHumanRequest) Get(_ context.Context, _ string) (*HumanRequest, error)\n```\n\n```go\nfunc (NullHumanRequest) Resolve(_ context.Context, _, _, _, _ string) error\n```\n\n```go\nfunc (NullHumanRequest) WaitForResolution(_ context.Context, _ string, _ time.Duration) (*HumanRequest, error)\n```\n\n```go\ntype NullMemoryStore struct {\n\t// contains filtered or unexported fields\n}\n```\nNullMemoryStore is a no-op MemoryStoreService. Search returns nil; Save and ExtractAndSave are no-ops.\n\n```go\nfunc (NullMemoryStore) ExtractAndSave(_ context.Context, _, _ string, _ provider.Embedder) error\n```\n\n```go\nfunc (NullMemoryStore) Save(_ context.Context, _ MemoryEntry) error\n```\n\n```go\nfunc (NullMemoryStore) Search(_ context.Context, _, _ string, _ int) ([]MemoryEntry, error)\n```\n\n```go\ntype NullSkill struct {\n\t// contains filtered or unexported fields\n}\n```\nNullSkill is a no-op SkillService. BuildSkillPrompt returns \"\" (no skill augmentation); List/Get return nil.\n\n```go\nfunc (NullSkill) BuildSkillPrompt(_ context.Context, _ string) (string, error)\n```\n\n```go\nfunc (NullSkill) GetAgentSkills(_ context.Context, _ string) ([]Skill, error)\n```\n\n```go\nfunc (NullSkill) GetSkill(_ context.Context, _ string) (*Skill, error)\n```\n\n```go\nfunc (NullSkill) ListSkills(_ context.Context) ([]Skill, error)\n```\n\n```go\ntype NullSubAgent struct {\n\t// contains filtered or unexported fields\n}\n```\nNullSubAgent is a no-op SubAgentService. CountActive returns 0; Spawn returns ErrServiceUnavailable; CancelChildren is a no-op.\n\n```go\nfunc (NullSubAgent) CancelChildren(_ context.Context, _ string) error\n```\n\n```go\nfunc (NullSubAgent) CheckTask(_ context.Context, _ string) (string, string, error)\n```\n\n```go\nfunc (NullSubAgent) CountActive(_ context.Context, _ string) (int, error)\n```\n\n```go\nfunc (NullSubAgent) Spawn(_ context.Context, _, _, _, _ string) (string, error)\n```\n\n```go\nfunc (NullSubAgent) WaitTasks(_ context.Context, _ []string, _ time.Duration) (map[string]tools.SubTaskResult, error)\n```\n\n```go\ntype NullToolRegistry struct {\n\t// contains filtered or unexported fields\n}\n```\nNullToolRegistry is a no-op ToolRegistryService. Get returns (nil,false); AllDefs/Names return nil; Execute returns ErrServiceUnavailable.\n\n```go\nfunc (NullToolRegistry) AllDefs() []provider.ToolDef\n```\n\n```go\nfunc (NullToolRegistry) Execute(_ context.Context, _ string, _ map[string]any) (any, error)\n```\n\n```go\nfunc (NullToolRegistry) Get(_ string) (any, bool)\n```\n\n```go\nfunc (NullToolRegistry) Names() []string\n```\n\n```go\nfunc (NullToolRegistry) SetPaginator(_ *ResponsePaginator)\n```\n\n```go\ntype NullTranscript struct {\n\t// contains filtered or unexported fields\n}\n```\nNullTranscript is a no-op TranscriptService. Record is a no-op.\n\n```go\nfunc (NullTranscript) Record(_ context.Context, _ TranscriptEntry) error\n```\n\n```go\ntype NullWebhook struct {\n\t// contains filtered or unexported fields\n}\n```\nNullWebhook is a no-op WebhookService. GetBySource returns nil; VerifySignature returns false (reject); RenderTaskTemplate returns ErrServiceUnavailable.\n\n```go\nfunc (NullWebhook) ExtractEventType(_ string, _ map[string]string, _ map[string]any) string\n```\n\n```go\nfunc (NullWebhook) GetBySource(_ context.Context, _ string) ([]Webhook, error)\n```\n\n```go\nfunc (NullWebhook) MatchesFilter(_, _, _ string) bool\n```\n\n```go\nfunc (NullWebhook) RenderTaskTemplate(_ string, _ map[string]any) (string, string, error)\n```\n\n```go\nfunc (NullWebhook) VerifySignature(_, _ string, _ []byte, _, _ string) bool\n```\n\n```go\ntype OverrideConfig struct {\n\tMechanism      string `yaml:\"mechanism\" json:\"mechanism\"`\n\tAdminSecretEnv string `yaml:\"admin_secret_env\" json:\"admin_secret_env\"`\n\tFallback       string `yaml:\"fallback\" json:\"fallback\"`\n}\n```\nOverrideConfig configures the challenge-token override mechanism.\n\n```go\ntype PolicyAction string\n```\nPolicyAction defines the action of a tool policy.\n\n```go\nconst (\n\tPolicyAllow PolicyAction = \"allow\"\n\tPolicyDeny  PolicyAction = \"deny\"\n)\n```\n\n```go\ntype PolicyScope string\n```\nPolicyScope defines the scope of a tool policy.\n\n```go\nconst (\n\tPolicyScopeGlobal PolicyScope = \"global\"\n\tPolicyScopeTeam   PolicyScope = \"team\"\n\tPolicyScopeAgent  PolicyScope = \"agent\"\n)\n```\n\n```go\ntype ProviderFactory func(ctx context.Context, apiKey string, cfg LLMProviderConfig) (provider.Provider, error)\n```\nProviderFactory creates a provider.Provider from a context, API key, and config. The context is propagated from the caller (e.g., GetByAlias/GetDefault) to allow cancellation and timeout during provider initialization.\n\n```go\ntype ProviderModelsStep struct {\n\t// contains filtered or unexported fields\n}\n```\nProviderModelsStep fetches available models from a provider's API. Requires provider type and API key in the request body.\n\n```go\nfunc (s *ProviderModelsStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *ProviderModelsStep) Name() string\n```\n\n```go\ntype ProviderRegistry struct {\n\t// contains filtered or unexported fields\n}\n```\nProviderRegistry manages AI provider lifecycle: factory creation, caching, and DB lookup.\n\nThe secrets provider is held as an ACCESSOR (func() secrets.Provider) rather than a snapshot because wiring hooks run in BuildFromConfig BEFORE module Start() — so the engine secrets.vault module's Provider() is nil at hook time (the secretService composite's secretsHolder lazy-resolves it on first use, post-Start). Resolving on demand at provider-resolution time (post-Start, e.g. inside agent\\_execute) triggers that lazy-resolve instead of snapshotting a permanently-nil provider. UpdateSecretsProvider hot-swaps the accessor for the runtime vault-config path.\n\n```go\nfunc NewProviderRegistry(db *sql.DB, secretsProvider func() secrets.Provider) *ProviderRegistry\n```\nNewProviderRegistry creates a new ProviderRegistry with built-in factories registered.\n\nsecretsProvider is a lazy accessor (typically secretService.Holder().Provider) — it is invoked on demand at provider-resolution time (post-Start), NOT snapshotted at wiring time. This is required because the secretsHolder resolves the engine vault module's Provider lazily on first use; snapshotting at wiring time would capture nil (the module's Provider is populated only in Start(), which runs AFTER wiring hooks). A nil accessor degrades gracefully (no secret resolution).\n\n```go\nfunc (r *ProviderRegistry) GetByAlias(ctx context.Context, alias string) (provider.Provider, error)\n```\nGetByAlias looks up a provider by its alias. It checks the cache first, then falls back to DB lookup, secret resolution, and factory creation.\n\n```go\nfunc (r *ProviderRegistry) GetDefault(ctx context.Context) (provider.Provider, error)\n```\nGetDefault finds the default provider (is\\_default=1) and returns it.\n\n```go\nfunc (r *ProviderRegistry) InvalidateCache()\n```\nInvalidateCache clears all cached providers.\n\n```go\nfunc (r *ProviderRegistry) InvalidateCacheAlias(alias string)\n```\nInvalidateCacheAlias removes a specific cached provider by alias.\n\n```go\nfunc (r *ProviderRegistry) InvalidateCacheBySecret(secretName string)\n```\nInvalidateCacheBySecret removes all cached providers that use the given secret name.\n\n```go\nfunc (r *ProviderRegistry) ProviderTypes() []string\n```\nProviderTypes returns the registered provider type names in sorted order.\n\n```go\nfunc (r *ProviderRegistry) TestConnection(ctx context.Context, alias string) (bool, string, time.Duration, error)\n```\nTestConnection sends a minimal test message to the provider and returns success, a status message, the latency, and any error.\n\n```go\nfunc (r *ProviderRegistry) UpdateSecretsProvider(p secrets.Provider)\n```\nUpdateSecretsProvider swaps the underlying secrets provider and clears the cache. It overrides the lazy accessor with one returning the hot-swapped provider, so the runtime vault-config path takes precedence over guard lazy-resolution.\n\n```go\ntype ProviderSecurityCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nProviderSecurityCheck verifies AI provider API keys are stored in the vault.\n\n```go\nfunc (c *ProviderSecurityCheck) Name() string\n```\n\n```go\nfunc (c *ProviderSecurityCheck) Run(ctx context.Context) []AuditFinding\n```\n\n```go\ntype ProviderTestStep struct {\n\t// contains filtered or unexported fields\n}\n```\nProviderTestStep tests connectivity to a configured AI provider.\n\n```go\nfunc (s *ProviderTestStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *ProviderTestStep) Name() string\n```\n\n```go\ntype RatchetPlugin struct {\n\tplugin.BaseEnginePlugin\n}\n```\nRatchetPlugin implements plugin.EnginePlugin.\n\n```go\nfunc New() *RatchetPlugin\n```\nNew creates a new RatchetPlugin ready to register with the workflow engine.\n\n```go\nfunc (p *RatchetPlugin) Capabilities() []capability.Contract\n```\nCapabilities returns the capability contracts for this plugin.\n\n```go\nfunc (p *RatchetPlugin) ModuleFactories() map[string]plugin.ModuleFactory\n```\nModuleFactories returns the module factories registered by this plugin. \"agent.provider\" is registered here so ratchetplugin is self-contained and does not need workflow-plugin-agent loaded as a separate engine plugin (which would cause a duplicate step.agent\\_execute conflict).\n\n```go\nfunc (p *RatchetPlugin) ModuleSchemas() []*schema.ModuleSchema\n```\nModuleSchemas returns schema definitions for IDE completions and config validation.\n\n```go\nfunc (p *RatchetPlugin) StepFactories() map[string]plugin.StepFactory\n```\nStepFactories returns the pipeline step factories registered by this plugin. step.agent\\_execute uses ratchet's richer implementation (browser, sub-agent, skill injection, etc.). step.provider\\_test and step.provider\\_models are delegated to the agent plugin's factories since ratchetplugin absorbs the agent plugin to avoid duplicate step registration.\n\n```go\nfunc (p *RatchetPlugin) WiringHooks() []plugin.WiringHook\n```\nWiringHooks returns the post-init wiring hooks for this plugin. agentplugin.ProviderRegistryHook() is included here because ratchetplugin absorbs the workflow-plugin-agent to avoid duplicate step type registration.\n\n```go\ntype RateLimitCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nRateLimitCheck verifies rate limiting is properly configured.\n\n```go\nfunc (c *RateLimitCheck) Name() string\n```\n\n```go\nfunc (c *RateLimitCheck) Run(_ context.Context) []AuditFinding\n```\n\n```go\ntype RequestStatus string\n```\nRequestStatus represents the resolution state of a human request.\n\n```go\nconst (\n\tRequestPending   RequestStatus = \"pending\"\n\tRequestResolved  RequestStatus = \"resolved\"\n\tRequestCancelled RequestStatus = \"cancelled\"\n\tRequestExpired   RequestStatus = \"expired\"\n)\n```\n\n```go\ntype RequestType string\n```\nRequestType categorizes what the agent needs from the human.\n\n```go\nconst (\n\tRequestTypeToken  RequestType = \"token\"  // API keys, PATs, secrets\n\tRequestTypeBinary RequestType = \"binary\" // Install a CLI tool or binary\n\tRequestTypeAccess RequestType = \"access\" // Grant access to a service/repo\n\tRequestTypeInfo   RequestType = \"info\"   // Clarification or instructions\n\tRequestTypeCustom RequestType = \"custom\" // Anything else\n)\n```\n\n```go\ntype ResponsePaginator struct {\n\t// contains filtered or unexported fields\n}\n```\nResponsePaginator caches and paginates large tool responses so they fit within the LLM's context window without truncation.\n\n```go\nfunc NewResponsePaginator(contextWindow int) *ResponsePaginator\n```\nNewResponsePaginator creates a paginator sized for the given context window. maxResponseSize is set to 20% of the context window (char estimate); pageSize targets ~10% of the context window at ~80 chars per line.\n\n```go\nfunc (rp *ResponsePaginator) Paginate(toolName string, args map[string]any, result string) string\n```\nPaginate returns result unchanged if it fits within maxResponseSize. For larger results it caches the lines and returns page 1 with navigation hints. If args contains {\"page\": N}, it serves page N from the cache instead.\n\n```go\ntype ResponseSource interface {\n\t// GetResponse receives the current interaction (messages + tools) and returns\n\t// a response. Implementations may block (e.g. waiting for human input).\n\tGetResponse(ctx context.Context, interaction Interaction) (*InteractionResponse, error)\n}\n```\nResponseSource is the interface that pluggable backends implement to supply responses for the TestProvider.\n\n```go\ntype ReviewPipelineConfig struct {\n\tDesignerProvider    string `yaml:\"designer_provider\" json:\"designer_provider\"`\n\tImplementerProvider string `yaml:\"implementer_provider\" json:\"implementer_provider\"`\n\tReviewerProvider    string `yaml:\"reviewer_provider\" json:\"reviewer_provider\"`\n\tSecurityProvider    string `yaml:\"security_provider\" json:\"security_provider\"`\n\tRequireApproval     bool   `yaml:\"require_approval\" json:\"require_approval\"`\n}\n```\nReviewPipelineConfig holds provider configurations for the four review roles.\n\n```go\ntype SSEHub struct {\n\t// contains filtered or unexported fields\n}\n```\nSSEHub is a modular.Module that manages Server-Sent Events connections. It provides an HTTP handler for SSE clients and a Broadcast method for pushing events from pipeline steps or other parts of the system.\n\n```go\nfunc (h *SSEHub) Broadcast(event []byte)\n```\nBroadcast sends a raw SSE payload to all connected clients.\n\n```go\nfunc (h *SSEHub) BroadcastEvent(eventType, data string)\n```\nBroadcastEvent formats and broadcasts a named SSE event with data.\n\n```go\nfunc (h *SSEHub) Init(app modular.Application) error\n```\nInit registers the hub as a named service.\n\n```go\nfunc (h *SSEHub) Name() string\n```\nName implements modular.Module.\n\n```go\nfunc (h *SSEHub) Path() string\n```\nPath returns the configured SSE endpoint path.\n\n```go\nfunc (h *SSEHub) ProvidesServices() []modular.ServiceProvider\n```\nProvidesServices declares the SSE hub service.\n\n```go\nfunc (h *SSEHub) RequiresServices() []modular.ServiceDependency\n```\nRequiresServices declares no dependencies.\n\n```go\nfunc (h *SSEHub) ServeHTTP(w http.ResponseWriter, r *http.Request)\n```\nServeHTTP handles an incoming SSE connection. It sets the required headers, registers the client channel, and streams events until the client disconnects or the server shuts down.\n\n```go\nfunc (h *SSEHub) Start(_ context.Context) error\n```\nStart implements modular.Startable (no-op — the hub starts on first HTTP connection).\n\n```go\nfunc (h *SSEHub) Stop(_ context.Context) error\n```\nStop implements modular.Stoppable — closes all connected clients.\n\n```go\ntype ScopeContext struct {\n\tAgent    string\n\tTeam     string\n\tModel    string\n\tProvider string\n}\n```\nScopeContext carries the agent's identity for scope resolution.\n\n```go\ntype ScopeMatch struct {\n\tAgent    string `yaml:\"agent\" json:\"agent\"`\n\tTeam     string `yaml:\"team\" json:\"team\"`\n\tModel    string `yaml:\"model\" json:\"model\"`\n\tProvider string `yaml:\"provider\" json:\"provider\"`\n}\n```\nScopeMatch defines which agents/teams/models/providers this scope applies to. Fields with empty string match any value. Patterns support \\* wildcard.\n\n```go\ntype ScopeOverride struct {\n\tAllowedTools          []string       `yaml:\"allowed_tools\" json:\"allowed_tools\"`\n\tBlockedTools          []string       `yaml:\"blocked_tools\" json:\"blocked_tools\"`\n\tMaxIterationsPerCycle *int           `yaml:\"max_iterations_per_cycle,omitempty\" json:\"max_iterations_per_cycle,omitempty\"`\n\tCommandPolicy         *safety.Policy `yaml:\"command_policy,omitempty\" json:\"command_policy,omitempty\"`\n\tEnableIacModification *bool          `yaml:\"enable_iac_modification,omitempty\" json:\"enable_iac_modification,omitempty\"`\n\tRequireHumanApproval  *bool          `yaml:\"require_human_approval,omitempty\" json:\"require_human_approval,omitempty\"`\n}\n```\nScopeOverride holds the overriding rules for a specific scope. Non-nil/non-empty fields replace the defaults for matched agents.\n\n```go\ntype ScopeRule struct {\n\tMatch    ScopeMatch    `yaml:\"match\" json:\"match\"`\n\tOverride ScopeOverride `yaml:\"rules\" json:\"rules\"`\n}\n```\nScopeRule is a scope + its override rules.\n\n```go\ntype ScriptedScenario struct {\n\tName        string         `yaml:\"name\" json:\"name\"`\n\tDescription string         `yaml:\"description,omitempty\" json:\"description,omitempty\"`\n\tSteps       []ScriptedStep `yaml:\"steps\" json:\"steps\"`\n\tLoop        bool           `yaml:\"loop,omitempty\" json:\"loop,omitempty\"`\n}\n```\nScriptedScenario is a named sequence of steps loadable from YAML.\n\n```go\nfunc LoadScenario(path string) (*ScriptedScenario, error)\n```\nLoadScenario reads a ScriptedScenario from a YAML file.\n\n```go\ntype ScriptedSource struct {\n\t// contains filtered or unexported fields\n}\n```\nScriptedSource returns responses from a pre-defined sequence of steps. It is safe for concurrent use.\n\n```go\nfunc NewScriptedSource(steps []ScriptedStep, loop bool) *ScriptedSource\n```\nNewScriptedSource creates a ScriptedSource from the given steps. If loop is true, steps cycle indefinitely; otherwise GetResponse returns an error when all steps are exhausted.\n\n```go\nfunc NewScriptedSourceFromScenario(scenario *ScriptedScenario) *ScriptedSource\n```\nNewScriptedSourceFromScenario creates a ScriptedSource from a loaded scenario.\n\n```go\nfunc (s *ScriptedSource) GetResponse(ctx context.Context, interaction Interaction) (*InteractionResponse, error)\n```\nGetResponse implements ResponseSource.\n\n```go\nfunc (s *ScriptedSource) Remaining() int\n```\nRemaining returns how many unconsumed steps remain.\n\n```go\ntype ScriptedStep struct {\n\tContent   string              `yaml:\"content\" json:\"content\"`\n\tToolCalls []provider.ToolCall `yaml:\"tool_calls,omitempty\" json:\"tool_calls,omitempty\"`\n\tError     string              `yaml:\"error,omitempty\" json:\"error,omitempty\"`\n\tDelay     time.Duration       `yaml:\"delay,omitempty\" json:\"delay,omitempty\"`\n}\n```\nScriptedStep defines a single scripted response in a test scenario.\n\n```go\ntype SecretExposureCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nSecretExposureCheck scans recent transcripts for potential credential leakage.\n\n```go\nfunc (c *SecretExposureCheck) Name() string\n```\n\n```go\nfunc (c *SecretExposureCheck) Run(ctx context.Context) []AuditFinding\n```\n\n```go\ntype SecurityAuditStep struct {\n\t// contains filtered or unexported fields\n}\n```\nSecurityAuditStep runs a full security audit and returns the report as JSON.\n\n```go\nfunc (s *SecurityAuditStep) Execute(ctx context.Context, _ *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *SecurityAuditStep) Name() string\n```\n\n```go\ntype SecurityAuditor struct {\n\t// contains filtered or unexported fields\n}\n```\nSecurityAuditor orchestrates all audit checks.\n\n```go\nfunc NewSecurityAuditor(db *sql.DB, app modular.Application) *SecurityAuditor\n```\nNewSecurityAuditor creates a SecurityAuditor wired with all built-in checks.\n\n```go\nfunc (sa *SecurityAuditor) RunAll(ctx context.Context) *AuditReport\n```\nRunAll executes all checks and returns an AuditReport.\n\n```go\ntype SelfImproveDeployStep struct {\n\t// contains filtered or unexported fields\n}\n```\nSelfImproveDeployStep executes one of three deployment strategies after a mandatory pre-deploy validation gate.\n\nConfig keys:\n\n\tstrategy     string — \"hot_reload\", \"git_pr\", or \"canary\" (default: \"git_pr\")\n\tproposed_key string — key in pc.Current for proposed YAML (default: \"proposed_yaml\")\n\tbranch_prefix string — git branch prefix for git_pr strategy (default: \"self-improve/\")\n\tskip_validation bool — skip the pre-deploy validation gate (not recommended)\n\n```go\nfunc (s *SelfImproveDeployStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *SelfImproveDeployStep) Name() string\n```\n\n```go\ntype SelfImproveDiffStep struct {\n\t// contains filtered or unexported fields\n}\n```\nSelfImproveDiffStep generates a diff between current and proposed configs, optionally posting the result to the Blackboard.\n\nConfig keys:\n\n\tproposed_key        string — key in pc.Current for proposed YAML (default: \"proposed_yaml\")\n\tcurrent_key         string — key in pc.Current for current YAML (default: \"current_yaml\")\n\tforce               bool   — always generate diff even if content is identical\n\tinclude_iac         bool   — include IaC-relevant fields in diff output\n\toutput_to_blackboard bool  — post diff artifact to blackboard\n\n```go\nfunc (s *SelfImproveDiffStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *SelfImproveDiffStep) Name() string\n```\n\n```go\ntype SelfImproveValidateStep struct {\n\t// contains filtered or unexported fields\n}\n```\nSelfImproveValidateStep runs validation on a proposed workflow config. It checks:\n\n 1. YAML parse validity\n 2. Immutability constraints (if a GuardrailsModule is registered)\n 3. MCP-based wfctl validation (if an MCP provider is available)\n\n```go\nfunc (s *SelfImproveValidateStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *SelfImproveValidateStep) Name() string\n```\n\n```go\ntype Skill struct {\n\tID            string\n\tName          string\n\tDescription   string\n\tContent       string   // the markdown body (injected into system prompt)\n\tCategory      string   // e.g., \"development\", \"analysis\", \"communication\"\n\tRequiredTools []string // tools needed for this skill\n\tCreatedAt     time.Time\n}\n```\nSkill represents a composable skill that can be assigned to agents.\n\n```go\ntype SkillManager struct {\n\t// contains filtered or unexported fields\n}\n```\nSkillManager manages skills stored in SQLite, loaded from markdown files.\n\n```go\nfunc NewSkillManager(db *sql.DB, skillDir string) *SkillManager\n```\nNewSkillManager creates a new SkillManager with the given database and skill directory.\n\n```go\nfunc (sm *SkillManager) AssignToAgent(ctx context.Context, agentID, skillID string) error\n```\nAssignToAgent assigns a skill to an agent.\n\n```go\nfunc (sm *SkillManager) BuildSkillPrompt(ctx context.Context, agentID string) (string, error)\n```\nBuildSkillPrompt concatenates all assigned skill contents for an agent into a prompt section.\n\n```go\nfunc (sm *SkillManager) GetAgentSkills(ctx context.Context, agentID string) ([]Skill, error)\n```\nGetAgentSkills returns all skills assigned to an agent.\n\n```go\nfunc (sm *SkillManager) GetSkill(ctx context.Context, id string) (*Skill, error)\n```\nGetSkill retrieves a skill by ID.\n\n```go\nfunc (sm *SkillManager) InitTables() error\n```\nInitTables creates the skills and agent\\_skills tables.\n\n```go\nfunc (sm *SkillManager) ListSkills(ctx context.Context) ([]Skill, error)\n```\nListSkills returns all skills.\n\n```go\nfunc (sm *SkillManager) LoadFromDirectory() error\n```\nLoadFromDirectory reads .md files from skillDir and upserts them into the DB.\n\n```go\nfunc (sm *SkillManager) RemoveFromAgent(ctx context.Context, agentID, skillID string) error\n```\nRemoveFromAgent removes a skill assignment from an agent.\n\n```go\ntype SkillService interface {\n\tGetSkill(ctx context.Context, id string) (*Skill, error)\n\tListSkills(ctx context.Context) ([]Skill, error)\n\tBuildSkillPrompt(ctx context.Context, agentID string) (string, error)\n\tGetAgentSkills(ctx context.Context, agentID string) ([]Skill, error)\n}\n```\nSkillService is the orchestrator-scoped skill manager.\n\nConsumer: step\\_agent\\_execute (TRULY-OPTIONAL — BuildSkillPrompt augments the system prompt; agent runs normally without skills).\n\n```go\ntype SubAgentManager struct {\n\t// contains filtered or unexported fields\n}\n```\nSubAgentManager manages ephemeral sub-agents spawned by parent agents. It implements the tools.SubAgentSpawner interface.\n\n```go\nfunc NewSubAgentManager(db *sql.DB, maxPerParent, maxDepth int) *SubAgentManager\n```\nNewSubAgentManager creates a new SubAgentManager. maxPerParent is the maximum number of concurrent sub-agents per parent (default 5 when \\\u003c= 0). maxDepth is the maximum spawn depth — ephemeral agents at this depth cannot spawn further (default 1 when \\\u003c= 0).\n\n```go\nfunc (sm *SubAgentManager) CancelChildren(ctx context.Context, parentAgentID string) error\n```\nCancelChildren cancels all active sub-agent tasks for the given parent agent.\n\n```go\nfunc (sm *SubAgentManager) CheckTask(ctx context.Context, taskID string) (status string, result string, err error)\n```\nCheckTask returns the current status and result of a task.\n\n```go\nfunc (sm *SubAgentManager) CountActive(ctx context.Context, parentAgentID string) (int, error)\n```\nCountActive returns the number of active (non-completed, non-failed) sub-agents for the given parent.\n\n```go\nfunc (sm *SubAgentManager) Spawn(ctx context.Context, parentAgentID string, name string, taskDesc string, systemPrompt string) (taskID string, err error)\n```\nSpawn creates an ephemeral sub-agent and assigns it a task. Returns the task ID for tracking.\n\n```go\nfunc (sm *SubAgentManager) WaitTasks(ctx context.Context, taskIDs []string, timeout time.Duration) (map[string]tools.SubTaskResult, error)\n```\nWaitTasks polls all given task IDs until they complete or timeout expires. Returns a map of taskID -\u003e tools.SubTaskResult.\n\n```go\ntype SubAgentService interface {\n\tCountActive(ctx context.Context, parentAgentID string) (int, error)\n\tSpawn(ctx context.Context, parentAgentID, name, taskDesc, systemPrompt string) (string, error)\n\tCheckTask(ctx context.Context, taskID string) (status, result string, err error)\n\tWaitTasks(ctx context.Context, taskIDs []string, timeout time.Duration) (map[string]tools.SubTaskResult, error)\n\tCancelChildren(ctx context.Context, parentAgentID string) error\n}\n```\nSubAgentService is the orchestrator-scoped sub-agent manager.\n\nConsumer: step\\_agent\\_execute (TRULY-OPTIONAL — CancelChildren during cleanup; the manager is also used by the agent\\_spawn tool, but that resolves it directly, not via this step-level interface).\n\n```go\ntype TestInteractStep struct {\n\t// contains filtered or unexported fields\n}\n```\nTestInteractStep is a pipeline step that bridges HTTP requests to an HTTPSource. It supports three operations: list\\_pending, get\\_interaction, and respond.\n\n```go\nfunc (s *TestInteractStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *TestInteractStep) Name() string\n```\n\n```go\ntype TestProvider struct {\n\t// contains filtered or unexported fields\n}\n```\nTestProvider implements provider.Provider by delegating to a ResponseSource. It enables interactive and scripted E2E testing of the agent execution pipeline.\n\n```go\nfunc NewTestProvider(source ResponseSource, opts ...TestProviderOption) *TestProvider\n```\nNewTestProvider creates a TestProvider backed by the given ResponseSource.\n\n```go\nfunc (tp *TestProvider) AuthModeInfo() provider.AuthModeInfo\n```\nAuthModeInfo implements provider.Provider.\n\n```go\nfunc (tp *TestProvider) Chat(ctx context.Context, messages []provider.Message, tools []provider.ToolDef) (*provider.Response, error)\n```\nChat implements provider.Provider.\n\n```go\nfunc (tp *TestProvider) InteractionCount() int64\n```\nInteractionCount returns how many interactions have been processed.\n\n```go\nfunc (tp *TestProvider) Name() string\n```\nName implements provider.Provider.\n\n```go\nfunc (tp *TestProvider) Source() ResponseSource\n```\nSource returns the underlying ResponseSource.\n\n```go\nfunc (tp *TestProvider) Stream(ctx context.Context, messages []provider.Message, tools []provider.ToolDef) (\u003c-chan provider.StreamEvent, error)\n```\nStream implements provider.Provider by wrapping Chat() into stream events.\n\n```go\ntype TestProviderOption func(*TestProvider)\n```\nTestProviderOption configures a TestProvider.\n\n```go\nfunc WithName(s string) TestProviderOption\n```\nWithName sets the provider name returned by Name().\n\n```go\nfunc WithTimeout(d time.Duration) TestProviderOption\n```\nWithTimeout sets the maximum time to wait for a response from the source.\n\n```go\ntype ToolPolicy struct {\n\tID          string\n\tScope       PolicyScope\n\tScopeID     string // empty for global, team_id for team, agent_id for agent\n\tToolPattern string // tool name or \"group:fs\", \"group:runtime\", etc.\n\tAction      PolicyAction\n\tCreatedAt   time.Time\n}\n```\nToolPolicy represents a policy controlling tool access.\n\n```go\ntype ToolPolicyEngine struct {\n\tDefaultPolicy PolicyAction // \"allow\" or \"deny\"; defaults to \"deny\" (fail-closed)\n\t// contains filtered or unexported fields\n}\n```\nToolPolicyEngine evaluates tool access policies stored in SQLite.\n\n```go\nfunc NewToolPolicyEngine(db *sql.DB) *ToolPolicyEngine\n```\nNewToolPolicyEngine creates a new ToolPolicyEngine backed by the given DB. The default policy is \"deny\" (fail-closed) when no matching policies exist.\n\n```go\nfunc (tpe *ToolPolicyEngine) AddPolicy(ctx context.Context, policy ToolPolicy) error\n```\nAddPolicy inserts a new policy into the database.\n\n```go\nfunc (tpe *ToolPolicyEngine) InitTable() error\n```\nInitTable creates the tool\\_policies table if it does not already exist.\n\n```go\nfunc (tpe *ToolPolicyEngine) IsAllowed(ctx context.Context, toolName string, agentID string, teamID string) (bool, string)\n```\nIsAllowed checks whether the given tool is permitted for the given agent and team.\n\nResolution order (most specific wins for allow; deny-wins across all matching):\n\n 1. Expand group patterns to concrete tool names.\n 2. Collect all policies that match the tool name (global, team, agent).\n 3. If ANY matching policy denies → return false.\n 4. If no explicit policy exists → apply DefaultPolicy (\"deny\" by default, fail-closed).\n\n```go\nfunc (tpe *ToolPolicyEngine) ListPolicies(ctx context.Context) ([]ToolPolicy, error)\n```\nListPolicies returns all policies ordered by scope specificity.\n\n```go\nfunc (tpe *ToolPolicyEngine) RemovePolicy(ctx context.Context, id string) error\n```\nRemovePolicy deletes a policy by ID.\n\n```go\ntype ToolRegistry struct {\n\t// contains filtered or unexported fields\n}\n```\nToolRegistry merges built-in tools and MCP tools into a unified registry.\n\n```go\nfunc NewToolRegistry() *ToolRegistry\n```\n\n```go\nfunc (tr *ToolRegistry) AllDefs() []provider.ToolDef\n```\nAllDefs returns tool definitions for all registered tools. Tool names use the registry key (e.g. \"mcp\\_wfctl\\_\\_validate\\_config\") so the LLM calls tools by the same name that Execute() looks up.\n\n```go\nfunc (tr *ToolRegistry) Execute(ctx context.Context, name string, args map[string]any) (any, error)\n```\nExecute runs a tool by name with the given arguments. If a policy engine is set, access control is checked before execution.\n\n```go\nfunc (tr *ToolRegistry) Get(name string) (plugin.Tool, bool)\n```\nGet returns a tool by name.\n\n```go\nfunc (tr *ToolRegistry) Names() []string\n```\nNames returns all registered tool names.\n\n```go\nfunc (tr *ToolRegistry) Register(tool plugin.Tool)\n```\nRegister adds a tool to the registry.\n\n```go\nfunc (tr *ToolRegistry) RegisterMCP(serverName string, tools []plugin.Tool)\n```\nRegisterMCP registers MCP tools with a server-prefixed name.\n\n```go\nfunc (tr *ToolRegistry) SetPaginator(rp *ResponsePaginator)\n```\nSetPaginator attaches a ResponsePaginator that will be applied to large string tool results before they are returned to the agent loop.\n\n```go\nfunc (tr *ToolRegistry) SetPolicyEngine(engine *ToolPolicyEngine)\n```\nSetPolicyEngine attaches a ToolPolicyEngine for access control enforcement.\n\n```go\nfunc (tr *ToolRegistry) UnregisterMCP(serverName string)\n```\nUnregisterMCP removes all tools registered under the given MCP server name.\n\n```go\ntype ToolRegistryService interface {\n\tGet(name string) (any, bool)\n\tAllDefs() []provider.ToolDef\n\tExecute(ctx context.Context, name string, args map[string]any) (any, error)\n\tNames() []string\n\t// SetPaginator attaches a ResponsePaginator that truncates large tool outputs.\n\t// Added in P2-T3: step_agent_execute calls this when the registry is present.\n\tSetPaginator(rp *ResponsePaginator)\n}\n```\nToolRegistryService is the orchestrator-scoped tool registry.\n\nConsumer: step\\_agent\\_execute (TRULY-OPTIONAL — agent loop gracefully degrades when no tools are registered; Get/AllDefs/Execute are only called when the registry is present and non-empty).\n\n```go\ntype TranscriptEntry struct {\n\tID         string              `json:\"id\"`\n\tAgentID    string              `json:\"agent_id\"`\n\tTaskID     string              `json:\"task_id\"`\n\tProjectID  string              `json:\"project_id\"`\n\tIteration  int                 `json:\"iteration\"`\n\tRole       provider.Role       `json:\"role\"`\n\tContent    string              `json:\"content\"`\n\tToolCalls  []provider.ToolCall `json:\"tool_calls\"`\n\tToolCallID string              `json:\"tool_call_id\"`\n\tRedacted   bool                `json:\"redacted\"`\n\tCreatedAt  string              `json:\"created_at\"`\n}\n```\nTranscriptEntry represents one entry in the transcript log.\n\n```go\ntype TranscriptRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nTranscriptRecorder records agent interactions to the database.\n\n```go\nfunc NewTranscriptRecorder(db *sql.DB, svc *secretService) *TranscriptRecorder\n```\n\n```go\nfunc (tr *TranscriptRecorder) GetByAgent(ctx context.Context, agentID string) ([]TranscriptEntry, error)\n```\nGetByAgent returns all transcript entries for a given agent.\n\n```go\nfunc (tr *TranscriptRecorder) GetByTask(ctx context.Context, taskID string) ([]TranscriptEntry, error)\n```\nGetByTask returns all transcript entries for a given task.\n\n```go\nfunc (tr *TranscriptRecorder) Record(ctx context.Context, entry TranscriptEntry) error\n```\nRecord saves a transcript entry to the database.\n\n```go\ntype TranscriptService interface {\n\tRecord(ctx context.Context, entry TranscriptEntry) error\n}\n```\nTranscriptService is the orchestrator-scoped transcript recorder.\n\nConsumer: step\\_agent\\_execute (TRULY-OPTIONAL — Record is guarded by nil checks throughout the agent loop).\n\nNote: the executor package defines a TranscriptRecorder \\*interface\\* (with its own TranscriptEntry type). The orchestrator's concrete TranscriptRecorder is a \\*struct\\* whose Record method takes the orchestrator's TranscriptEntry. This interface uses the orchestrator-scoped type so the concrete struct satisfies it directly.\n\n```go\ntype UnionAdapter struct {\n\t// contains filtered or unexported fields\n}\n```\nUnionAdapter exposes the agent plugin's 4 steps + the orchestrator's 3 stateless steps = 7 under the AGENT plugin name, via the sdk gRPC interfaces. It delegates Manifest/Module/Typed\\* to the embedded \\*agent.AgentPlugin and dispatches CreateStep across both factory maps.\n\nIt implements sdk.PluginProvider, sdk.StepProvider, sdk.ModuleProvider, sdk.TypedStepProvider, sdk.TypedModuleProvider (compile-time-asserted in grpc\\_adapter\\_test.go).\n\n```go\nfunc NewUnionAdapter() *UnionAdapter\n```\nNewUnionAdapter builds a UnionAdapter over a fresh agent plugin and the 3 orchestrator stateless step factories. The factories are obtained from the package-level constructors (the same ones RatchetPlugin.StepFactories() calls) rather than constructing a full RatchetPlugin, because the adapter serves ONLY these 3 types and must not pull in the orchestrator's stateful wiring.\n\n```go\nfunc (u *UnionAdapter) CreateModule(typeName, name string, config map[string]any) (sdk.ModuleInstance, error)\n```\nCreateModule implements sdk.ModuleProvider — delegates to the agent plugin.\n\n```go\nfunc (u *UnionAdapter) CreateStep(typeName, name string, config map[string]any) (sdk.StepInstance, error)\n```\nCreateStep implements sdk.StepProvider. Agent-owned types delegate to AgentPlugin.CreateStep (preserving its typed/legacy split + error shape). Orchestrator-owned stateless types call the local factory with app=nil (the PR1-proven-safe bridge contract) and wrap the result in the shared agent.NewLegacyStepInstance. Unknown types — including orchestrator-only STATEFUL types like step.self\\_improve\\_deploy — return an error.\n\n```go\nfunc (u *UnionAdapter) CreateTypedModule(typeName, name string, config *anypb.Any) (sdk.ModuleInstance, error)\n```\nCreateTypedModule implements sdk.TypedModuleProvider — delegates to the agent plugin's typed module factory (agent.provider).\n\n```go\nfunc (u *UnionAdapter) CreateTypedStep(typeName, name string, config *anypb.Any) (sdk.StepInstance, error)\n```\nCreateTypedStep implements sdk.TypedStepProvider — delegates to the agent plugin's typed factories (provider\\_models, model\\_pull).\n\n```go\nfunc (u *UnionAdapter) Manifest() sdk.PluginManifest\n```\nManifest implements sdk.PluginProvider. Delegates to the agent plugin so the union is served under the AGENT name+version (the ADR 0053 fold-in), not ratchet.\n\n```go\nfunc (u *UnionAdapter) ModuleTypes() []string\n```\nModuleTypes implements sdk.ModuleProvider — delegates to the agent plugin (agent.provider). The orchestrator contributes no modules to the union.\n\n```go\nfunc (u *UnionAdapter) StepTypes() []string\n```\nStepTypes implements sdk.StepProvider: the 7-type union (agent's 4 + the 3 orchestrator stateless). Deduped defensively in case agent ever absorbs a stateless type; ordering is agent-types-first then stateless (stable).\n\n```go\nfunc (u *UnionAdapter) TypedModuleTypes() []string\n```\nTypedModuleTypes implements sdk.TypedModuleProvider — delegates to the agent plugin (agent.provider).\n\n```go\nfunc (u *UnionAdapter) TypedStepTypes() []string\n```\nTypedStepTypes implements sdk.TypedStepProvider — the agent's typed set only. The 3 orchestrator stateless steps are legacy-served (CreateStep), NOT typed: they carry no proto contracts in this adapter.\n\n```go\ntype VaultCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nVaultCheck flags when vault-dev is used in a production environment.\n\n```go\nfunc (c *VaultCheck) Name() string\n```\n\n```go\nfunc (c *VaultCheck) Run(_ context.Context) []AuditFinding\n```\n\n```go\ntype VaultConfigFile struct {\n\tBackend   string `json:\"backend\"`              // \"vault-dev\" or \"vault-remote\"\n\tAddress   string `json:\"address,omitempty\"`    // remote vault address\n\tToken     string `json:\"token,omitempty\"`      // encrypted remote vault token\n\tMountPath string `json:\"mount_path,omitempty\"` // KV v2 mount path\n\tNamespace string `json:\"namespace,omitempty\"`  // vault namespace\n}\n```\nVaultConfigFile stores persistent vault backend configuration. Saved as JSON to data/vault-config.json so it's available before DB init. The token field is encrypted at rest using AES-256-GCM.\n\n```go\nfunc LoadVaultConfig(dir string) (*VaultConfigFile, error)\n```\nLoadVaultConfig reads vault config from dir/vault-config.json. Returns nil (not error) if the file doesn't exist. Tokens are decrypted transparently.\n\n```go\ntype Webhook struct {\n\tID           string\n\tSource       string // \"github\", \"slack\", \"generic\"\n\tName         string\n\tSecretName   string // name of secret in vault for HMAC verification\n\tFilter       string // event filter e.g. \"issues.opened\", \"push\"\n\tTaskTemplate string // Go template for task title/description\n\tEnabled      bool\n\tCreatedAt    time.Time\n}\n```\nWebhook represents a configured inbound webhook endpoint.\n\n```go\ntype WebhookManager struct {\n\t// contains filtered or unexported fields\n}\n```\nWebhookManager manages webhook configurations and processing logic.\n\n```go\nfunc NewWebhookManager(db *sql.DB) *WebhookManager\n```\nNewWebhookManager creates a new WebhookManager.\n\n```go\nfunc (wm *WebhookManager) Create(ctx context.Context, wh Webhook) error\n```\nCreate inserts a new webhook into the database.\n\n```go\nfunc (wm *WebhookManager) Delete(ctx context.Context, id string) error\n```\nDelete removes a webhook by ID.\n\n```go\nfunc (wm *WebhookManager) ExtractEventType(source string, headers map[string]string, payload map[string]any) string\n```\nExtractEventType extracts the event type from request headers or payload.\n\n```go\nfunc (wm *WebhookManager) GetBySource(ctx context.Context, source string) ([]Webhook, error)\n```\nGetBySource returns all enabled webhooks matching a source identifier.\n\n```go\nfunc (wm *WebhookManager) List(ctx context.Context) ([]Webhook, error)\n```\nList returns all webhooks.\n\n```go\nfunc (wm *WebhookManager) MatchesFilter(source string, eventType string, filter string) bool\n```\nMatchesFilter returns true if the event type matches the webhook filter. An empty filter matches everything. Filter format: \"event.action\" (e.g. \"issues.opened\", \"push\") or just \"event\" (e.g. \"push\").\n\n```go\nfunc (wm *WebhookManager) RenderTaskTemplate(tmpl string, payload map[string]any) (title string, description string, err error)\n```\nRenderTaskTemplate renders the Go template with the webhook payload as data. The template can use {{.title}} and {{.description}} fields or any payload fields. Returns title, description, and any rendering error.\n\nExample template:\n\n\ttitle: \"GitHub issue: {{.payload.title}}\"\n\tdescription: \"Opened by {{.payload.user.login}}\"\n\n```go\nfunc (wm *WebhookManager) VerifySignature(source string, secret string, payload []byte, signature string, timestamp string) bool\n```\nVerifySignature verifies the HMAC signature of a webhook payload. Returns true if the signature matches or if no secret is configured (SecretName is empty).\n\nSignature schemes:\n\n  - github:  X-Hub-Signature-256: sha256=\\\u003chex\u003e\n  - slack:   X-Slack-Signature:   v0=\\\u003chex\u003e  (message: \"v0:\\\u003ctimestamp\u003e:\\\u003cbody\u003e\")\n  - generic: X-Webhook-Signature: sha256=\\\u003chex\u003e\n\nFor Slack, timestamp is the value of the X-Slack-Request-Timestamp header and is required to construct the correct base string and enforce replay protection.\n\n```go\ntype WebhookProcessStep struct {\n\t// contains filtered or unexported fields\n}\n```\nWebhookProcessStep processes an inbound webhook request. It:\n\n 1. Extracts the webhook source from the URL path parameter (:source / {source})\n 2. Reads the raw request body\n 3. Looks up matching webhook configs from the DB\n 4. Verifies HMAC signature if a secret is configured\n 5. Applies event type filters\n 6. Creates a task using the webhook's task template\n 7. Returns the created task ID\n\n```go\nfunc (s *WebhookProcessStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\nExecute processes the inbound webhook and auto-creates a task.\n\n```go\nfunc (s *WebhookProcessStep) Name() string\n```\n\n```go\ntype WebhookSecurityCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nWebhookSecurityCheck looks for webhook configurations lacking HMAC verification.\n\n```go\nfunc (c *WebhookSecurityCheck) Name() string\n```\n\n```go\nfunc (c *WebhookSecurityCheck) Run(ctx context.Context) []AuditFinding\n```\n\n```go\ntype WebhookService interface {\n\tGetBySource(ctx context.Context, source string) ([]Webhook, error)\n\tExtractEventType(source string, headers map[string]string, payload map[string]any) string\n\tVerifySignature(source, secret string, payload []byte, signature, timestamp string) bool\n\tMatchesFilter(source, eventType, filter string) bool\n\tRenderTaskTemplate(tmpl string, payload map[string]any) (title, description string, err error)\n}\n```\nWebhookService is the orchestrator-scoped webhook manager.\n\nConsumer: step\\_webhook (WebhookProcessStep — REQUIRED-STATEFUL: errors if absent).\n\n```go\ntype WorkspaceInitStep struct {\n\t// contains filtered or unexported fields\n}\n```\nWorkspaceInitStep creates a project workspace directory.\n\n```go\nfunc (s *WorkspaceInitStep) Execute(ctx context.Context, pc *module.PipelineContext) (*module.StepResult, error)\n```\n\n```go\nfunc (s *WorkspaceInitStep) Name() string\n```\n\n```go\ntype WorkspaceSpec struct {\n\tImage        string            `json:\"image\"`\n\tInitCommands []string          `json:\"init_commands,omitempty\"`\n\tEnv          map[string]string `json:\"env,omitempty\"`\n\tMemoryLimit  int64             `json:\"memory_limit,omitempty\"`\n\tCPULimit     float64           `json:\"cpu_limit,omitempty\"`\n\tNetworkMode  string            `json:\"network_mode,omitempty\"`\n\tMounts       []MountSpec       `json:\"mounts,omitempty\"`\n}\n```\nWorkspaceSpec describes the container configuration for a project workspace.\n\n","path":"github.com/GoCodeAlone/workflow-plugin-agent/orchestrator","name":"orchestrator","synopsis":"Package ratchetplugin is a workflow EnginePlugin that provides ratchet-specific module types, pipeline steps, and wiring hooks.","isRedistributable":true}
