@aifabrix/builder 2.50.0 → 2.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/.cursor/plans/Done/157.1-security-quality-violations-by-type.csv +374 -0
  2. package/.cursor/rules/assistant-driven-integration-build.mdc +40 -0
  3. package/integration/hubspot-test/create-hubspot.js +1 -16
  4. package/jest.isolated-projects.js +77 -1
  5. package/jest.projects.js +5 -426
  6. package/lib/api/assistants.api.js +67 -0
  7. package/lib/api/datasources-extended.api.js +6 -6
  8. package/lib/api/evidence-authoring-helpers.js +267 -0
  9. package/lib/api/evidence-authoring.api.js +337 -0
  10. package/lib/api/evidence-kinds.api.js +128 -0
  11. package/lib/api/evidence.api.js +57 -1
  12. package/lib/api/index.js +24 -7
  13. package/lib/api/pipeline.api.js +47 -3
  14. package/lib/api/records-bulk.api.js +28 -3
  15. package/lib/api/resource-types.api.js +4 -4
  16. package/lib/api/roles.api.js +121 -0
  17. package/lib/api/types/evidence-kinds.types.js +42 -0
  18. package/lib/api/types/evidence.types.js +156 -8
  19. package/lib/api/types/roles.types.js +36 -0
  20. package/lib/api/work.api.js +283 -0
  21. package/lib/app/certification-verify-rows.js +1 -1
  22. package/lib/app/run-deploy-job.js +108 -0
  23. package/lib/app/run-helpers.js +10 -3
  24. package/lib/app/run.js +8 -0
  25. package/lib/app/show.js +2 -2
  26. package/lib/certification/merge-certification-from-artifact.js +1 -1
  27. package/lib/channels/add-channel.js +54 -23
  28. package/lib/channels/approval-guides/chatgpt.js +8 -7
  29. package/lib/channels/approval-guides/microsoft-copilot.js +7 -8
  30. package/lib/channels/channel-artifact-generator.js +16 -3
  31. package/lib/channels/channel-credential.js +3 -1
  32. package/lib/channels/channel-probe-evidence.js +79 -0
  33. package/lib/channels/channel-probe.js +265 -13
  34. package/lib/channels/channel-runtime-resolver.js +120 -29
  35. package/lib/channels/channel-status-display.js +44 -0
  36. package/lib/channels/channel-targets.js +7 -0
  37. package/lib/channels/chatgpt-runtime-contract.js +29 -0
  38. package/lib/channels/microsoft-copilot-package.js +280 -0
  39. package/lib/channels/runtime-tool-catalog.js +165 -0
  40. package/lib/cli/index.js +6 -0
  41. package/lib/cli/setup-app.js +26 -5
  42. package/lib/cli/setup-dev.js +23 -7
  43. package/lib/cli/setup-external-system-help.js +8 -2
  44. package/lib/cli/setup-external-system.js +12 -0
  45. package/lib/cli/setup-utility-help-after.js +12 -0
  46. package/lib/cli/setup-utility-validate.js +41 -2
  47. package/lib/commands/app-test.js +2 -14
  48. package/lib/commands/datasource-load-export-cli.js +6 -1
  49. package/lib/commands/deploy-gate-failure-details.js +23 -0
  50. package/lib/commands/deploy-gate-orchestrator.js +64 -18
  51. package/lib/commands/dev-cli-handlers.js +6 -3
  52. package/lib/commands/dev-down.js +2 -6
  53. package/lib/commands/dev-init.js +7 -109
  54. package/lib/commands/dev-refresh.js +197 -0
  55. package/lib/commands/evidence-kind.js +478 -0
  56. package/lib/commands/governance-command-action.js +4 -2
  57. package/lib/commands/governance-generate-external.js +56 -21
  58. package/lib/commands/lifecycle-external.js +10 -4
  59. package/lib/commands/repair-datasource-apply.js +10 -1
  60. package/lib/commands/repair-datasource-run.js +4 -2
  61. package/lib/commands/repair-datasource-test-payload.js +80 -19
  62. package/lib/commands/repair-datasource-webhooks-sync-bridge.js +42 -3
  63. package/lib/commands/repair-internal.js +9 -1
  64. package/lib/commands/repair-openapi-export.js +1 -1
  65. package/lib/commands/repair-openapi-sync.js +43 -18
  66. package/lib/commands/resource-type.js +101 -18
  67. package/lib/commands/role-assistant.js +313 -0
  68. package/lib/commands/role.js +452 -0
  69. package/lib/commands/setup.js +1 -1
  70. package/lib/commands/upload-data-sync-finalize.js +5 -4
  71. package/lib/commands/upload-sidecar-followups.js +144 -47
  72. package/lib/commands/upload.js +43 -6
  73. package/lib/commands/validate-json.js +230 -0
  74. package/lib/commands/verify-governance-combined-external.js +73 -9
  75. package/lib/commands/verify-governance-db.js +80 -25
  76. package/lib/commands/verify-governance-external.js +29 -5
  77. package/lib/commands/verify-operations-step-plan.js +78 -40
  78. package/lib/commands/wizard-core-helpers.js +7 -3
  79. package/lib/commands/wizard-core.js +78 -9
  80. package/lib/core/audit-logger.js +1 -1
  81. package/lib/core/secrets-load.js +1 -3
  82. package/lib/datasource/bulk-loader-run-batches.js +4 -2
  83. package/lib/datasource/bulk-loader-service.js +5 -1
  84. package/lib/datasource/capability/relate-operations.js +1 -1
  85. package/lib/datasource/datasource-validate-summary.js +2 -2
  86. package/lib/datasource/validate.js +13 -6
  87. package/lib/external-system/deploy-helpers.js +35 -1
  88. package/lib/external-system/deploy.js +23 -10
  89. package/lib/external-system/download-helpers.js +111 -2
  90. package/lib/external-system/download-role-assistant.js +55 -0
  91. package/lib/external-system/download.js +45 -26
  92. package/lib/external-system/test-helpers.js +1 -1
  93. package/lib/external-system/test.js +39 -3
  94. package/lib/generator/builders.js +3 -0
  95. package/lib/generator/helpers.js +13 -5
  96. package/lib/generator/split-variables.js +9 -3
  97. package/lib/generator/wizard.js +51 -4
  98. package/lib/infrastructure/helpers-docker-check.js +6 -0
  99. package/lib/infrastructure/helpers.js +1 -1
  100. package/lib/lifecycle/access-control-abac.js +121 -0
  101. package/lib/lifecycle/lifecycle-governance-options.js +4 -1
  102. package/lib/lifecycle/product-model.js +3 -2
  103. package/lib/lifecycle/report-display.js +14 -2
  104. package/lib/programmatic/auth-config.js +3 -2
  105. package/lib/programmatic/bearer-auth.js +1 -1
  106. package/lib/programmatic/capability-registry.js +20 -1
  107. package/lib/programmatic/command-options.js +1 -0
  108. package/lib/programmatic/enterprise-mcp-client.js +18 -2
  109. package/lib/programmatic/index.js +4 -0
  110. package/lib/programmatic/manifest-patch-section.js +48 -9
  111. package/lib/programmatic/manifest-section-registry-data.js +3 -2
  112. package/lib/programmatic/manifest-section-registry.js +18 -1
  113. package/lib/programmatic/openapi-apply-result-schemas.js +44 -0
  114. package/lib/programmatic/openapi-component-schemas.js +16 -1
  115. package/lib/programmatic/openapi-description-enricher.js +3 -1
  116. package/lib/programmatic/openapi-descriptions.js +55 -5
  117. package/lib/programmatic/openapi-evidence-schemas.js +161 -0
  118. package/lib/programmatic/openapi-manifest-schemas.js +6 -2
  119. package/lib/programmatic/openapi-operation-bindings.js +99 -0
  120. package/lib/programmatic/openapi-request-schemas.js +36 -1
  121. package/lib/programmatic/openapi-result-schemas.js +29 -12
  122. package/lib/programmatic/openapi-schema-descriptions-certify.js +5 -1
  123. package/lib/programmatic/openapi-schema-descriptions-core.js +6 -3
  124. package/lib/programmatic/openapi-schema-descriptions-evidence.js +156 -0
  125. package/lib/programmatic/openapi-schema-descriptions-manifest.js +4 -3
  126. package/lib/programmatic/openapi-schema-descriptions-operations.js +70 -0
  127. package/lib/programmatic/openapi-schema-helpers.js +16 -1
  128. package/lib/programmatic/openapi-spec.js +48 -29
  129. package/lib/programmatic/orchestration-openapi-meta.js +5 -0
  130. package/lib/programmatic/request-timeout.js +3 -0
  131. package/lib/programmatic/route-handler-map.js +89 -2
  132. package/lib/programmatic/run-certify.js +15 -2
  133. package/lib/programmatic/run-deploy.js +74 -0
  134. package/lib/programmatic/run-evidence-authoring.js +80 -0
  135. package/lib/programmatic/run-protection.js +124 -0
  136. package/lib/programmatic/run-repository-emcp.js +11 -3
  137. package/lib/programmatic/run-template-workspace.js +42 -2
  138. package/lib/programmatic/workspace-context.js +6 -0
  139. package/lib/protection/auth-context.js +48 -6
  140. package/lib/protection/paths.js +22 -0
  141. package/lib/protection/run-protection-create-helpers.js +22 -1
  142. package/lib/protection/run-protection-create.js +1 -1
  143. package/lib/protection/sync-after-upload.js +1 -1
  144. package/lib/resolvers/evidence-kind-file.js +230 -0
  145. package/lib/resolvers/resource-type-file.js +36 -1
  146. package/lib/resolvers/role-file.js +227 -0
  147. package/lib/role-assistant/evidence-sync.js +450 -0
  148. package/lib/role-assistant/github-workflow.js +96 -0
  149. package/lib/role-assistant/knowledge-sync.js +465 -0
  150. package/lib/role-assistant/settings.js +126 -0
  151. package/lib/role-assistant/test-cases-evaluate.js +170 -0
  152. package/lib/role-assistant/test-cases-honesty.js +184 -0
  153. package/lib/role-assistant/test-cases.js +364 -0
  154. package/lib/role-assistant/test-runner-workhub-answers.js +203 -0
  155. package/lib/role-assistant/test-runner-workhub.js +385 -0
  156. package/lib/role-assistant/test-runner.js +500 -0
  157. package/lib/schema/application-schema.json +36 -2
  158. package/lib/schema/deployment-rules.yaml +1 -0
  159. package/lib/schema/external-datasource.schema.json +121 -4
  160. package/lib/schema/external-system.schema.json +20 -6
  161. package/lib/schema/infra.parameter.yaml +45 -1
  162. package/lib/schema/role-assistant-settings.schema.json +108 -0
  163. package/lib/schema/type/credential-field-registry.json +19 -3
  164. package/lib/utils/api.js +52 -21
  165. package/lib/utils/app-path-resolve.js +72 -24
  166. package/lib/utils/app-register-config.js +4 -3
  167. package/lib/utils/authentication-shape.js +3 -1
  168. package/lib/utils/cli-sync-options.js +59 -3
  169. package/lib/utils/cli-utils.js +11 -3
  170. package/lib/utils/deployment-validation.js +28 -3
  171. package/lib/utils/dev-ca-install.js +5 -6
  172. package/lib/utils/dev-config.js +2 -2
  173. package/lib/utils/dev-list-sort.js +145 -0
  174. package/lib/utils/dev-platform-tls.js +0 -63
  175. package/lib/utils/docker-build.js +46 -27
  176. package/lib/utils/docker-daemon-tls-ca.js +1 -1
  177. package/lib/utils/docker-exec.js +91 -6
  178. package/lib/utils/docker-run-ephemeral.js +55 -0
  179. package/lib/utils/enterprise-knowledge-paths.js +29 -12
  180. package/lib/utils/env-copy-keycloak.js +196 -0
  181. package/lib/utils/env-copy.js +35 -4
  182. package/lib/utils/error-formatters/error-parser.js +0 -3
  183. package/lib/utils/external-env-template.js +1 -1
  184. package/lib/utils/external-system-readiness-compact-blocks.js +28 -1
  185. package/lib/utils/external-system-readiness-compact-display.js +3 -0
  186. package/lib/utils/health-check-request.js +2 -3
  187. package/lib/utils/help-builder.js +4 -0
  188. package/lib/utils/image-name.js +22 -4
  189. package/lib/utils/logger.js +37 -4
  190. package/lib/utils/manifest-source-emit.js +1 -1
  191. package/lib/utils/paths.js +98 -26
  192. package/lib/utils/pipeline-upload-auth-retry.js +19 -3
  193. package/lib/utils/postgres-platform-bootstrap.js +24 -17
  194. package/lib/utils/postgres-wipe.js +5 -2
  195. package/lib/utils/remote-dev-auth.js +39 -4
  196. package/lib/utils/resolve-docker-image-ref.js +36 -6
  197. package/lib/utils/role-assistant-paths.js +98 -0
  198. package/lib/utils/schema-loader.js +41 -0
  199. package/lib/utils/schema-resolver.js +36 -4
  200. package/lib/utils/token-manager.js +47 -22
  201. package/lib/utils/upload-sync-options.js +17 -3
  202. package/lib/utils/url-declarative-resolve-load-doc.js +38 -1
  203. package/lib/validation/external-manifest-validator.js +31 -8
  204. package/lib/validation/openapi-contract-surface-validator.js +4 -0
  205. package/lib/validation/validate-external-file.js +8 -1
  206. package/lib/validation/validator.js +6 -5
  207. package/package.json +35 -12
  208. package/scripts/export-builder-api-evidence.js +3 -3
  209. package/scripts/lib/plan-actor.js +2 -2
  210. package/scripts/lib/plan-meta.js +1 -1
  211. package/scripts/lib/plan-parse.js +1 -1
  212. package/scripts/lib/plan-prevalidate-gates.js +12 -1
  213. package/scripts/lib/plan-run-report.js +13 -2
  214. package/scripts/pnpm/lib/resolve-aifabrix-bin.mjs +10 -10
  215. package/templates/applications/dataplane/application.yaml +47 -17
  216. package/templates/applications/dataplane/env.template +28 -9
  217. package/templates/applications/dataplane/rbac.yaml +78 -2
  218. package/templates/applications/miso-controller/application.yaml +10 -1
  219. package/templates/applications/miso-controller/env.template +13 -8
  220. package/templates/applications/miso-controller/rbac.yaml +72 -0
  221. package/templates/channels/chatgpt/install.template.md.hbs +42 -24
  222. package/templates/channels/chatgpt/integration/README.md +10 -7
  223. package/templates/channels/chatgpt/integration/application.json +2 -2
  224. package/templates/channels/chatgpt/integration/chatgpt-system.json +3 -3
  225. package/templates/channels/chatgpt/integration/env.template +1 -1
  226. package/templates/channels/chatgpt/manifest.template.json.hbs +36 -5
  227. package/templates/channels/microsoft-copilot/ai-plugin.template.json.hbs +28 -0
  228. package/templates/channels/microsoft-copilot/declarative-agent.template.json.hbs +22 -0
  229. package/templates/channels/microsoft-copilot/install.template.md.hbs +32 -22
  230. package/templates/channels/microsoft-copilot/integration/README.md +9 -7
  231. package/templates/channels/microsoft-copilot/integration/application.json +2 -2
  232. package/templates/channels/microsoft-copilot/integration/env.template +1 -1
  233. package/templates/channels/microsoft-copilot/integration/microsoft-copilot-system.json +7 -6
  234. package/templates/channels/microsoft-copilot/manifest.template.json.hbs +34 -6
  235. package/templates/channels/slack/integration/slack-system.json +60 -2
  236. package/templates/python/requirements.txt +1 -1
@@ -17,6 +17,17 @@ const { loadPlanFile, hasSurface } = require('./plan-parse');
17
17
  const REPO_ROOT = path.resolve(__dirname, '../..');
18
18
  const PREVALIDATE_REPORT_DIR = path.join(REPO_ROOT, 'temp/plan-prevalidation');
19
19
 
20
+ /**
21
+ * @param {unknown} value
22
+ * @returns {string}
23
+ */
24
+ function escapeMarkdownCell(value) {
25
+ return String(value ?? '')
26
+ .replace(/\r?\n+/g, ' ')
27
+ .replace(/\|/g, '\\|')
28
+ .trim();
29
+ }
30
+
20
31
  /**
21
32
  * @typedef {{ label: string, status: 'pass' | 'fail' | 'warn' | 'skip', detail?: string }} GateResult
22
33
  */
@@ -299,7 +310,7 @@ function buildPrevalidateReport(params) {
299
310
  '| --- | --- | --- |'
300
311
  ];
301
312
  for (const g of gates) {
302
- lines.push(`| ${g.label} | ${g.status} | ${(g.detail || '').replace(/\|/g, '\\|')} |`);
313
+ lines.push(`| ${escapeMarkdownCell(g.label)} | ${escapeMarkdownCell(g.status)} | ${escapeMarkdownCell(g.detail || '')} |`);
303
314
  }
304
315
  return `${lines.join('\n')}\n`;
305
316
  }
@@ -8,6 +8,17 @@ const fs = require('fs');
8
8
  const path = require('path');
9
9
  const { REPORT_DIR } = require('./plan-config');
10
10
 
11
+ /**
12
+ * @param {unknown} value
13
+ * @returns {string}
14
+ */
15
+ function escapeMarkdownCell(value) {
16
+ return String(value ?? '')
17
+ .replace(/\r?\n+/g, ' ')
18
+ .replace(/\|/g, '\\|')
19
+ .trim();
20
+ }
21
+
11
22
  /**
12
23
  * @param {object} params
13
24
  * @returns {string}
@@ -44,13 +55,13 @@ function buildSummaryMarkdown(params) {
44
55
 
45
56
  for (const g of gates) {
46
57
  const icon = g.status === 'pass' ? 'pass' : g.status === 'warn' ? 'warn' : 'FAIL';
47
- lines.push(`| ${g.label} | ${icon} | ${(g.detail || '').replace(/\|/g, '\\|')} |`);
58
+ lines.push(`| ${escapeMarkdownCell(g.label)} | ${icon} | ${escapeMarkdownCell(g.detail || '')} |`);
48
59
  }
49
60
 
50
61
  lines.push('', '## Todos', '', '| ID | Status | Content |', '| --- | --- | --- |');
51
62
  for (const t of todos) {
52
63
  lines.push(
53
- `| ${t.id} | ${t.status} | ${String(t.content).replace(/\|/g, '\\|').slice(0, 100)} |`
64
+ `| ${escapeMarkdownCell(t.id)} | ${escapeMarkdownCell(t.status)} | ${escapeMarkdownCell(t.content).slice(0, 100)} |`
54
65
  );
55
66
  }
56
67
 
@@ -10,8 +10,8 @@ const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../
10
10
  const MIN_AIFABRIX_VERSION = '2.45.0';
11
11
 
12
12
  /**
13
- * @param {string} version
14
- * @returns {number[]}
13
+ * @param {string} version - Semver string.
14
+ * @returns {number[]} Parsed numeric semver segments.
15
15
  */
