Skip to content

chore: rename artifact worker to spec-to-worker#12

Merged
rohitg00 merged 1 commit into
mainfrom
rename-spec-to-worker
May 14, 2026
Merged

chore: rename artifact worker to spec-to-worker#12
rohitg00 merged 1 commit into
mainfrom
rename-spec-to-worker

Conversation

@rohitg00

@rohitg00 rohitg00 commented May 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • rename the worker, binary, package, and public function surface from artifact-worker to spec-to-worker
  • update README and research notes to describe the OpenAPI/MCP spec-to-worker path
  • update Rust type names, metadata schema, user-agent strings, tests, and worker manifest
  • keep the automatic conversion behavior unchanged: OpenAPI or MCP input becomes triggerable iii functions through HTTP invocation
  • align with feat(engine): expose generated HTTP functions as worker groups iii-hq/iii#1635 so generated sources appear externally as normal worker groups with normal triggerable functions

Validation

  • cargo fmt --all -- --check
  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo run --bin spec-to-worker -- --help
  • git diff --check
  • stale-name scan: no artifact, Artifact, or ARTIFACT matches outside ignored target/ and local upstream/

E2E With Current Engine PR

Using a generic local fixture, not Context7-specific code:

  • OpenAPI convert registered generic_openapi::getecho and generic_openapi::createpet
  • OpenAPI generated functions returned fixture responses through iii trigger
  • MCP HTTP convert registered generic_mcp_http::search_docs and generic_mcp_http::read_doc
  • MCP HTTP generated function returned fixture tools/call content through iii trigger
  • MCP stdio convert registered generic_mcp_stdio::stdio_search and generic_mcp_stdio::stdio_read
  • MCP stdio generated function returned fixture tools/call content through iii trigger
  • engine::workers::list showed generic-openapi-worker, generic-mcp-http-worker, and generic-mcp-stdio-worker as normal engine-runtime worker groups
  • public worker/function payloads did not expose virtual_worker, virtual:*, metadata.iii, or isolation: "virtual"
  • process check showed only the real spec-to-worker worker and the test fixture server; no generated worker processes were started

Notes

The paired iii engine PR is iii-hq/iii#1635. That PR provides the internal routing needed for generated sources while callers and other workers see ordinary worker/function shapes.

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR comprehensively renames the artifact-worker crate to spec-to-worker across project configuration, public API types, worker registration, conversion logic, MCP protocol handling, and documentation. The conversion entrypoint and virtual worker registration flow remain functionally similar but now use spec-oriented naming, error types, and metadata structures.

Changes

Worker Identity and Type System Rename

Layer / File(s) Summary
Project identity and configuration rename
Cargo.toml, iii.worker.yaml, src/bin/spec-to-worker.rs
Package, library crate, and binary target names changed from artifact-worker to spec-to-worker; worker configuration and binary entrypoint updated accordingly.
Core type system and public API
src/lib.rs
Error enum renamed from ArtifactError to SpecToWorkerError; Result type alias and conversion input/output structs (ConvertSpecToWorkerInput, SpecToWorkerConversion) renamed; constants updated to WORKER_NAME="spec-to-worker" and SPEC_TO_WORKER_FUNCTION_IDS.

Conversion Registration and Logic

Layer / File(s) Summary
Worker registration and conversion entrypoint
src/lib.rs
register_spec_to_worker_primitives registers spec-to-worker::convert function; convert_spec_to_worker_for_iii implements the conversion entrypoint with input trimming/validation and SpecSource construction.
OpenAPI virtual worker registration
src/lib.rs
register_openapi_virtual_worker and openapi_virtual_functions updated to handle OpenAPI discovery and registration with spec-oriented function ID generation and metadata.
MCP virtual worker discovery and registration
src/lib.rs
register_mcp_virtual_worker, mcp_discovered_virtual_functions, and mcp_named_virtual_functions handle MCP spec discovery, tool enumeration, and virtual function wiring with spec-based function ID uniqueness.

Protocol and Transport Handling

