-
Notifications
You must be signed in to change notification settings - Fork 0
docs: post-v0.6 accuracy pass — Crush→Goose, arch update, bug backlog, godoc #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,19 +8,19 @@ ShellForge is a single Go binary (~7.5MB) that provides governed local AI agent | |
|
|
||
| ``` | ||
| ┌─────────────────────────────────────────────┐ | ||
| │ Layer 8: OpenShell (Kernel Sandbox) │ NVIDIA Landlock/Seccomp | ||
| │ Layer 8: OpenShell (Kernel Sandbox) │ Docker/Colima isolation | ||
| ├─────────────────────────────────────────────┤ | ||
| │ Layer 7: DefenseClaw (Supply Chain) │ Cisco AI BoM Scanner | ||
| ├─────────────────────────────────────────────┤ | ||
| │ Layer 6: DeepAgents (Multi-Agent) │ LangChain orchestration | ||
| │ Layer 6: Dagu (Orchestration) │ YAML DAG workflows + web UI | ||
| ├─────────────────────────────────────────────┤ | ||
| │ Layer 5: OpenCode (AI Coding) │ Go CLI, native tools | ||
| │ Layer 5: Goose / OpenCode (Execution) │ Primary local agent driver | ||
| ├─────────────────────────────────────────────┤ | ||
| │ Layer 4: AgentGuard (Governance Kernel) │ Policy enforcement | ||
| ├─────────────────────────────────────────────┤ | ||
| │ Layer 3: TurboQuant (Quantization) │ KV cache optimization | ||
| │ Layer 3: TurboQuant (Quantization) │ KV cache optimization (optional) | ||
| ├─────────────────────────────────────────────┤ | ||
| │ Layer 2: RTK (Token Compression) │ Auto-compress I/O | ||
| │ Layer 2: RTK (Token Compression) │ Auto-compress I/O (optional) | ||
| ├─────────────────────────────────────────────┤ | ||
| │ Layer 1: Ollama (Local LLM) │ Metal GPU on Mac | ||
| └─────────────────────────────────────────────┘ | ||
|
|
@@ -47,26 +47,27 @@ internal/ | |
|
|
||
| ShellForge uses a pluggable engine system: | ||
|
|
||
| 1. **OpenCode** (preferred) — subprocess, `--non-interactive` mode, governance-wrapped | ||
| 2. **DeepAgents** — subprocess, Node.js/Python SDK, governance-wrapped | ||
| 3. **Native** (fallback) — built-in multi-turn loop with Ollama + tool calling | ||
| 1. **Goose (Block)** (preferred local driver) — subprocess, native Ollama support, SHELL wrapped via `govern-shell.sh` | ||
| 2. **OpenCode** (alternative) — subprocess, `--non-interactive` mode, governance-wrapped | ||
| 3. **DeepAgents** (alternative) — subprocess, Node.js/Python SDK, governance-wrapped | ||
| 4. **Native** (fallback) — built-in multi-turn loop with Ollama + tool calling | ||
|
|
||
| The engine selection is automatic based on what's installed. | ||
| The engine selection is automatic based on what's installed. Use `shellforge run goose` for local models, or `shellforge agent` for the native loop. | ||
|
|
||
| ## Governance Flow | ||
|
|
||
| ``` | ||
| User Request → Engine (OpenCode/DeepAgents/Native) | ||
| User Request → Engine (Goose/OpenCode/DeepAgents/Native) | ||
| → Tool Call → Governance Check (agentguard.yaml) | ||
| → ALLOW → Execute Tool → Return Result | ||
| → DENY → Log Violation → Block Execution | ||
| → DENY → Log Violation → Correction Feedback → Retry | ||
| ``` | ||
|
|
||
| ## Data Flow | ||
|
|
||
| 1. User invokes `./shellforge qa` (or agent, report, scan) | ||
| 2. CLI loads `agentguard.yaml` governance policy | ||
| 3. Detects available engine (OpenCode > DeepAgents > Native) | ||
| 3. Detects available engine (Goose > OpenCode > DeepAgents > Native) | ||
| 4. Engine sends prompt to Ollama (via RTK for token compression) | ||
|
Comment on lines
68
to
71
|
||
| 5. LLM responds with tool calls | ||
| 6. Each tool call passes through governance check | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -45,6 +45,8 @@ entries []Entry | |||||
| logFile *os.File | ||||||
| ) | ||||||
|
|
||||||
| // Init opens a JSONL log file under outputDir named "<agent>-<timestamp>.jsonl". | ||||||
| // Must be called before any log functions; call Close when done. | ||||||
|
||||||
| // Must be called before any log functions; call Close when done. | |
| // Call Init before logging to enable JSONL file output; otherwise logs are stdout/in-memory only. Call Close when done. |
Copilot
AI
Mar 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Governance GoDoc says it logs to stdout and the JSONL log, but JSONL output only happens if Init has been called (logFile != nil). Consider clarifying that file logging is conditional so callers don’t assume a file is always written.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -80,6 +80,8 @@ func ExecuteDirect(tool string, params map[string]string, timeoutSec int) Result | |||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // Execute runs a tool call through governance, then executes if allowed. | ||||||||||||||||||||||
| // Execute evaluates the tool call against governance policy and, if allowed, runs it. | ||||||||||||||||||||||
| // This is the fully governed path; use ExecuteDirect when governance is already checked. | ||||||||||||||||||||||
| func Execute(engine *governance.Engine, agent, tool string, params map[string]string) Result { | ||||||||||||||||||||||
| decision := engine.Evaluate(tool, params) | ||||||||||||||||||||||
|
Comment on lines
82
to
86
|
||||||||||||||||||||||
| // Execute runs a tool call through governance, then executes if allowed. | |
| // Execute evaluates the tool call against governance policy and, if allowed, runs it. | |
| // This is the fully governed path; use ExecuteDirect when governance is already checked. | |
| func Execute(engine *governance.Engine, agent, tool string, params map[string]string) Result { | |
| decision := engine.Evaluate(tool, params) | |
| // Execute runs a tool call through governance and, if allowed, executes it. | |
| // This is the fully governed path; use ExecuteDirect when governance is already checked. | |
| func Execute(engine *governance.Engine, agent, tool string, params map[string]string) Result { | |
| decision := engine.Evaluate(tool, params) | |
| decision := engine.Evaluate(tool, params) |
Copilot
AI
Mar 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FormatForPrompt has two consecutive GoDoc summary lines that both start with the function name and say essentially the same thing. Please remove the duplication and keep a single, precise summary (with any extra detail in subsequent sentences that don’t repeat the opener).
| // FormatForPrompt returns tool descriptions for the system prompt. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This text says engine selection is automatic based on what’s installed, but the CLI requires the user to explicitly choose a driver via
shellforge run <driver>(it doesn’t auto-pick Goose/OpenCode/etc.). Please adjust the wording to match the current behavior (e.g., “ShellForge can run different engines; select one withshellforge run <driver>”).