16
16
  function parseSemver(version) {
17
17
  return String(version)
@@ -21,9 +21,9 @@ function parseSemver(version) {
21
21
  }
22
22
 
23
23
  /**
24
- * @param {string} left
25
- * @param {string} right
26
- * @returns {number}
24
+ * @param {string} left - Left semver.
25
+ * @param {string} right - Right semver.
26
+ * @returns {number} Compare result (1, 0, -1).
27
27
  */
28
28
  function compareSemver(left, right) {
29
29
  const a = parseSemver(left);
@@ -38,8 +38,8 @@ function compareSemver(left, right) {
38
38
  }
39
39
 
40
40
  /**
41
- * @param {string} bin
42
- * @returns {string|null}
41
+ * @param {string} bin - Candidate executable path.
42
+ * @returns {string|null} CLI version output or null.
43
43
  */
44
44
  function readAifabrixVersion(bin) {
45
45
  try {
@@ -50,7 +50,7 @@ function readAifabrixVersion(bin) {
50
50
  }
51
51
 
52
52
  /**
53
- * @returns {string[]}
53
+ * @returns {string[]} Candidate aifabrix binary paths.
54
54
  */
55
55
  function collectAifabrixCandidates() {
56
56
  const candidates = [];
@@ -85,14 +85,14 @@ function collectAifabrixCandidates() {
85
85
  /**
86
86
  * Prefer this repo's bin/aifabrix.js when developing the builder package locally.
87
87
  *
88
- * @returns {string}
88
+ * @returns {string} Resolved aifabrix executable path.
89
89
  */
90
90
  export function resolveAifabrixBin() {
91
91
  let bestBin = null;
92
92
  let bestVersion = null;
93
93
 
94
94
  for (const candidate of collectAifabrixCandidates()) {
95
- let resolved = candidate;
95
+ let resolved;
96
96
  try {
97
97
  if (fs.existsSync(candidate)) {
98
98
  resolved = fs.realpathSync(candidate);
@@ -4,12 +4,12 @@ app:
4
4
  displayName: "AI Fabrix Dataplane"
5
5
  description: "AI Fabrix Dataplane is a secure, in-tenant integration and automation layer that supplies governed, normalized, and explainable enterprise data to AI agents. Using CIP as a declarative standard, it enforces RBAC and ABAC, executes integrations, and exposes trusted data via MCP and OpenAPI."
6
6
  type: webapp
7
- language: python # Explicitly specify Python language
8
- version: 2.0.0
7
+ language: python # Explicitly specify Python language
8
+ version: 2.0.15
9
9
 
10
10
  # Image Configuration
11
- # Set tag to match your build (e.g. aifabrix build dataplane -t 1.0.0 then tag: 1.0.0)
12
- # Registry is required so the controller can pull the image (avoids "docker: not found" on the controller host).
11
+ # Set tag to match your build (example: aifabrix build dataplane -t 1.0.0).
12
+ # Registry is required so the controller can pull the image (avoids docker-not-found on the controller host).
13
13
  image:
14
14
  name: aifabrix/dataplane
15
15
  tag: latest
@@ -35,10 +35,10 @@ frontDoorRouting:
35
35
  requires:
36
36
  database: true
37
37
  databases:
38
- - name: dataplane # Main database - configuration only
39
- - name: dataplane-vector # Vector and document store: chunks, embeddings, vector indexes (pgvector)
40
- - name: dataplane-logs # Logs database - execution, audit, ABAC traces
41
- - name: dataplane-records # Records database - external records storage
38
+ - name: dataplane # Main database - configuration only
39
+ - name: dataplane-vector # Vector and document store: chunks, embeddings, vector indexes (pgvector)
40
+ - name: dataplane-logs # Logs database - execution, audit, ABAC traces
41
+ - name: dataplane-records # Records database - external records storage
42
42
  redis: true
43
43
  storage: true
44
44
 
@@ -60,19 +60,23 @@ authentication:
60
60
  # Build Configuration
61
61
  # Dataplane builds from published image; context is project root (like miso-controller)
62
62
  build:
63
- context: ../.. # Docker build context (relative to builder/dataplane/)
64
- dockerfile: builder/dataplane/Dockerfile # Dockerfile path (relative to project root)
65
- envOutputPath: ../../.env # Copy to repo root for local dev
66
- language: python # Runtime language for template selection (typescript or python)
63
+ context: ../.. # Docker build context (relative to builder/dataplane/)
64
+ dockerfile: builder/dataplane/Dockerfile # Dockerfile path (relative to project root)
65
+ envOutputPath: ../../.env # Copy to repo root for local dev
66
+ language: python # Runtime language for template selection (typescript or python)
67
67
  # Dev reload: polling + watch /app/app only (avoids EMFILE on full repo bind-mount). See run_local.py, make af-reload.
68
68
  reloadStart: WATCHFILES_FORCE_POLLING=1 uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-3001} --reload --reload-dir /app/app
69
69
  # Pulled-image local compose (no bind-mount): drives `command` in generated docker-compose. Override for non-standard images (e.g. stub ACR tags).
70
70
  imageRun: exec python -m uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-3001}
71
71
  # Image policy (442.0): explicit Dockerfile COPY; worker/beat via python -m app.core.*
72
- # integration/ in image: <systemKey>-deploy.json + application.json|yaml only (no test-*, wizard-configs).
72
+ # integration/ in image: only onboarding-catalog.json keys (+ deploy/application per key).
73
73
  worker: true
74
74
  imageRunWorker: exec python -m app.core.celery_worker_main
75
75
  imageRunBeat: exec python -m app.core.celery_beat_main
76
+ # Optional one-shot before ANY long-running role (api/worker/beat). Run exactly once per
77
+ # aifabrix run / Deployment — never once-per-container. Schema: application-schema build.deployJob.
78
+ # Local: aifabrix run; remote: miso Deployment via miso-azure (not Docker on controller).
79
+ deployJob: python -m app.db.migrate upgrade
76
80
 
77
81
  # =============================================================================
78
82
  # Portal Input Configuration (Deployment Wizard)
@@ -82,8 +86,10 @@ build:
82
86
  #
83
87
  # NOT included (auto-configured):
84
88
  # - Database URLs, Redis → auto-generated during Azure install
85
- # - MISO_*, KEYCLOAK_* → auto-generated during Azure install
86
- # - AI params (OPENAI_*, AZURE_OPENAI_*) → from controller config
89
+ # - MISO_*, KEYCLOAK_* → auto-generated during Azure install
90
+ # - AI params / provider secrets → LLM external systems + secret store
91
+ # (never product OPENAI_* / AZURE_OPENAI_*). ≥2 providers →
92
+ # ENTERPRISE_LLM_DEFAULT_SELECTOR (portal LLM category).
87
93
  # - ENVIRONMENT → set by deployment target
88
94
 
89
95
  configuration:
@@ -91,6 +97,7 @@ configuration:
91
97
  # Operations & Debugging
92
98
  # -------------------------------------------------------------------------
93
99
  - name: LOG_LEVEL
100
+ category: Operations & Debugging
94
101
  portalInput:
95
102
  field: select
96
103
  label: "Log Level"
@@ -101,6 +108,7 @@ configuration:
101
108
  - ERROR
102
109
 
103
110
  - name: ABAC_AUDIT_DETAIL_LEVEL
111
+ category: Operations & Debugging
104
112
  portalInput:
105
113
  field: select
106
114
  label: "ABAC Audit Detail Level"
@@ -109,6 +117,7 @@ configuration:
109
117
  - detailed
110
118
 
111
119
  - name: RBAC_AUDIT_DETAIL_LEVEL
120
+ category: Operations & Debugging
112
121
  portalInput:
113
122
  field: select
114
123
  label: "RBAC Audit Detail Level"
@@ -118,6 +127,7 @@ configuration:
118
127
  - explain
119
128
 
120
129
  - name: TRUST_CUSTOMER_POLICY_LEVEL
130
+ category: Trust
121
131
  portalInput:
122
132
  field: select
123
133
  label: "Trust policy level (no-policy defaults)"
@@ -127,22 +137,27 @@ configuration:
127
137
  - relaxed
128
138
 
129
139
  - name: TRUST_PUBLISH_GATE_ENABLED
140
+ category: Trust
130
141
  portalInput:
131
142
  field: select
132
- label: "Enforce trust gate on datasource publish"
143
+ label: "Enforce trust gate on datasource publish (empty=ENVIRONMENT default)"
133
144
  options:
145
+ - ""
134
146
  - "false"
135
147
  - "true"
136
148
 
137
149
  - name: TRUST_PROMOTE_GATE_ENABLED
150
+ category: Trust
138
151
  portalInput:
139
152
  field: select
140
- label: "Enforce trust gate on external system publish (promote scope)"
153
+ label: "Enforce trust gate on Deploy / system publish (empty=ENVIRONMENT default)"
141
154
  options:
155
+ - ""
142
156
  - "false"
143
157
  - "true"
144
158
 
145
159
  - name: TRUST_RUNTIME_GATE_ENABLED
160
+ category: Trust
146
161
  portalInput:
147
162
  field: select
148
163
  label: "Enforce trust gate on CIP execution and workforce generation inputs (runtime scope)"
@@ -151,6 +166,7 @@ configuration:
151
166
  - "true"
152
167
 
153
168
  - name: TRUST_AI_EXPOSURE_GATE_ENABLED
169
+ category: Trust
154
170
  portalInput:
155
171
  field: select
156
172
  label: "Enforce trust gate on AI document-storage prompt generation"
@@ -164,24 +180,28 @@ configuration:
164
180
  # Tune based on customer data volumes and external API characteristics
165
181
 
166
182
  - name: CIP_EXECUTION_MAX_RECORDS
183
+ category: CIP Execution
167
184
  portalInput:
168
185
  field: text
169
186
  label: "Max Records per CIP Execution"
170
187
  placeholder: "100000"
171
188
 
172
189
  - name: CIP_EXECUTION_MAX_RESPONSE_SIZE_MB
190
+ category: CIP Execution
173
191
  portalInput:
174
192
  field: text
175
193
  label: "Max Response Size (MB)"
176
194
  placeholder: "100.0"
177
195
 
178
196
  - name: CIP_EXECUTION_OPERATION_TIMEOUT
197
+ category: CIP Execution
179
198
  portalInput:
180
199
  field: text
181
200
  label: "Operation Timeout (seconds)"
182
201
  placeholder: "300.0"
183
202
 
184
203
  - name: CIP_EXECUTION_HTTP_TIMEOUT
204
+ category: CIP Execution
185
205
  portalInput:
186
206
  field: text
187
207
  label: "HTTP Request Timeout (seconds)"
@@ -193,13 +213,23 @@ configuration:
193
213
  # Tune to match external API rate limits
194
214
 
195
215
  - name: CIP_EXECUTION_RATE_LIMIT_REQUESTS_PER_SECOND
216
+ category: CIP Rate Limiting
196
217
  portalInput:
197
218
  field: text
198
219
  label: "Rate Limit (requests/second)"
199
220
  placeholder: "10.0"
200
221
 
201
222
  - name: CIP_EXECUTION_RATE_LIMIT_BURST_SIZE
223
+ category: CIP Rate Limiting
202
224
  portalInput:
203
225
  field: text
204
226
  label: "Rate Limit Burst Size"
205
227
  placeholder: "20"
228
+
229
+ - name: ENTERPRISE_LLM_DEFAULT_SELECTOR
230
+ category: LLM
231
+ portalInput:
232
+ field: text
233
+ label: "Default LLM provider (system key when two or more providers)"
234
+ placeholder: "openai"
235
+
@@ -14,8 +14,9 @@ ENVIRONMENT=dev
14
14
  DEBUG=false
15
15
  # Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL
16
16
  LOG_LEVEL=INFO
17
- # Log format: json or text
18
- LOG_FORMAT=json
17
+ # Platform / enterprise language for Evidence platformText + Knowledge enterpriseLanguage.
18
+ # V1: English only. Do not change after install — no retranslation migration in V1.
19
+ AIFABRIX_PLATFORM_LANGUAGE=en
19
20
  # Path for log file output.
20
21
  # Docker default (no volume): use LOG_FILE_PATH=/app/logs/app.log (directory created in image).
21
22
  # Production with persistent logs: use /mnt/data/logs/app.log and mount a volume at /mnt/data.
@@ -43,7 +44,7 @@ API_KEY_BYPASS_ROLES=full-access
43
44
 
44
45
  # API Configuration
45
46
  API_V1_STR=/api/v1
46
- VERSION=2.0.0
47
+ VERSION=2.0.15
47
48
  # Minimum supported aifabrix-builder CLI semver (advertised on /health and /api/v1/health; empty = no gate)
48
49
  # MIN_BUILDER_CLI_VERSION=2.45.0
49
50
  MIN_BUILDER_CLI_VERSION=2.45.5
@@ -135,8 +136,6 @@ MISO_CLIENTSECRET=kv://dataplane-client-secretKeyVault
135
136
  # Keycloak Configuration (for OAuth2 endpoints)
136
137
  # Public: browser / issuer (includes /auth when Keycloak uses KC_HTTP_RELATIVE_PATH=/auth).
137
138
  KEYCLOAK_SERVER_URL=url://keycloak-public
138
- # Internal: server-to-Keycloak HTTP (docker: service:port + /auth from keycloak application.yaml)
139
- KEYCLOAK_INTERNAL_SERVER_URL=url://keycloak-internal
140
139
  KEYCLOAK_REALM=aifabrix
141
140
 
142
141
  # =============================================================================
@@ -155,9 +154,14 @@ MISO_LOGOUT_URL=/logout
155
154
  MISO_PIPELINE_ENV_KEY=
156
155
 
157
156
  # LLM: chat/embed route through governed enterprise-llm only. Provider credentials
158
- # live on LLM provider external systems (integration/openai, azure-openai, ollama).
159
- # Shared secret for integration/openai: secrets-openaiApiKeyVault (af secret set ... --shared)
160
- AI_VALIDATION_LLM_MODEL=gpt-4o-mini
157
+ # live on LLM provider external systems + dataplane secret store (not product .env).
158
+ # When ≥2 LLM providers are published under enterprise-llm, set selectorKey
159
+ # (system key), e.g. openai | azure-openai | ollama. Ignored when only one.
160
+ # Prefer portal Configuration category LLM after deploy; this env is the resolve target.
161
+ # Default LLM provider systemKey when ≥2 LLM providers are published under
162
+ # enterprise-llm (fail-closed if empty). Portal category LLM can override.
163
+ # Lab default: openai (catalog also ships azure-openai).
164
+ ENTERPRISE_LLM_DEFAULT_SELECTOR=openai
161
165
 
162
166
  # =============================================================================
163
167
  # AUDIT CONFIGURATION
@@ -194,6 +198,22 @@ AUDIT_ASYNC_SHADOW_ENQUEUE=false
194
198
  # Set true for local dev policy CRUD; pair with VITE_POLICY_MANAGEMENT_ENABLED=true in app-ui.
195
199
  POLICY_MANAGEMENT_API_ENABLED=false
196
200
 
201
+ # Role Assistant debug defaults (Assistants admin overrides per assistant):
202
+ # debugEnabled → agent_workforce.debugTraceEnabled
203
+ # fullDebugEnabled → agent_workforce.debugFullEnabled (system-prompt capture)
204
+ # debugRetentionDays → agent_workforce.debugTraceRetentionDays
205
+ WORKFORCE_RUNTIME_DEBUG_TRACE_ENABLED=false
206
+ # Shared retention for WorkerRuntimeDebugTrace + LlmPromptDebugCapture (daily Celery purge).
207
+ # WORKFORCE_RUNTIME_DEBUG_TRACE_RETENTION_DAYS=30
208
+ # WORKFORCE_RUNTIME_DEBUG_TRACE_MAX_ROWS_PER_TASK=500
209
+
210
+ # Platform default for Role Assistant fullDebugEnabled when assistant has no override.
211
+ # When unset: enabled in LOCAL_MODE or when WORKFORCE_RUNTIME_DEBUG_TRACE_ENABLED=true.
212
+ # Prefer Assistants admin → Full debug per Role Assistant.
213
+ # LLM_PROMPT_DEBUG_CAPTURE_ENABLED=
214
+ # LLM_PROMPT_DEBUG_SYSTEM_PROMPT_MAX_CHARS=32000
215
+ # LLM_PROMPT_DEBUG_USER_CONTENT_MAX_CHARS=4000
216
+
197
217
  # VIEW_MODULES — optional comma-separated UI module allowlist (unset = all modules).
198
218
  # Keys: dashboard, work, content-review, assistants, connected-systems, templates,
199
219
  # audit-logs, ai-trust, administration (deep link only; never sidebar in V1).
@@ -220,7 +240,6 @@ FIRST_PARTY_HTTP_INTERNAL_SPEC_EXTERNAL_SYSTEM_ID=
220
240
 
221
241
  # OpenTelemetry Configuration
222
242
  OPENTELEMETRY_ENABLED=false
223
- OPENTELEMETRY_ENDPOINT=
224
243
 
225
244
  # =============================================================================
226
245
  # INTEGRATION CERTIFICATE SIGNING (RS256 PEM)
@@ -30,6 +30,11 @@ roles:
30
30
  description: "Developer access to deploy applications via CI pipelines"
31
31
  groups: ["AI-Fabrix-Developers"]
32
32
 
33
+ - name: "AI Fabrix Business Transformation"
34
+ value: "aifabrix-business-transformation"
35
+ description: "Built-in assistant: business intention → governed Connected Systems via Runtime and builder-api"
36
+ groups: ["AI-Fabrix-Business-Transformation"]
37
+
33
38
  - name: "AI Fabrix Observer"
34
39
  value: "aifabrix-observer"
35
40
  description: "Read-only access to monitoring, logs, and compliance reports"
@@ -138,6 +143,20 @@ permissions:
138
143
  - name: "integration-template:delete"
139
144
  roles: ["aifabrix-platform-admin", "aifabrix-developer"]
140
145
  description: "Delete integration templates"
146
+
147
+ # Resource type catalog (public read; Miso owns writes via controller sync)
148
+ - name: "resource-type:read"
149
+ roles:
150
+ [
151
+ "aifabrix-platform-admin",
152
+ "aifabrix-security-admin",
153
+ "aifabrix-deployment-admin",
154
+ "aifabrix-compliance-admin",
155
+ "aifabrix-developer",
156
+ "aifabrix-observer",
157
+ "aifabrix-ai-trust-operator",
158
+ ]
159
+ description: "Read the global Resource Type catalog (list/get)"
141
160
 
142
161
  # Generic dataplane operations
143
162
  - name: "dataplane:read"
@@ -312,6 +331,10 @@ permissions:
312
331
  ]
313
332
  description: "Discover business context (semantics, exposure, enabled governance, tools, validation state) for external systems"
314
333
 
334
+ - name: "external-system:data-manager"
335
+ roles: ["aifabrix-platform-admin"]
336
+ description: "Reset (purge) all stored records, document rows, vectors, relations, and sync job history for a datasource (keeps datasource config)"
337
+
315
338
  - name: "governance:evaluate"
316
339
  roles: ["aifabrix-platform-admin", "aifabrix-security-admin", "aifabrix-developer"]
317
340
  description: "Run governance scenario acceptance (subject impersonation for ABAC proof)"
@@ -362,7 +385,9 @@ permissions:
362
385
  "aifabrix-developer",
363
386
  "aifabrix-ai-trust-operator",
364
387
  ]
365
- description: "Update assistantName or preferredChannel on a user activation"
388
+ description: >-
389
+ Update assistantName or preferredChannel on a user activation, and
390
+ work.continue on Process Executions
366
391
 
367
392
  - name: "worker:archive"
368
393
  roles:
@@ -380,7 +405,9 @@ permissions:
380
405
  "aifabrix-security-admin",
381
406
  "aifabrix-ai-trust-operator",
382
407
  ]
383
- description: "Approve or reject pending worker tasks"
408
+ description: >-
409
+ Approve or reject pending worker tasks, and record human.respond
410
+ (ask or approval) on Process Executions
384
411
 
385
412
  - name: "worker:manager-read"
386
413
  roles:
@@ -411,7 +438,47 @@ permissions:
411
438
  ]
412
439
  description: "Create, update, delete, and reorder Evidence Fabrix v2 rows"
413
440
 
441
+ # Knowledge Asset platform (465.1) — no public knowledge:create
442
+ - name: "knowledge:read"
443
+ roles:
444
+ [
445
+ "aifabrix-platform-admin",
446
+ "aifabrix-security-admin",
447
+ "aifabrix-developer",
448
+ "aifabrix-ai-trust-operator",
449
+ "aifabrix-observer",
450
+ ]
451
+ description: "List and get Knowledge Assets and EnterpriseLineage edges"
452
+
453
+ - name: "knowledge:update"
454
+ roles:
455
+ [
456
+ "aifabrix-platform-admin",
457
+ "aifabrix-developer",
458
+ "aifabrix-ai-trust-operator",
459
+ ]
460
+ description: "Update draft Knowledge Assets or supersede active versions"
461
+
462
+ - name: "knowledge:archive"
463
+ roles:
464
+ [
465
+ "aifabrix-platform-admin",
466
+ "aifabrix-developer",
467
+ "aifabrix-ai-trust-operator",
468
+ ]
469
+ description: "Archive Knowledge Assets and cascade disposable projections"
470
+
471
+ - name: "knowledge:delete"
472
+ roles:
473
+ [
474
+ "aifabrix-platform-admin",
475
+ "aifabrix-developer",
476
+ "aifabrix-ai-trust-operator",
477
+ ]
478
+ description: "Soft-delete Knowledge Assets and cascade disposable projections"
479
+
414
480
  # Workforce subscriptions (436.11 / 438.6)
481
+ # Role Assistant surfaces use worker:* (already defined above) — not agentWorkforce:*.
415
482
  - name: "subscription:read"
416
483
  roles:
417
484
  [
@@ -423,6 +490,15 @@ permissions:
423
490
  ]
424
491
  description: "List workforce subscriptions and execution audit rows"
425
492
 
493
+ - name: "subscription:write"
494
+ roles:
495
+ [
496
+ "aifabrix-platform-admin",
497
+ "aifabrix-developer",
498
+ "aifabrix-deployment-admin",
499
+ ]
500
+ description: "Create and update workforce subscriptions"
501
+
426
502
  - name: "subscription:run"
427
503
  roles:
428
504
  [
@@ -4,7 +4,7 @@ app:
4
4
  displayName: 'Miso Controller'
5
5
  description: 'Miso is the AI Fabrix in-tenant controller and portal layer for securely operating enterprise AI apps inside a customer’s Azure tenant. It provides Entra ID SSO, RBAC, audit logs, environment/app configuration via schemas, and safe secret handling via Key Vault references—ensuring governance, traceability, and predictable UX across portal, SDK, and CLI.'
6
6
  type: webapp
7
- version: '2.0.0'
7
+ version: '2.0.10'
8
8
 
9
9
  # Image Configuration
10
10
  # Set tag to match your build (e.g. aifabrix build miso-controller -t 1.0.0 then tag: 1.0.0)
@@ -81,6 +81,7 @@ configuration:
81
81
  # Operations & Debugging
82
82
  # -------------------------------------------------------------------------
83
83
  - name: LOG_LEVEL
84
+ category: General
84
85
  portalInput:
85
86
  field: select
86
87
  label: 'Log Level'
@@ -91,6 +92,7 @@ configuration:
91
92
  - error
92
93
 
93
94
  - name: ENABLE_API_DOCS
95
+ category: General
94
96
  portalInput:
95
97
  field: select
96
98
  label: 'Enable API Documentation (Swagger/ReDoc)'
@@ -99,6 +101,7 @@ configuration:
99
101
  - 'false'
100
102
 
101
103
  - name: FAST_STARTUP
104
+ category: General
102
105
  portalInput:
103
106
  field: select
104
107
  label: 'Fast Startup (skip non-critical init)'
@@ -107,6 +110,7 @@ configuration:
107
110
  - 'false'
108
111
 
109
112
  - name: LOG_TO_FILE
113
+ category: General
110
114
  portalInput:
111
115
  field: select
112
116
  label: 'Log to File'
@@ -118,6 +122,7 @@ configuration:
118
122
  # Keycloak Events (feature flag)
119
123
  # -------------------------------------------------------------------------
120
124
  - name: KEYCLOAK_EVENTS_ENABLED
125
+ category: General
121
126
  portalInput:
122
127
  field: select
123
128
  label: 'Keycloak Events (sync users/groups)'
@@ -129,12 +134,14 @@ configuration:
129
134
  # Rate Limiting (tune for environment)
130
135
  # -------------------------------------------------------------------------
131
136
  - name: RATE_LIMIT_WINDOW_MS
137
+ category: General
132
138
  portalInput:
133
139
  field: text
134
140
  label: 'Rate Limit Window (milliseconds)'
135
141
  placeholder: '900000'
136
142
 
137
143
  - name: RATE_LIMIT_MAX
144
+ category: General
138
145
  portalInput:
139
146
  field: text
140
147
  label: 'Rate Limit Max Requests per Window'
@@ -144,12 +151,14 @@ configuration:
144
151
  # Redis Cache TTL (seconds) – RBAC/roles caching
145
152
  # -------------------------------------------------------------------------
146
153
  - name: REDIS_ROLES_TTL
154
+ category: Redis
147
155
  portalInput:
148
156
  field: text
149
157
  label: 'Redis Roles Cache TTL (seconds)'
150
158
  placeholder: '900'
151
159
 
152
160
  - name: REDIS_PERMISSIONS_TTL
161
+ category: Redis
153
162
  portalInput:
154
163
  field: text
155
164
  label: 'Redis Permissions Cache TTL (seconds)'
@@ -63,6 +63,8 @@ NODE_ENV=dev
63
63
  PORT=${PORT}
64
64
  AUTO_CREATE_TABLES=true
65
65
  FAST_STARTUP=false
66
+ # Pending Prisma migrations still run on startup unless set to false (even when FAST_STARTUP=true).
67
+ # AUTO_RUN_MIGRATIONS=false
66
68
  ENABLE_API_DOCS=true
67
69
 
68
70
  # Rate Limiting Configuration (for local development)
@@ -189,7 +191,7 @@ CONTROLLER_EVALUATION=
189
191
  #
190
192
  # Delegated Graph (second redirect URI on the same vendor app): see section below.
191
193
  ENTRA_CALLBACK_STATE_SECRET=kv://entra-callback-state-secret
192
- ENTRA_ID_CENTRAL_CALLBACK_URI=kv://entra-callback-uri
194
+ ENTRA_ID_CENTRAL_CALLBACK_URI=https://aifabrix-pro-mori-web-we.azurewebsites.net/entra-id-concent/callback
193
195
  ENTRA_ID_CLIENT_ID=kv://entra-client-idKeyVault
194
196
  ENTRA_ID_CLIENT_SECRET=kv://entra-client-secretKeyVault
195
197
 
@@ -265,16 +267,16 @@ API_KEY=kv://miso-controller-secrets-apiKeyVault
265
267
  #
266
268
  # Development: set to DEVELOPMENT to disable license validation (no Mori/JWT required):
267
269
  # LICENSE_JWT=DEVELOPMENT
268
- # - Use only for local development; do not use in production.
269
- LICENSE_JWT=DEVELOPMENT
270
+ # - Use only for local development (DEPLOYMENT=local|database|azure-mock).
271
+ # - Ignored when DEPLOYMENT=azure (Azure marketplace / App Service installs).
272
+ LICENSE_JWT=kv://miso-controller-jwt-licenseKeyVault
270
273
 
271
274
  # =============================================================================
272
275
  # ENTRA ID ONBOARDING (delegated Graph via Mori)
273
276
  # =============================================================================
274
277
  # Must match a Web redirect URI on the vendor multi-tenant app and Mori’s route
275
- # …/entra-graph-delegated/callback. Example (001 dev Mori API):
276
- # ENTRA_GRAPH_DELEGATED_REDIRECT_URI=https://aifabrix001-mori-web-we.azurewebsites.net/entra-graph-delegated/callback
277
- ENTRA_GRAPH_DELEGATED_REDIRECT_URI=
278
+ # …/entra-graph-delegated/callback. Shared pro Mori (CICD):
279
+ ENTRA_GRAPH_DELEGATED_REDIRECT_URI=https://aifabrix-pro-mori-web-we.azurewebsites.net/entra-graph-delegated/callback
278
280
 
279
281
  # Optional delegated Graph scopes for GET …/graph-auth-url (space- or comma-separated).
280
282
  # ENTRA_GRAPH_DELEGATED_SCOPES=https://graph.microsoft.com/Application.ReadWrite.All,https://graph.microsoft.com/Group.ReadWrite.All,https://graph.microsoft.com/Synchronization.ReadWrite.All,openid,profile,offline_access
@@ -286,8 +288,11 @@ ENTRA_GRAPH_DELEGATED_REDIRECT_URI=
286
288
  # MORI SERVICE CONFIGURATION
287
289
  # =============================================================================
288
290
 
289
- MORI_BASE_URL=url://mori-controller-public
290
- MORI_AUTH_METHOD=apiKey
291
+ # Shared pro Mori (Entra handoff + Graph callback). Prefer this over url://mori-controller-public
292
+ # unless a local Mori app is registered and running for the developer.
293
+ MORI_BASE_URL=https://aifabrix-pro-mori-web-we.azurewebsites.net
294
+ MORI_AUTH_METHOD=kv://mori-controller-auth-methodKeyVault
295
+ MORI_CALLBACK_API_KEY=kv://mori-callback-api-keyKeyVault
291
296
  MORI_API_KEY=kv://mori-controller-api-keyKeyVault
292
297
  MORI_USERNAME=kv://mori-controller-basic-usernameKeyVault
293
298
  MORI_PASSWORD=kv://mori-controller-basic-passwordKeyVault