Skip to content

Commit 94df1e0

Browse files
authored
feat: Add ExportManifest RPC to reconstruct manifest from live state (#1694)
Introduces an ExportManifest RPC on the ManifestHistoryService that queries downstream services for their current resources and assembles a complete Manifest proto. This enables migrating tenants configured via direct gRPC calls into the manifest-first workflow. Key design decisions: - Collector interfaces per service section (instruments, account types, sagas, market data, organizations, internal accounts, operational gateway) allow the export to be assembled incrementally - Sections without live service collectors (valuation_rules, mappings, party_types, payment_rails, seed_data) fall back to the last applied manifest version - Collector errors produce warnings and graceful fallback rather than failing the entire export - Response includes section_sources map documenting data provenance and SHA-256 checksum for content verification - Read-only operation: no mutations, no manifest version created Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>
1 parent 9476493 commit 94df1e0

6 files changed

Lines changed: 1284 additions & 4 deletions

File tree

api/proto/meridian/control_plane/v1/manifest_history_service.proto

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ service ManifestHistoryService {
4747
get: "/v1/manifests/diff"
4848
};
4949
}
50+
51+
// ExportManifest reconstructs a manifest from live service state.
52+
// Queries each downstream service (reference-data, market-information, party,
53+
// operational-gateway, internal-account) for their current resources and
54+
// assembles them into a complete Manifest proto. Used to migrate existing
55+
// tenants (set up via direct gRPC before the manifest-first model) into the
56+
// manifest-first workflow. This is a read-only operation — no mutations and
57+
// no manifest version is created.
58+
rpc ExportManifest(ExportManifestRequest) returns (ExportManifestResponse) {
59+
option (google.api.http) = {
60+
get: "/v1/manifests/export"
61+
};
62+
}
5063
}
5164

5265
// ========================================
@@ -251,3 +264,53 @@ message DiffSummary {
251264
// has_breaking_changes indicates whether any action is a breaking change.
252265
bool has_breaking_changes = 6;
253266
}
267+
268+
// ========================================
269+
// Export Manifest
270+
// ========================================
271+
272+
// ExportManifestRequest requests a manifest reconstructed from live service state.
273+
// All fields are optional filters to control which sections are included.
274+
message ExportManifestRequest {
275+
// include_sections filters which manifest sections to include in the export.
276+
// If empty, all sections are included. Valid values:
277+
// "instruments", "account_types", "valuation_rules", "sagas",
278+
// "market_data", "organizations", "internal_accounts",
279+
// "operational_gateway", "mappings", "party_types", "payment_rails"
280+
repeated string include_sections = 1 [(buf.validate.field).repeated = {
281+
max_items: 20
282+
items: {
283+
string: {
284+
min_len: 1
285+
max_len: 64
286+
}
287+
}
288+
}];
289+
290+
// manifest_version filters the export to match a specific previously applied
291+
// manifest version string. When set, metadata and sections not backed by live
292+
// services (e.g., valuation_rules, seed_data) are sourced from this version.
293+
// When empty, the most recently applied manifest version is used as fallback.
294+
string manifest_version = 2 [(buf.validate.field).string.max_len = 50];
295+
}
296+
297+
// ExportManifestResponse contains the reconstructed manifest and export metadata.
298+
message ExportManifestResponse {
299+
// manifest is the reconstructed manifest from live service state.
300+
Manifest manifest = 1;
301+
302+
// exported_at is the timestamp when the export was generated.
303+
google.protobuf.Timestamp exported_at = 2;
304+
305+
// checksum is the SHA-256 hash of the reconstructed manifest content.
306+
string checksum = 3;
307+
308+
// section_sources documents where each section's data was sourced from.
309+
// Keys are section names, values describe the source (e.g., "live:reference-data",
310+
// "fallback:manifest-v1.0").
311+
map<string, string> section_sources = 4;
312+
313+
// warnings contains non-fatal issues encountered during export
314+
// (e.g., a service was unreachable, partial data returned).
315+
repeated string warnings = 5;
316+
}

0 commit comments

Comments
 (0)