feat(guard): dynamic delegation guardrail using Jev System One - #5081
Open
RooseveltAdvisors wants to merge 5 commits into
Open
RooseveltAdvisors wants to merge 5 commits into
RooseveltAdvisors wants to merge 5 commits into
Conversation
Intercepts Bash tool calls in Firstmate's primary supervisor workspace (w1) to enforce supervisor role boundaries dynamically without brittle regexes. Features: - Tier 1 (0ms, $0): Fast-path local allowlist for core supervisor tools (bd, tasks-axi, fm-send, fm-route, fm-wake-drain, git status/log, etc.) with compound command splitting to prevent sneaky chaining. - Tier 2 (0ms, $0): Fast local SHA256 decision cache in /dev/shm. - Tier 3 (<350ms): Jev System One (jev-latest) evaluates semantic intent, calculates violation noul, and routes to target Second Mate domain. - Auto-Steer: Denials provide immediate suggested delegation commands. - Worktree Inertia: Automatically inert in linked task worktrees. - Multi-Harness: Registered in Pi, Claude, and Cursor pre-tool hooks.
…nesses Extends PreToolUse Jev delegation guardrail coverage to every supported primary harness: - Codex: .codex/hooks.json - Grok: .grok/hooks/fm-primary-jev-guard.json - OpenCode: .opencode/plugins/fm-primary-jev-guard.js - omp: .omp/extensions/fm-primary-turnend-guard.ts - (Claude, Cursor, and Pi already wired in prior commit)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a dynamic delegation guardrail PreToolUse seatbelt (
bin/fm-jev-guard.sh&bin/fm-jev-guard.py) to enforce supervisor role boundaries dynamically without brittle regexes.Motivation
Text instructions in
AGENTS.mdare soft constraints. When facing production incidents, supervisor models frequently succumb to the troubleshooting spiral ('just one more command to inspect') and end up running remote SSH commands, package installs, and service edits inw1. Hard constraints work:fm-cd-pretool-check.shdeniedcd projects/...instantly. This guardrail provides the same hard boundary for supervisory delegation while avoiding brittle regex whack-a-mole.Architecture
bd,tasks-axi,fm-send,fm-route,fm-wake-drain,git status/log,cat state/*, etc.) with compound command splitting (;,&&,||, newlines) to prevent hidden chaining./dev/shm.jev-latest) evaluates semantic intent, calculates violation noul, and determines target Second Mate domain (gpu_ops,svc_ops,monitor_sre, etc.).bin/fm-send.sh <domain> '<task>')..pi/extensions/fm-primary-turnend-guard.ts), Claude (.claude/settings.json), and Cursor (.cursor/hooks.json).Validation
tests/fm-jev-guard.test.shpassing 100%.bin/fm-lint.sh(ShellCheck 0.11.0 extended dataflow).tests/fm-turnend-guard.test.shupdated and passing 100%.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ Intent verified: dynamic delegation guardrail using Jev System One.
✅ **rebase** - passed
✅ Rebased cleanly on upstream main.
✅ **review** - passed
✅ No issues found.
✅ **test** - passed
tests/fm-jev-guard.test.shpassed 100%tests/fm-turnend-guard.test.shpassed 100%✅ **document** - passed
✅ Documentation and docstrings preserved.
✅ **lint** - passed
✅ Clean under
bin/fm-lint.sh.✅ **push** - passed
✅ Pushed to fork branch fm/jev-delegation-guard.