@exellix/ai-tasks 9.0.6 → 9.1.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 (177) hide show
  1. package/CHANGELOG.md +22 -4
  2. package/README.md +5 -5
  3. package/RUNTASK_REQUEST.md +17 -15
  4. package/dist/compile/compileTaskConfiguration.d.ts.map +1 -1
  5. package/dist/compile/compileTaskConfiguration.js +3 -0
  6. package/dist/compile/compileTaskConfiguration.js.map +1 -1
  7. package/dist/core/task-sdk.d.ts.map +1 -1
  8. package/dist/core/task-sdk.js +112 -166
  9. package/dist/core/task-sdk.js.map +1 -1
  10. package/dist/invocation/types.d.ts +1 -1
  11. package/dist/narrix/narrixUnitExecution.js +2 -2
  12. package/dist/narrix/narrixUnitExecution.js.map +1 -1
  13. package/dist/node-execution/buildRequestFromNodePlan.d.ts +4 -0
  14. package/dist/node-execution/buildRequestFromNodePlan.d.ts.map +1 -1
  15. package/dist/node-execution/buildRequestFromNodePlan.js +4 -13
  16. package/dist/node-execution/buildRequestFromNodePlan.js.map +1 -1
  17. package/dist/node-execution/compileProfessionalAnswerRequest.d.ts +2 -0
  18. package/dist/node-execution/compileProfessionalAnswerRequest.d.ts.map +1 -0
  19. package/dist/node-execution/compileProfessionalAnswerRequest.js +4 -0
  20. package/dist/node-execution/compileProfessionalAnswerRequest.js.map +1 -0
  21. package/dist/node-execution/rejectForbiddenWireFields.d.ts +2 -0
  22. package/dist/node-execution/rejectForbiddenWireFields.d.ts.map +1 -1
  23. package/dist/node-execution/rejectForbiddenWireFields.js +42 -7
  24. package/dist/node-execution/rejectForbiddenWireFields.js.map +1 -1
  25. package/dist/node-execution/resolveUnitModelSelection.d.ts.map +1 -1
  26. package/dist/node-execution/resolveUnitModelSelection.js +10 -1
  27. package/dist/node-execution/resolveUnitModelSelection.js.map +1 -1
  28. package/dist/observability/graphExecutionRunLogContract.d.ts +1 -1
  29. package/dist/observability/graphExecutionRunLogContract.js +1 -1
  30. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.d.ts +19 -3
  31. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.d.ts.map +1 -1
  32. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.js +7 -1
  33. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.js.map +1 -1
  34. package/dist/post-steps/audit/loadAuditTemplates.d.ts +2 -55
  35. package/dist/post-steps/audit/loadAuditTemplates.d.ts.map +1 -1
  36. package/dist/post-steps/audit/loadAuditTemplates.js +3 -38
  37. package/dist/post-steps/audit/loadAuditTemplates.js.map +1 -1
  38. package/dist/post-steps/audit/parseAuditFuncxOutput.d.ts +8 -0
  39. package/dist/post-steps/audit/parseAuditFuncxOutput.d.ts.map +1 -0
  40. package/dist/post-steps/audit/parseAuditFuncxOutput.js +62 -0
  41. package/dist/post-steps/audit/parseAuditFuncxOutput.js.map +1 -0
  42. package/dist/post-steps/audit/parseAuditOutput.d.ts +2 -0
  43. package/dist/post-steps/audit/parseAuditOutput.d.ts.map +1 -1
  44. package/dist/post-steps/audit/parseAuditOutput.js +56 -0
  45. package/dist/post-steps/audit/parseAuditOutput.js.map +1 -1
  46. package/dist/post-steps/audit/runAudit.d.ts.map +1 -1
  47. package/dist/post-steps/audit/runAudit.js +53 -113
  48. package/dist/post-steps/audit/runAudit.js.map +1 -1
  49. package/dist/post-steps/audit/runAuditFuncxCall.d.ts +18 -0
  50. package/dist/post-steps/audit/runAuditFuncxCall.d.ts.map +1 -0
  51. package/dist/post-steps/audit/runAuditFuncxCall.js +59 -0
  52. package/dist/post-steps/audit/runAuditFuncxCall.js.map +1 -0
  53. package/dist/synthesis/resolveSourceMaterial.d.ts.map +1 -1
  54. package/dist/synthesis/resolveSourceMaterial.js +14 -0
  55. package/dist/synthesis/resolveSourceMaterial.js.map +1 -1
  56. package/dist/types/task-types.d.ts +4 -3
  57. package/dist/types/task-types.d.ts.map +1 -1
  58. package/dist/utils/bridgeRunSkillGatewayMemory.d.ts.map +1 -1
  59. package/dist/utils/bridgeRunSkillGatewayMemory.js +1 -0
  60. package/dist/utils/bridgeRunSkillGatewayMemory.js.map +1 -1
  61. package/dist/utils/executionMemoryInputRecord.d.ts +12 -0
  62. package/dist/utils/executionMemoryInputRecord.d.ts.map +1 -0
  63. package/dist/utils/executionMemoryInputRecord.js +28 -0
  64. package/dist/utils/executionMemoryInputRecord.js.map +1 -0
  65. package/dist/utils/resolveAiProfileModel.d.ts +1 -1
  66. package/dist/utils/resolveAiProfileModel.d.ts.map +1 -1
  67. package/dist/utils/skillTemplateVariables.d.ts +3 -2
  68. package/dist/utils/skillTemplateVariables.d.ts.map +1 -1
  69. package/dist/utils/skillTemplateVariables.js +3 -2
  70. package/dist/utils/skillTemplateVariables.js.map +1 -1
  71. package/dist/validation/validateProfessionalAnswerContract.d.ts +8 -0
  72. package/dist/validation/validateProfessionalAnswerContract.d.ts.map +1 -0
  73. package/dist/validation/validateProfessionalAnswerContract.js +45 -0
  74. package/dist/validation/validateProfessionalAnswerContract.js.map +1 -0
  75. package/dist/validation/validateRunTaskConfig.d.ts.map +1 -1
  76. package/dist/validation/validateRunTaskConfig.js +2 -0
  77. package/dist/validation/validateRunTaskConfig.js.map +1 -1
  78. package/documenations/record-and-template-variables.md +21 -13
  79. package/documenations/run-task-execution-flow.md +1 -1
  80. package/documenations/schemas/v1/run-task-request.json +1 -1
  81. package/documenations/upstream-feature-requests/README.md +9 -5
  82. package/documenations/upstream-feature-requests/ai-skills-orchestrator-invoke-contract-5.9.md +1 -1
  83. package/documenations/upstream-feature-requests/funcx-4.9.13-open-items.md +62 -0
  84. package/documenations/upstream-feature-requests/funcx-gap-analysis-cr-fr.md +401 -0
  85. package/documenations/upstream-feature-requests/funcx-pre-post-sidekick-actions.md +1 -0
  86. package/documenations/upstream-feature-requests/graph-engine-runtask-contract-alignment-investigation.md +370 -0
  87. package/documenations/upstream-feature-requests/xynthesis-ai-profiles-2.1-import-break.md +2 -2
  88. package/documenations/upstream-feature-requests/xynthesis-openrouter-wire-model-double-prefix-bug.md +1 -1
  89. package/documenations/upstream-feature-requests/xynthesis-orchestrator-invoke-contract-4.2.md +1 -1
  90. package/package.json +14 -17
  91. package/.docs/DOWNSTREAM_ENV.md +0 -42
  92. package/.docs/FEEDBACK_TO_CLIENT_DOWNSTREAM_FIXES.md +0 -64
  93. package/.docs/INTERMEDIATE_STEPS.md +0 -82
  94. package/.docs/activity-structure.md +0 -31
  95. package/.docs/ai-task-ai-scoping-spec.md +0 -338
  96. package/.docs/ai-tasks-model-profile-aliases-7x.md +0 -96
  97. package/.docs/blockers-and-issues.md +0 -346
  98. package/.docs/building-runTask-sdk.md +0 -659
  99. package/.docs/building-skill-execution-orchestrator.md +0 -968
  100. package/.docs/code-used-before/run-task.txt +0 -39
  101. package/.docs/code-used-before/task-executor.ts.old +0 -57
  102. package/.docs/code-used-before/test-run-task.ts.old +0 -42
  103. package/.docs/code-used-before/types.txt +0 -23
  104. package/.docs/env-ready-policy.md +0 -40
  105. package/.docs/flow-io/flow-README.md +0 -76
  106. package/.docs/flow-io/narrix.md +0 -124
  107. package/.docs/flow-io/web-scoping.md +0 -135
  108. package/.docs/flow-io/xynthesis-post.md +0 -154
  109. package/.docs/flow-io/xynthesis-pre.md +0 -181
  110. package/.docs/gap-analysis.md +0 -201
  111. package/.docs/integration-facts-ai-tasks.md +0 -109
  112. package/.docs/investigation/ai-skills.md +0 -170
  113. package/.docs/investigation/external-packages-assignments.md +0 -66
  114. package/.docs/investigation/integration-summary.md +0 -20
  115. package/.docs/investigation/narrix-catalox.md +0 -29
  116. package/.docs/investigation/workplan-close-graph-engine-gaps.md +0 -101
  117. package/.docs/logging-stack.md +0 -30
  118. package/.docs/memory-narrix-adapter-developer-guide.md +0 -402
  119. package/.docs/memory-narrix-adapter-requirements.md +0 -112
  120. package/.docs/narrix-context-consumption-gap.md +0 -184
  121. package/.docs/narrix-context-downstream-report.md +0 -30
  122. package/.docs/narrix-ingest-and-packs-library-spec.md +0 -240
  123. package/.docs/narrix-record-input-current-design.md +0 -48
  124. package/.docs/pacakge.md +0 -48
  125. package/.docs/possible-components/README.md +0 -11
  126. package/.docs/possible-components/integration/README.md +0 -10
  127. package/.docs/possible-components/integration/gaps-when-merging.md +0 -16
  128. package/.docs/possible-components/integration/platform.md +0 -54
  129. package/.docs/possible-components/integration/reintegrate-into-ai-tasks.md +0 -26
  130. package/.docs/possible-components/integration/roadmap-and-checklists.md +0 -54
  131. package/.docs/possible-components/post-component/README.md +0 -18
  132. package/.docs/possible-components/post-component/builder-guide.md +0 -175
  133. package/.docs/possible-components/post-component/gaps-and-artifacts.md +0 -52
  134. package/.docs/possible-components/post-component/handler-audit.md +0 -47
  135. package/.docs/possible-components/post-component/handler-polish.md +0 -41
  136. package/.docs/possible-components/post-component/unified-protocol.md +0 -59
  137. package/.docs/possible-components/pre-component/README.md +0 -22
  138. package/.docs/possible-components/pre-component/builder-guide.md +0 -127
  139. package/.docs/possible-components/pre-component/gaps-and-artifacts.md +0 -35
  140. package/.docs/possible-components/pre-component/handler-ai-scoping.md +0 -45
  141. package/.docs/possible-components/pre-component/handler-narrix-preprocessor.md +0 -49
  142. package/.docs/possible-components/pre-component/handler-narrix-system2.md +0 -35
  143. package/.docs/possible-components/pre-component/handler-synthesized-context.md +0 -65
  144. package/.docs/possible-components/pre-component/handler-web-scope.md +0 -29
  145. package/.docs/possible-components/pre-component/unified-protocol.md +0 -89
  146. package/.docs/prefer-openrouter-routing-policy.md +0 -114
  147. package/.docs/questions-for-ai-skills.md +0 -123
  148. package/.docs/realtime-narrixing-gap-analysis.md +0 -40
  149. package/.docs/realtime-narrixing.md +0 -433
  150. package/.docs/run-context-object.md +0 -32
  151. package/.docs/session-id-usage.md +0 -26
  152. package/.docs/skill-library-spec.md +0 -249
  153. package/.docs/synthesized-context-strategy-spec.md +0 -906
  154. package/.docs/upstream-issue/2026-03-21_woroces-ai-tasks_ISSUE-006_web-scope-question-from-cni-entity.md +0 -46
  155. package/.docs/web-scopper-embed.md +0 -93
  156. package/.docs/xynthesis-wiring-and-io.md +0 -12
  157. package/documenations/activix-feature-request-identity.md +0 -123
  158. package/documenations/bug-report-xynthesis-and-synthesis-call.md +0 -217
  159. package/documenations/feature-request-ai-skills-raw-template-access.md +0 -82
  160. package/documenations/feature-request-athenix-core-directive.md +0 -145
  161. package/documenations/feature-request-athenix-token-extraction.md +0 -124
  162. package/documenations/funcx-upstream-github-issues-draft.md +0 -153
  163. package/documenations/identity-metadata-contract.md +0 -165
  164. package/documenations/run-task-single-run-checklist.md +0 -109
  165. package/documenations/sessions/2026-06-08-subnets-model-resolution/CR-1-no-concrete-wire-in-graph-plans.md +0 -93
  166. package/documenations/sessions/2026-06-08-subnets-model-resolution/CR-2-skillModel-profile-only-at-storage.md +0 -88
  167. package/documenations/sessions/2026-06-08-subnets-model-resolution/CR-3-reject-concrete-models-in-catalog-rows.md +0 -76
  168. package/documenations/sessions/2026-06-08-subnets-model-resolution/FR-1-suggested-profile-in-catalogs.md +0 -96
  169. package/documenations/sessions/2026-06-08-subnets-model-resolution/FR-2-graph-engine-failure-phase-attribution.md +0 -92
  170. package/documenations/sessions/2026-06-08-subnets-model-resolution/INVESTIGATION-original-bug.md +0 -182
  171. package/documenations/sessions/2026-06-08-subnets-model-resolution/PROBLEM.md +0 -236
  172. package/documenations/sessions/2026-06-08-subnets-model-resolution/README.md +0 -11
  173. package/documenations/sessions/2026-06-08-subnets-model-resolution/funcx-test-resolveModel.cheapDefaultWireSlug.test.ts +0 -117
  174. package/documenations/upstream-feature-requests/ai-tasks-wrap-up-after-upstream.md +0 -129
  175. package/documenations/upstream-feedback-request-shape-clarification.md +0 -101
  176. package/documenations/web-context-precedence.md +0 -33
  177. package/documenations/xynthesis-activix-telemetry.md +0 -28
