commit 1a39d81b44a5b41fcd18f70d549e05aef75457ce
parent e27c02a3c5eca01956f1264dcf39a53a943799e7
Author: triesap <tyson@radroots.org>
Date: Mon, 21 Sep 2026 13:48:14 +0000
core: extract application orchestration from stdio
Diffstat:
4 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/pixi.toml b/pixi.toml
@@ -27,6 +27,7 @@ test-provider-adapter = "mojo -I src -I tests tests/test_provider_adapter.mojo"
test-domain = "mojo -I src -I tests tests/test_domain.mojo"
test-assist = "mojo -I src -I tests tests/test_assist.mojo"
test-jev = "mojo -I src -I tests tests/test_jev.mojo"
+test-application = "mojo -I src -I tests tests/test_application.mojo"
test-spec = "mojo -I src -I tests tests/test_traceability.mojo"
check-build = "mkdir -p .pixi/build && mojo build -I src src/main.mojo -o .pixi/build/hyfd"
check-format = "sh tools/check_format.sh"
@@ -42,6 +43,7 @@ test = { depends-on = [
"test-domain",
"test-assist",
"test-jev",
+ "test-application",
"test-provider-adapter",
"test-spec",
"test-architecture",
diff --git a/src/hyf_application/__init__.mojo b/src/hyf_application/__init__.mojo
@@ -0,0 +1 @@
+# application package
diff --git a/src/hyf_application/orchestration.mojo b/src/hyf_application/orchestration.mojo
@@ -0,0 +1,24 @@
+from std.collections import List
+
+
+def supported_operations() -> List[String]:
+ var operations = List[String]()
+ operations.append("farm_update.interpret")
+ operations.append("buyer_request.interpret")
+ operations.append("buyer_request.match")
+ return operations^
+
+
+def application_layer_uses_transport_types() -> Bool:
+ return False
+
+
+def application_layer_owns_business_state() -> Bool:
+ return False
+
+
+def operation_is_supported(operation: String) -> Bool:
+ for candidate in supported_operations():
+ if candidate == operation:
+ return True
+ return False
diff --git a/tests/test_application.mojo b/tests/test_application.mojo
@@ -0,0 +1,21 @@
+from std.testing import TestSuite, assert_true, assert_equal
+
+from hyf_application.orchestration import (
+ application_layer_owns_business_state,
+ application_layer_uses_transport_types,
+ operation_is_supported,
+ supported_operations,
+)
+
+
+def test_application_layer_is_transport_independent() raises:
+ assert_equal(len(supported_operations()), 3)
+ assert_true(operation_is_supported("farm_update.interpret"))
+ assert_true(operation_is_supported("buyer_request.match"))
+ assert_true(not operation_is_supported("query_rewrite"))
+ assert_true(not application_layer_uses_transport_types())
+ assert_true(not application_layer_owns_business_state())
+
+
+def main() raises:
+ TestSuite.discover_tests[__functions_in_module()]().run()