Featured image of post “Do the calculation, not the model call”: resolve-harness’s three-tier Fast Path

“Do the calculation, not the model call”: resolve-harness’s three-tier Fast Path

A three-tier Fast Path routes deterministic tasks to code first.

New post

A Zero-Model Path for Deterministic Tasks

The open-source Agent harness resolve-harness describes a three-tier Fast Path for deterministic work. The design lets tasks that can be solved with pure code bypass LLM calls, delivering millisecond-scale responses with no model-token usage. Its core principle is simple: do the calculation, not the model call. The mechanism remains transparent to upper-layer orchestration—Planner, Specialist, Evaluator, and Reporter—while task trees can display a zero-model marker.

Key elements include:

  • Built-in matchers: Regex matching plus pure Python computation can return results directly.
  • Codegen: A model generates detector functions, which are persisted for reuse after AST-whitelist sandbox validation.
  • Promote: Humans review candidate detectors and merge stable ones into the source tree.
  • Zero-model execution: A deterministic-path hit makes no model call and uses zero tokens.
  • Security controls: An AST node whitelist and forbidden-attribute list constrain generated code.

The Trade-offs of a Three-Tier Fast Path

The framework separates agent execution into deterministic and non-deterministic layers: controlled, deterministic work goes to code; intelligence outside that boundary goes to models. Built-in matchers cover scenarios such as arithmetic, base conversion, leap-year checks, date calculations, and unit conversion. For example, converting 255 to hexadecimal can be completed without invoking a model.

The Codegen tier addresses long-tail needs that built-in rules do not cover. When a new task type first appears, the system can call a model to generate detector code, then validate the code’s AST and write it to disk. Later requests of the same type can reuse the persisted plugin without another model call. This creates a “generate once, reuse later” path for some long-tail deterministic logic.

AST validation, however, addresses execution safety rather than semantic correctness. A detector with incorrect business logic can still pass an AST whitelist and be reused, so human review and the Promote step remain important quality controls. The project also restricts potential escape routes such as eval, exec, and format_map, with regression tests intended to prevent known bypasses from returning.

TierProcessingSecurityCorrectness assurancePersistence
Built-in matcherDirect Python computationHuman-authored code and testsRule logic and test coverageEmbedded in source
CodegenModel-generated detector functionsAST-whitelist sandboxNo semantic-correctness validationdata/fastpath_plugins/
PromoteHuman-reviewed promotionCode-review confirmationHuman oversightsrc/resolve_harness/generated_detectors.py

Working with PSE Orchestration

resolve-harness’s task mode uses a four-role pipeline: Planner → Specialist → Evaluator → Reporter. The Planner breaks a goal into ordered subtasks. Specialists execute tasks in tool loops and can fan out in parallel. The Evaluator returns passed, score, and feedback, and unsuccessful results can trigger replanning. The Reporter aggregates the final deliverables.

Fast Path sits at the Specialist entry point, allowing eligible subtasks to complete without a model call. The orchestration layer does not need special handling for that path.

An end-to-end view produces three broad outcomes:

  1. “What is 255 in hexadecimal?” → A built-in matcher can handle the request with zero model calls.
  2. “Group these orders by amount range” → If no built-in rule exists, the request can enter Codegen, which generates and stores a detector; later similar requests can reuse it.
  3. “Analyze why quarterly revenue declined and write a retrospective” → This is an open-ended goal, so Fast Path yields to the full PSE workflow.

Where It May Fit

Potentially suitable scenarios:

  • Teams with repeated structured tasks, such as fixed-format conversions, metric calculations, or rule-based checks.
  • Workflows where commonly used logic should become shared code rather than remain in chat histories or temporary prompts.
  • Multi-step tasks that combine deterministic calculations with open-ended analysis, where the former can be routed to code first.

Scenarios that warrant additional caution:

  • Products centered on generative creation or open-ended understanding, where Fast Path has a more limited role.
  • Environments with strict requirements for code-execution safety and output correctness, which should be assessed against their own threat models, testing practices, and human-review processes.

Final Thoughts

Separating deterministic from non-deterministic work is a practical approach to agent engineering: use code for repeatable, verifiable computation, and reserve models for open-ended judgment and understanding. Fast Path is valuable not only because it can reduce model calls, but because it can turn stable domain logic into reusable assets. The stronger the automation, however, the stronger the need for safety validation and human quality control.