@@ -0,0 +1,370 @@
1
+ # Investigation: graph-engine `RunTaskRequest` alignment (taskVariables + flat `executionMemory.input`)
2
+
3
+ **Status:** Draft v2 — **awaiting approval** (revised after graph-engine 8.1.x source audit)
4
+ **Date:** 2026-06-12 (v2 same day)
5
+ **Owners:** `@exellix/graph-engine` (implementation), `@exellix/ai-tasks` (contract + fixtures)
6
+ **Consumers:** `@exellix/ai-skills` (`professional-answer`), `@exellix/ai-tasks` `runTask()`
7
+ **graph-engine source:** `c:\prometheus\exellix\graph-engine` (audited separately from this mono-repo)
8
+ **Related:** [RUNTASK_REQUEST.md](../../RUNTASK_REQUEST.md), [record-and-template-variables.md](../record-and-template-variables.md), [graph-engine-task-pre-synthesis-compile.md](../../../archived/ai-tasks/reports/graph-engine-task-pre-synthesis-compile.md)
9
+
10
+ ---
11
+
12
+ ## 1. Purpose
13
+
14
+ Subnet-style graphs (`graph-qcrbz6t`, web-scope variants) need a **shared target contract** between graph-engine, ai-tasks, and ai-skills — especially `taskVariables`, flat `executionMemory.input`, and PRE synthesis on the **nodePlan-only** wire (graph-engine **≥ 8.1**, ai-tasks **9.x**).
15
+
16
+ This report:
17
+
18
+ 1. States the **normative target contract** (what we want on the wire).
19
+ 2. Records **graph-engine 8.1.x ground truth** (what is already implemented vs still missing).
20
+ 3. Proposes **remaining graph-engine changes** ranked P0–P2.
21
+ 4. Defines **acceptance criteria** for graph-engine CI (full compiled plan path, not preflight-only).
22
+
23
+ **v1 correction:** The first draft read like a greenfield spec and recommended **`taskConfiguration` forward (P0-1)**. That is **wrong** for graph-engine **≥ 8.1** / ai-tasks **9** when `nodePlan` is present — PRE must be compiled into **`nodePlan.executionUnits`**, and `taskConfiguration` is **forbidden** on the outbound wire.
24
+
25
+ **No graph-engine code should change until this revised report is approved.**
26
+
27
+ ---
28
+
29
+ ## 2. Scope
30
+
31
+ | In scope | Out of scope |
32
+ |----------|----------------|
33
+ | Compile path: graph node → `RunTaskRequest` | ai-skills FlexMD frame parsing |
34
+ | `executionMemory` seeding and per-node snapshots | FUNCX catalog hosting |
35
+ | `taskVariables` / `jobVariables` buckets | graph-engine failure-phase attribution (separate FR) |
36
+ | Flat `executionMemory.input` (MAIN record bucket) | Studio UX (P2 unless blocking) |
37
+ | `professional-answer` wire shape | Changing `executionMapping` apply location (stays in graph-engine) |
38
+ | PRE via **`nodePlan.executionUnits`** (not `taskConfiguration` on wire) | ai-tasks re-introducing legacy folding |
39
+
40
+ ---
41
+
42
+ ## 3. Evidence
43
+
44
+ | Artifact | Role |
45
+ |----------|------|
46
+ | [`test/fixtures/run-task/graph-engine-pre-synthesis.json`](../../test/fixtures/run-task/graph-engine-pre-synthesis.json) | **Target wire shape** (partially updated in ai-tasks mono-repo; still missing `nodePlan`, still includes transitional `taskConfiguration` — see §3.1) |
47
+ | [`test/fixtures/run-task/graph-engine-pre-synthesis-web-scope.json`](../../test/fixtures/run-task/graph-engine-pre-synthesis-web-scope.json) | Target + NARRIX/web-scope (ai-tasks mono-repo) |
48
+ | [`test/fixtures/graphs/graph-qcrbz6t-pre-synthesis.json`](../../test/fixtures/graphs/graph-qcrbz6t-pre-synthesis.json) | Fixed graph JSON (authoring shape) |
49
+ | [`test/fixtures/graphs/graph-qcrbz6t-format-2.1.0.json`](../../test/fixtures/graphs/graph-qcrbz6t-format-2.1.0.json) | Graphenix `formatVersion` 2.1.0 (studio) |
50
+ | graph-engine repo tests | `executeGraph` + `compileExellixExecutablePlan` path — **authoritative** for what graph-engine actually emits today |
51
+ | [`RUNTASK_REQUEST.md`](../../RUNTASK_REQUEST.md) | Normative field inventory (has known tension: §`taskConfiguration` lift vs graphenix v2.1 forbidden list) |
52
+
53
+ ### 3.1 Fixture honesty (ai-tasks mono-repo)
54
+
55
+ The ai-tasks golden [`graph-engine-pre-synthesis.json`](../../test/fixtures/run-task/graph-engine-pre-synthesis.json) was updated toward the target (`taskVariables.question`, top-level `outputContract`, flat `executionMemory.input`) but is **not yet a complete graph-engine 8.1 wire exemplar**:
56
+
57
+ | Field | Target | Current fixture |
58
+ |-------|--------|-----------------|
59
+ | `executionMemory.taskVariables.question` | Required | **Present** |
60
+ | `outputContract` top-level | Required | **Present** |
61
+ | `input.question` / `input.outputContract` | Absent | **Absent** |
62
+ | `nodePlan` with PRE `executionUnits` | Required @ 8.1 | **Missing** |
63
+ | `taskConfiguration` on wire | **Forbidden** with `nodePlan` | **Still present** (transitional / pre-8.1) |
64
+ | `modelConfig` on wire | **Forbidden** with `nodePlan` (recipe in plan units) | **Still present** (transitional) |
65
+
66
+ graph-engine parity tests today assert a **subset** (flat input, no `.raw`, `taskConfiguration === undefined`, `nodePlan` present) — not the full §4 contract. CI must be tightened after fixtures align.
67
+
68
+ ---
69
+
70
+ ## 4. Canonical contract (normative)
71
+
72
+ ### 4.1 Variable scopes
73
+
74
+ | Scope | On `RunTaskRequest` | Template tokens |
75
+ |-------|---------------------|-----------------|
76
+ | Job / graph | `variables` **and** `executionMemory.jobVariables` (same bucket) | `{{jobVariables.*}}` |
77
+ | Node / task | **`executionMemory.taskVariables` only** (no top-level field) | `{{taskVariables.*}}` |
78
+
79
+ - **Invalid:** root `question`, `variables.question`, relying on `input.question` alone for `professional-answer`.
80
+ - **Valid:** `executionMemory.taskVariables.question` (Catalox prompt `{{taskVariables.question}}`).
81
+
82
+ ### 4.2 MAIN input bucket
83
+
84
+ | Surface | Shape |
85
+ |---------|--------|
86
+ | `RunTaskRequest.input` | Flat task payload (`record`, `graphIntent`, …) — compiled from `inputsConfig` + `taskVariable` literals |
87
+ | `executionMemory.input` | **Same flat MAIN bucket** mirrored for PRE / NARRIX / synthesis — **not** nested under `input.raw` |
88
+
89
+ Legacy `executionMemory.input.raw` is **deprecated**. ai-tasks **still reads** nested `raw` as a fallback (G1 fix), but graph-engine must **not** treat it as canonical.
90
+
91
+ ### 4.3 `professional-answer` specifics
92
+
93
+ | Field | Wire location |
94
+ |-------|----------------|
95
+ | `question` | `executionMemory.taskVariables.question` |
96
+ | `outputContract` | **Top-level** `RunTaskRequest.outputContract` |
97
+ | Domain record | `input.record` (and mirrored flat `executionMemory.input` when graph seeds memory) |
98
+ | `graphIntent` | `input.graphIntent` (or job-scope `jobVariables` when authored that way) |
99
+
100
+ ### 4.4 Response consumption (graph-engine)
101
+
102
+ `executionMapping` must read structured skill output:
103
+
104
+ ```json
105
+ "shortAnswer": "output.parsed.shortAnswer"
106
+ ```
107
+
108
+ **Not** `flexMd.*` — FlexMD is ai-skills-internal; FUNCX / graph-engine consume `response.parsed`.
109
+
110
+ ### 4.5 PRE synthesis (graph-engine ≥ 8.1 / ai-tasks 9)
111
+
112
+ **Wire rule:** When `nodePlan` is present, these are **forbidden** on `RunTaskRequest`:
113
+
114
+ - `taskConfiguration`
115
+ - `executionPipeline`
116
+ - root `modelConfig` (recipe authority lives in plan units)
117
+
118
+ PRE synthesis must be compiled **before invoke** into frozen `nodePlan.executionUnits` — typically `externalPreUtility` or `pipelinePhase` units with correct `invokeContract` (strategy, memory reads, `includeContextInPrompt`). graph-engine passes the **compiled plan** from `compileExellixExecutablePlan` / `compileExecutablePlanV2` (`@x12i/graphenix-plan-compiler`).
119
+
120
+ ai-tasks executes PRE from plan units; it must **not** rely on a compile-time `taskConfiguration` blob on the wire.
121
+
122
+ **Legacy path (no compiled plan):** `buildTaskNodeRunTaskRequest` without a compiled plan may use `minimalNodePlanForSkillKey` (MAIN only, **no PRE**). Preflight tests on that path **cannot** validate PRE wiring.
123
+
124
+ ### 4.6 Graphenix v2.1 strict path
125
+
126
+ When using frozen `nodePlan` (`graphenix.node-plan/v2.1`):
127
+
128
+ - `nodePlan.invokeContract.taskVariables` → must appear on wire as `executionMemory.taskVariables`.
129
+ - `nodePlan.invokeContract.taskVariable` → must **not** re-place `question` / `outputContract` into `input` at runtime (coordination gap — see **P0-7**).
130
+ - Forbidden on wire with `nodePlan`: `taskConfiguration`, `executionPipeline`, root `modelConfig`.
131
+
132
+ ---
133
+
134
+ ## 5. Reference: correct outbound shape (excerpt)
135
+
136
+ From [`graph-engine-pre-synthesis.json`](../../test/fixtures/run-task/graph-engine-pre-synthesis.json):
137
+
138
+ ```json
139
+ {
140
+ "skillKey": "professional-answer",
141
+ "outputContract": { "shortAnswer": "...", "fullAnswer": "..." },
142
+ "input": {
143
+ "graphIntent": "Understand the subnet role in the topology.",
144
+ "record": { "target_subnet_cidr": "192.168.10.0/24" }
145
+ },
146
+ "executionMemory": {
147
+ "taskVariables": {
148
+ "question": "What inbound routed-reachability candidates exist for this subnet?"
149
+ },
150
+ "input": {
151
+ "target_subnet_cidr": "192.168.10.0/24",
152
+ "topology": { }
153
+ }
154
+ },
155
+ "nodePlan": {
156
+ "planVersion": "graphenix.node-plan/v2.1",
157
+ "executionUnits": [ "/* PRE synthesis unit(s) + MAIN */" ]
158
+ }
159
+ }
160
+ ```
161
+
162
+ **Note:** `executionMemory.input` mirrors the graph record fields **flat** — no `.raw` wrapper. `question` is **not** on `input` or root. **No** `taskConfiguration` / root `modelConfig` on this wire.
163
+
164
+ ---
165
+
166
+ ## 6. graph-engine 8.1.x ground truth (audited)
167
+
168
+ | Report item | Status in graph-engine | Notes |
169
+ |-------------|------------------------|-------|
170
+ | **P0-2** flat `executionMemory.input` | **Done** | `normalizeRuntimeExecutionMemory` seeds flat input; tests assert no `.raw` |
171
+ | **P0-4** `inputsConfig.path: "input"` | **Done** | Graph fixture + tests |
172
+ | **P0-6** `output.parsed.*` mapping | **Done** | `graph-qcrbz6t-pre-synthesis.json` |
173
+ | Job vs task buckets | **Partial** | `jobVariables` / `taskVariables` exist; `node.variables` → `taskVariables` |
174
+ | **P0-1** PRE enablement | **Different mechanism** | PRE via compiled `nodePlan.executionUnits`, **not** `taskConfiguration` on wire |
175
+ | **P0-3 / P0-5** `taskVariable` → wire | **Gap** | `taskVariable` literals compile to **`input`**; `mirrorTaskVariablesOnExecution` copies **`node.variables` only**, not `taskVariable.question` |
176
+ | **P0-1′** PRE in plan units | **Verify** | Tests expect `synthesisEnabled` via plan units; confirm `compileExecutablePlanV2` for all graph shapes |
177
+ | Preflight without compiled plan | **Trap** | `minimalNodePlanForSkillKey` = MAIN only — cannot validate PRE |
178
+
179
+ ### Remaining gap IDs (still accurate)
180
+
181
+ | ID | Behavior | Symptom |
182
+ |----|----------|---------|
183
+ | **GE-4** | `taskVariable.question` → `input.question` (not `taskVariables`) | Empty `{{taskVariables.question}}` / validation errors |
184
+ | **GE-5** | `outputContract` stays in `input` | Wrong gateway contract |
185
+ | **GE-6** | `node.taskVariables` / `taskVariable` not fully mirrored to `executionMemory.taskVariables` | Template scope wrong |
186
+ | **GE-7** | `flexMd` mapping (older graphs) | Empty mapping writes |
187
+ | **GE-8** | Stale `executionMemory` on parallel invokes | Downstream context wrong |
188
+ | **GE-9** | PRE hints only in `metadata.graphConcept` | No PRE units in compiled plan |
189
+ | ~~GE-1~~ | ~~Drops `taskConfiguration`~~ | **Not a bug @ 8.1** — forbidden by design |
190
+ | ~~GE-2~~ | ~~Only `input.raw`~~ | **Fixed** in graph-engine |
191
+ | ~~GE-3~~ | ~~`input.raw` path~~ | **Fixed** in fixtures |
192
+
193
+ ---
194
+
195
+ ## 7. Proposed graph-engine changes (requires approval)
196
+
197
+ ### P0 — Remaining work
198
+
199
+ | # | Change | Status | Notes |
200
+ |---|--------|--------|-------|
201
+ | **P0-1′** | Compile PRE into `nodePlan.executionUnits` + correct `invokeContract` (strategy, memory paths, `includeContextInPrompt`) | **Verify / complete** | Replaces v1 **P0-1** (`taskConfiguration` forward) — **do not** forward `taskConfiguration` on wire |
202
+ | **P0-2** | Flat `executionMemory.input` at graph run start | **Done** | Keep |
203
+ | **P0-3′** | Mirror **`taskVariable` prompt fields** (at least `question`) → `executionMemory.taskVariables`; keep `node.variables` merge | **Todo** | Extend `mirrorTaskVariablesOnExecution` or compile step |
204
+ | **P0-4** | `inputsConfig.path: "input"` | **Done** | Keep |
205
+ | **P0-5′** | Lift `outputContract` → top-level `RunTaskRequest.outputContract`; exclude `question` from `input` | **Todo** | `resolveTaskNodeInputsForRunTask` today merges full `taskVariable` into `input` |
206
+ | **P0-6** | `executionMapping` → `output.parsed.*` | **Done** in fixtures | Keep |
207
+ | **P0-7** | Align `nodePlan.invokeContract` with wire contract; stop double-merging `taskVariable` into `input` at ai-tasks boundary | **Coordination** | graph-engine compile + ai-tasks `buildRequestFromNodePlan` + graphenix compiler |
208
+
209
+ **P0-2 implementation sketch (approved direction):**
210
+
211
+ ```ts
212
+ // At graph run init — flat MAIN bucket
213
+ runtime.executionMemory.input = {
214
+ ...(runtime.executionMemory.input ?? {}),
215
+ ...(runtime.input ?? graphInvokePayload ?? {}),
216
+ };
217
+ // Do NOT wrap in { raw: ... } for new graphs
218
+ ```
219
+
220
+ **P0-4 `inputsConfig` example (authoring):**
221
+
222
+ ```json
223
+ "inputsConfig": {
224
+ "record": {
225
+ "type": "executionMemoryPath",
226
+ "path": "input"
227
+ }
228
+ }
229
+ ```
230
+
231
+ ### P1 — Correctness under parallelism + strict plans
232
+
233
+ | # | Change |
234
+ |---|--------|
235
+ | **P1-1** | Pass **current** shared `executionMemory` into every `runTask` invoke (parallel-safe) | GE-8 |
236
+ | **P1-2** | Emit `nodePlan` v2.1 with `invokeContract.taskVariables` populated from node authoring | GE-6 |
237
+ | **P1-3** | Lint: `pre: "synthesis"` requires resolvable `executionMemory.input` when record is required |
238
+ | **P1-4** | Reject / warn `INPUT_SYNTHESIS_PIPELINE_CONFLICT` per RUNTASK_REQUEST |
239
+
240
+ ### P2 — Migration + studio
241
+
242
+ | # | Change |
243
+ |---|--------|
244
+ | **P2-1** | Studio fields for `taskVariables`, `preInputStrategy`, `inputsConfig.path: input` |
245
+ | **P2-2** | One-time migration: `input.raw` → flat `input`, `variables.question` → `taskVariables.question`, mapping paths → `output.parsed.*` |
246
+ | **P2-3** | Update graph-engine docs that still prescribe `executionMemory.input.raw` |
247
+
248
+ ---
249
+
250
+ ## 8. ai-tasks: published vs mono-repo source
251
+
252
+ | Behavior | `@exellix/ai-tasks` **9.1.0** (published) | **This mono-repo** (unreleased) |
253
+ |----------|-------------------------------------------|----------------------------------|
254
+ | Flat `executionMemory.input` for PRE record | Question-driven path still prefers **`input.raw`** | **`readExecutionMemoryInputRecord`** — flat first |
255
+ | NARRIX `preferPaths` | `input.raw` before `input` | `input` before `input.raw` |
256
+ | `professional-answer` overlay | `buildRequestFromNodePlan` merges `invokeContract.taskVariable` → **`input`** | **`compileProfessionalAnswerRequest`** lifts `question` → `taskVariables`, `outputContract` top-level |
257
+ | Validation `taskVariables.question` | Not in 9.1.0 | **`validateProfessionalAnswerContract`** |
258
+ | PRE from `nodePlan` units | Yes (graphenix v2.1) | Same |
259
+ | PRE from `taskConfiguration` on wire | Legacy compile path when no forbidden fields | Stripped when `nodePlan` set |
260
+
261
+ **Implication:** Approving §7 requires stating an **ai-tasks version pin** (e.g. next release containing G1–G4) before graph-engine can rely on flat-input PRE + strict `professional-answer` validation.
262
+
263
+ ai-tasks **forwards** `executionMemory` **without** folding scopes into `variables`. It will **not** add graph-engine shims (e.g. re-nesting flat input under `.raw`).
264
+
265
+ ---
266
+
267
+ ## 9. Verification plan (graph-engine CI)
268
+
269
+ ### 9.1 Full plan compile test (required)
270
+
271
+ 1. Load [`graph-qcrbz6t-pre-synthesis.json`](../../test/fixtures/graphs/graph-qcrbz6t-pre-synthesis.json).
272
+ 2. Run **`compileExellixExecutablePlan`** (not preflight / `minimalNodePlanForSkillKey` only).
273
+ 3. Build `RunTaskRequest` via **`executeGraph`** path for node `step-1`.
274
+
275
+ **Must hold:**
276
+
277
+ - `nodePlan` present; `planVersion` = `graphenix.node-plan/v2.1`.
278
+ - `nodePlan.executionUnits` contains PRE unit (`externalPreUtility` and/or `pipelinePhase`).
279
+ - `taskConfiguration === undefined`, `executionPipeline === undefined`, root `modelConfig === undefined`.
280
+ - `executionMemory.taskVariables.question` present and non-empty.
281
+ - `outputContract` top-level; **absent** from `input`.
282
+ - `input.question` and `input.outputContract` **absent**.
283
+ - `executionMemory.input` flat; `'raw' in executionMemory.input === false`.
284
+
285
+ Then diff against an updated golden fixture (target shape in §5).
286
+
287
+ ### 9.2 PRE integration smoke
288
+
289
+ ```ts
290
+ import { runTask } from "@exellix/ai-tasks";
291
+
292
+ // request must include compiled nodePlan from graph-engine — NOT taskConfiguration compile
293
+ const res = await runTask(request, { catalox });
294
+ assert(res.metadata?.synthesisEnabled === true);
295
+ assert(String(res.parsed?.shortAnswer ?? "").trim().length > 0);
296
+ ```
297
+
298
+ Use model triplet from plan units / fixture. Do **not** gate on `flexMd.frame`.
299
+
300
+ ### 9.3 Mapping round-trip
301
+
302
+ After `runTask`, apply `executionMapping` and assert `executionMemory.answers.q1.shortAnswer` (or equivalent) is populated from `output.parsed`, not FlexMD.
303
+
304
+ ---
305
+
306
+ ## 10. Risk if graph-engine is not updated
307
+
308
+ | Risk | Impact |
309
+ |------|--------|
310
+ | PRE enabled in graph JSON but never runs | Silent quality loss |
311
+ | `professional-answer` with `input.question` only | Validation failure (ai-tasks 9.x+) or empty prompt |
312
+ | Flat memory in studio / 2.1 graphs, engine still nests `.raw` | Duplicate or divergent record shapes |
313
+ | `flexMd` mapping | Empty graph answers despite LLM success |
314
+ | Parallel nodes | Stale memory → wrong downstream context |
315
+
316
+ Backward compatibility in ai-tasks for `input.raw` is **temporary tolerance**, not a contract rollback.
317
+
318
+ ---
319
+
320
+ ## 11. Approval checklist
321
+
322
+ Before graph-engine implementation, confirm:
323
+
324
+ - [ ] **`nodePlan`-only wire** is canonical; **`taskConfiguration` forward is out of scope** for graph-engine ≥ 8.1 (P0-1′).
325
+ - [ ] **Flat `executionMemory.input`** is the canonical seed path (P0-2 — already done).
326
+ - [ ] **`taskVariable` → `taskVariables` / top-level `outputContract`** migration scoped across graph-engine compile, graphenix `invokeContract`, and ai-tasks `buildRequestFromNodePlan` (P0-3′, P0-5′, P0-7).
327
+ - [ ] **`output.parsed.*`** is the mapping source of truth (P0-6).
328
+ - [ ] Golden fixture updated to include `nodePlan` and **exclude** forbidden fields; §9.1 asserts **full** target shape.
329
+ - [ ] **ai-tasks version pin** stated (9.1.0 vs next release with flat-input PRE + `professional-answer` validation).
330
+ - [ ] P2 migration scope (auto-patch vs manual) is agreed with studio owners.
331
+
332
+ **Approved by:** _pending_
333
+ **graph-engine tracking issue:** _TBD_
334
+
335
+ ---
336
+
337
+ ## 12. ai-tasks follow-ups (after graph-engine approval — separate PRs)
338
+
339
+ These are **not** graph-engine work; listed for coordination only:
340
+
341
+ 1. Finish doc drift cleanup (`README.md` NARRIX path order, stale sections in `graph-engine-task-pre-synthesis-compile.md`).
342
+ 2. Default `compileTaskConfiguration` `memoryPaths` to `executionMemory.input` instead of `.raw`.
343
+ 3. Live smoke scripts: assert `response.parsed.*` instead of `flexMd.payloads`.
344
+
345
+ ---
346
+
347
+ ## Appendix A — Authoring → wire mapping (`professional-answer` node)
348
+
349
+ | Graph node field | Compiled to |
350
+ |------------------|-------------|
351
+ | `taskVariables.question` | `executionMemory.taskVariables.question` |
352
+ | `taskVariable.outputContract` | `RunTaskRequest.outputContract` |
353
+ | `inputs.graphIntent` | `input.graphIntent` |
354
+ | `inputsConfig.record` → `path: "input"` | `input.record` from flat `executionMemory.input` |
355
+ | `taskConfiguration.aiTaskStrategies` | compiled into `nodePlan.executionUnits` (not on wire) |
356
+ | `executionMapping.map.*` | `output.parsed.*` paths |
357
+
358
+ ## Appendix B — Deprecated patterns (do not emit from graph-engine)
359
+
360
+ | Deprecated | Replacement |
361
+ |------------|-------------|
362
+ | `executionMemory.input.raw` as canonical record | flat `executionMemory.input` |
363
+ | `inputsConfig.path: "input.raw"` | `path: "input"` |
364
+ | `input.question` / root `question` | `executionMemory.taskVariables.question` |
365
+ | `variables.question` (node scope) | `executionMemory.taskVariables.question` |
366
+ | `input.outputContract` | top-level `outputContract` |
367
+ | `executionMapping` → `flexMd.payloads.*` | `output.parsed.*` |
368
+ | `invokeContract.variables` (node plan) | `invokeContract.taskVariables` |
369
+ | `taskConfiguration` on wire with `nodePlan` | PRE units inside `nodePlan` only |
370
+ | root `modelConfig` with `nodePlan` | per-unit `modelSelection` in plan |
@@ -279,7 +279,7 @@ Run full suite with **`@x12i/ai-profiles@2.1.0`** installed (not 2.0.x).
279
279
  2. `npm install && npm run test`
280
280
  3. Patch release **8.4.x** updating README / BREAKING-CHANGES minimums
281
281
 
282
- See [`ai-tasks-wrap-up-after-upstream.md`](./ai-tasks-wrap-up-after-upstream.md).
282
+ See [`ai-tasks-wrap-up-after-upstream.md`](../../../archived/ai-tasks/documenations/upstream-feature-requests/superseded/ai-tasks-wrap-up-after-upstream.md).
283
283
 
284
284
  ---
285
285
 
@@ -319,6 +319,6 @@ See [`ai-tasks-wrap-up-after-upstream.md`](./ai-tasks-wrap-up-after-upstream.md)
319
319
  ## Related
320
320
 
321
321
  - [`@exellix/ai-tasks` `src/utils/aiProfileModelFormat.ts`](../../src/utils/aiProfileModelFormat.ts) — reference implementation
322
- - [`.docs/ai-tasks-model-profile-aliases-7x.md`](../../.docs/ai-tasks-model-profile-aliases-7x.md) — wire shapes orchestrators send
322
+ - [`.docs/ai-tasks-model-profile-aliases-7x.md`](../../../archived/ai-tasks/.docs/ai-tasks-model-profile-aliases-7x.md) — wire shapes orchestrators send
323
323
  - [`BREAKING-CHANGES.md`](../../BREAKING-CHANGES.md) — 8.4.x blocked subsection
324
324
  - [`xynthesis-orchestrator-invoke-contract-4.2.md`](./xynthesis-orchestrator-invoke-contract-4.2.md) — invoke contract (reasoningEffort shipped; import fix is separate P0)
@@ -186,6 +186,6 @@ Skill phase (`phaseKind: "skill"`) should **keep** `openrouter/` gateway prefix
186
186
 
187
187
  ## Related
188
188
 
189
- - [`.docs/prefer-openrouter-routing-policy.md`](../../.docs/prefer-openrouter-routing-policy.md)
189
+ - [`.docs/prefer-openrouter-routing-policy.md`](../../../archived/ai-tasks/.docs/prefer-openrouter-routing-policy.md)
190
190
  - [`funcx-openrouter-model-id-pass-through.md`](./funcx-openrouter-model-id-pass-through.md) — funcx is pass-through; no fix required there
191
191
  - [`xynthesis-upstream-fixes-checklist.md`](../xynthesis-upstream-fixes-checklist.md)
@@ -179,7 +179,7 @@ ai-tasks will follow whichever contract is published; default integration is **n
179
179
 
180
180
  ## After this ships — ai-tasks follow-up
181
181
 
182
- See [`ai-tasks-wrap-up-after-upstream.md`](./ai-tasks-wrap-up-after-upstream.md):
182
+ See [`ai-tasks-wrap-up-after-upstream.md`](../../../archived/ai-tasks/documenations/upstream-feature-requests/superseded/ai-tasks-wrap-up-after-upstream.md):
183
183
 
