Define typed application service boundaries #19

Merged
JayKobe6k merged 2 commits from issue-2-application-services into main 2026-09-04 00:49:21 +00:00
Owner

Summary

  • add typed requests, results, and errors for index creation, updates, search, and lineage
  • define frontend-facing use-case interfaces and application-owned adapter ports
  • document the application boundary and test typed dispatch/error propagation with in-memory fakes

Tests

  • nix develop --command cargo fmt --all -- --check
  • nix develop --command cargo lint
  • nix develop --command cargo test --all-targets --all-features
  • nix develop --command cargo doc --no-deps --all-features

Closes #2

## Summary - add typed requests, results, and errors for index creation, updates, search, and lineage - define frontend-facing use-case interfaces and application-owned adapter ports - document the application boundary and test typed dispatch/error propagation with in-memory fakes ## Tests - `nix develop --command cargo fmt --all -- --check` - `nix develop --command cargo lint` - `nix develop --command cargo test --all-targets --all-features` - `nix develop --command cargo doc --no-deps --all-features` Closes #2
Define typed application service boundaries
All checks were successful
Validate / Formatting, linting, and tests (push) Successful in 1m50s
Validate / Formatting, linting, and tests (pull_request) Successful in 1m59s
dc2b14e815
JayKobe6k left a comment

Found two actionable issues in the application service boundary.

Found two actionable issues in the application service boundary.
@ -0,0 +989,4 @@
&self,
request: CreateIndexRequest,
) -> Result<IndexResult, ApplicationError> {
self.create.create_index(request)
Author
Owner

[P1] This facade only delegates to an injected CreateIndexUseCase, but the application module provides no concrete service that orchestrates the source, compilation, parser, analysis, repository, and catalog ports; the tests substitute a fake for the entire use case instead of exercising application behavior through fake ports. As a result, none of the documented indexing, refresh, or query workflows is executable through the shared application layer. Please implement the application-owned services over the port traits and test those services with in-memory port fakes.

[P1] This facade only delegates to an injected `CreateIndexUseCase`, but the application module provides no concrete service that orchestrates the source, compilation, parser, analysis, repository, and catalog ports; the tests substitute a fake for the entire use case instead of exercising application behavior through fake ports. As a result, none of the documented indexing, refresh, or query workflows is executable through the shared application layer. Please implement the application-owned services over the port traits and test those services with in-memory port fakes.
@ -0,0 +1231,4 @@
///
/// Returns the adapter's typed error when the catalog cannot be updated
/// atomically.
fn register_index(&self, index: &ResolvedIndex) -> Result<(), Self::Error>;
Author
Owner

[P1] The catalog port can read the active revision but cannot activate a newly built revision or perform the required compare-and-swap. Any concrete index or refresh service would have to bypass this boundary to publish atomically, which breaks the application-port architecture and permits lost updates. Please add a typed activation operation carrying the expected and replacement revisions, with an explicit conflict result.

[P1] The catalog port can read the active revision but cannot activate a newly built revision or perform the required compare-and-swap. Any concrete index or refresh service would have to bypass this boundary to publish atomically, which breaks the application-port architecture and permits lost updates. Please add a typed activation operation carrying the expected and replacement revisions, with an explicit conflict result.
Implement application service orchestration
All checks were successful
Validate / Formatting, linting, and tests (pull_request) Successful in 1m57s
Validate / Formatting, linting, and tests (push) Successful in 9m4s
e190aef566
Author
Owner

Review comment #922: Fixed in e190aef. The catalog boundary now plans immutable descriptors and activates them with a typed compare-and-swap request whose conflict is an explicit application outcome. Fake-port tests cover stale activation after persistence. Validation: full formatting, lint, all-target/all-feature tests, and rustdoc passed.

Review comment #922: Fixed in e190aef. The catalog boundary now plans immutable descriptors and activates them with a typed compare-and-swap request whose conflict is an explicit application outcome. Fake-port tests cover stale activation after persistence. Validation: full formatting, lint, all-target/all-feature tests, and rustdoc passed.
Author
Owner

Review comment #920: Fixed in e190aef. Added concrete application-owned create/update/search/lineage services that orchestrate typed ports, plus fake-port sequencing and failure tests. Validation: nix develop --command cargo fmt --all -- --check, cargo lint, cargo test --all-targets --all-features, and cargo doc --no-deps --all-features.

Review comment #920: Fixed in e190aef. Added concrete application-owned create/update/search/lineage services that orchestrate typed ports, plus fake-port sequencing and failure tests. Validation: `nix develop --command cargo fmt --all -- --check`, `cargo lint`, `cargo test --all-targets --all-features`, and `cargo doc --no-deps --all-features`.
Sign in to join this conversation.
No description provided.