feat: update README and documentation for new tools and features

- Updated README.md to reflect the addition of 3 new built-in tools, bringing the total to 37.
- Revised architecture documentation to indicate the increase in tool count.
- Enhanced backend documentation with updated line counts for various modules.
- Modified data documentation to change edit log format from JSON to JSONL.
- Updated dependencies documentation to reflect version upgrades for several crates.
- Improved prompts for auto-reviewer, division implementer, planner, tester, and quality reviewer to enforce stricter coding standards regarding linter bypasses.
- Refactored code in various modules to improve clarity and performance, including updates to error handling and tool execution logic.
- Added comprehensive tests for IPC frame serialization and deserialization.
This commit is contained in:
asepharyana
2026-07-13 14:39:39 +07:00
parent 00e29139c5
commit 1d50b94eec
23 changed files with 327 additions and 176 deletions
+23 -16
View File
@@ -4,7 +4,7 @@
## AI Provider
`src/service/provider.rs` (258 lines)
`src/service/provider.rs` (310 lines)
- `LlmClient::new(api_key, model, base_url)` — constructs blocking reqwest client
- `chat_with_tools()` — non-streaming with tool definitions
- `chat_stream()` — SSE streaming, returns `SseParser` yielding `StreamEvent`
@@ -18,51 +18,58 @@
## IPC / Daemon
`src/ipc/` (7 files, ~300 lines total)
`src/ipc/` (7 files, ~350 lines total)
- Unix domain socket, length-prefixed JSON frames
- Daemon sends `DaemonFrame { state: StatePayload, diff, tasks }` to clients
- Clients send `ClientRequest { action: Action }` back
- State sync uses snapshots + binary diffs (rsync-style, not git)
- Daemon sends `DaemonFrame` (state payload, stream tokens, system notes)
- Clients send `ClientRequest` (key presses, resize, submit, scroll)
- State sync uses full-state push from daemon to client after each action
## Workflow Engine
`src/app/workflow/engine.rs` (251 lines) + `script.rs`
`src/app/workflow/engine.rs` (648 lines) + `script.rs`
- Inline JS-style DSL executed by a lightweight runtime
- `agent()`, `parallel()`, `pipeline()`, `phase()`, `log()` — spawns sub-agents
- Max concurrency configurable via `workflow_max_concurrency` setting
- Company pipeline orchestrator in `company.rs` (406 lines): full 5-division or quick 3-division pipelines
## Sub-Agent System
`src/app/subagent/` (4 files, ~250 lines)
- `run_subagent()` — spawns independent agent with its own tool set & context
`src/app/subagent/` (6 files: `spawn.rs`, `engine.rs`, `context.rs`, `event.rs`, `division.rs`, `auto.rs`, ~450 lines total)
- `run_subagent()` — spawns independent agent with its own tool set and context
- Communicates via `mpsc<SubagentEvent>` channel (tool calls, results, completion)
- Uses `LlmClient` (same as main agent) with tool-use API
- Auto-healing: on build/test failure, spawns auto-fix sub-agent
- Division roles: Strategy, Engineering, Quality, Security, Documentation
## MCP Client
`src/app/mcp/manager.rs` (371 lines)
`src/app/mcp/manager.rs` (441+ lines)
- Stdio transport: spawns child process, JSON-RPC via stdin/stdout
- HTTP transport: streaming HTTP with JSON-RPC
- Tool registration: `tools/list``McpToolAdapter` implements `crate::tool::Tool`
- Dynamic tool list refresh and error recovery
- Persistent child handle for stdio (reuses connection across calls)
## Self-Review
`src/app/review/mod.rs` (437 lines)
`src/app/review/mod.rs` (495 lines)
- Post-tool execution quality check against learned lessons
- Invokes `run_subagent()` with reviewer prompt
- Staleness detection: skips review after N consecutive empty results
- Three review types: code quality, architecture, security
## Background Bash
`src/app/bgbash/` (2 files)
`src/app/bgbash/` (2 files: `job.rs`, `control.rs`)
- `spawn_bash_job()` — runs `sh -c` in a thread, collects stdout line-by-line
- Channels: output via `mpsc<String>`, PID via `mpsc<u32>`
- Killable via PID
- Killable via PID (SIGTERM)
- Output buffering capped at 10,000 lines to prevent memory issues
## Gate Guard / Harness
`src/app/harness.rs` (127 lines)
`src/app/harness.rs` (495 lines)
- `Harness::gate_tool_call()` — verdict-based tool gating (allow/block)
- Parses LLM verdicts (JSON or plain-text)
- `test_parse_verdict_*` tests for 6 verdict formats
- Path traversal, credential read, and destructive command detection
- Pattern detection for stub code, denial language, and assumptions in write/edit content
- Reason validation for mutating tools (minimum 8 characters, rejects generic non-answers)
- Includes 8 unit tests for verdict parsing formats