@exellix/ai-tasks 8.4.3 → 8.5.0
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.
- package/CHANGELOG.md +16 -0
- package/dist/core/task-sdk.d.ts.map +1 -1
- package/dist/core/task-sdk.js +40 -15
- package/dist/core/task-sdk.js.map +1 -1
- package/dist/execution-strategies/constants.d.ts +11 -4
- package/dist/execution-strategies/constants.d.ts.map +1 -1
- package/dist/execution-strategies/constants.js +11 -4
- package/dist/execution-strategies/constants.js.map +1 -1
- package/dist/execution-strategies/executionStrategyCatalogMetadata.d.ts +6 -3
- package/dist/execution-strategies/executionStrategyCatalogMetadata.d.ts.map +1 -1
- package/dist/execution-strategies/executionStrategyCatalogMetadata.js +36 -5
- package/dist/execution-strategies/executionStrategyCatalogMetadata.js.map +1 -1
- package/dist/execution-strategies/executionStrategyRequestPayload.d.ts +19 -0
- package/dist/execution-strategies/executionStrategyRequestPayload.d.ts.map +1 -0
- package/dist/execution-strategies/executionStrategyRequestPayload.js +21 -0
- package/dist/execution-strategies/executionStrategyRequestPayload.js.map +1 -0
- package/dist/execution-strategies/runExecutionStrategyViaXynthesis.d.ts +35 -0
- package/dist/execution-strategies/runExecutionStrategyViaXynthesis.d.ts.map +1 -0
- package/dist/execution-strategies/runExecutionStrategyViaXynthesis.js +129 -0
- package/dist/execution-strategies/runExecutionStrategyViaXynthesis.js.map +1 -0
- package/dist/index.d.ts +14 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/resolveLlmCallForXynthesis.d.ts.map +1 -1
- package/dist/internal/resolveLlmCallForXynthesis.js +6 -0
- package/dist/internal/resolveLlmCallForXynthesis.js.map +1 -1
- package/dist/internal/runPostStepLlmCall.d.ts.map +1 -1
- package/dist/internal/runPostStepLlmCall.js +4 -1
- package/dist/internal/runPostStepLlmCall.js.map +1 -1
- package/dist/planWebScopeQuestions/index.d.ts +4 -8
- package/dist/planWebScopeQuestions/index.d.ts.map +1 -1
- package/dist/planWebScopeQuestions/index.js +109 -149
- package/dist/planWebScopeQuestions/index.js.map +1 -1
- package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts +21 -21
- package/dist/task-strategies/canonicalInputExecutionStrategies.js +12 -12
- package/dist/task-strategies/canonicalInputExecutionStrategies.js.map +1 -1
- package/dist/task-strategies/types.d.ts +4 -2
- package/dist/task-strategies/types.d.ts.map +1 -1
- package/dist/types/llmCall.d.ts +1 -1
- package/dist/types/llmCall.d.ts.map +1 -1
- package/dist/types/llmCall.js.map +1 -1
- package/documenations/upstream-feature-requests/README.md +1 -0
- package/documenations/upstream-feature-requests/xynthesis-execution-strategies-option-a.md +637 -0
- package/package.json +2 -4
package/dist/types/llmCall.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface LlmCallConfig {
|
|
|
49
49
|
/**
|
|
50
50
|
* Stage tag used in observations so consumers can filter by where the call originated.
|
|
51
51
|
*/
|
|
52
|
-
export type LlmCallStage = "pre-synthesis-markdown" | "pre-synthesis-question" | "pre-synthesis-structured" | "main-skill" | "post-audit" | "post-audit-merge" | "post-polish" | "ai-scoping" | "plan-web-scope-questions" | "utility-finalize" | "structured-repair";
|
|
52
|
+
export type LlmCallStage = "pre-synthesis-markdown" | "pre-synthesis-question" | "pre-synthesis-structured" | "main-skill" | "post-audit" | "post-audit-merge" | "post-polish" | "ai-scoping" | "plan-web-scope-questions" | "execution-strategy-planner" | "execution-strategy-optimizer" | "utility-finalize" | "structured-repair";
|
|
53
53
|
/** Snapshot of the request as resolved on the ai-tasks side (tuning only — no token cap fields). */
|
|
54
54
|
export type LlmCallRequestSnapshot = LlmCallConfig;
|
|
55
55
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llmCall.d.ts","sourceRoot":"","sources":["../../src/types/llmCall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,iBAAiB,E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","sources":["../../src/types/llmCall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAeH,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"llmCall.js","sourceRoot":"","sources":["../../src/types/llmCall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAeH,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AA8E9D,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,WAAW,CAAqB;IAChC,KAAK,CAAW;IACzB,YAAY,OAAe,EAAE,WAA+B,EAAE,KAAe;QAC3E,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvB,IAA4B,CAAC,KAAK,GAAG,KAAK,CAAC;QAC9C,CAAC;IACH,CAAC;CACF;AAQD,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -9,6 +9,7 @@ Fix reports filed for sibling packages. Hand these to the package owners; after
|
|
|
9
9
|
| `@exellix/ai-skills` 6.0 | [ai-skills-orchestrator-invoke-contract-5.9.md](./ai-skills-orchestrator-invoke-contract-5.9.md) | **shipped** — `ModelConfig.reasoningEffort` |
|
|
10
10
|
| `@exellix/xynthesis` 4.3 | [**xynthesis-ai-profiles-2.1-import-break.md**](./xynthesis-ai-profiles-2.1-import-break.md) | **shipped** in **4.3.1** — ai-profiles 2.1 import + profile/choice resolve |
|
|
11
11
|
| `@exellix/xynthesis` 4.3 | [xynthesis-orchestrator-invoke-contract-4.2.md](./xynthesis-orchestrator-invoke-contract-4.2.md) | **partial** — `reasoningEffort` shipped in 4.3.0; ai-profiles 2.1 import fixed in **4.3.1** (see CR above) |
|
|
12
|
+
| `@exellix/xynthesis` 4.4 | [**xynthesis-execution-strategies-option-a.md**](./xynthesis-execution-strategies-option-a.md) | **shipped** — execution-strategy sidekick actions; ai-tasks 8.5+ uses xynthesis (FuncX path deprecated) |
|
|
12
13
|
| `@x12i/ai-profiles` 2.1 | — | **shipped** — `catalogLane` required; sync `isKnownProfileOrShortcut` removed (safer — resolve at invoke) |
|
|
13
14
|
| `@exellix/ai-tasks` | [ai-tasks-wrap-up-after-upstream.md](./ai-tasks-wrap-up-after-upstream.md) | **done** in 8.4 — no legacy tiers; resolve at invoke via `resolveAIProfile` |
|
|
14
15
|
|
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
# `@exellix/xynthesis` — MAIN execution strategies (Option A: absorb FuncX wrappers)
|
|
2
|
+
|
|
3
|
+
Status: **shipped** in `@exellix/xynthesis` ≥ 4.4.0; ai-tasks **8.5.0** consumes via `runExecutionStrategyViaXynthesis`
|
|
4
|
+
Owner: `@exellix/xynthesis`
|
|
5
|
+
Filed by: `@exellix/ai-tasks`
|
|
6
|
+
Consumer: `@exellix/ai-tasks` 8.4+ (sole consumer — no separate package planned)
|
|
7
|
+
Target release: **`@exellix/xynthesis` ≥ 4.4.0** (semver minor; ai-tasks follow-up in 8.5.x)
|
|
8
|
+
Pinned in ai-tasks today: `@exellix/xynthesis@^4.3.1`
|
|
9
|
+
|
|
10
|
+
Related:
|
|
11
|
+
|
|
12
|
+
- [`xynthesis-orchestrator-invoke-contract-4.2.md`](./xynthesis-orchestrator-invoke-contract-4.2.md) — invoke contract this FR extends
|
|
13
|
+
- [`funcx-scoping-integration-gaps.md`](../funcx-scoping-integration-gaps.md) §6 — current FuncX wire contracts (source of truth for shapes)
|
|
14
|
+
- [`funcx-catalog-hosting-checklist.md`](../funcx-catalog-hosting-checklist.md) — what FuncX hosts today (to migrate prompts into xynthesis/Catalox)
|
|
15
|
+
- ai-tasks reference adapters: [`genericExecutionFuncxEnvelope.ts`](../../src/execution-strategies/genericExecutionFuncxEnvelope.ts)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 0. Decision record
|
|
20
|
+
|
|
21
|
+
**Chosen:** Option A — implement planner / optimizer / consolidated web-scope planning as **first-class xynthesis actions**, invoked like audit, polish, and scoping.
|
|
22
|
+
|
|
23
|
+
**Rejected:** Option B — a new `@exellix/*` package for execution strategies. Only `@exellix/ai-tasks` consumes these capabilities; a separate package would add publish/version overhead without reuse.
|
|
24
|
+
|
|
25
|
+
**Goal:** Remove **direct** `@x12i/funcx` usage from `@exellix/ai-tasks` for MAIN wrappers while preserving behavior, catalogs, and observability parity with other xynthesis hops.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 1. Summary
|
|
30
|
+
|
|
31
|
+
Today `@exellix/ai-tasks` calls FuncX **`run(functionId, payload)`** for:
|
|
32
|
+
|
|
33
|
+
| Capability | FuncX `functionId` | When |
|
|
34
|
+
|------------|-------------------|------|
|
|
35
|
+
| Planner | `execution/plan` | Once before first MAIN attempt |
|
|
36
|
+
| Optimizer | `execution/evaluate-result` | After each MAIN attempt (retry loop) |
|
|
37
|
+
| Web-scope questions (optional backend) | `research/plan-questions` | Narrix web-scope preprocessor |
|
|
38
|
+
|
|
39
|
+
These hops **bypass** the 8.4 invoke contract: no `modelConfig` slots, no Optimixer via `outputExpectation`, no `InvokeAttemptSummary`, no unified `LlmCallObservation`.
|
|
40
|
+
|
|
41
|
+
**Ask:** xynthesis exposes three structured actions on the same surface as audit/polish/scoping (`executeXynthesisAction` or thin dedicated wrappers), owns prompts + JSON schemas + Optimixer defaults, and returns typed results ai-tasks merges into `RunTaskRequest` before/after MAIN.
|
|
42
|
+
|
|
43
|
+
| Orchestrator sends (ai-tasks) | xynthesis owns internally |
|
|
44
|
+
|------------------------------|---------------------------|
|
|
45
|
+
| Wire **model** (from `modelConfig` slot — see §4) | — |
|
|
46
|
+
| **outputExpectation** | — |
|
|
47
|
+
| **temperature**, **topP**, **reasoningEffort** | — |
|
|
48
|
+
| Structured **input** payload (§5) | Prompt rendering from Catalox templates |
|
|
49
|
+
| **workScope** (`jobId`, `taskId`, `agentId`, identity) | Correlation / Activix attribution |
|
|
50
|
+
| — | **max completion tokens** (Optimixer) |
|
|
51
|
+
| — | Provider invoke (OpenRouter / gateway) |
|
|
52
|
+
| — | JSON parse + schema validation |
|
|
53
|
+
|
|
54
|
+
**ai-tasks keeps:** `executionStrategies` validation/sort, MAIN retry loop, `applyPlannerOutputToRequest` / `applyOptimizerFeedbackToRequest`, intermediateSteps / trace assembly. xynthesis does **not** call ai-skills or execute MAIN.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 2. Background — current ai-tasks behavior
|
|
59
|
+
|
|
60
|
+
### 2.1 Planner flow
|
|
61
|
+
|
|
62
|
+
1. `resolveExecutionStrategies` sorts `executionStrategies[]` rows with `strategyKey: "planner"`, `phase: "before"`.
|
|
63
|
+
2. For each planner row (typically one), ai-tasks builds `buildExecutionStrategyRequestPayload(...)` and calls `runPlannerFuncx` → FuncX `execution/plan`.
|
|
64
|
+
3. Response adapted by `adaptExecutionPlanResult` → merged via `applyPlannerOutputToRequest`:
|
|
65
|
+
- `variables` (shallow merge)
|
|
66
|
+
- `templateTokens` (+ `instructions` / `prompt` keys when present)
|
|
67
|
+
- `executionMemory.executionStrategies.lastPlanner` / `plannerChain`
|
|
68
|
+
|
|
69
|
+
### 2.2 Optimizer flow
|
|
70
|
+
|
|
71
|
+
1. First `optimizer` row after sort drives retry loop (`maxIterations` default 3, env `AI_TASKS_OPTIMIZER_MAX_ITERATIONS`).
|
|
72
|
+
2. Each iteration: `runDirect` (MAIN via ai-skills) → build `mainResultSummary` (rawText ≤ 12k, parsed, metadata summarized ≤ 6k) → `runOptimizerFuncx` → FuncX `execution/evaluate-result`.
|
|
73
|
+
3. If `satisfied === true` or last iteration: return MAIN result.
|
|
74
|
+
4. Else: `applyOptimizerFeedbackToRequest` sets `variables.optimizerFeedback`, `variables.optimizerIteration`, `variables.optimizerSuggestedChanges`, optional `templateTokens`, then retry MAIN.
|
|
75
|
+
|
|
76
|
+
### 2.3 Web-scope questions
|
|
77
|
+
|
|
78
|
+
- **Default path (keep):** `runPlanWebScopeQuestions` → `runPostStepLlmCall` → `executeXynthesisAction` with inline system prompt + `parseAndValidatePlanWebScopeQuestionsOutput`.
|
|
79
|
+
- **FuncX path (deprecate):** `backend: "funcx"` → `research/plan-questions` generic envelope.
|
|
80
|
+
|
|
81
|
+
### 2.4 Problem with FuncX path
|
|
82
|
+
|
|
83
|
+
[`runFuncxExecutionStrategy.ts`](../../src/execution-strategies/runFuncxExecutionStrategy.ts) uses `createClient({ backend: "openrouter" })` with **no** `RunTaskRequest.modelConfig` forwarding. Planner/optimizer ignore `preActionModel` / `postActionModel` and the unified observability stack.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 3. Scope
|
|
88
|
+
|
|
89
|
+
### 3.1 In scope (xynthesis)
|
|
90
|
+
|
|
91
|
+
- Three new **`SidekickActionType`** values (names provisional — see §4.1).
|
|
92
|
+
- Catalox sidekick templates + Optimixer catalog entries for each action.
|
|
93
|
+
- Public TypeScript request/response types + JSON schemas.
|
|
94
|
+
- Integration with `executeXynthesisAction` (preferred) or dedicated exports that delegate to it.
|
|
95
|
+
- Structured JSON output validation (same shapes ai-tasks adapters expect today).
|
|
96
|
+
- `InvokeAttemptSummary` / token resolution / model routing identical to audit/polish.
|
|
97
|
+
- Test hook: injectable invoker (same pattern as existing synthesis tests).
|
|
98
|
+
|
|
99
|
+
### 3.2 Out of scope (stays in ai-tasks)
|
|
100
|
+
|
|
101
|
+
- `RunTaskRequest.executionStrategies` array shape and validation.
|
|
102
|
+
- Optimizer **retry loop** and `maxIterations` policy.
|
|
103
|
+
- Merging planner/optimizer outputs into gateway request fields.
|
|
104
|
+
- FuncX catalog hosting for `execution/*` and `research/plan-questions` (deprecated after migration).
|
|
105
|
+
- MAIN skill execution (`@exellix/ai-skills`).
|
|
106
|
+
|
|
107
|
+
### 3.3 Deprecation
|
|
108
|
+
|
|
109
|
+
After ai-tasks migrates:
|
|
110
|
+
|
|
111
|
+
- ai-tasks removes direct `@x12i/funcx` dependency (may remain transitive via xynthesis/narrix).
|
|
112
|
+
- `backend: "funcx"` on `runPlanWebScopeQuestions` removed in ai-tasks major/minor follow-up.
|
|
113
|
+
- FuncX function ids remain documented for hosts that still call FuncX directly during transition.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 4. Public API
|
|
118
|
+
|
|
119
|
+
### 4.1 New sidekick actions
|
|
120
|
+
|
|
121
|
+
Add to xynthesis `SidekickActionType`:
|
|
122
|
+
|
|
123
|
+
| Action key | Purpose | ai-tasks `LlmCallStage` |
|
|
124
|
+
|------------|---------|-------------------------|
|
|
125
|
+
| `execution-plan` | Planner before MAIN | `execution-strategy-planner` |
|
|
126
|
+
| `execution-evaluate-result` | Optimizer after MAIN attempt | `execution-strategy-optimizer` |
|
|
127
|
+
| `plan-web-scope-questions` | Web-scope question planner (consolidate inline prompt) | `plan-web-scope-questions` (existing stage) |
|
|
128
|
+
|
|
129
|
+
**Canonical aliases** (for Catalox / docs): mirror former FuncX ids `execution/plan`, `execution/evaluate-result`, `research/plan-questions` as **documentation aliases only** — xynthesis uses sidekick action keys, not FuncX `functionId` routing.
|
|
130
|
+
|
|
131
|
+
### 4.2 Entry points
|
|
132
|
+
|
|
133
|
+
**Preferred — extend existing hop API:**
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
import type { OutputExpectation } from "@exellix/xynthesis/ai-actions";
|
|
137
|
+
import type { OptimixerReasoningEffort } from "@x12i/optimixer";
|
|
138
|
+
|
|
139
|
+
/** Shared invoke fields — same contract as audit/polish (see xynthesis-orchestrator-invoke-contract-4.2.md). */
|
|
140
|
+
type ExecutionStrategyInvokeBase = {
|
|
141
|
+
model: string;
|
|
142
|
+
outputExpectation: OutputExpectation;
|
|
143
|
+
temperature?: number;
|
|
144
|
+
topP?: number;
|
|
145
|
+
reasoningEffort?: OptimixerReasoningEffort;
|
|
146
|
+
timeoutMs?: number;
|
|
147
|
+
maxOutputLength?: number;
|
|
148
|
+
gateway?: { agentId?: string; sessionId?: string; temperature?: number };
|
|
149
|
+
workScope?: {
|
|
150
|
+
jobId?: string;
|
|
151
|
+
taskId?: string;
|
|
152
|
+
agentId?: string;
|
|
153
|
+
identity?: Record<string, unknown>;
|
|
154
|
+
};
|
|
155
|
+
/** Strategy row args minus functionId — opaque JSON-safe knobs forwarded into template context. */
|
|
156
|
+
strategyArgs?: Record<string, unknown>;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/** Planner — maps from buildPlannerGenericPayload envelope. */
|
|
160
|
+
export type RunExecutionPlanRequest = ExecutionStrategyInvokeBase & {
|
|
161
|
+
sidekickAction: "execution-plan";
|
|
162
|
+
goal: string;
|
|
163
|
+
input?: unknown;
|
|
164
|
+
context: ExecutionStrategyContext;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/** Optimizer — maps from buildOptimizerGenericPayload envelope. */
|
|
168
|
+
export type RunExecutionEvaluateResultRequest = ExecutionStrategyInvokeBase & {
|
|
169
|
+
sidekickAction: "execution-evaluate-result";
|
|
170
|
+
goal: string;
|
|
171
|
+
input?: unknown;
|
|
172
|
+
context: ExecutionStrategyContext;
|
|
173
|
+
result: MainResultSummary;
|
|
174
|
+
iterationIndex: number;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/** Web-scope — maps from buildResearchPlanQuestionsPayload envelope. */
|
|
178
|
+
export type RunPlanWebScopeQuestionsRequest = ExecutionStrategyInvokeBase & {
|
|
179
|
+
sidekickAction: "plan-web-scope-questions";
|
|
180
|
+
goal: string;
|
|
181
|
+
input: { nodeInput?: unknown; rawRecord?: unknown };
|
|
182
|
+
context?: {
|
|
183
|
+
memorySummary?: unknown;
|
|
184
|
+
xynthesized?: { job?: unknown; task?: unknown };
|
|
185
|
+
};
|
|
186
|
+
args: {
|
|
187
|
+
maxQuestions: number; // 1–20, clamped by xynthesis
|
|
188
|
+
sourceType: "web";
|
|
189
|
+
allowSkip: boolean;
|
|
190
|
+
includeReasons?: boolean;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export type ExecutionStrategyContext = {
|
|
195
|
+
skillKey?: string;
|
|
196
|
+
variables?: Record<string, unknown>;
|
|
197
|
+
jobContext?: Record<string, unknown>;
|
|
198
|
+
jobMemory?: unknown;
|
|
199
|
+
taskMemory?: unknown;
|
|
200
|
+
executionMemory?: unknown;
|
|
201
|
+
jobId?: string;
|
|
202
|
+
taskId?: string;
|
|
203
|
+
agentId?: string;
|
|
204
|
+
graphId?: string;
|
|
205
|
+
nodeId?: string;
|
|
206
|
+
prevNodeId?: string;
|
|
207
|
+
coreSkillId?: string;
|
|
208
|
+
includeContextInPrompt?: boolean;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export type MainResultSummary = {
|
|
212
|
+
rawText?: string;
|
|
213
|
+
parsed?: unknown;
|
|
214
|
+
skillKey?: string;
|
|
215
|
+
metadata?: unknown;
|
|
216
|
+
};
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Dispatch:** Either overload `executeXynthesisAction` to accept these `sidekickAction` values, or export:
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
export async function runExecutionPlan(req: RunExecutionPlanRequest): Promise<ExecutionPlanResult>;
|
|
223
|
+
export async function runExecutionEvaluateResult(req: RunExecutionEvaluateResultRequest): Promise<ExecutionEvaluateResult>;
|
|
224
|
+
export async function runPlanWebScopeQuestionsAction(req: RunPlanWebScopeQuestionsRequest): Promise<PlanWebScopeQuestionsResult>;
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
All three must return `{ result, invokeSummary, debugTrace? }` consistent with other actions.
|
|
228
|
+
|
|
229
|
+
### 4.3 Model slot mapping (ai-tasks caller policy)
|
|
230
|
+
|
|
231
|
+
ai-tasks resolves model aliases before invoke:
|
|
232
|
+
|
|
233
|
+
| Action | Default `modelConfig` slot | Rationale |
|
|
234
|
+
|--------|---------------------------|-----------|
|
|
235
|
+
| `execution-plan` | **`preActionModel`** | Runs before MAIN; same phase family as PRE synthesis |
|
|
236
|
+
| `execution-evaluate-result` | **`postActionModel`** | Evaluative hop (like audit); judges MAIN output quality |
|
|
237
|
+
| `plan-web-scope-questions` | **`preActionModel`** | Pre-MAIN Narrix web-scope preprocessor |
|
|
238
|
+
|
|
239
|
+
Per-strategy override (ai-tasks follow-up, optional): `executionStrategies[].llmCall?.model` wins over slot default when set.
|
|
240
|
+
|
|
241
|
+
### 4.4 OutputExpectation defaults (xynthesis Optimixer catalog)
|
|
242
|
+
|
|
243
|
+
Register Catalox defaults per action (ai-tasks may override via `llmCall.outputExpectation`):
|
|
244
|
+
|
|
245
|
+
| Action | Suggested default | Notes |
|
|
246
|
+
|--------|-------------------|-------|
|
|
247
|
+
| `execution-plan` | `{ size: { mode: "absolute", minWords: 80, maxWords: 600 }, density: "concise" }` | Structured plan text + optional variables |
|
|
248
|
+
| `execution-evaluate-result` | `{ size: { mode: "absolute", minWords: 40, maxWords: 400 }, density: "concise" }` | Boolean satisfied + feedback |
|
|
249
|
+
| `plan-web-scope-questions` | `{ size: { mode: "absolute", minWords: 50, maxWords: 800 }, density: "concise" }` | JSON array of questions |
|
|
250
|
+
|
|
251
|
+
Expose via `resolveOutputExpectation("execution-plan" | ...)` when action keys are added.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## 5. Input contracts (wire payloads)
|
|
256
|
+
|
|
257
|
+
These mirror today's FuncX generic envelope built in ai-tasks. xynthesis templates receive **`goal`**, **`input`**, **`context`**, optional **`result`** (optimizer only), **`args`**, and **`strategyArgs`**.
|
|
258
|
+
|
|
259
|
+
### 5.1 Planner input
|
|
260
|
+
|
|
261
|
+
Built by ai-tasks `buildPlannerGenericPayload`:
|
|
262
|
+
|
|
263
|
+
```json
|
|
264
|
+
{
|
|
265
|
+
"goal": "Plan how to execute the MAIN gateway skill for skillKey \"my.skill\" (coreSkillId: node-1).",
|
|
266
|
+
"input": { "...": "task input — opaque" },
|
|
267
|
+
"context": {
|
|
268
|
+
"skillKey": "my.skill",
|
|
269
|
+
"variables": {},
|
|
270
|
+
"jobContext": {},
|
|
271
|
+
"jobMemory": {},
|
|
272
|
+
"taskMemory": {},
|
|
273
|
+
"executionMemory": {},
|
|
274
|
+
"jobId": "uuid",
|
|
275
|
+
"taskId": "uuid",
|
|
276
|
+
"agentId": "uuid",
|
|
277
|
+
"graphId": "optional",
|
|
278
|
+
"nodeId": "optional",
|
|
279
|
+
"prevNodeId": "optional",
|
|
280
|
+
"coreSkillId": "optional",
|
|
281
|
+
"includeContextInPrompt": false
|
|
282
|
+
},
|
|
283
|
+
"args": { "...": "optional strategy row args except functionId" },
|
|
284
|
+
"attribution": {
|
|
285
|
+
"runId": "jobId",
|
|
286
|
+
"subjectId": "taskId",
|
|
287
|
+
"actorId": "agentId",
|
|
288
|
+
"tags": { "caller": "ai-tasks", "jobId": "...", "taskId": "...", "agentId": "..." }
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Template requirements:**
|
|
294
|
+
|
|
295
|
+
- Must **not** execute MAIN or call ai-skills.
|
|
296
|
+
- Use `goal` as the primary objective line in the user prompt.
|
|
297
|
+
- Render `input` + `context` as JSON-safe sections (truncate large blobs with explicit markers).
|
|
298
|
+
- Forward correlation from `workScope` / `attribution` into provider attribution fields.
|
|
299
|
+
|
|
300
|
+
### 5.2 Optimizer input
|
|
301
|
+
|
|
302
|
+
Built by ai-tasks `buildOptimizerGenericPayload`. Same as planner plus:
|
|
303
|
+
|
|
304
|
+
```json
|
|
305
|
+
{
|
|
306
|
+
"result": {
|
|
307
|
+
"rawText": "...(max ~12000 chars from ai-tasks)...",
|
|
308
|
+
"parsed": { "...": "skill parsed output if any" },
|
|
309
|
+
"skillKey": "my.skill",
|
|
310
|
+
"metadata": { "...": "summarized metadata max ~6000 chars" }
|
|
311
|
+
},
|
|
312
|
+
"args": {
|
|
313
|
+
"iterationIndex": 0,
|
|
314
|
+
"...": "optional strategy row args except functionId"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
`iterationIndex` is **zero-based** (first MAIN attempt → optimizer call with `iterationIndex: 0`).
|
|
320
|
+
|
|
321
|
+
### 5.3 Web-scope questions input
|
|
322
|
+
|
|
323
|
+
Built by ai-tasks `buildResearchPlanQuestionsPayload`:
|
|
324
|
+
|
|
325
|
+
```json
|
|
326
|
+
{
|
|
327
|
+
"goal": "<nodeQuestion trimmed>",
|
|
328
|
+
"input": {
|
|
329
|
+
"nodeInput": null,
|
|
330
|
+
"rawRecord": { "...": "optional" }
|
|
331
|
+
},
|
|
332
|
+
"context": {
|
|
333
|
+
"memorySummary": { "jobMemory": {}, "taskMemory": {}, "executionMemory": {} },
|
|
334
|
+
"xynthesized": { "job": {}, "task": {} }
|
|
335
|
+
},
|
|
336
|
+
"args": {
|
|
337
|
+
"maxQuestions": 5,
|
|
338
|
+
"sourceType": "web",
|
|
339
|
+
"allowSkip": true,
|
|
340
|
+
"includeReasons": true
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
**Migration note:** Replace ai-tasks inline `PLAN_WEB_SCOPE_SYSTEM` string with xynthesis Catalox template producing **identical** JSON shape (§6.3).
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## 6. Output contracts (structured JSON)
|
|
350
|
+
|
|
351
|
+
xynthesis validates model JSON **before** returning to ai-tasks. On parse/validation failure: throw `XynthesisResponseParseError` with raw text preserved (same as structured synthesis).
|
|
352
|
+
|
|
353
|
+
### 6.1 Planner output — `ExecutionPlanResult`
|
|
354
|
+
|
|
355
|
+
Minimum schema (all fields optional except empty object allowed):
|
|
356
|
+
|
|
357
|
+
```typescript
|
|
358
|
+
type ExecutionPlanResult = {
|
|
359
|
+
/** Primary merge field — preferred over plan/steps. */
|
|
360
|
+
instructions?: string;
|
|
361
|
+
plan?: string;
|
|
362
|
+
steps?: Array<{
|
|
363
|
+
title?: string;
|
|
364
|
+
description?: string;
|
|
365
|
+
reason?: string;
|
|
366
|
+
}>;
|
|
367
|
+
assumptions?: string[];
|
|
368
|
+
missingInputs?: string[];
|
|
369
|
+
suggestedContext?: string[];
|
|
370
|
+
/** Direct gateway overlays (optional). */
|
|
371
|
+
prompt?: string;
|
|
372
|
+
variables?: Record<string, unknown>;
|
|
373
|
+
templateTokens?: Record<string, unknown>;
|
|
374
|
+
/** Alternate nesting — ai-tasks adapters also read metadata.* today. */
|
|
375
|
+
metadata?: {
|
|
376
|
+
variables?: Record<string, unknown>;
|
|
377
|
+
templateTokens?: Record<string, unknown>;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Normalization (xynthesis or ai-tasks — pick one owner, document):**
|
|
383
|
+
|
|
384
|
+
- ai-tasks today merges `instructions` ← `instructions` || `plan` || rendered `steps`; appends assumptions/missingInputs/suggestedContext into `instructions` text.
|
|
385
|
+
- **Recommendation:** xynthesis returns **raw structured object**; ai-tasks keeps `adaptExecutionPlanResult` unchanged during migration, then optionally deletes adapter once xynthesis guarantees canonical shape.
|
|
386
|
+
|
|
387
|
+
### 6.2 Optimizer output — `ExecutionEvaluateResult`
|
|
388
|
+
|
|
389
|
+
```typescript
|
|
390
|
+
type ExecutionEvaluateResult = {
|
|
391
|
+
/** Required — strict boolean; only `true` stops retry loop. */
|
|
392
|
+
satisfied: boolean;
|
|
393
|
+
feedback?: string;
|
|
394
|
+
suggestedChanges?: string[];
|
|
395
|
+
issues?: Array<{
|
|
396
|
+
issue: string;
|
|
397
|
+
severity?: string;
|
|
398
|
+
reason?: string;
|
|
399
|
+
}>;
|
|
400
|
+
variables?: Record<string, unknown>;
|
|
401
|
+
templateTokens?: Record<string, unknown>;
|
|
402
|
+
metadata?: {
|
|
403
|
+
variables?: Record<string, unknown>;
|
|
404
|
+
templateTokens?: Record<string, unknown>;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
**ai-tasks merge semantics (unchanged):**
|
|
410
|
+
|
|
411
|
+
- `feedback` + rendered `suggestedChanges` + rendered `issues` → `variables.optimizerFeedback`
|
|
412
|
+
- `suggestedChanges` → `variables.optimizerSuggestedChanges`
|
|
413
|
+
- `templateTokens` shallow-merged into request
|
|
414
|
+
- `satisfied === true` → stop retry loop
|
|
415
|
+
|
|
416
|
+
### 6.3 Web-scope output — `PlanWebScopeQuestionsResult`
|
|
417
|
+
|
|
418
|
+
Must match ai-tasks [`PlanWebScopeQuestionsOutput`](../../src/planWebScopeQuestions/index.ts):
|
|
419
|
+
|
|
420
|
+
```typescript
|
|
421
|
+
type PlanWebScopeQuestionsResult = {
|
|
422
|
+
questions: Array<{
|
|
423
|
+
id?: string;
|
|
424
|
+
question: string;
|
|
425
|
+
reason: string;
|
|
426
|
+
source: "ai-driven";
|
|
427
|
+
}>;
|
|
428
|
+
confidence: number; // 0–1 inclusive
|
|
429
|
+
skipped?: boolean;
|
|
430
|
+
reasonCodes?: string[];
|
|
431
|
+
};
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**Validation rules** (port from `parseAndValidatePlanWebScopeQuestionsOutput`):
|
|
435
|
+
|
|
436
|
+
- Root must be object; `confidence` finite in [0, 1].
|
|
437
|
+
- `questions` array length ≤ `args.maxQuestions` (1–20).
|
|
438
|
+
- Each question: non-empty `question`, non-empty `reason`, `source` must be `"ai-driven"` when set.
|
|
439
|
+
- Empty questions + `skipped: true` allowed (e.g. `reasonCodes: ["INPUT_TOO_THIN"]`).
|
|
440
|
+
- xynthesis assigns UUID `id` when missing **or** leave to ai-tasks (document choice; ai-tasks can keep id generation).
|
|
441
|
+
|
|
442
|
+
**System prompt content** to migrate into Catalox (currently in ai-tasks):
|
|
443
|
+
|
|
444
|
+
```
|
|
445
|
+
You are a planning assistant for web evidence collection.
|
|
446
|
+
Return ONLY a single JSON object (no markdown fences, no prose) with this exact shape:
|
|
447
|
+
{
|
|
448
|
+
"questions": Array<{ "id"?: string, "question": string, "reason": string, "source": "ai-driven" }>,
|
|
449
|
+
"confidence": number,
|
|
450
|
+
"skipped"?: boolean,
|
|
451
|
+
"reasonCodes"?: string[]
|
|
452
|
+
}
|
|
453
|
+
Rules:
|
|
454
|
+
- "confidence" is a number from 0 to 1.
|
|
455
|
+
- Each "question" must be a concrete web search or research question (non-empty string).
|
|
456
|
+
- Each "reason" briefly explains why that question helps (non-empty string).
|
|
457
|
+
- "source" must be the literal string "ai-driven" for every question entry.
|
|
458
|
+
- Produce at most the requested maxQuestions items in "questions".
|
|
459
|
+
- If you cannot propose useful questions, set "skipped": true, "questions": [], "confidence" <= 0.5, and include "reasonCodes" such as ["INPUT_TOO_THIN"].
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
## 7. Invoke contract (must match 4.2+)
|
|
465
|
+
|
|
466
|
+
Every new action **must** follow [`xynthesis-orchestrator-invoke-contract-4.2.md`](./xynthesis-orchestrator-invoke-contract-4.2.md):
|
|
467
|
+
|
|
468
|
+
| Field | Required | Notes |
|
|
469
|
+
|-------|----------|-------|
|
|
470
|
+
| `model` | yes | Resolved alias from ai-tasks |
|
|
471
|
+
| `outputExpectation` | yes | Throws if missing |
|
|
472
|
+
| `reasoningEffort` | optional | Forward to Optimixer |
|
|
473
|
+
| `temperature` / `topP` | optional | Echo in `invokeSummary.executionMetadata` |
|
|
474
|
+
| `maxTokens` on request | optional ceiling only | Do not require hosts to pre-compute |
|
|
475
|
+
| Host pre-resolve via `resolveMaxTokens` | **forbidden** | Internal Optimixer only |
|
|
476
|
+
|
|
477
|
+
**Structured output:** Use JSON mode / schema-constrained generation where provider supports it; otherwise validate parse server-side and throw `XynthesisResponseParseError`.
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
## 8. Observability and correlation
|
|
482
|
+
|
|
483
|
+
### 8.1 InvokeAttemptSummary
|
|
484
|
+
|
|
485
|
+
Each action returns `invokeSummary` with:
|
|
486
|
+
|
|
487
|
+
- `sidekickAction`: one of the three new keys
|
|
488
|
+
- `tokenResolution` / Optimixer diagnostics
|
|
489
|
+
- `routing` (OpenRouter vs direct)
|
|
490
|
+
- `executionMetadata.temperature`, `executionMetadata.topP`, effective `reasoningEffort`
|
|
491
|
+
|
|
492
|
+
### 8.2 Activix / workScope
|
|
493
|
+
|
|
494
|
+
Forward `workScope.jobId`, `workScope.taskId`, `workScope.agentId`, and optional `identity` into xynthesis Activix phases:
|
|
495
|
+
|
|
496
|
+
- Suggested activix action types: `execution-strategy-planner`, `execution-strategy-optimizer`, `plan-web-scope-questions`
|
|
497
|
+
|
|
498
|
+
### 8.3 ai-tasks trace integration
|
|
499
|
+
|
|
500
|
+
ai-tasks will push trace rows (already stubbed for FuncX):
|
|
501
|
+
|
|
502
|
+
- Planner: `phase: "execution_strategy_planner"`, `taskType: "pre-execution"`
|
|
503
|
+
- Optimizer: `phase: "execution_strategy_optimizer"`, metadata `{ iterationIndex, satisfied }`
|
|
504
|
+
- Web-scope: existing `plan-web-scope-questions` stage → `LlmCallObservation`
|
|
505
|
+
|
|
506
|
+
---
|
|
507
|
+
|
|
508
|
+
## 9. Catalox / template deliverables
|
|
509
|
+
|
|
510
|
+
For each action, ship:
|
|
511
|
+
|
|
512
|
+
1. Sidekick template (system + user Handlebars or equivalent).
|
|
513
|
+
2. Optimixer catalog spec (`reasoningEffort`, `outputIntent`, …).
|
|
514
|
+
3. JSON schema for structured output validation.
|
|
515
|
+
4. Studio/catalog id stable across releases (version template, not action key).
|
|
516
|
+
|
|
517
|
+
| Catalox item | Action key | Replaces FuncX id |
|
|
518
|
+
|--------------|------------|-------------------|
|
|
519
|
+
| Execution plan sidekick | `execution-plan` | `execution/plan` |
|
|
520
|
+
| Execution evaluate sidekick | `execution-evaluate-result` | `execution/evaluate-result` |
|
|
521
|
+
| Plan web scope questions sidekick | `plan-web-scope-questions` | `research/plan-questions` |
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
## 10. Test ergonomics
|
|
526
|
+
|
|
527
|
+
Mirror existing xynthesis test patterns:
|
|
528
|
+
|
|
529
|
+
```typescript
|
|
530
|
+
/** Test-only: replace live provider call for execution-strategy actions. */
|
|
531
|
+
export function setExecutionStrategyActionInvoker(
|
|
532
|
+
fn: ((req: RunExecutionPlanRequest | RunExecutionEvaluateResultRequest) => Promise<unknown>) | null
|
|
533
|
+
): void;
|
|
534
|
+
|
|
535
|
+
export function setPlanWebScopeQuestionsActionInvoker(
|
|
536
|
+
fn: ((req: RunPlanWebScopeQuestionsRequest) => Promise<PlanWebScopeQuestionsResult>) | null
|
|
537
|
+
): void;
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
ai-tasks will migrate `setFuncxExecutionStrategyInvoker` → xynthesis invoker or wrap `setSynthesisInvoker` with action discrimination.
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
## 11. Migration plan
|
|
545
|
+
|
|
546
|
+
### Phase 1 — xynthesis ships actions (≥ 4.4.0)
|
|
547
|
+
|
|
548
|
+
- Implement three actions + Catalox templates + tests.
|
|
549
|
+
- Export types and schemas.
|
|
550
|
+
- Document in xynthesis CHANGELOG.
|
|
551
|
+
|
|
552
|
+
### Phase 2 — ai-tasks migration (8.5.x)
|
|
553
|
+
|
|
554
|
+
- Replace `runPlannerFuncx` / `runOptimizerFuncx` with `runPostStepLlmCall`-style wrappers calling new xynthesis actions.
|
|
555
|
+
- Map `modelConfig.preActionModel` / `postActionModel` per §4.3.
|
|
556
|
+
- Add `LlmCallStage`: `execution-strategy-planner`, `execution-strategy-optimizer`.
|
|
557
|
+
- Extend `sidekickActionForStage` mapping in ai-tasks.
|
|
558
|
+
- Wire `LlmCallObservation` / `logLlmProviderInvocation` for new stages.
|
|
559
|
+
- Remove `runFuncxExecutionStrategy.ts`, `runResearchPlanQuestionsFuncx.ts`, direct `@x12i/funcx` imports.
|
|
560
|
+
- Deprecate exports: `setFuncxExecutionStrategyInvoker`, `FUNCX_*_FUNCTION_ID`, `unwrapFuncxRunValue`, `backend: "funcx"`.
|
|
561
|
+
- Keep `adaptExecutionPlanResult` / `adaptEvaluateResultResponse` until xynthesis output is proven stable (then inline or delete).
|
|
562
|
+
|
|
563
|
+
### Phase 3 — cleanup
|
|
564
|
+
|
|
565
|
+
- Remove `@x12i/funcx` from ai-tasks `dependencies` and `overrides` if no transitive need.
|
|
566
|
+
- Update `CANONICAL_EXECUTION_STRATEGIES` catalog metadata: `runtimeKind: "xynthesis-action"` (replace `funcx-wrapper`).
|
|
567
|
+
- Archive FuncX hosting checklist items as deprecated.
|
|
568
|
+
|
|
569
|
+
---
|
|
570
|
+
|
|
571
|
+
## 12. ai-tasks follow-up checklist (after xynthesis ships)
|
|
572
|
+
|
|
573
|
+
- [ ] Bump `"@exellix/xynthesis": "^4.4.0"` (or whatever minor ships this).
|
|
574
|
+
- [ ] Implement `runExecutionPlannerViaXynthesis` / `runExecutionOptimizerViaXynthesis` in `src/execution-strategies/`.
|
|
575
|
+
- [ ] Pass `preActionModel` / `postActionModel` + `llmCall` overlays from `RunTaskRequest`.
|
|
576
|
+
- [ ] Update `runPlanWebScopeQuestions` to call xynthesis action only (remove FuncX backend).
|
|
577
|
+
- [ ] Remove `@x12i/funcx` direct dependency.
|
|
578
|
+
- [ ] Update tests: replace `setFuncxExecutionStrategyInvoker` with xynthesis test invoker.
|
|
579
|
+
- [ ] Update README / BREAKING-CHANGES / RUNTASK_REQUEST.md.
|
|
580
|
+
- [ ] Update task-strategies catalog descriptions and `defaultFunctionId` → `defaultSidekickAction` (or remove functionId concept).
|
|
581
|
+
|
|
582
|
+
---
|
|
583
|
+
|
|
584
|
+
## 13. Acceptance criteria (xynthesis PR)
|
|
585
|
+
|
|
586
|
+
### 13.1 execution-plan
|
|
587
|
+
|
|
588
|
+
- [ ] `runExecutionPlan({ model, outputExpectation, goal, input, context, workScope })` returns valid `ExecutionPlanResult`.
|
|
589
|
+
- [ ] Optimixer runs; no host `maxTokens` required.
|
|
590
|
+
- [ ] `invokeSummary.sidekickAction === "execution-plan"`.
|
|
591
|
+
- [ ] Integration test with mock provider: structured JSON → typed result.
|
|
592
|
+
- [ ] Invalid JSON → `XynthesisResponseParseError`.
|
|
593
|
+
|
|
594
|
+
### 13.2 execution-evaluate-result
|
|
595
|
+
|
|
596
|
+
- [ ] Accepts `result` + `iterationIndex`; returns `satisfied` boolean.
|
|
597
|
+
- [ ] Handles missing/partial `result.rawText` gracefully (empty string ok).
|
|
598
|
+
- [ ] `invokeSummary` includes iteration metadata when passed in request context.
|
|
599
|
+
|
|
600
|
+
### 13.3 plan-web-scope-questions
|
|
601
|
+
|
|
602
|
+
- [ ] Output passes ai-tasks validation rules (§6.3).
|
|
603
|
+
- [ ] `maxQuestions` clamped 1–20 server-side.
|
|
604
|
+
- [ ] Parity test: same input → same shape as current ai-tasks inline prompt path (golden fixture).
|
|
605
|
+
|
|
606
|
+
### 13.4 Cross-cutting
|
|
607
|
+
|
|
608
|
+
- [ ] All three actions accept `reasoningEffort`, `temperature`, `topP`.
|
|
609
|
+
- [ ] Model alias resolution via `@x12i/ai-profiles` consistent with audit/polish.
|
|
610
|
+
- [ ] Activix correlation when diagnostics enabled.
|
|
611
|
+
- [ ] CHANGELOG + README section for orchestrators.
|
|
612
|
+
|
|
613
|
+
---
|
|
614
|
+
|
|
615
|
+
## 14. Non-goals / explicit boundaries
|
|
616
|
+
|
|
617
|
+
- xynthesis **must not** implement the optimizer retry loop or call `@exellix/ai-skills`.
|
|
618
|
+
- xynthesis **must not** require `@exellix/ai-tasks` as a dependency.
|
|
619
|
+
- No new npm package — ai-tasks is the only orchestrator consumer.
|
|
620
|
+
- FuncX may remain xynthesis's internal provider adapter; ai-tasks should not call FuncX directly after migration.
|
|
621
|
+
|
|
622
|
+
---
|
|
623
|
+
|
|
624
|
+
## 15. Paste-ready GitHub issue (xynthesis repo)
|
|
625
|
+
|
|
626
|
+
**Title:** Add execution-strategy sidekick actions (planner, optimizer, plan-web-scope-questions)
|
|
627
|
+
|
|
628
|
+
**Body:**
|
|
629
|
+
|
|
630
|
+
> `@exellix/ai-tasks` currently invokes FuncX `execution/plan`, `execution/evaluate-result`, and optionally `research/plan-questions` for MAIN wrappers. These bypass `modelConfig`, Optimixer, and `InvokeAttemptSummary`.
|
|
631
|
+
>
|
|
632
|
+
> Please add three first-class xynthesis actions (`execution-plan`, `execution-evaluate-result`, `plan-web-scope-questions`) on the same contract as audit/polish (`executeXynthesisAction`, required `outputExpectation`, optional `reasoningEffort`).
|
|
633
|
+
>
|
|
634
|
+
> Full spec (input/output JSON, model slot policy, Catalox deliverables, acceptance tests):
|
|
635
|
+
> [link to this doc in ai-tasks repo]
|
|
636
|
+
>
|
|
637
|
+
> ai-tasks will migrate in 8.5.x and remove direct `@x12i/funcx` usage. No separate consumer package planned.
|