Commit 98bceb8
committed
feat(routing): per-client grants, multi-FS bindings, capability-branched resolver
Replaces the resolver's permissive Tier-2 fallback (which silently routed
unbound sessions through the default Space's Default FeatureSet) with a
capability-branched four-tier model. Roots-capable sessions route via
WorkspaceBinding or pend; rootless clients route via per-client grants
restored from the pre-resolver-v2 design; everything else denies.
Resolver (crates/mcpmux-gateway/src/services/feature_set_resolver.rs):
Tier 1 roots reported + binding match -> binding.feature_set_ids
Tier 1b roots reported + no binding -> Deny + WorkspaceNeedsBinding
Tier 1c declared roots, none yet -> PendingRoots (empty)
Tier 2 client declared rootless -> client_grants for (client, space)
Tier 3 no signal -> Deny
ResolvedFeatureSet now carries Vec<String> so multi-FS bindings and
multi-grant clients fan into a single union allow set. fingerprint()
gives change-detection a stable key.
Storage:
009 restore client_grants table (junction client_id x space x FS)
010 inbound_clients.reports_roots
011 inbound_clients.roots_capability_known (tri-state UI)
012 workspace_binding_feature_sets junction; recreate workspace_bindings
without the legacy single feature_set_id column
013 feature_set_type 'default' -> 'starter'
014 rewrite the auto-seeded Starter FS's stale 'Default' / 'fallback
feature set for this space' copy (only when row still matches the
seed exactly so renamed FSes are untouched)
Notifier (mcp_notifier.rs):
client_peers -> sessions, keyed on mcp-session-id. Fanout consults the
same FeatureSetResolverService the request handlers use, so a session
redirected to a non-default Space via a binding is matched correctly.
New ClientGrantChanged DomainEvent wired through the GrantService write
path; per-peer push covers grant edits without a reconnect.
Capability:
on_initialized stamps SessionRootsRegistry::set_roots_capable for every
session and InboundClientRepository::mark_roots_capability sticky-
positively for every client (a one-off rootless reconnect from a
normally-rooted client doesn't bounce the badge). The Clients UI
hides the per-client grants section entirely except for explicitly-
rootless clients.
Multi-FS bindings:
WorkspaceBinding.feature_set_id (single) -> feature_set_ids: Vec<String>.
Tauri create/update commands accept arrays, validate non-empty, and
dedup while preserving operator-chosen order. Inspector DTO surfaces
the full FS list (binding_id + feature_sets[]); Workspaces page
multi-select picker with always-on search and max-h scrolling. Same
search treatment ported to the per-client grants list.
Default -> Starter rename (FeatureSetType, copy, helper):
The 'Default' name implied a routing fallback that no longer exists.
Renamed throughout (DB + enum + helpers + UI). The id prefix
fs_default_<space> is preserved for FK stability. parse('default')
still resolves to Starter so a stale read during the migration window
is harmless; isStarterFeatureSet() helper accepts both.
Verified: cargo check --workspace, cargo clippy --workspace --all-targets
-- -D warnings, pnpm typecheck.
Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>1 parent a313ffd commit 98bceb8
46 files changed
Lines changed: 2549 additions & 624 deletions
File tree
- apps/desktop
- src-tauri/src
- commands
- src
- features
- clients
- featuresets
- workspaces
- lib/api
- crates
- mcpmux-core/src
- domain
- repository
- mcpmux-gateway/src
- consumers
- mcp
- oauth
- server
- services
- meta_tools
- mcpmux-storage/src
- migrations
- repositories
- tests/rust
- src
- tests
- database
- integration
- streamable_http
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
688 | 702 | | |
689 | 703 | | |
690 | 704 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
| 695 | + | |
| 696 | + | |
695 | 697 | | |
696 | 698 | | |
697 | 699 | | |
| |||
762 | 764 | | |
763 | 765 | | |
764 | 766 | | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
765 | 781 | | |
766 | 782 | | |
767 | 783 | | |
| |||
825 | 841 | | |
826 | 842 | | |
827 | 843 | | |
| 844 | + | |
| 845 | + | |
828 | 846 | | |
829 | 847 | | |
830 | 848 | | |
| |||
972 | 990 | | |
973 | 991 | | |
974 | 992 | | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
0 commit comments