Skip to content

Add host fetch capability and public plugin export bindings - #7

Merged
paulyhedral merged 3 commits into
developfrom
add-host-fetch-capability
Jul 20, 2026
Merged

paulyhedral merged 3 commits into
developfrom
add-host-fetch-capability

Conversation

@paulyhedral

Copy link
Copy Markdown
Member

Implements the add-host-fetch-capability OpenSpec change.

  • Adds interface host { fetch: func(url: string) -> result<list<u8>, network-failure>; } and wires import host; into world plugin.
  • Bumps INTERFACE_VERSION to 2.0 (breaking — see design.md for the major-vs-minor reasoning).
  • Re-exports the generated Guest trait and export! macro for data-provider (via wit-bindgen's pub_export_macro), and adds a host_fetch wrapper around the generated fetch import.
  • Updates docs/plugin-authoring.md, README.md, CHANGELOG.md.

Closes #6

All local checks pass: cargo build/test --all-features --workspace/test --no-default-features/clippy --all-targets --all-features -- -D warnings/fmt --all -- --check/doc --no-deps (RUSTDOCFLAGS=-D warnings).

No crates.io release needed for Plugins/Bundesliga to consume this — a git dependency on this branch is sufficient until this is reviewed, merged, and released as 0.2.0.

OpenSpec change: openspec/changes/add-host-fetch-capability/proposal.md

Implements the add-host-fetch-capability OpenSpec change.

Adds a `host` WIT interface (`fetch`, reusing errors.network-failure)
and wires it into `world plugin` as an import alongside the existing
`export data-provider`, so a plugin component can no longer
instantiate without a host that supplies network access. Bumps
INTERFACE_VERSION to 2.0 accordingly.

Re-exports the generated `Guest` trait and `export!` macro for the
data-provider interface (via wit-bindgen's pub_export_macro option),
and adds a `host_fetch` wrapper around the generated fetch import, so
a downstream plugin can implement and export the world using this
crate's own canonical types instead of regenerating an incompatible
copy from a vendored WIT file.

BREAKING CHANGE: world plugin now imports `host.fetch`; any component
built against the previous world requires rebuilding, and
INTERFACE_VERSION 1.x manifests are no longer accepted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn
@paulyhedral paulyhedral added the enhancement New feature or request label Jul 20, 2026
@paulyhedral paulyhedral self-assigned this Jul 20, 2026
paulyhedral and others added 2 commits July 19, 2026 22:09
…ates

wit-bindgen's single-arg export!($ty) expands to self::export!($ty
with_types_in self), which only resolves inside this crate. Verified
by cross-compiling a scratch crate against this one for
wasm32-wasip2: the with_types_in form is required downstream, and it
in turn needs the generated exports::fulltime::plugin_api module tree
reachable at the crate root, not just the Guest trait alias pulled
out of it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn
@paulyhedral
paulyhedral marked this pull request as ready for review July 20, 2026 12:52
@paulyhedral
paulyhedral merged commit 8b5090a into develop Jul 20, 2026
5 checks passed
@paulyhedral
paulyhedral deleted the add-host-fetch-capability branch July 20, 2026 12:52
paulyhedral added a commit that referenced this pull request Jul 20, 2026
* Post-merge docs, trusted publishing, and archive define-league-data-contract (#5)

* docs: add badges, CONTRIBUTING, CODE_OF_CONDUCT, and RELEASING

Adds crates.io/docs.rs/CI/license badges to README, a CONTRIBUTING.md
covering dev setup, branching, commit conventions, and the WIT-contract
change process, the org's standard Citizen Code of Conduct, and a
RELEASING.md documenting the prepare-release/tag-release/release pipeline
built earlier (including the CRATES_API_KEY-to-trusted-publishing follow-up).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* chore: switch to crates.io trusted publishing

Trusted publishing is now configured for fulltime-plugin-api on crates.io
(bootstrapped by the v0.1.0 token-based publish). Flips release.yaml to
trusted-publishing: true and updates RELEASING.md; CRATES_API_KEY is no
longer used by the workflow. Marks task 5.2 complete - v0.1.0 is published.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* chore: archive define-league-data-contract, sync baseline specs

All 16 tasks complete: canonical schema, WIT interface, manifest format
implemented and v0.1.0 published to crates.io. Archives the change to
openspec/changes/archive/2026-07-19-define-league-data-contract and syncs
its three delta specs into openspec/specs/ as the initial baseline.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* fix: drop static CHANGELOG title to match git-cliff --prepend behavior

git-cliff --prepend inserts at byte offset 0, ahead of any static content
already in the file — with a hand-written "# Changelog" title at the top,
the v0.1.0 release landed above that title instead of under it, and the
release also lacked a version heading since cliff.toml's body template
didn't render one. Adds the version heading to the body template and drops
the static title (README's CHANGELOG link doesn't need one), matching
dtrpg-sdk.rs's title-less convention, which doesn't hit this because it
never had competing static content at the top to displace.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

* chore: remove local copies of skills/commands available globally in ~/.claude/

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* Add host fetch capability and public plugin export bindings (#7)

* feat!: add host fetch capability and public plugin export bindings

Implements the add-host-fetch-capability OpenSpec change.

Adds a `host` WIT interface (`fetch`, reusing errors.network-failure)
and wires it into `world plugin` as an import alongside the existing
`export data-provider`, so a plugin component can no longer
instantiate without a host that supplies network access. Bumps
INTERFACE_VERSION to 2.0 accordingly.

Re-exports the generated `Guest` trait and `export!` macro for the
data-provider interface (via wit-bindgen's pub_export_macro option),
and adds a `host_fetch` wrapper around the generated fetch import, so
a downstream plugin can implement and export the world using this
crate's own canonical types instead of regenerating an incompatible
copy from a vendored WIT file.

BREAKING CHANGE: world plugin now imports `host.fetch`; any component
built against the previous world requires rebuilding, and
INTERFACE_VERSION 1.x manifests are no longer accepted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* fix: re-export the exports module so export! works from downstream crates

wit-bindgen's single-arg export!($ty) expands to self::export!($ty
with_types_in self), which only resolves inside this crate. Verified
by cross-compiling a scratch crate against this one for
wasm32-wasip2: the with_types_in form is required downstream, and it
in turn needs the generated exports::fulltime::plugin_api module tree
reachable at the crate root, not just the Guest trait alias pulled
out of it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

* chore(release): 0.1.0

---------

Co-authored-by: Paul Schifferer <paul@schifferers.net>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: psw-ci[bot] <300730600+psw-ci[bot]@users.noreply.github.com>
paulyhedral added a commit that referenced this pull request Jul 20, 2026
* Post-merge docs, trusted publishing, and archive define-league-data-contract (#5)

* docs: add badges, CONTRIBUTING, CODE_OF_CONDUCT, and RELEASING

Adds crates.io/docs.rs/CI/license badges to README, a CONTRIBUTING.md
covering dev setup, branching, commit conventions, and the WIT-contract
change process, the org's standard Citizen Code of Conduct, and a
RELEASING.md documenting the prepare-release/tag-release/release pipeline
built earlier (including the CRATES_API_KEY-to-trusted-publishing follow-up).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* chore: switch to crates.io trusted publishing

Trusted publishing is now configured for fulltime-plugin-api on crates.io
(bootstrapped by the v0.1.0 token-based publish). Flips release.yaml to
trusted-publishing: true and updates RELEASING.md; CRATES_API_KEY is no
longer used by the workflow. Marks task 5.2 complete - v0.1.0 is published.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* chore: archive define-league-data-contract, sync baseline specs

All 16 tasks complete: canonical schema, WIT interface, manifest format
implemented and v0.1.0 published to crates.io. Archives the change to
openspec/changes/archive/2026-07-19-define-league-data-contract and syncs
its three delta specs into openspec/specs/ as the initial baseline.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* fix: drop static CHANGELOG title to match git-cliff --prepend behavior

git-cliff --prepend inserts at byte offset 0, ahead of any static content
already in the file — with a hand-written "# Changelog" title at the top,
the v0.1.0 release landed above that title instead of under it, and the
release also lacked a version heading since cliff.toml's body template
didn't render one. Adds the version heading to the body template and drops
the static title (README's CHANGELOG link doesn't need one), matching
dtrpg-sdk.rs's title-less convention, which doesn't hit this because it
never had competing static content at the top to displace.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

* chore: remove local copies of skills/commands available globally in ~/.claude/

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* Add host fetch capability and public plugin export bindings (#7)

* feat!: add host fetch capability and public plugin export bindings

Implements the add-host-fetch-capability OpenSpec change.

Adds a `host` WIT interface (`fetch`, reusing errors.network-failure)
and wires it into `world plugin` as an import alongside the existing
`export data-provider`, so a plugin component can no longer
instantiate without a host that supplies network access. Bumps
INTERFACE_VERSION to 2.0 accordingly.

Re-exports the generated `Guest` trait and `export!` macro for the
data-provider interface (via wit-bindgen's pub_export_macro option),
and adds a `host_fetch` wrapper around the generated fetch import, so
a downstream plugin can implement and export the world using this
crate's own canonical types instead of regenerating an incompatible
copy from a vendored WIT file.

BREAKING CHANGE: world plugin now imports `host.fetch`; any component
built against the previous world requires rebuilding, and
INTERFACE_VERSION 1.x manifests are no longer accepted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

* fix: re-export the exports module so export! works from downstream crates

wit-bindgen's single-arg export!($ty) expands to self::export!($ty
with_types_in self), which only resolves inside this crate. Verified
by cross-compiling a scratch crate against this one for
wasm32-wasip2: the with_types_in form is required downstream, and it
in turn needs the generated exports::fulltime::plugin_api module tree
reachable at the crate root, not just the Guest trait alias pulled
out of it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117XhibDRjfkbNdmmxzqhHn

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

* chore(release): 0.1.1

---------

Co-authored-by: Paul Schifferer <paul@schifferers.net>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: psw-ci[bot] <300730600+psw-ci[bot]@users.noreply.github.com>
paulyhedral added a commit that referenced this pull request Jul 20, 2026
PR #7's squash merge dropped the feat!: prefix, which git-cliff never
saw, so the automated release under-bumped 0.1.1 instead of a proper
minor/major version and produced an empty changelog section for it.
paulyhedral added a commit that referenced this pull request Jul 21, 2026
Sync the data-provider-plugin-api delta (downstream implementation
bindings, versioning policy update) into the main spec, add the new
host-fetch-capability spec, and archive the completed change now that
PR #7 has merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add host fetch capability and public plugin export bindings

1 participant