Commit 9587f8c
authored
feat(federation): workspace-scoped vault export + mimir_federate tool (#177)
Roadmap Phase 2, Week 7-9: Cross-Workspace Federation (v1.2.0).
Three deliverables:
1. Workspace-scoped vault_export: optional workspace_hash param filters export
to a single workspace. Vault .md files now include workspace_hash + agent_id
in frontmatter for roundtrip fidelity through vault_import.
2. Last-write-wins merge: vault_import reads workspace_hash + agent_id from
frontmatter and passes them through to remember(), which handles idempotent
INSERT OR REPLACE by (category, key). Imported entities carry the source
identity.
3. New mimir_federate MCP tool: exports entities from from_workspace to a temp
vault, remaps workspace_hash in the .md files to to_workspace, then
vault_imports into the target scope. Returns export/remap/import counts.
Registered with inputSchema, outputSchema, annotations in mcp.rs.
E2E verified: 2 entities in w1 federated to w2, recall in w2 returns both
with correct workspace_hash. 31 tests passing.
Known caveat: dedup-by-content in remember() can merge near-identical entity
bodies even across workspaces — use distinct content for federated entities.1 parent e8b1def commit 9587f8c
3 files changed
Lines changed: 140 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2072 | 2072 | | |
2073 | 2073 | | |
2074 | 2074 | | |
2075 | | - | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
2076 | 2080 | | |
2077 | 2081 | | |
2078 | 2082 | | |
2079 | 2083 | | |
2080 | 2084 | | |
2081 | 2085 | | |
2082 | | - | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
2083 | 2095 | | |
2084 | | - | |
2085 | | - | |
2086 | | - | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
2087 | 2101 | | |
2088 | 2102 | | |
2089 | 2103 | | |
| |||
2096 | 2110 | | |
2097 | 2111 | | |
2098 | 2112 | | |
2099 | | - | |
2100 | | - | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
2101 | 2117 | | |
2102 | 2118 | | |
2103 | 2119 | | |
| |||
2116 | 2132 | | |
2117 | 2133 | | |
2118 | 2134 | | |
| 2135 | + | |
| 2136 | + | |
2119 | 2137 | | |
2120 | 2138 | | |
2121 | 2139 | | |
| |||
2142 | 2160 | | |
2143 | 2161 | | |
2144 | 2162 | | |
| 2163 | + | |
| 2164 | + | |
2145 | 2165 | | |
2146 | 2166 | | |
2147 | 2167 | | |
| |||
2156 | 2176 | | |
2157 | 2177 | | |
2158 | 2178 | | |
| 2179 | + | |
| 2180 | + | |
2159 | 2181 | | |
2160 | 2182 | | |
2161 | 2183 | | |
| |||
2286 | 2308 | | |
2287 | 2309 | | |
2288 | 2310 | | |
| 2311 | + | |
| 2312 | + | |
2289 | 2313 | | |
2290 | 2314 | | |
2291 | 2315 | | |
| |||
2338 | 2362 | | |
2339 | 2363 | | |
2340 | 2364 | | |
2341 | | - | |
2342 | | - | |
| 2365 | + | |
| 2366 | + | |
2343 | 2367 | | |
2344 | 2368 | | |
2345 | 2369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
1599 | 1647 | | |
1600 | 1648 | | |
1601 | 1649 | | |
| |||
1659 | 1707 | | |
1660 | 1708 | | |
1661 | 1709 | | |
| 1710 | + | |
1662 | 1711 | | |
1663 | 1712 | | |
1664 | 1713 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| 741 | + | |
| 742 | + | |
741 | 743 | | |
742 | 744 | | |
743 | 745 | | |
| |||
755 | 757 | | |
756 | 758 | | |
757 | 759 | | |
758 | | - | |
| 760 | + | |
759 | 761 | | |
760 | 762 | | |
761 | 763 | | |
| |||
933 | 935 | | |
934 | 936 | | |
935 | 937 | | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
936 | 993 | | |
937 | 994 | | |
938 | 995 | | |
| |||
0 commit comments