Skip to content

feat: plan.json tools, ripgrep-style search, writable_paths permissions - #1

Open
itech001 wants to merge 1 commit into
mainfrom
feat/plan-json-writable-paths-ripgrep
Open

feat: plan.json tools, ripgrep-style search, writable_paths permissions#1
itech001 wants to merge 1 commit into
mainfrom
feat/plan-json-writable-paths-ripgrep

Conversation

@itech001

Copy link
Copy Markdown
Owner

Summary

Four improvements to agent-runner's planning, filesystem tools, permission system, and agent loading.

Changes

1. Planning Phase → structured plan.json

  • src/agent/planner.rs: Added Plan and PlanStep structs (Serialize/Deserialize), parse_plan() to convert LLM plan text into structured steps, and save_plan_json() to persist plan.json (replaces plan.md)
  • src/tools/plan.rs (new): Two built-in tools for the agent to interact with the plan during execution:
    • read_plan — reads plan.json so the agent can review all steps and their current status
    • update_plan — updates a step's status (pending/in_progress/done/skipped) and optional description
  • src/main.rs: Registers both tools, --plan-only now prints plan.json content, report plan field points to plan.json

2. Filesystem Tools → ripgrep engine (ignore crate)

  • src/tools/filesystem.rs: Rewrote glob and grep using the ignore crate (ripgrep's underlying library):
    • Respects .gitignore, .git/info/exclude, and global gitignore
    • Skips hidden files by default
    • Result limit of 1000 to prevent memory exhaustion
    • glob uses globset for pattern matching (**, *, ?)
    • grep retains optional glob file filter via globset::GlobMatcher
  • Replaced glob crate dependency with globset + ignore

3. Permission System → default read-only + writable_paths

  • src/permissions.rs: Rewritten permission logic:
    • Read operations (ls, read_file, glob, grep): allowed everywhere by default
    • Write operations (write_file, edit_file, execute): only allowed on paths matching writable_paths glob patterns; denied otherwise
    • Legacy permissions array kept as fallback for advanced allow/deny rules
    • Paths normalized (resolves relative paths against working_dir, strips . components) for consistent matching
    • 5 unit tests covering all scenarios
  • src/config.rs: Added writable_paths: Vec<String> to Config
  • src/main.rs: Added --writable-paths CLI flag (comma-separated), merged with config values

4. Agent dir loading — already single-source (no change needed)

  • Confirmed agent_dir.rs only reads from --agent-dir (AGENTS.md, agent-runner.json, skills/). No home directory scanning, no dirs crate dependency.

Verification

  • cargo build --release — compiles successfully (exit code 0)
  • cargo test — 5/5 permission tests pass
  • ✅ Pre-existing warnings only (unused loop_config var, unused Path import in run_log.rs)

Files Changed

  • agent-runner/Cargo.toml — replaced glob with ignore + globset
  • agent-runner/Cargo.lock — updated lockfile
  • agent-runner/src/agent/planner.rs — Plan/PlanStep structs, parse_plan, save_plan_json
  • agent-runner/src/tools/plan.rsnew ReadPlanTool + UpdatePlanTool
  • agent-runner/src/tools/mod.rs — register plan module
  • agent-runner/src/tools/filesystem.rs — rewritten glob/grep with ignore crate
  • agent-runner/src/permissions.rs — default read-only + writable_paths + tests
  • agent-runner/src/config.rs — writable_paths field
  • agent-runner/src/main.rs — register tools, CLI flag, plan flow
  • README.md — updated docs
  • web-site/index.html — updated feature cards, tools, config example

- Planning Phase: generate structured plan.json (Plan/PlanStep structs)
  with read_plan and update_plan built-in tools for agent to track
  step status (pending/in_progress/done/skipped) during execution
- Filesystem Tools: rewrite glob and grep using the ignore crate
  (ripgrep's engine), respecting .gitignore and skipping hidden files;
  add result limits to prevent memory exhaustion
- Permission System: default all paths read-only, only writable_paths
  whitelist allows writes (glob-based); legacy permissions array kept
  as fallback; add --writable-paths CLI flag
- Agent dir loading already single-source (only --agent-dir, no home
  directory scanning) - no change needed
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-runner Ready Ready Preview Aug 13, 2026 1:29pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant