[P0-05] Replace textual one-shot tools with native iterative tool execution #21

Closed
opened 2026-08-28 20:54:30 +01:00 by conductor · 1 comment
Owner

Plain summary

Models execute REAL iterative tool calls — inspect, edit, test, retry, diff — instead of printing JSON in fake one-shot tool calls. Typed ToolAction/ToolResult objects, recoverable failures, and a max-step budget.

Example

Qwen3 14B completes a multi-step disposable coding task using actual tool calls, not printed faux-tool JSON.

Technical details

Parent epic: #16

Manifest ID: P0-05

Priority: P0
Problem: current protocol asks models to print JSON and supports essentially one tool/follow-up cycle.

Goal:

model → tool → result → model → tool → ... → verification → done

Requirements:

  • provider/model adapters expose structured tool calling where supported;
  • iterative loop with stop conditions;
  • typed ToolAction and ToolResult objects;
  • tool failures are recoverable;
  • coding loop supports inspect/edit/test/retry/diff.

Acceptance criteria:

  • Qwen3 14B completes a multi-step disposable coding task using actual tool calls;
  • no printed faux-tool JSON accepted as successful execution;
  • tool loop has max-step/budget safeguards.

Dependencies: P0-02, P0-03.


Resolved dependency references

  • Depends on: #18 (P0-02), #19 (P0-03)
  • Blocks: #24 (P1-01), #29 (P1-06), #30 (P1-07), #32 (P1-09), #33 (P1-10), #34 (P1-11)

Relevant source files

Not specified in the handoff. P0-01 must identify authoritative paths before implementation; do not guess by adding another path.

Do not do

  • Do not begin this issue before its dependencies are complete.
  • Do not create a parallel authority path; replace, extend, or remain dormant.
  • Do not add unrelated cognitive subsystems or additive feature growth.
  • Do not treat module/schema existence, background activity, or model self-report as acceptance evidence.

Source directive

Preserved from /home/nick/Desktop/rune_v1_course_correction_handoff.md, Section 14. The handoff is authoritative if this issue summary is ambiguous.

Pipeline requirements

  • TDD: frozen/regression tests written first, red → green
  • ruff check and ruff format --check clean
  • Spec-compliance review gate: PASS
  • Code-quality review gate: Approved
  • Full orchestration suite regression green
  • Canary passes (where applicable)
  • Closed with a properly formatted closing comment + commit/PR references
## Plain summary Models execute REAL iterative tool calls — inspect, edit, test, retry, diff — instead of printing JSON in fake one-shot tool calls. Typed ToolAction/ToolResult objects, recoverable failures, and a max-step budget. ## Example Qwen3 14B completes a multi-step disposable coding task using actual tool calls, not printed faux-tool JSON. ## Technical details Parent epic: #16 Manifest ID: **P0-05** **Priority:** P0 **Problem:** current protocol asks models to print JSON and supports essentially one tool/follow-up cycle. **Goal:** ```text model → tool → result → model → tool → ... → verification → done ``` **Requirements:** - provider/model adapters expose structured tool calling where supported; - iterative loop with stop conditions; - typed ToolAction and ToolResult objects; - tool failures are recoverable; - coding loop supports inspect/edit/test/retry/diff. **Acceptance criteria:** - Qwen3 14B completes a multi-step disposable coding task using actual tool calls; - no printed faux-tool JSON accepted as successful execution; - tool loop has max-step/budget safeguards. **Dependencies:** P0-02, P0-03. --- ## Resolved dependency references - Depends on: #18 (P0-02), #19 (P0-03) - Blocks: #24 (P1-01), #29 (P1-06), #30 (P1-07), #32 (P1-09), #33 (P1-10), #34 (P1-11) ## Relevant source files Not specified in the handoff. P0-01 must identify authoritative paths before implementation; do not guess by adding another path. ## Do not do - Do not begin this issue before its dependencies are complete. - Do not create a parallel authority path; replace, extend, or remain dormant. - Do not add unrelated cognitive subsystems or additive feature growth. - Do not treat module/schema existence, background activity, or model self-report as acceptance evidence. ## Source directive Preserved from `/home/nick/Desktop/rune_v1_course_correction_handoff.md`, Section 14. The handoff is authoritative if this issue summary is ambiguous. ## Pipeline requirements - [ ] TDD: frozen/regression tests written first, red → green - [ ] `ruff check` and `ruff format --check` clean - [ ] Spec-compliance review gate: PASS - [ ] Code-quality review gate: Approved - [ ] Full orchestration suite regression green - [ ] Canary passes (where applicable) - [ ] Closed with a properly formatted closing comment + commit/PR references
conductor added the P0 — criticalv1-course-correction labels 2026-08-28 20:54:30 +01:00
gitea-actions Bot added the featuregrowth labels 2026-08-28 20:54:43 +01:00
gitea-actions Bot added the custodian label 2026-09-03 22:53:40 +01:00
Author
Owner

