Skip to content

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.

metadata Object Fields
ParameterTypeDefaultDescription
schemaVersionrequired
stringlatticedx.solution-bundle/v3Bundle schema identifier (importer accepts v1, v2, and v3).
platformVersionrequired
string0.4.2LatticeDX 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 KeyTypeIncluded Artifacts and Validation Rules
rolesArray<object>Non-system ^ldx_[a-z0-9_]{2,48}$ roles, resource action grants, and field scopes; forbids root, admin, and ldx_admin.
portalsArray<object>Portal definitions (^ldx-portal-[a-z0-9-]+$), routePath (/p/*), and routeName (p_*); forbids authCheck: false.
workflowsArray<object>LatticeFlow workflow definitions and DAG nodes (validateWorkflowNodesDag); imported inactive unless enableWorkflows: true.
aiProfilesArray<object>AI agent profiles (username, systemPrompt, tools, and toolPermissions in ALLOW, ASK, or OFF).
customCollectionsArray<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.
connectorsArray<object>Integration metadata stripped of all Vault secrets (SECRET_KEY_RE); newly created connectors default to active: false.
routesAndBlocksobjectContains { routes, flowModels }; routes sort topologically before upsert, models allowlisted via ALLOWED_FLOW_MODEL_USES, system layouts protected.
governanceobjectContains { decisionTables, slaPolicies, incidentRules, automationRules, webhookSubscriptions } scoped by organizationId.
json
{
  "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:

GuardrailValidation Rule in validateSolutionBundle
Size and Structure LimitsPayloads 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 PreventionRejects 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 BlockingRejects 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 IsolationValidates 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:

POST/api/dxosStudio:solutionBundleExport
Bearer JWT | ldx_pat_*admin
Exports the target organization's live state as a latticedx.solution-bundle/v3 payload with contentSha256 (also supports GET).
POST/api/dxosStudio:solutionBundleDiff
Bearer JWT | ldx_pat_*admin
Validates an incoming bundle against live state and returns per-section added, changed, unchanged, and removed summaries.
POST/api/dxosStudio:solutionBundleImport
Bearer JWT | ldx_pat_*admin
Defaults to dryRun=true for non-mutating validation; when dryRun=false, saves a pre-import snapshot before applying changes transactionally.
POST/api/dxosStudio:solutionBundleRollback
Bearer JWT | ldx_pat_*admin
Restores the latest or specified snapshotUid from latticeUiSnapshots with reconcileV3Deletions enabled.

When 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.

bash
# 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:

CategoryCountContents
latticeflow-blueprints/8LatticeFlow v2 DAG blueprints (coldchain-emergency, mkt-quarantine, procurement-hitl-approval, sla-escalation, and peers).
n8n-workflows/10Sanitized stock n8n workflows (active: false, zero embedded credential IDs).
dmn-tables/43 DMN decision tables (cold_chain_approval_v1, cmms_priority_routing_v1, coldchain_settlement_policy_v1) plus sample-evaluations.json (12 cases).
business-packs/162 Business Packs, 5 manifests, 4 workflow templates, 3 App Builder suites, and 2 domain solutions.
public-forms/4Zero-PII /v/form/:slug templates (partner-intake, coldchain-incident-report, customer-service-ticket, order-inquiry).
solution-bundles/1Starter 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:

bash
git clone https://github.com/CTU-OpenPaw/lattice-templates.git
cd lattice-templates
node --check scripts/validate-templates.mjs
npm run validate

Operational Notes ​

  • Newly imported connectors always initialize with active: false so operators can bind Vault secrets or complete OAuth2 PKCE consent flows before enabling live traffic.
  • If solutionBundleImport encounters any schema error or cross-tenant organization mismatch during execution, the enclosing PostgreSQL transaction rolls back cleanly without partial writes.

Apache-2.0 · LatticeDX v0.4.2 · Powered by NocoBase · v2.2.50 · Apache-2.0 (Clause 5.2)