Skip to content

HOK-2358: Wrap workflow commands as native tools#893

Open
timogilvie wants to merge 4 commits into
auto/integrationfrom
task/epic-7-wrap-review-route-expand-and-stage-result-workflow-commands-as-native-tools
Open

HOK-2358: Wrap workflow commands as native tools#893
timogilvie wants to merge 4 commits into
auto/integrationfrom
task/epic-7-wrap-review-route-expand-and-stage-result-workflow-commands-as-native-tools

Conversation

@timogilvie

Copy link
Copy Markdown
Owner

Summary

  • Wraps local Wavemill workflow commands as native runtime tools for review, routing, issue expansion, and stage-result recording.
  • Adds structured success/error results, transcript metadata, and stage-artifact recording so workflow command failures preserve diagnostics.
  • Makes stage-result writes idempotent updates and covers success, failure, and retry behavior with fixtures.
  • Addresses self-review follow-ups for schema docs, UTF-8 truncation, expand_issue deps typing, route_task model-pool passthrough, and import ordering.

Changes

  • shared/lib/native-agent/workflow-tools/command-tools.ts and tests: native wrappers for review_changes, route_task, expand_issue, and write_stage_result.
  • shared/lib/native-agent/workflow-tools/linear-tools.ts and tests: Linear-facing tool execution and shared expand_issue execution surface.
  • shared/lib/native-agent/workflow-tools/contracts.ts, contracts.json, and docs: native workflow tool result/request contracts and schema versioning.
  • shared/lib/native-agent/workflow-tools/dedupe.ts, mutation policy/enforcer/record modules, and fixtures: idempotency, mutation recording, and fixture coverage.
  • shared/lib/linear.ts and shared/lib/linear.test.ts: supporting Linear behavior used by the native wrappers.

Test plan

  • npm test -- --run shared/lib/native-agent/workflow-tools/command-tools.test.ts shared/lib/native-agent/workflow-tools/linear-tools.test.ts shared/lib/native-agent/workflow-tools/contracts.test.ts (expanded to the repo test script; passed shell, unit, custom, smoke, and config suites).
  • node --test shared/lib/native-agent/workflow-tools/command-tools.test.ts shared/lib/native-agent/workflow-tools/contracts.test.ts (68 passed).
  • npm run typecheck (passed: 727 node tests, 47 workflow-router tests, 22 workflow-cost tests).
  • Self-review tool run from the task worktree as required.

Self-review

  • Iteration 1: exited 0, verdict ready; warnings fixed for docs schema version, byte-accurate UTF-8 truncation, and expand_issue dependency typing.
  • Iteration 2: exited 0, verdict ready; warnings fixed for route_task modelsAvailable passthrough and dedupe import ordering.
  • Iteration 3: exited 2 after Claude returned unparsable non-JSON on both attempts; required diagnostics were logged and PR creation proceeded per workflow instructions.
  • No unresolved structured blockers were reported. wm:ready was not added because the final self-review run exited 2, not 0.

Routing

  • Bootstrap route (.initial-route.json): planner claude-opus-4-7 depth medium, coder claude-sonnet-4-6 depth medium, reviewer gpt-5.5, review mode llm; provenance source bootstrap, input kind issue, routed at 2026-06-27T22:20:21Z.
  • Actual planning execution (.planning-result.json): agent claude, model claude-opus-4-7, status completed, notes Plan approved by user, artifact plan.md.
  • Recommended after expansion (.post-expansion-route.json): planner claude-opus-4-7, coder gpt-5.4, reviewer gpt-5.5, routing mode hokusai, provenance source expanded from the task packet.
  • Active remaining route (.routing-complete / .phase-config.json): planning claude on claude-opus-4-7, coding codex on gpt-5.4, review codex on gpt-5.5 in llm mode.
  • No routing.jsonl artifact was present, so runtime execution telemetry lines were not available.

Refs HOK-2358.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant