-
Notifications
You must be signed in to change notification settings - Fork 3
feat(decider): compile deciders to WASM/WIT components #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yordis
wants to merge
39
commits into
main
Choose a base branch
from
yordis/decider-wasm-wit-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8,824
−351
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
b552b13
feat(decider): compile deciders to WASM/WIT components
yordis f03be96
Merge remote-tracking branch 'origin/main' into yordis/decider-wasm-w…
yordis b22ead0
ci(decider): keep feature-build guards green under coverage and flaky…
yordis cb887c1
fix(decider-sim): scan the whole component WIT for imports
yordis 1af84c9
fix(decider-test): honor `then.rejected: false` in the YAML runner
yordis e1c83cc
test(decider-macros): make the bundle event-mismatch guard effective
yordis 048d3c7
Merge remote-tracking branch 'origin/main' into yordis/decider-wasm-w…
yordis 3d757f3
fix(decider): surface invalid snapshot loads and assert error expecta…
yordis 8156f88
test(decider): exclude the wasm-guest pipeline from the host coverage…
yordis 49ee4be
test(decider): restrict host coverage ignores to generated proto
yordis 0f0260c
fix(decider): preserve domain rejection codes across the wasm bridge
yordis eb8633b
test(decider): assert distinct domain rejection code in sim suite
yordis 898b39b
test(decider): restore wasm-guest coverage exclusions to satisfy the …
yordis ad83a17
test(scheduler): raise host coverage above the 95% gate
yordis 05c2b36
fix(decider): reject bundles with mismatched state schema versions
yordis b71f869
fix(decider): compare sim events by decoded meaning not raw proto bytes
yordis dedb793
Merge remote-tracking branch 'origin/main' into yordis/decider-wasm-w…
yordis 8824e3d
style(decider): apply rustfmt to sim event-comparison tests
yordis 374f474
fix(decider): reject bundles with mismatched module or version
yordis 7e85e32
refactor(proto): drop Command suffix from schedules v1 command messages
yordis 9c31f11
fix(decider): satisfy repo dylint policy for new test modules
yordis 3e76c69
refactor(decider): remove the light example decider and spike
yordis 21a0e9f
chore(coverage): scope codegen ignore to generated sources only
yordis b5a922a
ci(rust): manage wasm tool installs via mise in wasm-decider job
yordis e92ad51
refactor(decider): rename components dir to wasm-components
yordis 9885405
docs(decider): track only outstanding WASM work
yordis 64f4f3b
ci(rust): install wasm32 target serially to avoid rustup download race
yordis 935f288
fix(decider-test): harden YAML codec against silent test drift
yordis da37884
refactor(decider-guest): keep bridge errors typed to the WIT boundary
yordis 10eabb5
refactor(decider-sim): type sim errors and fail closed on bad input
yordis 7762ad6
fix(scheduler-domain): keep value objects validated in the guest build
yordis 9b93371
fix(scheduler-domain): reject malformed wire input at the domain boun…
yordis fc41488
Merge remote-tracking branch 'origin/main' into yordis/decider-wasm-w…
yordis d5da8e9
fix(decider-guest): skip out-of-set events in guest evolve to match n…
yordis 6f32784
ci(rust): satisfy env-access lint and scope host coverage to host code
yordis 4f6a638
fix(decider-guest): reject overflowing 10-byte snapshot varints
yordis da365d7
chore(rust): sync Cargo.lock for trogon-std sim dependency
yordis c017fde
test(decider): satisfy dylint policies and lift host coverage over th…
yordis 54cb9e4
fix(proto): tag guest snapshots with the native snapshot type name
yordis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # WASM Decider — Remaining Work | ||
|
|
||
| Goal: deciders compile to WASM components (WIT-defined interface) so they can be | ||
| deployed/distributed independently of the host runtime. | ||
|
|
||
| v1 (M0 spike + M1 YAML test runner + scheduler WASM bundle) is **complete and merged**. | ||
| Design discovery, decisions, benchmarks, and the v1 implementation log have been removed — | ||
| they live in git history. What follows is only the work that has **not** been done. | ||
|
|
||
| ## Deferred past v1 (P2) | ||
|
|
||
| - [ ] **Typed cross-language codec + proto→WIT emitter.** Publish a per-stream-type codec | ||
| library component (`encode`/`decode` of version-faithful typed events) with WIT types | ||
| generated from the same proto source (Nth codegen target beside Rust/Elixir). Must map | ||
| proto open enums → WIT closed variant with an explicit `unknown` case; handle field | ||
| presence, maps, well-known types, recursion. v1 cross-language consumers decode bytes | ||
| with their own native proto library instead. | ||
| - [ ] **Platform service.** Host service embedding wasmtime: NATS command subjects in, | ||
| JetStream persistence (replay/OCC/snapshots host-owned), components pulled from a | ||
| registry. Untrusted-ready: fuel/epoch limits, memory caps, per-execution timeouts, | ||
| instance isolation. | ||
| - [ ] **Registry / OCI distribution.** PR → CI builds artifact → registry → platform pulls | ||
| by digest (digest pinning from the start; signing/provenance later). | ||
| - [ ] **Browser jco host.** jco-transpiled components running in-browser for unit testing | ||
| and AI-sandbox simulation; reuse the in-memory sim host contract. | ||
| - [ ] **`Decision::Act` support.** Currently v1 is events-only (scheduler never uses `Act`). | ||
| If needed, extend `decide`'s return with a variant for host-driven iteration — additive, | ||
| does not break events-only modules. | ||
| - [ ] **StateModel / Command split (optional refactor).** Split the fused `Decider` trait | ||
| into `StateModel` (State/Event/initial_state/evolve) + `Command` (decide), so bundle | ||
| state-agreement becomes a type fact instead of macro-emitted bounds. | ||
|
|
||
| ## Ideas (unscheduled) | ||
|
|
||
| - [ ] Expose the sim host as an MCP tool (via mcp-nats) so agents can load/test/simulate | ||
| deciders over the wire. | ||
| - [ ] Conformance gate at registry upload: run the YAML given/when/then suites on push. |
17 changes: 17 additions & 0 deletions
17
proto/trogonai/scheduler/schedules/v1/create_schedule.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| edition = "2024"; | ||
|
|
||
| package trogonai.scheduler.schedules.v1; | ||
|
|
||
| import "trogonai/scheduler/schedules/v1/delivery.proto"; | ||
| import "trogonai/scheduler/schedules/v1/message.proto"; | ||
| import "trogonai/scheduler/schedules/v1/schedule.proto"; | ||
| import "trogonai/scheduler/schedules/v1/schedule_status.proto"; | ||
|
|
||
| // Wire command to create a schedule stream. | ||
| message CreateSchedule { | ||
| string schedule_id = 1 [features.field_presence = LEGACY_REQUIRED]; | ||
| ScheduleStatus status = 2 [features.field_presence = LEGACY_REQUIRED]; | ||
| Schedule schedule = 3 [features.field_presence = LEGACY_REQUIRED]; | ||
| Delivery delivery = 4 [features.field_presence = LEGACY_REQUIRED]; | ||
| Message message = 5 [features.field_presence = LEGACY_REQUIRED]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| edition = "2024"; | ||
|
|
||
| package trogonai.scheduler.schedules.v1; | ||
|
|
||
| message PauseSchedule { | ||
| string schedule_id = 1 [features.field_presence = LEGACY_REQUIRED]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| edition = "2024"; | ||
|
|
||
| package trogonai.scheduler.schedules.v1; | ||
|
|
||
| message RemoveSchedule { | ||
| string schedule_id = 1 [features.field_presence = LEGACY_REQUIRED]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| edition = "2024"; | ||
|
|
||
| package trogonai.scheduler.schedules.v1; | ||
|
|
||
| message ResumeSchedule { | ||
| string schedule_id = 1 [features.field_presence = LEGACY_REQUIRED]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,21 @@ | ||
| [alias] | ||
| # Exclude sources the host coverage run cannot meaningfully measure: | ||
| # - Codegen output (proto/semconv `src/gen`) is not hand-authored. | ||
| # - The WASM decider guest (`trogon-decider-guest-sdk` glue + `wasm-components/*`) | ||
| # executes inside the component, so host `llvm-cov` never instruments it; its | ||
| # behavior is covered by the sim host integration tests and the YAML conformance | ||
| # suite instead. | ||
| # - `trogon-decider-test` is the conformance CLI / test harness, not shipped logic. | ||
| cov = [ | ||
| "llvm-cov", | ||
| "--all-features", | ||
| "--workspace", | ||
| "--ignore-filename-regex", | ||
| "crates/(trogonai-proto|trogon-semconv)/src/gen/.*", | ||
| "crates/(trogonai-proto|trogon-semconv)/src/gen/.*|crates/trogon-decider-guest-sdk/.*|wasm-components/.*|cli/trogon-decider-test/.*", | ||
| ] | ||
|
|
||
| [target.wasm32-wasip2] | ||
| rustflags = ['--cfg', 'getrandom_backend="unsupported"'] | ||
|
|
||
| [target.wasm32-unknown-unknown] | ||
| rustflags = ['--cfg', 'getrandom_backend="unsupported"'] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.