Skip to content

feat: implement threading model declaration host function (US-118)#104

Merged
tervezo-ai[bot] merged 1 commit intomainfrom
feat/implement-threading-model-declaration-host-function-krt42xr96li73r05ad5ez1t2
Mar 13, 2026
Merged

feat: implement threading model declaration host function (US-118)#104
tervezo-ai[bot] merged 1 commit intomainfrom
feat/implement-threading-model-declaration-host-function-krt42xr96li73r05ad5ez1t2

Conversation

@tervezo-ai
Copy link
Copy Markdown
Contributor

@tervezo-ai tervezo-ai bot commented Mar 13, 2026

Summary

  • Created ThreadingHost struct in crates/warpgrid-host/src/threading/host.rs following the established shim pattern (signals, filesystem, dns)
  • Converted threading.rs stub to module directory (threading/mod.rs + threading/host.rs)
  • Updated HostState Host trait impl in engine.rs with:
    • Immutability: Returns Err("threading model already declared") on double-call
    • Parallel warning: tracing::warn! when ParallelRequired is declared
    • Cooperative logging: tracing::info! when Cooperative is declared
  • ThreadingHost provides queryable state via threading_model() getter

Test coverage

  • 8 unit tests in threading/host.rs: construction, both enum variants, double-declaration error, model preservation
  • 2 new tests in engine.rs: threading_model_parallel_required_succeeds, threading_model_double_declaration_errors
  • All 355 unit tests pass; cargo clippy clean

Test plan

  • cargo check -p warpgrid-host compiles
  • cargo test -p warpgrid-host — 355 tests pass
  • cargo clippy -p warpgrid-host -- -D warnings — no warnings

View implementation in Tervezo

Add ThreadingHost struct with immutability enforcement, parallel-required
warning, cooperative logging, and queryable state. Update HostState impl
to reject double declarations and emit appropriate log levels per model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tervezo-ai tervezo-ai bot merged commit 31fa223 into main Mar 13, 2026
3 of 10 checks passed
tervezo-ai bot pushed a commit that referenced this pull request Mar 13, 2026
Reviewed and merged 6 PRs, closed 1 as superseded:
- PR #103: fix schedule script URL prefix and non-JSON responses
- PR #1: wasmtime 41.0.3 → 41.0.4 security bump
- PR #99: Postgres database proxy integration tests (US-114)
- PR #101: signal handling integration tests (US-110)
- PR #104: threading model declaration host function (US-118)
- PR #102: MySQL and Redis Wasm integration tests (US-117)
- PR #100: closed as superseded by #103

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tervezo-ai bot pushed a commit that referenced this pull request Mar 13, 2026
PRs #101 (signals) and #104 (threading) introduced a merge conflict that
GitHub's auto-merge didn't catch: HostState's `signal_queue: Vec<_>` field
was renamed to `signals: SignalsHost` by #101, but #104's tests still used
the old field name, preventing compilation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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