jev-gate — Local System-1 Decision Control Plane
All code and prose synthesis stays on frontier cloud models (Claude, Gemini, OpenAI). The local Jev-class decision model (vllm-sr/Decision-1.0-Nox-4B or jaredpalmer/kev-4b) hosted on the local RTX 5090 (/v1/systemone endpoint, ~15ms latency) and exposed via the jev-gate FastMCP server acts strictly as a single-pass probability control plane (choice, noul yes/no, and score) before and after cloud actions.
Contract 1: Cascading Configuration Hierarchy
All skills, hooks, and MCP tool calls must resolve configuration in this strict 3-tier precedence order:
Runtime Tool Args > Project-Local (./.jev-gate.toml) > User-Global (~/.config/jev-gate/config.toml)
- User-Global Config (
~/.config/jev-gate/config.toml):- Template:
templates/jev-gate.global.toml(configure via/configure jev-gate-global). - Holds the RTX 5090
/v1/systemoneendpoint URL, active decision model ID, default cloud model lane mappings (fast_lanevs.deep_lane), global search blocklists (-site:linkedin.com,-site:pinterest.com,-site:quora.com,-site:medium.com), and baseline confidence thresholds.
- Template:
- Project-Local Config (
./.jev-gate.toml):- Template:
templates/jev-gate.project.toml(configure via/configure jev-gate). - Overrides domain-specific search allowlists (e.g.,
3d_printing,rust_cad,software_arch), project-specific architectural invariants ([[invariants]]evaluated asnoulbooleans againstgit diffs), and per-project lane routing thresholds.
- Template:
- Runtime Tool Args:
- Explicit arguments passed to
smart_search,triage_coding_task,verify_code_invariants, orgate_shell_commandoverride both files for that call.
- Explicit arguments passed to
Contract 2: Pre-Search Hygiene (smart_search)
- Rule: Never execute a raw web search for technical settings, hardware parameters, CAD/slicer profiles, or SDK/library documentation directly.
- Procedure:
- Call the
jev-gateMCP toolsmart_search(query, force_backend="auto")first. - In a single ~15ms forward pass on the RTX 5090,
smart_search:- Classifies the query domain (
3d_printing,rust_cad,software_arch,general_dev, etc.). - Strips social/SEO spam by appending
global_blocklist(-site:linkedin.com -site:pinterest.com -site:quora.com -site:medium.com). - Injects matching
domain_allowlistsfrom.jev-gate.toml(e.g.,site:printables.com,site:docs.rs,site:github.com). - Evaluates
needs_perplexity_synthesis(noul):< 0.80→ executes a fast filtered search for exact parameters/docs.>= 0.80→ escalates to Perplexity MCP for multi-source synthesis.
- Classifies the query domain (
- Call the
- Graceful Fallback (when
jev-gateis unreachable):- Append the static
global_blocklist(-site:linkedin.com -site:pinterest.com -site:quora.com -site:medium.com) to the query manually before calling the host's native web search tool, and log[jev-gate: offline — applied static search blocklist].
- Append the static
Contract 3: Pre-Coding Triage & Context Pruning (triage_coding_task)
- Rule: Before starting a multi-file task or loading large repository contexts into the cloud LLM, call
triage_coding_task(task_prompt, candidate_files). - Outputs & Required Agent Actions:
- Model Lane Selection (
fast_lanevs.deep_lane):fast_lane(e.g., Claude Sonnet/Haiku, Gemini Flash) for single-file edits, boilerplate, unit tests, and syntax fixes.deep_lane(e.g., Claude Opus, Gemini Pro, OpenAI frontier reasoning) for multi-file refactors, concurrency, and architecture.- Confidence Floor: If lane confidence is
< 0.65, automatically fall back todeep_lane.
- Abstention Gate (
insufficient_context):- If
insufficient_contextscores highest among triage outcomes, halt immediately and ask the user for clarification (or emit aplan-ambiguity/blockedstatus in autonomous runs) before generating code.
- If
- Context Pruning (
keep_full|keep_signatures_only|drop):- Scores all
candidate_filesin parallel:keep_full: Read the full file into context.keep_signatures_only: Read only exported interfaces/signatures (viajev-gateskeleton output orast-grep), never the full implementation body.drop: Do not read into the cloud context window.
- Scores all
- Model Lane Selection (
- Graceful Fallback (when
jev-gateis unreachable):- Default to
deep_lane, log[jev-gate: offline — defaulting to deep_lane], and use standard repo-scoped file reading.
- Default to
Contract 4: Post-Generation Invariant & Tool-Safety (verify_code_invariants & gate_shell_command)
4A. Diff Auditing (verify_code_invariants)
- Rule: After generating a code patch (and before running slow builds/tests or committing), pass the
git difftoverify_code_invariants(git_diff). - What it does: Evaluates all project architectural invariants defined under
[[invariants]]in.jev-gate.tomlin a single parallel forward pass (noulboolean probabilities). - Required Action:
- If any invariant exceeds its failure threshold (default
>= 0.80), fix the architectural violation immediately before running build/test or presenting the code. - Record invariant check status in checkpoint and execution reports.
- If any invariant exceeds its failure threshold (default
- Graceful Fallback (when
jev-gateis unreachable):- Log
[jev-gate: offline — verify_code_invariants skipped]in the checkpoint/execution report; never claim that semantic invariants passed when the endpoint was unreachable.
- Log
4B. Shell Gating (gate_shell_command)
- Rule: Before running non-trivial shell commands (mutations, git history changes, package operations, database scripts, file deletions), evaluate
(command, working_dir)viagate_shell_command(command, working_dir)(either via the MCP tool or automatically via thePreToolUsehook scriptbin/jev-shell-hook). - Decision Classes (
choice):safe_auto_execute(probability >= 0.85): Execute immediately without prompting.requires_user_confirmation(safe_auto_execute < 0.85and not destructive): Pause and ask the user for confirmation.blocked_destructive: Refuse execution immediately and explain the risk dimension (modifies_git_history,destroys_uncommitted_work,touches_outside_workspace,exfiltrates_secrets).
- Graceful Fallback (when
jev-gateis unreachable):- Enforce the static destructive deny list (
git reset --hard,git push --force,git clean -f,git branch -D,rm -rf) as hard blocks, and route non-trivial mutating commands torequires_user_confirmation(ask).
- Enforce the static destructive deny list (
Contract Summary
- Inputs:
smart_search(query, force_backend="auto")triage_coding_task(task_prompt, candidate_files)verify_code_invariants(git_diff)gate_shell_command(command, working_dir)
- Preconditions: Cascading config loaded from
./.jev-gate.tomland~/.config/jev-gate/config.tomlwhen present. - Outputs: Calibrated
choice,noul, andscoredecisions governing search routing, model lane selection, context pruning, semantic diff invariants, and shell safety. - Failure modes: When the local RTX 5090
/v1/systemoneendpoint is unreachable, skills degrade gracefully per the fallback rules above (deep_lane+ static search blocklist + logged invariant skip +requires_user_confirmationshell gate).