Skip to content

fix(registry): expand local tool registry mode enum — parallel to PR #102#104

Merged
klappy merged 1 commit intomainfrom
fix/tool-registry-mode-enum-writing-modes
Apr 17, 2026
Merged

fix(registry): expand local tool registry mode enum — parallel to PR #102#104
klappy merged 1 commit intomainfrom
fix/tool-registry-mode-enum-writing-modes

Conversation

@klappy
Copy link
Copy Markdown
Owner

@klappy klappy commented Apr 17, 2026

Parallel fix to PR #102 for the local MCP server / CLI surface

Bugbot on PR #103 (Low severity) correctly flagged that PR #102's schema fix only updated the Cloudflare Worker surface. The local tool registry at src/core/tool-registry.js drives:

  • Local MCP server (src/mcp/server.js)
  • CLI (src/cli.js)

…and had the same 3-mode enum hardcoded at two sites. This PR ports the same expansion to those two sites, with description text matching PR #102's style.

What changes

  • src/core/tool-registry.js line 47-55: unified oddkit tool mode enum
  • src/core/tool-registry.js line 113-121: dedicated oddkit_challenge tool mode enum

Both expand from ["exploration", "planning", "execution"] to the full 9-mode enum. Mode families explained, voice-dump suppression called out in the dedicated-tool description.

Sweep verified

grep -rn '"exploration", "planning", "execution"' src/ workers/ ...
src/core/tool-registry.js:50:          "exploration", "planning", "execution",
src/core/tool-registry.js:117:            "exploration", "planning", "execution",
workers/src/index.ts:171:        "exploration", "planning", "execution",
workers/src/index.ts:240:          "exploration", "planning", "execution",

All 4 hits are the first line of a multi-line 9-mode block. Zero stale 3-mode-only enums remain.

Verification

  • npm run typecheck: clean
  • tests/smoke.sh: 6/6 pass

Why a separate PR

Keeping this isolated so PR #103 can promote cleanly without rebase. Merge order doesn't matter between #103 and this one — they touch independent files (workers surface vs local surface).

Longer-term direction (same as #102 flagged)

Drop the enum entirely and let canon be the validator. Hardcoding mode vocabulary in schema is the same Vodka anti-pattern shape that PR #100 fixed for challenge-detection stop words. Tracked as a follow-up.


Note

Low Risk
Schema/metadata-only change that mainly affects input validation and help text for local MCP/CLI surfaces; low risk aside from potential downstream assumptions about the old 3-value enum.

Overview
Expands the mode input schema in the local tool registry (src/core/tool-registry.js) from exploration/planning/execution to a 9-value enum that also includes writing-lifecycle modes (voice-dump through published-essay).

Updates the mode field descriptions for both the orchestrator tool (oddkit) and the dedicated oddkit_challenge tool to document the two mode families, and notes that voice-dump suppresses all challenge output.

Reviewed by Cursor Bugbot for commit 9c79926. Bugbot is set up for automated code reviews on this repo. Configure here.

Parallels PR #102 which fixed the same enum in workers/src/index.ts.
The local tool registry at src/core/tool-registry.js drives the local
MCP server (src/mcp/server.js) and CLI (src/cli.js) and had the same
3-mode enum, creating a contract divergence between the deployment
surfaces for the same logical API.

Two sites in src/core/tool-registry.js:
- Line 47-55 (unified oddkit tool)
- Line 113-121 (dedicated oddkit_challenge tool)

Both expanded to the full 9-mode enum with description text matching
PR #102's style. Mode families explained, voice-dump suppression called
out in the dedicated tool description.

Sweep verified: grep across src/ and workers/ for the 3-mode string
returns only the first line of each 9-mode block now — zero stale
enums.

Caught by bugbot on PR #103 (the promotion PR for #102). Flagged
appropriately as Low severity (the CF Worker surface is the primary
production path; the local surface is used for dev/CLI). Fixing in a
separate PR so #103 can promote cleanly without rebase.

Verification:
- npm run typecheck: clean
- tests/smoke.sh: 6/6 pass

Longer-term (same as #102 flagged): drop enum entirely and let canon
be the validator. Hardcoding mode vocabulary in schema is the same
Vodka anti-pattern shape challenge stop words used to be.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
oddkit 9c79926 Commit Preview URL

Branch Preview URL
Apr 17 2026, 04:46 PM

@klappy klappy merged commit daa9a96 into main Apr 17, 2026
5 checks passed
@klappy klappy deleted the fix/tool-registry-mode-enum-writing-modes branch April 17, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant