feat: merge go-agent + go-agentic + php-devops into unified agent repo
Combines three repositories into a single workspace:
- go-agent → pkg/orchestrator (Clotho), pkg/jobrunner, pkg/loop, cmd/
- go-agentic → pkg/lifecycle (allowance, sessions, plans, dispatch)
- php-devops → repos.yaml, setup.sh, scripts/, .core/
Module path: forge.lthn.ai/core/agent
All packages build, all tests pass.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:23:00 +00:00
package loop
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"time"
2026-03-16 21:48:31 +00:00
coreerr "forge.lthn.ai/core/go-log"
feat: merge go-agent + go-agentic + php-devops into unified agent repo
Combines three repositories into a single workspace:
- go-agent → pkg/orchestrator (Clotho), pkg/jobrunner, pkg/loop, cmd/
- go-agentic → pkg/lifecycle (allowance, sessions, plans, dispatch)
- php-devops → repos.yaml, setup.sh, scripts/, .core/
Module path: forge.lthn.ai/core/agent
All packages build, all tests pass.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:23:00 +00:00
)
var eaasClient = & http . Client { Timeout : 30 * time . Second }
// EaaSTools returns the three EaaS tool wrappers: score, imprint, and atlas similar.
func EaaSTools ( baseURL string ) [ ] Tool {
return [ ] Tool {
{
Name : "eaas_score" ,
Description : "Score text for AI-generated content, sycophancy, and compliance markers. Returns verdict, LEK score, heuristic breakdown, and detected flags." ,
Parameters : map [ string ] any {
"type" : "object" ,
"properties" : map [ string ] any {
"text" : map [ string ] any { "type" : "string" , "description" : "Text to analyse" } ,
} ,
"required" : [ ] any { "text" } ,
} ,
Handler : eaasPostHandler ( baseURL , "/v1/score/content" ) ,
} ,
{
Name : "eaas_imprint" ,
Description : "Analyse the linguistic imprint of text. Returns stylistic fingerprint metrics." ,
Parameters : map [ string ] any {
"type" : "object" ,
"properties" : map [ string ] any {
"text" : map [ string ] any { "type" : "string" , "description" : "Text to analyse" } ,
} ,
"required" : [ ] any { "text" } ,
} ,
Handler : eaasPostHandler ( baseURL , "/v1/score/imprint" ) ,
} ,
{
Name : "eaas_similar" ,
Description : "Find similar previously scored content via atlas vector search." ,
Parameters : map [ string ] any {
"type" : "object" ,
"properties" : map [ string ] any {
"id" : map [ string ] any { "type" : "string" , "description" : "Scoring ID to search from" } ,
"limit" : map [ string ] any { "type" : "integer" , "description" : "Max results (default 5)" } ,
} ,
"required" : [ ] any { "id" } ,
} ,
Handler : eaasPostHandler ( baseURL , "/v1/atlas/similar" ) ,
} ,
}
}
func eaasPostHandler ( baseURL , path string ) func ( context . Context , map [ string ] any ) ( string , error ) {
return func ( ctx context . Context , args map [ string ] any ) ( string , error ) {
body , err := json . Marshal ( args )
if err != nil {
2026-03-16 21:48:31 +00:00
return "" , coreerr . E ( "eaas.handler" , "marshal args" , err )
feat: merge go-agent + go-agentic + php-devops into unified agent repo
Combines three repositories into a single workspace:
- go-agent → pkg/orchestrator (Clotho), pkg/jobrunner, pkg/loop, cmd/
- go-agentic → pkg/lifecycle (allowance, sessions, plans, dispatch)
- php-devops → repos.yaml, setup.sh, scripts/, .core/
Module path: forge.lthn.ai/core/agent
All packages build, all tests pass.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:23:00 +00:00
}
req , err := http . NewRequestWithContext ( ctx , "POST" , baseURL + path , bytes . NewReader ( body ) )
if err != nil {
2026-03-16 21:48:31 +00:00
return "" , coreerr . E ( "eaas.handler" , "create request" , err )
feat: merge go-agent + go-agentic + php-devops into unified agent repo
Combines three repositories into a single workspace:
- go-agent → pkg/orchestrator (Clotho), pkg/jobrunner, pkg/loop, cmd/
- go-agentic → pkg/lifecycle (allowance, sessions, plans, dispatch)
- php-devops → repos.yaml, setup.sh, scripts/, .core/
Module path: forge.lthn.ai/core/agent
All packages build, all tests pass.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:23:00 +00:00
}
req . Header . Set ( "Content-Type" , "application/json" )
resp , err := eaasClient . Do ( req )
if err != nil {
2026-03-16 21:48:31 +00:00
return "" , coreerr . E ( "eaas.handler" , "eaas request" , err )
feat: merge go-agent + go-agentic + php-devops into unified agent repo
Combines three repositories into a single workspace:
- go-agent → pkg/orchestrator (Clotho), pkg/jobrunner, pkg/loop, cmd/
- go-agentic → pkg/lifecycle (allowance, sessions, plans, dispatch)
- php-devops → repos.yaml, setup.sh, scripts/, .core/
Module path: forge.lthn.ai/core/agent
All packages build, all tests pass.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:23:00 +00:00
}
defer resp . Body . Close ( )
result , err := io . ReadAll ( resp . Body )
if err != nil {
2026-03-16 21:48:31 +00:00
return "" , coreerr . E ( "eaas.handler" , "read response" , err )
feat: merge go-agent + go-agentic + php-devops into unified agent repo
Combines three repositories into a single workspace:
- go-agent → pkg/orchestrator (Clotho), pkg/jobrunner, pkg/loop, cmd/
- go-agentic → pkg/lifecycle (allowance, sessions, plans, dispatch)
- php-devops → repos.yaml, setup.sh, scripts/, .core/
Module path: forge.lthn.ai/core/agent
All packages build, all tests pass.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:23:00 +00:00
}
if resp . StatusCode != http . StatusOK {
2026-03-16 21:48:31 +00:00
return "" , coreerr . E ( "eaas.handler" , fmt . Sprintf ( "eaas returned %d: %s" , resp . StatusCode , string ( result ) ) , nil )
feat: merge go-agent + go-agentic + php-devops into unified agent repo
Combines three repositories into a single workspace:
- go-agent → pkg/orchestrator (Clotho), pkg/jobrunner, pkg/loop, cmd/
- go-agentic → pkg/lifecycle (allowance, sessions, plans, dispatch)
- php-devops → repos.yaml, setup.sh, scripts/, .core/
Module path: forge.lthn.ai/core/agent
All packages build, all tests pass.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-06 15:23:00 +00:00
}
return string ( result ) , nil
}
}