Plain summary — what was delivered

Native iterative tool calling verified and hardened (#21 P0-05). The issue's core acceptance is now PROVEN IN-SUITE: qwen3:14b completes a real multi-step coding task (read a broken file → edit it → run the verification command through approval → fix confirmed) using actual native tool calls — no printed faux-JSON. Plus four gap closures: step-budget visibility, a failure circuit breaker, self-correcting sandbox errors, and tool-usage guidance.

Technical details

Commits: c2f6109 (plan) → 21ae179 (implementation — note: carries a disclosed commit-message collision with the controller's pipeline-gate fix; content verified complete) → 6e9606c/ced5768 (discharges). Merged via PR #144 together with the 0.50.0 release bump.

What was already true (verified, not rebuilt): iterative while loop with max_iterations=8, typed ToolRequest/ToolEvent, approval pauses with resumable state, native tool_calls via /api/show capability discovery, executor errors fed back to the model.

Gap closures:

  1. Budget visibility — OperatorResponse.iterations_used/iteration_budget on every terminal path (F1 discharge: six mid-loop failure sites fixed, red-green proven).
  2. Failure circuit breaker — the same tool failing twice with identical arguments stops the loop with a typed reason instead of burning all 8 iterations; streak resets on success or different args.
  3. Sandbox self-correction — write denials name the allowed directories; BLOCKED dirs get a truthful separate message (minor-3).
  4. Tool guidance — the native path's system block now instructs tool usage ("never fabricate; read before editing"), +30 tokens, always admitted.

E2E acceptance evidence (local, live qwen3:14b): 1 passed in ~7-14s — events [read_file, edit_file(pending→approved), run_command(pending→approved)], iterations_used 4/8, add(2,3)==5 verified. Skips cleanly without Ollama (CI).

Gates: Spec PASS 14/14 (general-178, scripted-probe verified). Quality Approved with minors (general-179) — F1 + minor-3 + minor-5 discharged in ced5768, red-green proven. Suite 495 → 502 passed + 84 subtests (E2E adds 1 when Ollama live). Canary P0-05 NATIVE TOOLS CANARY PASSED registered; henxels exit 0.

Follow-ups: streak persistence across approval pauses (pending_state extension — #48 seam); read-side denial text symmetry; OllamaChatTransport keep_alive option; 13 pinned num_ctx sites; hook_engine.fire absence (pre-existing).

## Plain summary — what was delivered Native iterative tool calling verified and hardened (#21 P0-05). The issue's core acceptance is now PROVEN IN-SUITE: **qwen3:14b completes a real multi-step coding task** (read a broken file → edit it → run the verification command through approval → fix confirmed) using actual native tool calls — no printed faux-JSON. Plus four gap closures: step-budget visibility, a failure circuit breaker, self-correcting sandbox errors, and tool-usage guidance. ## Technical details **Commits**: `c2f6109` (plan) → `21ae179` (implementation — note: carries a disclosed commit-message collision with the controller's pipeline-gate fix; content verified complete) → `6e9606c`/`ced5768` (discharges). Merged via PR #144 together with the 0.50.0 release bump. **What was already true (verified, not rebuilt)**: iterative `while` loop with `max_iterations=8`, typed `ToolRequest`/`ToolEvent`, approval pauses with resumable state, native tool_calls via `/api/show` capability discovery, executor errors fed back to the model. **Gap closures**: 1. **Budget visibility** — `OperatorResponse.iterations_used`/`iteration_budget` on every terminal path (F1 discharge: six mid-loop failure sites fixed, red-green proven). 2. **Failure circuit breaker** — the same tool failing twice with identical arguments stops the loop with a typed reason instead of burning all 8 iterations; streak resets on success or different args. 3. **Sandbox self-correction** — write denials name the allowed directories; BLOCKED dirs get a truthful separate message (minor-3). 4. **Tool guidance** — the native path's system block now instructs tool usage ("never fabricate; read before editing"), +30 tokens, always admitted. **E2E acceptance evidence** (local, live qwen3:14b): `1 passed in ~7-14s` — events `[read_file, edit_file(pending→approved), run_command(pending→approved)]`, `iterations_used 4/8`, `add(2,3)==5` verified. Skips cleanly without Ollama (CI). **Gates**: Spec PASS 14/14 (general-178, scripted-probe verified). Quality Approved with minors (general-179) — F1 + minor-3 + minor-5 discharged in `ced5768`, red-green proven. Suite 495 → **502 passed + 84 subtests** (E2E adds 1 when Ollama live). Canary `P0-05 NATIVE TOOLS CANARY PASSED` registered; henxels exit 0. **Follow-ups**: streak persistence across approval pauses (pending_state extension — #48 seam); read-side denial text symmetry; OllamaChatTransport keep_alive option; 13 pinned num_ctx sites; hook_engine.fire absence (pre-existing).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: conductor/rune#21