Consolidates three codebases into a single agent orchestration repo: - agentci (from go-scm): Clotho dual-run verification, agent config, SSH security (sanitisation, secure commands, token masking) - jobrunner (from go-scm): Poll-dispatch-report pipeline with 7 handlers (dispatch, completion, auto-merge, publish draft, dismiss reviews, send fix command, tick parent epic) - plugins marketplace (from agentic/plugins): 27 Claude/Codex/Gemini plugins with shared MCP server All 150+ tests passing across 6 packages. Co-Authored-By: Virgil <virgil@lethean.io>
37 lines
928 B
Go
37 lines
928 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"github.com/mark3labs/mcp-go/mcp"
|
|
)
|
|
|
|
const ethicsModalPath = "codex/ethics/MODAL.md"
|
|
const ethicsAxiomsPath = "codex/ethics/kernel/axioms.json"
|
|
|
|
func ethicsCheckHandler(_ context.Context, _ mcp.CallToolRequest) (*mcp.CallToolResult, error) {
|
|
root, err := findRepoRoot()
|
|
if err != nil {
|
|
return mcp.NewToolResultError(fmt.Sprintf("failed to locate repo root: %v", err)), nil
|
|
}
|
|
|
|
modalBytes, err := os.ReadFile(filepath.Join(root, ethicsModalPath))
|
|
if err != nil {
|
|
return mcp.NewToolResultError(fmt.Sprintf("failed to read modal: %v", err)), nil
|
|
}
|
|
|
|
axioms, err := readJSONMap(filepath.Join(root, ethicsAxiomsPath))
|
|
if err != nil {
|
|
return mcp.NewToolResultError(fmt.Sprintf("failed to read axioms: %v", err)), nil
|
|
}
|
|
|
|
payload := EthicsContext{
|
|
Modal: string(modalBytes),
|
|
Axioms: axioms,
|
|
}
|
|
|
|
return mcp.NewToolResultStructuredOnly(payload), nil
|
|
}
|