184
184
  - Remove `resolveMaxTokens` imports and `resolveLlmCallForXynthesis` token math.
185
185
  - Pass `outputExpectation` + `temperature` + `topP` + `reasoningEffort` into every `executeXynthesisAction` call.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exellix/ai-tasks",
3
- "version": "9.0.6",
3
+ "version": "9.1.1",
4
4
  "description": "Task orchestration for the Exellix stack: runTask() with local handlers or LLM-backed execution, task-scoped memory/context enrichment, and executor dispatch via @exellix/ai-skills. ERC-compliant.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "license": "exellix-license",
51
51
  "repository": {
52
52
  "type": "git",
53
- "url": "git+ssh://git@github.com:exellix/ai-tasks.git"
53
+ "url": "git+ssh://git@github.com/exellix/ai-tasks.git"
54
54
  },
55
55
  "publishConfig": {
56
56
  "registry": "https://registry.npmjs.org/",
@@ -59,12 +59,8 @@
59
59
  "engines": {
60
60
  "node": ">=20"
61
61
  },
62
- "overrides": {
63
- "@x12i/ai-tools": "^3.3.3",
64
- "@x12i/ai-profiles": "^3.4.0"
65
- },
66
62
  "dependencies": {
67
- "@exellix/ai-skills": "^6.7.0",
63
+ "@exellix/ai-skills": "^6.9.1",
68
64
  "@exellix/memorix-narrix-adapter": "^2.0.0",
69
65
  "@exellix/narrix-adapter-chat": "^2.0.0",
70
66
  "@exellix/narrix-adapter-docs": "^2.0.0",
@@ -76,18 +72,19 @@
76
72
  "@exellix/narrix-ingest": "^2.0.0",
77
73
  "@exellix/narrix-runner": "^2.0.0",
78
74
  "@exellix/narrix-web-scoper": "^2.0.0",
79
- "@exellix/xynthesis": "^4.6.7",
80
- "@x12i/activix": "^8.6.2",
75
+ "@exellix/xynthesis": "^4.8.2",
76
+ "@x12i/activix": "^8.6.3",
81
77
  "@x12i/ai-profiles": "^3.4.0",
82
- "@x12i/funcx": "^4.9.6",
83
- "@x12i/catalox": "^5.1.3",
78
+ "@x12i/catalox": "^5.2.0",
84
79
  "@x12i/env": "^4.0.1",
85
80
  "@x12i/execution-memory-manager": "^1.2.0",
86
- "@x12i/graphenix-executable-contracts": "^1.1.0",
87
- "@x12i/graphenix-plan-format": "^1.1.1",
88
- "@x12i/graphenix-trace-format": "^1.1.1",
81
+ "@x12i/funcx": "^4.9.13",
82
+ "@x12i/graphenix-core": "^2.0.1",
83
+ "@x12i/graphenix-executable-contracts": "^2.0.1",
84
+ "@x12i/graphenix-plan-format": "^2.0.1",
85
+ "@x12i/graphenix-trace-format": "^2.0.1",
89
86
  "@x12i/logxer": "^4.6.0",
90
- "@x12i/optimixer": "^3.5.1",
87
+ "@x12i/optimixer": "^3.5.2",
91
88
  "@x12i/rendrix": "^4.3.0",
92
89
  "@x12i/search-adapter": "^1.5.1",
93
90
  "handlebars": "^4.7.8",
@@ -95,8 +92,8 @@
95
92
  },
96
93
  "devDependencies": {
97
94
  "@types/node": "^18.0.0 || ^20.0.0",
98
- "@x12i/graphenix-authoring-format": "^1.2.1",
99
- "@x12i/graphenix-plan-compiler": "^1.1.1",
95
+ "@x12i/graphenix-authoring-format": "^2.0.1",
96
+ "@x12i/graphenix-plan-compiler": "^2.0.1",
100
97
  "dotenv": "^16.0.0",
101
98
  "ts-node": "^10.9.0",
102
99
  "tsx": "^4.0.0",
@@ -1,42 +0,0 @@
1
- # Downstream / upstream environment variables
2
-
3
- This document lists which env vars **ai-tasks** uses itself and which are consumed **downstream** (by @woroces/ai-skills, @athenices/ai-gateway, @athenices/ai-provider-router, @athenices/ai-activities-tracking). ai-tasks does **not** read router or Mongo collection env vars; they are used by dependencies. For full reference, see each package’s docs.
4
-
5
- ---
6
-
7
- ## Env vars used by ai-tasks
8
-
9
- | Variable | Purpose | Default |
10
- |----------|---------|--------|
11
- | `MONGO_LOGS_DB` | Default database name for activity logs; passed as `bindingDefaultsDb` to the skills client and used downstream for routing. | `logs-db` |
12
-
13
- ---
14
-
15
- ## Env vars consumed downstream (when using ai-tasks)
16
-
17
- These affect behavior when you run LLM-backed tasks or activity tracking but are **not** read by ai-tasks. They are used by ai-skills → ai-gateway → ai-provider-router and ai-activities-tracking.
18
-
19
- ### Provider / router (ai-gateway, ai-provider-router)
20
-
21
- | Variable | Purpose |
22
- |----------|--------|
23
- | `OPEN_ROUTER_KEY` or `OPENROUTER_API_KEY` | Use OpenRouter for LLM calls; no need to register providers when set. |
24
- | `PREFER_OPENROUTER` | Prefer OpenRouter routing when an OpenRouter API key is present. |
25
-
26
- Other provider keys (e.g. `OPENAI_API_KEY`, `GROK_API_KEY`) are validated by **ai-skills** at init; for OpenRouter-only setups, ai-skills must accept `OPEN_ROUTER_KEY` / `OPENROUTER_API_KEY` in its provider check.
27
-
28
- ### Activity tracking (ai-gateway → ai-activities-tracking)
29
-
30
- | Variable | Purpose | Default (in ai-activities-tracking) |
31
- |----------|---------|-------------------------------------|
32
- | `MONGO_LOGS_COLLECTION` | Main activities collection name. | `cognitive-activities` |
33
- | `MONGO_BAD_REQUESTS_COLLECTION` | Bad/validation-failure requests collection name. | `ai-bad-requests` |
34
-
35
- Both are **optional**; safe to leave unset. If unset or unresolved, ai-activities-tracking uses the defaults above and never uses the env var name as the collection name.
36
-
37
- ---
38
-
39
- ## Summary
40
-
41
- - **ai-tasks** only reads `MONGO_LOGS_DB` (for `bindingDefaultsDb`). All other Mongo and router env vars are used by downstream packages.
42
- - For “No provider specified and no providers registered” and collection-name issues, fixes live in ai-provider-router, ai-gateway, and ai-activities-tracking. Ensure you use versions of `@athenices/ai-gateway` (and thus ai-activities-tracking) that include those fixes.
@@ -1,64 +0,0 @@
1
- # Feedback to client (worox-graphs): downstream fixes for the two reported issues
2
-
3
- **Audience:** Consumer of `@woroces/ai-tasks` (e.g. `@woroces/worox-graph`) who reported the router and Mongo collection-name issues.
4
- **From:** ai-tasks maintainers
5
- **Date:** 2026-02-23
6
-
7
- ---
8
-
9
- ## Summary
10
-
11
- Both issues you reported were **downstream** of ai-tasks (in ai-provider-router, ai-gateway, and ai-activities-tracking). They are fixed in those packages. **No change is required in your application (worox-graphs).** After upgrading to versions that include the fixes, the problems should be resolved.
12
-
13
- ---
14
-
15
- ## 1. “No provider specified and no providers registered”
16
-
17
- **What you saw:** The router threw this error even when `OPEN_ROUTER_KEY` was set; your app only calls `ai-tasks.runTask()` and does not register any provider.
18
-
19
- **Where it was fixed:** In `@athenices/ai-provider-router` and/or `@athenices/ai-gateway`:
20
-
21
- - OpenRouter is now considered (and can be used) **before** the “no providers registered” check, so when `OPEN_ROUTER_KEY` (or `OPENROUTER_API_KEY`) is set, the router can resolve a provider without your app registering anything.
22
- - Error messaging was improved to point to setting `OPEN_ROUTER_KEY` or registering a provider when no provider can be used.
23
-
24
- **What you should do:**
25
-
26
- - **Upgrade** so your resolved dependency stack includes the **fixed ai-gateway** (and thus the fixed ai-provider-router). That usually means upgrading `@woroces/ai-tasks` to a version that depends on the fixed ai-gateway (e.g. ai-tasks 2.8.x with ai-gateway ^7.3.1 or the version that includes the router fix), then run `npm install`.
27
- - Ensure **`OPEN_ROUTER_KEY`** (or `OPENROUTER_API_KEY`, depending on what the gateway reads) is set in your environment when you want to use OpenRouter. Load `.env` before the process starts (e.g. via dotenv/dotenvx) as you already do.
28
- - You do **not** need to create or configure the router or register any provider in your app.
29
-
30
- ---
31
-
32
- ## 2. Mongo collection names (ENV.MONGO_BAD_REQUESTS_COLLECTION etc.)
33
-
34
- **What you saw:** When `MONGO_LOGS_COLLECTION` / `MONGO_BAD_REQUESTS_COLLECTION` were unset, the app used the env var name (or an `ENV.*` token) as the MongoDB collection name, creating collections like `ENV.MONGO_BAD_REQUESTS_COLLECTION`.
35
-
36
- **Where it was fixed:** In `@athenices/ai-activities-tracking`:
37
-
38
- - Defaults were added: **`cognitive-activities`** for the main logs collection and **`ai-bad-requests`** for the bad-requests collection.
39
- - Collection names are normalized so that unset or unresolved `ENV.*` tokens are never used as collection names; the default is used instead.
40
-
41
- **What you should do:**
42
-
43
- - **Upgrade** so your resolved stack includes the **fixed ai-activities-tracking** (typically by depending on a version of ai-gateway that depends on the fixed ai-activities-tracking). Upgrading ai-tasks (and ensuring ai-gateway is updated) will pull in the fixed version.
44
- - You **do not** need to set `MONGO_LOGS_COLLECTION` or `MONGO_BAD_REQUESTS_COLLECTION` unless you want to override the defaults. If they are unset or unresolved, the packages now use `cognitive-activities` and `ai-bad-requests` and never the env var name.
45
-
46
- ---
47
-
48
- ## No changes required in your repo
49
-
50
- - **worox-graphs** does not need to create or configure the AI router, register providers, or read Mongo collection env vars. The fixes are entirely in the packages that implement that behavior (ai-provider-router, ai-gateway, ai-activities-tracking).
51
- - Your only required action is to **upgrade** to versions that include these fixes (via `@woroces/ai-tasks` and its dependency tree). Optional: ensure `OPEN_ROUTER_KEY` (or `OPENROUTER_API_KEY`) is set when using OpenRouter.
52
-
53
- ---
54
-
55
- ## Upgrade checklist
56
-
57
- | Step | Action |
58
- |------|--------|
59
- | 1 | Upgrade `@woroces/ai-tasks` to a version that depends on the fixed ai-gateway (e.g. ^2.8.x with ai-gateway that includes the router fix). |
60
- | 2 | Run `npm install` (or your package manager’s equivalent) so the lockfile resolves to the fixed ai-gateway and its transitive deps (ai-provider-router, ai-activities-tracking). |
61
- | 3 | Ensure `.env` is loaded before the process starts and contains `OPEN_ROUTER_KEY` (or `OPENROUTER_API_KEY`) when using OpenRouter. |
62
- | 4 | Optionally leave `MONGO_LOGS_COLLECTION` and `MONGO_BAD_REQUESTS_COLLECTION` unset; they now default to `cognitive-activities` and `ai-bad-requests`. |
63
-
64
- If you still see “No provider specified and no providers registered” after upgrading, confirm that the resolved `@athenices/ai-gateway` (and `@athenices/ai-provider-router`) in your lockfile are the versions that include the OpenRouter fix, and that your env key (`OPEN_ROUTER_KEY` or `OPENROUTER_API_KEY`) is set before any gateway call.