Files
archie/.okf/codebase/internal/workflow/agent.md
T
sam 7c34bdae5a okf: scaffold knowledge bundle and MCP server config
Adds a harvested .okf/ knowledge bundle (codebase concepts + starter
architecture/services/rules scaffolding) and .mcp.json pointing at the
shared okf MCP service (http://localhost:8765/archie-core/), which
serves multiple projects' bundles from a single process.
2026-07-22 04:36:50 +10:00

51 lines
1.3 KiB
Markdown

---
description: Source module internal/workflow/agent.go (221 lines).
resource: internal/workflow/agent.go
tags:
- go
- source
timestamp: "2026-07-21T18:36:22Z"
title: agent.go
type: Module
---
# Module agent.go
**Path**: `internal/workflow/agent.go`
**Lines**: 221
## Snippet Preview
```
package workflow
import (
"context"
"fmt"
"github.com/samcharles93/archie-core/internal/agentexec"
"github.com/samcharles93/archie-core/internal/config"
"github.com/samcharles93/archie-core/internal/skill"
)
// AgentStage is the reusable bridge from a workflow stage to an
// agentloop run. Every LLM-driven stage in any workflow (implement's
// planner/builder, tdd's test-writer/fixer, feasibility's analyst)
// is an AgentStage with a different mission, gate, and result handler —
// never a new engine.
type AgentStage struct {
Name string
// Role selects the model via cfg.Models[Role]; falls back to
// cfg.Models["builder"].
Role string
ReadOnly bool
// Mission produces the task statement from the current context.
Mission func(*TaskContext) string
// Gate returns the stage's quality gate; nil means ungated (e.g.
// read-only analysis stages).
Gate func(*TaskContext) agentexec.Gate
// ExtraRules is appended to the system prompt.
ExtraRules string
// MaxSteps overrides the configured step budget when > 0 (planner
```