Drop Felix references; harness stands as a platform on its own
Removes every Felix mention from public-facing surfaces so the framework reads as a standalone agent platform rather than an extracted module. User-visible changes: - HTTP User-Agent on web_fetch / web_search: Felix/1.0 → harness/1.0 - bash tool path-substitution prefix: '[felix]' → '[harness]' - On-disk paths: <workspace>/.felix/ → <workspace>/.harness/ (todos.json + spill/ tree); tests updated in lockstep. - OTel trace attributes: felix.trace_id / felix.total_ms / felix.phase_count → harness.* equivalents. Doc-comment changes: - Examples (lta-agent, data-agent) lose 'non-Felix consumer' framing. - README drops the 'extracted from Felix' lede and the 'What was lifted from Felix' section, replaced with a 'Design' overview that points to developer.md. - Runtime / tool / compaction doc comments rewritten so behaviour notes describe what the harness does without naming the prior origin. - Test-fixture text 'you are felix' → 'you are an assistant'. Verified: zero 'felix' (case-insensitive) in tracked .go / .md files. All 16 packages build and pass tests.
This commit is contained in:
1 parent
8ed38d7b66
commit
123a233cb7
22 files changed
+107
-85
No files matched your search
@@ -44,9 +44,10 @@ func TestBuildStaticSystemPromptIdentity(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// Consumers wanting "configuration file is at ..." in the static prompt
|
||||
// pass it through deps.ConfigSummary; the harness no longer hard-codes
|
||||
// Felix's config path. Verify the agent identity + IDENTITY.md content
|
||||
// land verbatim, plus that a caller-supplied config summary is honoured.
|
||||
// pass it through deps.ConfigSummary; the harness does not hard-code
|
||||
// any config path of its own. Verify the agent identity + IDENTITY.md
|
||||
// content land verbatim, plus that a caller-supplied config summary
|
||||
// is honoured.
|
||||
result := BuildStaticSystemPrompt(dir, "", "test", "Test Agent",
|
||||
[]string{"read_file", "bash"}, "configuration file is at /tmp/x.json", "", "", "")
|
||||
assert.Contains(t, result, identityContent)
|
||||
@@ -308,7 +309,7 @@ func TestPruneToolResultsSpillsToDisk(t *testing.T) {
|
||||
// Spill file lives where the marker text says it does, holds the
|
||||
// full original content, and the path embedded in the message is
|
||||
// absolute (so read_file's path handling works regardless of CWD).
|
||||
wantPath := filepath.Join(workspace, ".felix", "spill", "sess_abc", "tc_42.txt")
|
||||
wantPath := filepath.Join(workspace, ".harness", "spill", "sess_abc", "tc_42.txt")
|
||||
assert.Contains(t, got, wantPath)
|
||||
assert.True(t, filepath.IsAbs(wantPath))
|
||||
data, err := os.ReadFile(wantPath)
|
||||
|
||||
+6
-4
@@ -25,8 +25,9 @@ type RuntimeDeps struct {
|
||||
// KGFn returns the per-agent KnowledgeGraph for the given model
|
||||
// string. Nil at the call site means KG is disabled for this Runtime.
|
||||
// The function shape (rather than a single KG) lets consumers route
|
||||
// the chatting agent's own model to the KG's underlying LLM (Felix
|
||||
// uses this to mirror the chat model into Cortex's extractor).
|
||||
// the chatting agent's own model to the KG's underlying LLM — useful
|
||||
// when the KG runs an extractor on the same provider/model as the
|
||||
// agent itself.
|
||||
KGFn func(model string) KnowledgeGraph
|
||||
// AgentLoop carries the loop tunables (concurrency cap, depth cap,
|
||||
// streaming-tools toggle). Copied verbatim into every Runtime built
|
||||
@@ -42,8 +43,9 @@ type RuntimeDeps struct {
|
||||
// changes only on hot-reload.
|
||||
ConfigSummary string
|
||||
// MemoryFiles, when non-empty, is appended to the static system
|
||||
// prompt. Consumers compose this themselves (Felix walks
|
||||
// FELIX.md / AGENTS.md from workspace + $HOME).
|
||||
// prompt. Consumers compose this themselves — typical pattern is to
|
||||
// concatenate AGENTS.md (and any project-specific identity files)
|
||||
// from the workspace and the user's $HOME.
|
||||
MemoryFiles string
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ func TestBuildRuntimeMinimalSpecSafe(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestBuildRuntimeUsesCallerProvidedMemoryFiles(t *testing.T) {
|
||||
// Caller composes memoryFiles however they want (Felix walks
|
||||
// FELIX.md/AGENTS.md from workspace + $HOME; other consumers may
|
||||
// build it from a wiki dump, a doc index, etc.). Harness only
|
||||
// concatenates it into the static prompt.
|
||||
// Caller composes memoryFiles however they want — typical patterns
|
||||
// include walking AGENTS.md from workspace + $HOME, building from a
|
||||
// wiki dump, or pulling from a doc index. Harness only concatenates
|
||||
// it into the static prompt.
|
||||
const sentinel = "MEMFILE_END_TO_END_SENTINEL"
|
||||
deps := RuntimeDeps{
|
||||
MemoryFiles: "\n\n## Project memory: AGENTS.md\n\n" + sentinel,
|
||||
|
||||
+9
-7
@@ -86,12 +86,14 @@ func buildDefaultIdentity(toolNames []string) string {
|
||||
// per-turn. Suitable to call once at Runtime construction.
|
||||
//
|
||||
// configSummary is the consumer's place to advertise things like the
|
||||
// configured agents, channel bindings, configuration paths, or any other
|
||||
// hot-reload-bound context. Felix uses it to inject a list of configured
|
||||
// agents and the path to felix.json5; other consumers can leave it empty.
|
||||
// configured agents, channel bindings, configuration paths, or any
|
||||
// other hot-reload-bound context. Leave empty if you have nothing to
|
||||
// surface.
|
||||
//
|
||||
// memoryFiles is the consumer's place to inject project / user memory
|
||||
// files (e.g., Felix walks FELIX.md and AGENTS.md from workspace + $HOME).
|
||||
// files. A common pattern is to concatenate AGENTS.md from the
|
||||
// workspace and the user's $HOME, but the harness only treats this as
|
||||
// opaque text to append.
|
||||
func BuildStaticSystemPrompt(
|
||||
workspace, systemPrompt, agentID, agentName string,
|
||||
toolNames []string,
|
||||
@@ -404,7 +406,7 @@ const (
|
||||
// without a workspace working unchanged.
|
||||
//
|
||||
// When Workspace is set, oversized tool results are written to
|
||||
// <Workspace>/.felix/spill/<SessionKey>/<ToolCallID>.txt and the message
|
||||
// <Workspace>/.harness/spill/<SessionKey>/<ToolCallID>.txt and the message
|
||||
// is rewritten as: head preview (first maxLen chars cut at newline) +
|
||||
// spillMarker pointing the model at the absolute path so it can recover
|
||||
// the full output via read_file (which gates on Workspace).
|
||||
@@ -421,7 +423,7 @@ func spillToolResult(cfg spillConfig, toolCallID, content string) (string, error
|
||||
if cfg.Workspace == "" || cfg.SessionKey == "" || toolCallID == "" {
|
||||
return "", fmt.Errorf("spillToolResult: workspace, session key, and tool call id are required")
|
||||
}
|
||||
dir := filepath.Join(cfg.Workspace, ".felix", "spill", cfg.SessionKey)
|
||||
dir := filepath.Join(cfg.Workspace, ".harness", "spill", cfg.SessionKey)
|
||||
if err := os.MkdirAll(dir, 0o755); err != nil {
|
||||
return "", fmt.Errorf("spill mkdir: %w", err)
|
||||
}
|
||||
@@ -440,7 +442,7 @@ func spillToolResult(cfg spillConfig, toolCallID, content string) (string, error
|
||||
//
|
||||
// Two modes:
|
||||
// - With cfg.Workspace + cfg.SessionKey set: the FULL original content
|
||||
// is written to <Workspace>/.felix/spill/<SessionKey>/<ToolCallID>.txt
|
||||
// is written to <Workspace>/.harness/spill/<SessionKey>/<ToolCallID>.txt
|
||||
// and the message becomes "<head>\n\n[spilled — N of M chars saved
|
||||
// to <abs path>; use read_file to access the full output]". The
|
||||
// model can recover the entire output via read_file, eliminating the
|
||||
|
||||
+4
-4
@@ -14,12 +14,12 @@ import (
|
||||
//
|
||||
// Mirrors the path layout used by spillToolResult in context.go:
|
||||
//
|
||||
// <workspace>/.felix/spill/<sessionKey>/
|
||||
// <workspace>/.harness/spill/<sessionKey>/
|
||||
func SpillDirForSession(workspace, sessionKey string) string {
|
||||
if workspace == "" || sessionKey == "" {
|
||||
return ""
|
||||
}
|
||||
return filepath.Join(workspace, ".felix", "spill", sessionKey)
|
||||
return filepath.Join(workspace, ".harness", "spill", sessionKey)
|
||||
}
|
||||
|
||||
// RemoveSessionSpill removes the per-session spill directory if it exists.
|
||||
@@ -42,7 +42,7 @@ func SpillRoot(workspace string) string {
|
||||
if workspace == "" {
|
||||
return ""
|
||||
}
|
||||
return filepath.Join(workspace, ".felix", "spill")
|
||||
return filepath.Join(workspace, ".harness", "spill")
|
||||
}
|
||||
|
||||
// LiveSessionKeysFn returns the set of currently-existing session keys for
|
||||
@@ -51,7 +51,7 @@ func SpillRoot(workspace string) string {
|
||||
// session JSONL on disk).
|
||||
type LiveSessionKeysFn func() (map[string]bool, error)
|
||||
|
||||
// CleanupOrphanedSpills walks <workspace>/.felix/spill/ and removes any
|
||||
// CleanupOrphanedSpills walks <workspace>/.harness/spill/ and removes any
|
||||
// per-session subdirectory whose key is not in the set returned by liveKeys.
|
||||
// Returns the number of directories removed and the first error encountered
|
||||
// (if any). Missing root is not an error — it just means nothing to clean.
|
||||
|
||||
+2
-2
@@ -36,8 +36,8 @@ type SubagentBuildFn func(spec AgentSpec) (RuntimeInputs, error)
|
||||
type SubagentSpec struct {
|
||||
Spec AgentSpec
|
||||
// Registered reports whether the consumer considers this subagent ID
|
||||
// valid for parent-driven invocation. Mirrors Felix's
|
||||
// AgentConfig.Subagent flag.
|
||||
// valid for parent-driven invocation. False prevents a parent agent
|
||||
// from spawning this child via the task tool.
|
||||
Registered bool
|
||||
// InheritContext, when true, copies the parent session's view into
|
||||
// the child session before BuildRuntime fires.
|
||||
|
||||
@@ -229,9 +229,9 @@ loop:
|
||||
}
|
||||
|
||||
// TestRun_SubagentDepthCapEnforced verifies the cap stops construction past
|
||||
// the configured limit. With FELIX_MAX_AGENT_DEPTH=2, a parent at depth 0
|
||||
// can call a subagent (depth 1), and that subagent can call another (depth 2),
|
||||
// but a third-level attempt (depth 3) must fail with the cap error and the
|
||||
// the configured limit. With MaxAgentDepth=2, a parent at depth 0 can call
|
||||
// a subagent (depth 1), and that subagent can call another (depth 2), but
|
||||
// a third-level attempt (depth 3) must fail with the cap error and the
|
||||
// would-be subagent's RuntimeInputs builder must NOT be invoked.
|
||||
//
|
||||
// Note: this test reimplements the factory wiring rather than calling
|
||||
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
"github.com/sausheong/harness/llm"
|
||||
)
|
||||
|
||||
// testCfg is the harness test analogue of Felix's *config.Config — bundles
|
||||
// a SubagentResolver with the small accessor helpers (EligibleSubagents,
|
||||
// GetAgent) that subagent tests reach for. Lets the subagent_test.go and
|
||||
// inheritance_test.go call sites keep their `cfg.X()` shape after the
|
||||
// extraction without rewriting every test.
|
||||
// testCfg is a tiny stand-in for whatever live-config object a real
|
||||
// consumer would hold. It bundles a SubagentResolver with the small
|
||||
// accessor helpers (EligibleSubagents, GetAgent) that subagent tests
|
||||
// reach for, so subagent_test.go and inheritance_test.go can keep
|
||||
// their `cfg.X()` call shape.
|
||||
type testCfg struct {
|
||||
specs map[string]AgentSpec
|
||||
subagent map[string]bool // id → registered as subagent
|
||||
@@ -41,7 +41,8 @@ func (c *testCfg) GetAgent(id string) (AgentSpec, bool) {
|
||||
}
|
||||
|
||||
// newTwoAgentCfg builds a fixture with a parent ("default") and one
|
||||
// subagent ("researcher"). Direct port of Felix's twoAgentConfig fixture.
|
||||
// subagent ("researcher") — the minimal shape needed to exercise the
|
||||
// task-tool dispatch path.
|
||||
func newTwoAgentCfg(t *testing.T) *testCfg {
|
||||
t.Helper()
|
||||
parent := AgentSpec{
|
||||
|
||||
+3
-3
@@ -96,7 +96,7 @@ func NewTrace(agentID, model string) *Trace {
|
||||
if otelTracer != nil {
|
||||
_, t.span = otelTracer.Start(context.Background(), "agent.run",
|
||||
trace.WithAttributes(
|
||||
attribute.String("felix.trace_id", id),
|
||||
attribute.String("harness.trace_id", id),
|
||||
attribute.String("agent.id", agentID),
|
||||
attribute.String("llm.model", model),
|
||||
),
|
||||
@@ -219,8 +219,8 @@ func (t *Trace) Summary() {
|
||||
|
||||
if t.span != nil {
|
||||
t.span.SetAttributes(
|
||||
attribute.Int64("felix.total_ms", total),
|
||||
attribute.Int("felix.phase_count", len(t.phases)),
|
||||
attribute.Int64("harness.total_ms", total),
|
||||
attribute.Int("harness.phase_count", len(t.phases)),
|
||||
)
|
||||
t.span.End()
|
||||
}
|
||||
|
||||
+15
-12
@@ -5,10 +5,11 @@ import "context"
|
||||
// AgentSpec is the framework's view of an agent. Consumers convert their
|
||||
// own agent-config types into this struct before invoking BuildRuntime.
|
||||
//
|
||||
// Mirrors the fields Runtime actually consumes; Felix-specific options
|
||||
// (per-agent tool policies, MCP server bindings, channel routing,
|
||||
// inheritContext flag, subagent registration, identity files) live in the
|
||||
// consumer's config and are resolved before this struct is filled in.
|
||||
// Holds only the fields Runtime actually consumes. Anything richer that
|
||||
// a consumer's config carries (per-agent tool policies, MCP server
|
||||
// bindings, channel routing, inheritContext flags, subagent
|
||||
// registration, identity files) is resolved by the consumer before this
|
||||
// struct is filled in.
|
||||
type AgentSpec struct {
|
||||
// ID identifies the agent for logging, session paths, and subagent
|
||||
// resolution. Used as session.Session.AgentID.
|
||||
@@ -43,11 +44,10 @@ type AgentSpec struct {
|
||||
Loop LoopConfig
|
||||
}
|
||||
|
||||
// LoopConfig tunes the agent runtime's tool-execution behavior. Mirrors
|
||||
// Felix's AgentLoopConfig with framework-side env-var fallbacks
|
||||
// (HARNESS_MAX_TOOL_CONCURRENCY, HARNESS_MAX_AGENT_DEPTH,
|
||||
// HARNESS_STREAMING_TOOLS) — Felix consumers may set the FELIX_* env vars
|
||||
// instead by setting these fields explicitly from their own config block.
|
||||
// LoopConfig tunes the agent runtime's tool-execution behavior. Each
|
||||
// field has a built-in env-var fallback (HARNESS_MAX_TOOL_CONCURRENCY,
|
||||
// HARNESS_MAX_AGENT_DEPTH, HARNESS_STREAMING_TOOLS); set the field
|
||||
// explicitly from your own config to bypass the env vars.
|
||||
type LoopConfig struct {
|
||||
// MaxToolConcurrency caps parallel tool dispatch within a safe batch.
|
||||
// 0 ⇒ env fallback then default 10.
|
||||
@@ -91,7 +91,9 @@ type Message struct {
|
||||
}
|
||||
|
||||
// KnowledgeGraph is the optional plug point for a long-term memory /
|
||||
// knowledge-graph backend. Felix wires this to its cortex adapter.
|
||||
// knowledge-graph backend. Wire your own implementation if you need
|
||||
// recall + ingest hooks; leave deps.KGFn nil to disable the entire
|
||||
// pathway.
|
||||
//
|
||||
// - ShouldRecall is called synchronously at the start of every Run
|
||||
// before scheduling the recall goroutine. Cheap; should return
|
||||
@@ -121,6 +123,7 @@ type KnowledgeGraph interface {
|
||||
// child Runtime. Returning ok=false makes TaskTool surface a "subagent
|
||||
// %q not found" error to the parent LLM.
|
||||
//
|
||||
// Implementations typically read from a live config so subagent
|
||||
// definitions hot-reload (Felix reads through *config.Config).
|
||||
// Implementations typically read from a live config object (often via
|
||||
// an atomic.Value) so subagent definitions hot-reload without
|
||||
// restarting the runtime.
|
||||
type SubagentResolver func(agentID string) (spec AgentSpec, registered bool, ok bool)
|
||||
Reference in new issue
Block a user