Skip to content

Commit eec4b62

Browse files
committed
docs: update AGENTS.md, CHANGELOG, CHEATSHEET with 20 native tools
AGENTS.md: - Added perf_tools.go to source layout - Expanded Tools section with categorized table of all 20 new tools - Added security invariants (O_NOFOLLOW, ClassifyPath, ClassifyURL) CHANGELOG.md: - v0.38.2: batch_read, glob, file_info (first batch tools) - v0.39.0: 10 parallel/performance tools - v0.40.0: 5 more tools (sort, head_tail, base64, tr, word_count) - v0.40.1: security hardening (panic recovery, O_NOFOLLOW fixes, 60 tests) CHEATSHEET.md: - Added Native Tools Reference: 5 tables covering File I/O, Data Processing, Multi-Pattern, Execution, and Agent Infrastructure
1 parent 69542d3 commit eec4b62

3 files changed

Lines changed: 146 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ cmd/odek/
3131
subagent_tool.go delegate_tasks built-in tool (sub-agent spawning)
3232
browser_tool.go Built-in browser tool (HTTP fetch + headless navigation)
3333
file_tool.go Built-in file tools (read_file, write_file, search_files, patch)
34+
perf_tools.go Performance/parallelism tools (batch_read, batch_patch, math_eval, diff, multi_grep, etc.)
3435
mcp.go MCP server implementation (stdio + SSE transport)
3536
wsapprover.go WebSocket-based approval bridge
3637
ui/index.html Single-page Web UI (~770 LOC, vanilla JS + CSS)
@@ -75,10 +76,23 @@ ReAct cycle: observe → think → act → repeat.
7576
- Max 90 iterations by default (`--max-iter`).
7677

7778
### 2. Tools
78-
Built-in: `read_file`, `write_file`, `search_files`, `patch`, `shell`, `browser`, `memory`, `clarify`, `delegate_tasks`, `send_message`.
79+
80+
**Core** (always available):
81+
`read_file`, `write_file`, `search_files`, `patch`, `shell`, `browser`, `memory`, `clarify`, `delegate_tasks`, `send_message`
82+
83+
**Performance/parallelism** (added v0.38-v0.40):
84+
| Category | Tools |
85+
|----------|-------|
86+
| Parallel batch | `batch_read` — N files in 1 call, `batch_patch` — N edits atomically, `parallel_shell` — N commands true-parallel, `http_batch` — N URLs parallel fetch |
87+
| Zero-fork data | `math_eval` — native arithmetic, `diff` — LCS diff, `json_query` — dot-path JSON, `tr` — text transform, `base64` — encode/decode |
88+
| File analysis | `glob` — fast glob find, `file_info` — stat metadata, `count_lines` — streaming line count, `word_count` — streaming word count, `checksum` — SHA256/SHA1/MD5, `sort` — sort lines, `head_tail` — first/last N lines |
89+
| Multi-pattern | `multi_grep` — N regex patterns parallel, `tree` — structured directory tree |
90+
7991
All gated by the `danger` security classifier with three actions: allow, deny, prompt.
8092
- `shell`: Classifies commands into risk classes (safe, local_write, system_write, destructive, network_egress, code_execution, install, blocked).
8193
- `send_message`: Sends text/photo/document/voice to the Telegram chat with inline keyboard support.
94+
- All file tools: `O_NOFOLLOW` on opens, `danger.ClassifyPath` per path, atomic temp+rename for writes.
95+
- All network tools: `danger.ClassifyURL` per URL, configurable network egress gate.
8296

8397
### 3. Skills
8498
Trigger-matched `SKILL.md` files loaded on-demand via lazy injection. Auto-learns from patterns every session.

docs/CHANGELOG.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,84 @@
11
# Changelog
22

