Solution Bundles v3 & GitOps
Solution Bundle v3 (latticedx.solution-bundle/v3) defines a declarative packaging format that captures an organization's operational configuration in a single SHA-256 checksummed JSON document. By stripping Vault secrets from declarative definitions, platform teams can version configuration in Git, inspect diffs, execute dry-run validation, and roll back to pre-import snapshots cleanly.
latticedx.solution-bundle/v3 JSON Schema
The solution-bundle.js module emits documents adhering to latticedx.solution-bundle/v3 (while the importer retains backward compatibility for v1 and v2). Every bundle contains a metadata block and eight top-level payload sections.
| Parameter | Type | Default | Description |
|---|---|---|---|
schemaVersionrequired | string | latticedx.solution-bundle/v3 | Bundle schema identifier (importer accepts v1, v2, and v3). |
platformVersionrequired | string | 0.4.2 | LatticeDX platform version that produced the bundle. |
organizationIdrequired | string | — | Target organization identifier, or all when exported globally. |
exportedAtrequired | string | — | UTC ISO-8601 timestamp recorded at export time. |
contentSha256required | string | — | 64-character SHA-256 hex digest of JSON.stringify({ roles, portals, workflows, aiProfiles, customCollections, connectors, routesAndBlocks, governance }). |
warnings | string[] | — | Optional advisory messages, such as reminding operators to re-bind connector Vault secrets after import. |
Top-Level Payload Sections (8 Keys)
| Top-Level Key | Type | Included Artifacts and Validation Rules |
|---|---|---|
roles | Array<object> | Non-system ^ldx_[a-z0-9_]{2,48}$ roles, resource action grants, and field scopes; forbids root, admin, and ldx_admin. |
portals | Array<object> | Portal definitions (^ldx-portal-[a-z0-9-]+$), routePath (/p/*), and routeName (p_*); forbids authCheck: false. |
workflows | Array<object> | LatticeFlow workflow definitions and DAG nodes (validateWorkflowNodesDag); imported inactive unless enableWorkflows: true. |
aiProfiles | Array<object> | AI agent profiles (username, systemPrompt, tools, and toolPermissions in ALLOW, ASK, or OFF). |
customCollections | Array<object> | Dynamic ^latticeCustom[A-Z][A-Za-z0-9]{1,40}$ tables, 12 field types, Thompson NFA rules, AST formulas, and auto-attached PG16 RLS. |
connectors | Array<object> | Integration metadata stripped of all Vault secrets (SECRET_KEY_RE); newly created connectors default to active: false. |
routesAndBlocks | object | Contains { routes, flowModels }; routes sort topologically before upsert, models allowlisted via ALLOWED_FLOW_MODEL_USES, system layouts protected. |
governance | object | Contains { decisionTables, slaPolicies, incidentRules, automationRules, webhookSubscriptions } scoped by organizationId. |
{
"metadata": {
"schemaVersion": "latticedx.solution-bundle/v3",
"platformVersion": "0.4.2",
"organizationId": "org-coldchain-starter",
"exportedAt": "2026-11-26T14:55:00.000Z",
"contentSha256": "91eaddda971760c81b2c2c6d140a79e7fd9b79413388050f4ac9fb6f3e8f19d0"
},
"roles": [{ "name": "ldx_operator", "allowAll": false, "allowConfigure": false }],
"portals": [],
"workflows": [],
"aiProfiles": [],
"customCollections": [{ "name": "latticeCustomColdLotLogs", "fields": [] }],
"connectors": [],
"routesAndBlocks": { "routes": [], "flowModels": [] },
"governance": {
"decisionTables": [],
"slaPolicies": [],
"incidentRules": [],
"automationRules": [],
"webhookSubscriptions": []
}
}Security Guardrails and Secret Stripping
Before exporting or diffing, stripSecretsDeep traverses up to 48 nesting levels and removes any key matching SECRET_KEY_RE (password, secret, token, apikey, api_key, privatekey, authorization, cookie). validateSolutionBundle enforces four additional barriers:
| Guardrail | Validation Rule in validateSolutionBundle |
|---|---|
| Size and Structure Limits | Payloads cannot exceed 5,000,000 bytes (5 MB), must be JSON-serializable without cycles, and cannot contain __proto__, constructor, or prototype keys (checked up to depth 32). |
| Privilege Escalation Prevention | Rejects root, admin, and ldx_admin roles, wildcard or system permission snippets (*, !, pm.*, acl.*, app.*, ui.*), and strips admin builder tools from aiProfiles unless isAdminBuilder: true. |
| Code Injection and XSS Blocking | Rejects UNSAFE_CODE_KEY_RE keys (jsCode, script, customScript, evalCode, innerHTML, jsSettings, scriptSettings) and strings matching <script>, <iframe>, javascript:, vbscript:, or on*= attributes. |
| SSRF and Tenant Isolation | Validates governance.webhookSubscriptions[].targetUrl through validateSafeWebhookTargetUrl and throws HTTP 403 DXOS_ORG_MISMATCH if any connector or governance item belongs to another organization. |
Export, Diff, Dry-Run Import, and Rollback Endpoints
Four admin endpoints on dxosStudio (studio-resource.js) manage the bundle GitOps lifecycle:
/api/dxosStudio:solutionBundleExport/api/dxosStudio:solutionBundleDiff/api/dxosStudio:solutionBundleImport/api/dxosStudio:solutionBundleRollbackWhen solutionBundleImport runs with dryRun: false, the server persists the current live bundle into latticeUiSnapshots under portalSlug: '__gitops_bundle__' with a generated snapshotUid (gitops-<ts36>-<rand4>). Calling solutionBundleRollback restores that snapshot inside a tenant transaction with reconcileV3Deletions: true, removing routes, flow models, and governance records created after the snapshot while keeping admin-layout-model and mobile-layout-model untouched.
# 1. Inspect structural diff
curl -s -X POST "https://localhost:8443/api/dxosStudio:solutionBundleDiff" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"organizationId":"org-a","bundle":...}'
# 2. Validate via dry-run (dryRun defaults to true)
curl -s -X POST "https://localhost:8443/api/dxosStudio:solutionBundleImport" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"organizationId":"org-a","dryRun":true,"bundle":...}'
# 3. Apply bundle and retain snapshotUid for rollback
curl -s -X POST "https://localhost:8443/api/dxosStudio:solutionBundleImport" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"organizationId":"org-a","dryRun":false,"enableWorkflows":false,"bundle":...}'GitOps Workflow with CTU-OpenPaw/lattice-templates
The CTU-OpenPaw/lattice-templates repository curates 43 JSON artifacts across six categories under Apache-2.0, version-locked to 0.4.2:
| Category | Count | Contents |
|---|---|---|
latticeflow-blueprints/ | 8 | LatticeFlow v2 DAG blueprints (coldchain-emergency, mkt-quarantine, procurement-hitl-approval, sla-escalation, and peers). |
n8n-workflows/ | 10 | Sanitized stock n8n workflows (active: false, zero embedded credential IDs). |
dmn-tables/ | 4 | 3 DMN decision tables (cold_chain_approval_v1, cmms_priority_routing_v1, coldchain_settlement_policy_v1) plus sample-evaluations.json (12 cases). |
business-packs/ | 16 | 2 Business Packs, 5 manifests, 4 workflow templates, 3 App Builder suites, and 2 domain solutions. |
public-forms/ | 4 | Zero-PII /v/form/:slug templates (partner-intake, coldchain-incident-report, customer-service-ticket, order-inquiry). |
solution-bundles/ | 1 | Starter coldchain-starter-bundle.v3.json bundle with verified metadata.contentSha256. |
Before merging changes or importing bundles into a live environment, CI runs the zero-dependency validator scripts/validate-templates.mjs on Node.js 24:
git clone https://github.com/CTU-OpenPaw/lattice-templates.git
cd lattice-templates
node --check scripts/validate-templates.mjs
npm run validateOperational Notes
- Newly imported
connectorsalways initialize withactive: falseso operators can bind Vault secrets or complete OAuth2 PKCE consent flows before enabling live traffic. - If
solutionBundleImportencounters any schema error or cross-tenant organization mismatch during execution, the enclosing PostgreSQL transaction rolls back cleanly without partial writes.