Layer / File(s) Summary
MCP transport and protocol handling
src/lib.rs
mcp_transport_from_spec parses transport type; mcp_list_tools discovers tools; MCP initialize, JSON-RPC, and stdio handling updated with SpecToWorkerError mapping and spec-specific clientInfo/User-Agent strings.
HTTP and bridge infrastructure
src/lib.rs
HTTP fetching and OpenAPI parsing updated for spec error messages; bridge registry and HTTP handler (register_virtual_worker) serve virtual functions with spec-oriented error codes; virtual HTTP sending uses spec-to-worker/0.1 User-Agent.
Metadata and helper functions
src/lib.rs
spec_to_worker_metadata produces spec-shaped JSON; name inference and slugification defaults changed to spec-oriented values.

Documentation and Tests

Layer / File(s) Summary
Documentation updates
README.md, docs/research-note.md
Examples and descriptions updated to use spec-to-worker::convert; conversion contract section rewritten for spec discovery/registration flow; metadata JSON examples use spec key instead of artifact.
Test suite migration
tests/rust_core.rs
All tests migrated to spec_to_worker surface; function IDs, worker metadata, and conversion calls updated; error assertions and behavior tests reflect spec-oriented error messages and replacement semantics.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • iii-experimental/artifact-worker#9: Earlier worker-identity rename that this PR's spec-to-worker naming update builds upon, sharing the same crate and function identity wiring patterns.
  • iii-experimental/artifact-worker#6: Added the artifact::convert worker entrypoint and MCP-first SourceType conversion plumbing that this PR refactors and renames to the spec-to-worker surface.

Poem

🐇 A worker changes its name,
From artifacts to specs—the same,
The paths all flow with OpenAPI grace,
While MCP tools find their place,
And bridges glow in bytes' embrace! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.15% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: renaming the artifact worker to spec-to-worker across all codebase components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/lib.rs (1)

221-223: ⚡ Quick win

Use the function ID constant in registration to avoid drift.

SPEC_TO_WORKER_FUNCTION_IDS is already the source of truth, but registration still hardcodes the ID literal.

Proposed diff
     vec![iii.register_function(
         RegisterFunction::new(
-            "spec-to-worker::convert",
+            SPEC_TO_WORKER_FUNCTION_IDS[0],
             move |input: ConvertSpecToWorkerInput| {
                 convert_spec_to_worker_for_iii(&convert_iii, input)
             },
         )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib.rs` around lines 221 - 223, The registration currently hardcodes the
function ID string "spec-to-worker::convert"; replace that literal with the
central constant SPEC_TO_WORKER_FUNCTION_IDS (or the appropriate entry within
that constant if it is a map/struct) when calling RegisterFunction::new so the
registration uses the canonical ID; update the RegisterFunction::new invocation
that creates the closure (the one taking ConvertSpecToWorkerInput) to reference
SPEC_TO_WORKER_FUNCTION_IDS instead of the hardcoded string.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lib.rs`:
- Around line 221-223: The registration currently hardcodes the function ID
string "spec-to-worker::convert"; replace that literal with the central constant
SPEC_TO_WORKER_FUNCTION_IDS (or the appropriate entry within that constant if it
is a map/struct) when calling RegisterFunction::new so the registration uses the
canonical ID; update the RegisterFunction::new invocation that creates the
closure (the one taking ConvertSpecToWorkerInput) to reference
SPEC_TO_WORKER_FUNCTION_IDS instead of the hardcoded string.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 59fa04e4-7e71-4eb5-adb9-0f3b55292dac

📥 Commits

Reviewing files that changed from the base of the PR and between c04dcb0 and 419e700.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • Cargo.toml
  • README.md
  • docs/research-note.md
  • iii.worker.yaml
  • src/bin/spec-to-worker.rs
  • src/lib.rs
  • tests/rust_core.rs

@rohitg00 rohitg00 merged commit 40b44d4 into main May 14, 2026
1 check passed
@rohitg00 rohitg00 deleted the rename-spec-to-worker branch May 14, 2026 08:31
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