3+
## v0.40.1 (2026-05-24) — Security Hardening
4+
5+
### Panic Recovery
6+
- Added `safeCall()` helper and `defer recover()` to all parallel goroutines and
7+
file-processing helpers (`countFile`, `searchPattern`, `hashFile`, `readPreview`,
8+
`countWords`) — a panic in any goroutine is caught and returned as an error entry
9+
instead of crashing the process or hanging the semaphore drain
10+
11+
### O_NOFOLLOW Hardening
12+
- Fixed `diff`, `tr`, `base64` tools — replaced 5 `os.ReadFile` calls with
13+
`readFileNoFollow()` which opens with `O_NOFOLLOW` (previously followed symlinks)
14+
15+
### Tests
16+
- 60 new test cases covering symlink rejection, empty files, binary files,
17+
max limit enforcement, missing required fields, invalid JSON (all 15 tools),
18+
division by zero, chain transforms, and danger config deny enforcement
19+
20+
---
21+
22+
## v0.40.0 (2026-05-24) — 5 More Native Perf Tools
23+
24+
### New Tools
25+
26+
| Tool | What it does | Fork replaced |
27+
|------|-------------|---------------|
28+
| `sort` | Sort lines asc/desc, unique, numeric, case-insensitive, multi-file merge | `sort`, `sort -u`, `sort -n` |
29+
| `head_tail` | First/last N lines, streaming (stops at N), parallel multi-file | `head -n`, `tail -n` |
30+
| `base64` | Encode files/strings, decode strings | `base64` |
31+
| `tr` | Case conversion, char replacement, string substitution, delete. Chainable | `tr`, `sed` (simple) |
32+
| `word_count` | Words+lines+chars+bytes streaming, parallel multi-file, aggregate totals | `wc` |
33+
34+
### Stats
35+
- 1,009 lines added, 17 new tests, 0 new dependencies (stdlib: `encoding/base64`, `sort`)
36+
37+
---
38+
39+
## v0.39.0 (2026-05-24) — 10 New Parallelism/Performance Tools
40+
41+
### New Tools
42+
43+
| # | Tool | Parallel | Fork saved |
44+
|---|------|----------|------------|
45+
| 1 | `batch_patch` | N edits / 1 call, early-stop | N `sed`/`patch` → 1 |
46+
| 2 | `parallel_shell` | N commands / pool(4), timeout | N serial → parallel |
47+
| 3 | `http_batch` | N URLs / pool(4), 30s timeout | N `curl` → 1 call |
48+
| 4 | `math_eval` | N/A — go/parser AST walk | `bc`, `expr`, `python -c` |
49+
| 5 | `diff` | N/A — LCS line diff | `diff` fork |
50+
| 6 | `count_lines` | N files / pool(4), streaming | `wc -l` |
51+
| 7 | `multi_grep` | N patterns / pool(4), parallel walk | N `grep` → 1 call |
52+
| 8 | `json_query` | N/A — dot-path with array indexing | `jq`, `python -c` |
53+
| 9 | `tree` | N/A — recursive structured listing | `find`, `tree`, `ls -R` |
54+
| 10 | `checksum` | N files / pool(4), crypto stdlib | `sha256sum`, `md5sum` |
55+
56+
### Security
57+
- All tools gate through `danger.ClassifyPath`/`ClassifyURL` + `CheckOperation`
58+
- All file opens use `O_NOFOLLOW` (anti-symlink)
59+
- All registered in `classifyToolCall()` for batch approval gate
60+
- `parallel_shell` individually classifies each command through the danger classifier
61+
62+
### Stats
63+
- 2,126 lines added across 4 files (perf_tools.go 1,472 + test 640 + main.go 10 + loop.go 7)
64+
- 25 new tests, 0 new dependencies
65+
- Binary stays at ~12MB
66+
67+
---
68+
69+
## v0.38.2 (2026-05-24) — batch_read, glob, file_info
70+
71+
### New Tools
72+
- **`batch_read`** — read N files in parallel goroutines, returns all content/errors in one call. Fixes fast_read benchmark (was 23%, 163s across 10 serial iterations)
73+
- **`glob`** — file finding by glob pattern. `filepath.Glob` for simple patterns (zero-walk), fallback to `filepath.Walk` for recursive
74+
- **`file_info`** — file metadata via Lstat: size, mod_time (ISO8601), mode, is_dir, is_symlink, is_regular
75+
76+
### Security
77+
- Same `danger.ClassifyPath` + `CheckOperation` + `O_NOFOLLOW` as all existing tools
78+
- 14 new tests, 0 new dependencies
79+
80+
---
81+
382
## v0.37.0 (2026-05-23) — AIEB v2.0 Benchmark: 80.3%
483

584
### Code Generation Discipline

docs/CHEATSHEET.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,55 @@ odek mcp # stdio transport
209209
- **One loop, one interface** — tool implementers write `func Call(args string) (string, error)`
210210
- **File-based config** — no YAML, no DSL, no schema generation
211211
- **Sandbox is opt-in** — no container runtime required for basic operation
212+
213+
## Native Tools Reference
214+
215+
### File I/O (zero-fork, O_NOFOLLOW gated)
216+
| Tool | Description |
217+
|------|-------------|
218+
| `read_file` | Read with line numbers, offset/limit pagination |
219+
| `write_file` | Atomic temp+rename write, path confinement |
220+
| `patch` | Find-and-replace with unified diff output |
221+
| `batch_read` | Read N files in parallel, one call |
222+
| `batch_patch` | Apply N edits atomically across files |
223+
| `glob` | Find files by glob pattern |
224+
| `file_info` | Stat metadata (size, mod_time, mode, type) |
225+
| `sort` | Sort lines asc/desc/unique/numeric/case-insensitive |
226+
| `head_tail` | First/last N lines, streaming, parallel |
227+
| `search_files` | Regex content search or glob file find |
228+
229+
### Data Processing (in-process, no shell fork)
230+
| Tool | Description |
231+
|------|-------------|
232+
| `math_eval` | Arithmetic via go/parser AST (`42*17+256/10 = 97`) |
233+
| `diff` | LCS structured line diff |
234+
| `json_query` | Dot-path query with array indexing (`users[0].name`) |
235+
| `tr` | Text transform: upper/lower/char/string/delete |
236+
| `base64` | Encode files/strings, decode base64 |
237+
| `count_lines` | Streaming line/byte count, parallel files |
238+
| `word_count` | Streaming word/line/char/byte count |
239+
| `checksum` | SHA-256, SHA-1, MD5 hashing |
240+
| `tree` | Structured directory tree listing |
241+
242+
### Multi-Pattern (parallel goroutine search)
243+
| Tool | Description |
244+
|------|-------------|
245+
| `multi_grep` | Search N regex patterns in parallel |
246+
| `search_files` | Single-pattern content/file search |
247+
248+
### Execution (shell replacement)
249+
| Tool | Description |
250+
|------|-------------|
251+
| `shell` | Single command, danger-classified |
252+
| `parallel_shell` | N commands, true parallel, per-cmd timeout |
253+
| `http_batch` | N URLs parallel fetch (no HTML parse) |
254+
| `browser` | HTTP fetch + regex HTML extraction |
255+
256+
### Agent Infrastructure
257+
| Tool | Description |
258+
|------|-------------|
259+
| `delegate_tasks` | Spawn sub-agent OS processes |
260+
| `memory` | Persistent fact CRUD with cosine-merge |
261+
| `clarify` | Ask the user for clarification |
262+
| `send_message` | Send text/photo/document to Telegram |
263+
| `skill_load/list/save/patch/delete` | Skill CRUD |

0 commit comments

Comments
 (0)