HarperFast / HarperFast/harper

[Agent Loop] Registry-backed tool resolution + RBAC + audit + agent docs

Open
#852 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
89
Forks
10
Avg merge
2d 6h
Merged PRs (30d)
200

Description

Part of #612. **Depends on #615, #618, #622.**

Swap the agent loop's v1 caller-supplied `opts.toolHandlers` dispatch for **registry-backed tool resolution** — the half of #612 that makes `toolMode: 'auto'` the compressed-stack story (auto-discovered, RBAC-filtered, audited tools) rather than hand-wired handlers.

## Scope / acceptance

- [ ] Resolve tool calls against `scope.resources` — an `@export`-ed Resource's `get_*`/`search_*`/`create_*`/… verbs are callable as tools (#618).
- [ ] Resolve MCP-registered tools via the shared registry (#615) and custom `mcpTools` opt-ins (#622).
- [ ] Tool calls run with the **caller's identity** — RBAC enforced via the registry's filtering, not the caller's handler.
- [ ] Tool calls **audited in the transaction log** alongside data writes (inherited from Resource dispatch).
- [ ] Docs: building an agent with auto mode, registering a Resource as a tool, error/budget/abort/conversation semantics.

## Seam already in place (PR #848)

The loop's missing-handler split — DECLARED-but-no-handler → hard `ClientError(400)`; UNDECLARED → recoverable "unknown tool" — maps directly onto the registry's **resolvable-but-misconfigured vs unknown** cases. The swap is a lookup replacement in `runSingleToolCall`, not a loop rewrite.

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.