@exellix/ai-tasks 9.1.0 → 10.0.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 +34 -4
- package/README.md +2 -2
- package/RUNTASK_REQUEST.md +32 -17
- package/dist/builders/task-request-builder.d.ts.map +1 -1
- package/dist/builders/task-request-builder.js +2 -1
- package/dist/builders/task-request-builder.js.map +1 -1
- package/dist/compile/compileTaskConfiguration.d.ts.map +1 -1
- package/dist/compile/compileTaskConfiguration.js +3 -0
- package/dist/compile/compileTaskConfiguration.js.map +1 -1
- package/dist/core/task-sdk.d.ts.map +1 -1
- package/dist/core/task-sdk.js +148 -180
- package/dist/core/task-sdk.js.map +1 -1
- package/dist/errors/runTaskExecutionError.d.ts.map +1 -1
- package/dist/errors/runTaskExecutionError.js +0 -2
- package/dist/errors/runTaskExecutionError.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/invocation/types.d.ts +1 -1
- package/dist/narrix/applyWebScopeToRequest.d.ts +9 -0
- package/dist/narrix/applyWebScopeToRequest.d.ts.map +1 -0
- package/dist/narrix/applyWebScopeToRequest.js +156 -0
- package/dist/narrix/applyWebScopeToRequest.js.map +1 -0
- package/dist/narrix/narrixUnitExecution.d.ts.map +1 -1
- package/dist/narrix/narrixUnitExecution.js +8 -3
- package/dist/narrix/narrixUnitExecution.js.map +1 -1
- package/dist/node-execution/buildRequestFromNodePlan.d.ts +6 -0
- package/dist/node-execution/buildRequestFromNodePlan.d.ts.map +1 -1
- package/dist/node-execution/buildRequestFromNodePlan.js +4 -16
- package/dist/node-execution/buildRequestFromNodePlan.js.map +1 -1
- package/dist/node-execution/compileProfessionalAnswerRequest.d.ts +2 -0
- package/dist/node-execution/compileProfessionalAnswerRequest.d.ts.map +1 -0
- package/dist/node-execution/compileProfessionalAnswerRequest.js +4 -0
- package/dist/node-execution/compileProfessionalAnswerRequest.js.map +1 -0
- package/dist/node-execution/createNodeExecutionHost.d.ts.map +1 -1
- package/dist/node-execution/createNodeExecutionHost.js +97 -26
- package/dist/node-execution/createNodeExecutionHost.js.map +1 -1
- package/dist/node-execution/dispatchExecutionUnit.d.ts.map +1 -1
- package/dist/node-execution/dispatchExecutionUnit.js +4 -2
- package/dist/node-execution/dispatchExecutionUnit.js.map +1 -1
- package/dist/node-execution/orchestration/runPostOrchestration.d.ts +11 -0
- package/dist/node-execution/orchestration/runPostOrchestration.d.ts.map +1 -0
- package/dist/node-execution/orchestration/runPostOrchestration.js +123 -0
- package/dist/node-execution/orchestration/runPostOrchestration.js.map +1 -0
- package/dist/node-execution/orchestration/runPreOrchestration.d.ts +3 -0
- package/dist/node-execution/orchestration/runPreOrchestration.d.ts.map +1 -0
- package/dist/node-execution/orchestration/runPreOrchestration.js +110 -0
- package/dist/node-execution/orchestration/runPreOrchestration.js.map +1 -0
- package/dist/node-execution/orchestration/shardContext.d.ts +12 -0
- package/dist/node-execution/orchestration/shardContext.d.ts.map +1 -0
- package/dist/node-execution/orchestration/shardContext.js +71 -0
- package/dist/node-execution/orchestration/shardContext.js.map +1 -0
- package/dist/node-execution/orchestration/types.d.ts +21 -0
- package/dist/node-execution/orchestration/types.d.ts.map +1 -0
- package/dist/node-execution/orchestration/types.js +2 -0
- package/dist/node-execution/orchestration/types.js.map +1 -0
- package/dist/node-execution/rejectForbiddenWireFields.d.ts +2 -0
- package/dist/node-execution/rejectForbiddenWireFields.d.ts.map +1 -1
- package/dist/node-execution/rejectForbiddenWireFields.js +42 -7
- package/dist/node-execution/rejectForbiddenWireFields.js.map +1 -1
- package/dist/observability/classifyRunTaskFailure.d.ts.map +1 -1
- package/dist/observability/classifyRunTaskFailure.js +4 -3
- package/dist/observability/classifyRunTaskFailure.js.map +1 -1
- package/dist/observability/logRunTaskFailure.d.ts.map +1 -1
- package/dist/observability/logRunTaskFailure.js +0 -2
- package/dist/observability/logRunTaskFailure.js.map +1 -1
- package/dist/post-steps/audit/auditChecklistFuncxEnvelope.d.ts +19 -3
- package/dist/post-steps/audit/auditChecklistFuncxEnvelope.d.ts.map +1 -1
- package/dist/post-steps/audit/auditChecklistFuncxEnvelope.js +7 -1
- package/dist/post-steps/audit/auditChecklistFuncxEnvelope.js.map +1 -1
- package/dist/post-steps/audit/loadAuditTemplates.d.ts +2 -55
- package/dist/post-steps/audit/loadAuditTemplates.d.ts.map +1 -1
- package/dist/post-steps/audit/loadAuditTemplates.js +3 -38
- package/dist/post-steps/audit/loadAuditTemplates.js.map +1 -1
- package/dist/post-steps/audit/parseAuditFuncxOutput.d.ts +8 -0
- package/dist/post-steps/audit/parseAuditFuncxOutput.d.ts.map +1 -0
- package/dist/post-steps/audit/parseAuditFuncxOutput.js +62 -0
- package/dist/post-steps/audit/parseAuditFuncxOutput.js.map +1 -0
- package/dist/post-steps/audit/parseAuditOutput.d.ts +2 -0
- package/dist/post-steps/audit/parseAuditOutput.d.ts.map +1 -1
- package/dist/post-steps/audit/parseAuditOutput.js +56 -0
- package/dist/post-steps/audit/parseAuditOutput.js.map +1 -1
- package/dist/post-steps/audit/runAudit.d.ts.map +1 -1
- package/dist/post-steps/audit/runAudit.js +53 -113
- package/dist/post-steps/audit/runAudit.js.map +1 -1
- package/dist/post-steps/audit/runAuditFuncxCall.d.ts +18 -0
- package/dist/post-steps/audit/runAuditFuncxCall.d.ts.map +1 -0
- package/dist/post-steps/audit/runAuditFuncxCall.js +59 -0
- package/dist/post-steps/audit/runAuditFuncxCall.js.map +1 -0
- package/dist/synthesis/resolveSourceMaterial.d.ts.map +1 -1
- package/dist/synthesis/resolveSourceMaterial.js +14 -0
- package/dist/synthesis/resolveSourceMaterial.js.map +1 -1
- package/dist/synthesis/runStructuredSynthesisRobust.d.ts.map +1 -1
- package/dist/synthesis/runStructuredSynthesisRobust.js +24 -4
- package/dist/synthesis/runStructuredSynthesisRobust.js.map +1 -1
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts +3 -0
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts.map +1 -1
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js +28 -4
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js.map +1 -1
- package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts +4 -4
- package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts.map +1 -1
- package/dist/task-strategies/canonicalInputExecutionStrategies.js +2 -1
- package/dist/task-strategies/canonicalInputExecutionStrategies.js.map +1 -1
- package/dist/task-strategies/canonicalOrchestrationStrategies.d.ts +42 -0
- package/dist/task-strategies/canonicalOrchestrationStrategies.d.ts.map +1 -0
- package/dist/task-strategies/canonicalOrchestrationStrategies.js +47 -0
- package/dist/task-strategies/canonicalOrchestrationStrategies.js.map +1 -0
- package/dist/task-strategies/canonicalTaskStrategies.d.ts +2 -1
- package/dist/task-strategies/canonicalTaskStrategies.d.ts.map +1 -1
- package/dist/task-strategies/canonicalTaskStrategies.js +2 -1
- package/dist/task-strategies/canonicalTaskStrategies.js.map +1 -1
- package/dist/task-strategies/constants.d.ts +9 -1
- package/dist/task-strategies/constants.d.ts.map +1 -1
- package/dist/task-strategies/constants.js +9 -1
- package/dist/task-strategies/constants.js.map +1 -1
- package/dist/task-strategies/index.d.ts +5 -3
- package/dist/task-strategies/index.d.ts.map +1 -1
- package/dist/task-strategies/index.js +4 -3
- package/dist/task-strategies/index.js.map +1 -1
- package/dist/task-strategies/listAiTaskStrategies.d.ts +10 -1
- package/dist/task-strategies/listAiTaskStrategies.d.ts.map +1 -1
- package/dist/task-strategies/listAiTaskStrategies.js +17 -2
- package/dist/task-strategies/listAiTaskStrategies.js.map +1 -1
- package/dist/types/task-types.d.ts +4 -11
- package/dist/types/task-types.d.ts.map +1 -1
- package/dist/utils/bridgeRunSkillGatewayMemory.d.ts.map +1 -1
- package/dist/utils/bridgeRunSkillGatewayMemory.js +1 -0
- package/dist/utils/bridgeRunSkillGatewayMemory.js.map +1 -1
- package/dist/utils/executionMemoryInputRecord.d.ts +12 -0
- package/dist/utils/executionMemoryInputRecord.d.ts.map +1 -0
- package/dist/utils/executionMemoryInputRecord.js +28 -0
- package/dist/utils/executionMemoryInputRecord.js.map +1 -0
- package/dist/utils/resolveAiProfileModel.d.ts +1 -1
- package/dist/utils/resolveAiProfileModel.d.ts.map +1 -1
- package/dist/utils/resolveRunTaskModelReferences.d.ts.map +1 -1
- package/dist/utils/resolveRunTaskModelReferences.js +0 -32
- package/dist/utils/resolveRunTaskModelReferences.js.map +1 -1
- package/dist/utils/runTaskRequestShape.d.ts.map +1 -1
- package/dist/utils/runTaskRequestShape.js +4 -26
- package/dist/utils/runTaskRequestShape.js.map +1 -1
- package/dist/utils/skillTemplateVariables.d.ts +3 -2
- package/dist/utils/skillTemplateVariables.d.ts.map +1 -1
- package/dist/utils/skillTemplateVariables.js +3 -2
- package/dist/utils/skillTemplateVariables.js.map +1 -1
- package/dist/validation/validateProfessionalAnswerContract.d.ts +8 -0
- package/dist/validation/validateProfessionalAnswerContract.d.ts.map +1 -0
- package/dist/validation/validateProfessionalAnswerContract.js +45 -0
- package/dist/validation/validateProfessionalAnswerContract.js.map +1 -0
- package/dist/validation/validateRunTaskConfig.d.ts.map +1 -1
- package/dist/validation/validateRunTaskConfig.js +3 -66
- package/dist/validation/validateRunTaskConfig.js.map +1 -1
- package/documenations/record-and-template-variables.md +21 -13
- package/documenations/run-task-execution-flow.md +1 -1
- package/documenations/skill-orchestration-strategy-cr-fr.md +147 -0
- package/documenations/upstream-feature-requests/README.md +9 -5
- package/documenations/upstream-feature-requests/ai-skills-orchestrator-invoke-contract-5.9.md +1 -1
- package/documenations/upstream-feature-requests/funcx-4.9.13-open-items.md +62 -0
- package/documenations/upstream-feature-requests/funcx-gap-analysis-cr-fr.md +401 -0
- package/documenations/upstream-feature-requests/funcx-pre-post-sidekick-actions.md +1 -0
- package/documenations/upstream-feature-requests/graph-engine-runtask-contract-alignment-investigation.md +370 -0
- package/documenations/upstream-feature-requests/xynthesis-ai-profiles-2.1-import-break.md +2 -2
- package/documenations/upstream-feature-requests/xynthesis-openrouter-wire-model-double-prefix-bug.md +1 -1
- package/documenations/upstream-feature-requests/xynthesis-orchestrator-invoke-contract-4.2.md +1 -1
- package/package.json +10 -9
- package/.docs/DOWNSTREAM_ENV.md +0 -42
- package/.docs/FEEDBACK_TO_CLIENT_DOWNSTREAM_FIXES.md +0 -64
- package/.docs/INTERMEDIATE_STEPS.md +0 -82
- package/.docs/activity-structure.md +0 -31
- package/.docs/ai-task-ai-scoping-spec.md +0 -338
- package/.docs/ai-tasks-model-profile-aliases-7x.md +0 -96
- package/.docs/blockers-and-issues.md +0 -346
- package/.docs/building-runTask-sdk.md +0 -659
- package/.docs/building-skill-execution-orchestrator.md +0 -968
- package/.docs/code-used-before/run-task.txt +0 -39
- package/.docs/code-used-before/task-executor.ts.old +0 -57
- package/.docs/code-used-before/test-run-task.ts.old +0 -42
- package/.docs/code-used-before/types.txt +0 -23
- package/.docs/env-ready-policy.md +0 -40
- package/.docs/flow-io/flow-README.md +0 -76
- package/.docs/flow-io/narrix.md +0 -124
- package/.docs/flow-io/web-scoping.md +0 -135
- package/.docs/flow-io/xynthesis-post.md +0 -154
- package/.docs/flow-io/xynthesis-pre.md +0 -181
- package/.docs/gap-analysis.md +0 -201
- package/.docs/integration-facts-ai-tasks.md +0 -109
- package/.docs/investigation/ai-skills.md +0 -170
- package/.docs/investigation/external-packages-assignments.md +0 -66
- package/.docs/investigation/integration-summary.md +0 -20
- package/.docs/investigation/narrix-catalox.md +0 -29
- package/.docs/investigation/workplan-close-graph-engine-gaps.md +0 -101
- package/.docs/logging-stack.md +0 -30
- package/.docs/memory-narrix-adapter-developer-guide.md +0 -402
- package/.docs/memory-narrix-adapter-requirements.md +0 -112
- package/.docs/narrix-context-consumption-gap.md +0 -184
- package/.docs/narrix-context-downstream-report.md +0 -30
- package/.docs/narrix-ingest-and-packs-library-spec.md +0 -240
- package/.docs/narrix-record-input-current-design.md +0 -48
- package/.docs/pacakge.md +0 -48
- package/.docs/possible-components/README.md +0 -11
- package/.docs/possible-components/integration/README.md +0 -10
- package/.docs/possible-components/integration/gaps-when-merging.md +0 -16
- package/.docs/possible-components/integration/platform.md +0 -54
- package/.docs/possible-components/integration/reintegrate-into-ai-tasks.md +0 -26
- package/.docs/possible-components/integration/roadmap-and-checklists.md +0 -54
- package/.docs/possible-components/post-component/README.md +0 -18
- package/.docs/possible-components/post-component/builder-guide.md +0 -175
- package/.docs/possible-components/post-component/gaps-and-artifacts.md +0 -52
- package/.docs/possible-components/post-component/handler-audit.md +0 -47
- package/.docs/possible-components/post-component/handler-polish.md +0 -41
- package/.docs/possible-components/post-component/unified-protocol.md +0 -59
- package/.docs/possible-components/pre-component/README.md +0 -22
- package/.docs/possible-components/pre-component/builder-guide.md +0 -127
- package/.docs/possible-components/pre-component/gaps-and-artifacts.md +0 -35
- package/.docs/possible-components/pre-component/handler-ai-scoping.md +0 -45
- package/.docs/possible-components/pre-component/handler-narrix-preprocessor.md +0 -49
- package/.docs/possible-components/pre-component/handler-narrix-system2.md +0 -35
- package/.docs/possible-components/pre-component/handler-synthesized-context.md +0 -65
- package/.docs/possible-components/pre-component/handler-web-scope.md +0 -29
- package/.docs/possible-components/pre-component/unified-protocol.md +0 -89
- package/.docs/prefer-openrouter-routing-policy.md +0 -114
- package/.docs/questions-for-ai-skills.md +0 -123
- package/.docs/realtime-narrixing-gap-analysis.md +0 -40
- package/.docs/realtime-narrixing.md +0 -433
- package/.docs/run-context-object.md +0 -32
- package/.docs/session-id-usage.md +0 -26
- package/.docs/skill-library-spec.md +0 -249
- package/.docs/synthesized-context-strategy-spec.md +0 -906
- package/.docs/upstream-issue/2026-03-21_woroces-ai-tasks_ISSUE-006_web-scope-question-from-cni-entity.md +0 -46
- package/.docs/web-scopper-embed.md +0 -93
- package/.docs/xynthesis-wiring-and-io.md +0 -12
- package/documenations/activix-feature-request-identity.md +0 -123
- package/documenations/bug-report-xynthesis-and-synthesis-call.md +0 -217
- package/documenations/feature-request-ai-skills-raw-template-access.md +0 -82
- package/documenations/feature-request-athenix-core-directive.md +0 -145
- package/documenations/feature-request-athenix-token-extraction.md +0 -124
- package/documenations/funcx-upstream-github-issues-draft.md +0 -153
- package/documenations/identity-metadata-contract.md +0 -165
- package/documenations/run-task-single-run-checklist.md +0 -109
- package/documenations/sessions/2026-06-08-subnets-model-resolution/CR-1-no-concrete-wire-in-graph-plans.md +0 -93
- package/documenations/sessions/2026-06-08-subnets-model-resolution/CR-2-skillModel-profile-only-at-storage.md +0 -88
- package/documenations/sessions/2026-06-08-subnets-model-resolution/CR-3-reject-concrete-models-in-catalog-rows.md +0 -76
- package/documenations/sessions/2026-06-08-subnets-model-resolution/FR-1-suggested-profile-in-catalogs.md +0 -96
- package/documenations/sessions/2026-06-08-subnets-model-resolution/FR-2-graph-engine-failure-phase-attribution.md +0 -92
- package/documenations/sessions/2026-06-08-subnets-model-resolution/INVESTIGATION-original-bug.md +0 -182
- package/documenations/sessions/2026-06-08-subnets-model-resolution/PROBLEM.md +0 -236
- package/documenations/sessions/2026-06-08-subnets-model-resolution/README.md +0 -11
- package/documenations/sessions/2026-06-08-subnets-model-resolution/funcx-test-resolveModel.cheapDefaultWireSlug.test.ts +0 -117
- package/documenations/upstream-feature-requests/ai-tasks-wrap-up-after-upstream.md +0 -129
- package/documenations/upstream-feedback-request-shape-clarification.md +0 -101
- package/documenations/web-context-precedence.md +0 -33
- package/documenations/xynthesis-activix-telemetry.md +0 -28
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# ISSUE-006 — Render web-scope search question from Narrix entity / CNI (CVE, vendor, label)
|
|
2
|
-
|
|
3
|
-
**Status:** Implemented in `@woroces/ai-tasks` (`src/narrix/buildWebScopeScopeInput.ts`, `narrix.*` config fields). See `documenations/web-scoping-in-ai-tasks.md` §3.2.1.
|
|
4
|
-
|
|
5
|
-
**Issue:** ISSUE-006
|
|
6
|
-
**Package to fix:** `@woroces/ai-tasks`
|
|
7
|
-
**Date:** 2026-03-21
|
|
8
|
-
**Type:** Feature request
|
|
9
|
-
**Related index:** [`2026-03-21_worox-graphs_ISSUE-000_gap-analysis-index.md`](./2026-03-21_worox-graphs_ISSUE-000_gap-analysis-index.md)
|
|
10
|
-
**Complements:** [`2026-03-21_worox-graphs_ISSUE-008_enrich-web-scope-question-from-execution-input.md`](./2026-03-21_worox-graphs_ISSUE-008_enrich-web-scope-question-from-execution-input.md) (same problem, fix in executor)
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Problem
|
|
15
|
-
|
|
16
|
-
Web scoping uses a **generic** `inputs.question` (e.g. “What is the exploitability of this vulnerability?”) without embedding CVE id, vendor, or product from the current entity. Search queries stay broad; evidence is less targeted than it could be.
|
|
17
|
-
|
|
18
|
-
`@woroces/ai-tasks` (or NARRIX pre-processing inside it) often has access to **CNI / entity facts** after Narrix runs — ideal place to render `baseQuestion + entityArgs` before calling the scoper.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Desired behavior
|
|
23
|
-
|
|
24
|
-
1. Keep `questionId` / pack routing as today.
|
|
25
|
-
2. Before `scopeGeneric` / internal web scope, compute `webScopeQuestion = render(template, { cve, vendor, label, ... })`.
|
|
26
|
-
3. Pass that string into the scoper as the `question` argument.
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Options (from prior design discussion)
|
|
31
|
-
|
|
32
|
-
- **Downstream-heavy:** `ai-tasks` renders from `narrixResult.entity` / CNI (this issue).
|
|
33
|
-
- **Executor-heavy:** `worox-graphs` enriches before scope (ISSUE-008). Both can coexist; prefer one owner to avoid double logic.
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## Acceptance criteria
|
|
38
|
-
|
|
39
|
-
1. For vuln-group–style jobs, logged or asserted `queriesUsed` contains vulnerability-specific tokens (e.g. CVE id) when entity provides them.
|
|
40
|
-
2. No regression when entity facts are missing (fallback to base question).
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Longer design notes
|
|
45
|
-
|
|
46
|
-
See also `.docs/web-scoping/feature-request-narrix-web-scope-question-templating.md` (narrative duplicate; **this ISSUE file is the canonical tracker name** for `@woroces/ai-tasks`).
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# Feature Request: NARRIX Web Scoper (question-driven web context)
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
This feature request proposes adding support in `@woroces/ai-tasks` for **question-driven web context** when the NARRIX pre-processor runs. When a task request includes `narrix` and a question (or questionId), ai-tasks should optionally call **@narrices/narrix-web-scoper** to plan and fetch web context (via @narrices/search-adapter), merge it with narrative from memory, and pass the combined context to the task so that answers can use both data-scoped narrative and web search as needed.
|
|
6
|
-
|
|
7
|
-
**Depends on (or extends):** [ai-tasks-narrix-pre-processor-feature-request.md](ai-tasks-narrix-pre-processor-feature-request.md) — the NARRIX pre-processor must have built or received CNI before web-scoper can run.
|
|
8
|
-
|
|
9
|
-
## Background
|
|
10
|
-
|
|
11
|
-
- **Question-driven flow:** Graph nodes often carry a question (`inputs.question`) and/or `metadata.narrix.questionId`. Some questions are best answered from **narrative already in memory** (e.g. from NARRIX scoping/discovery on the record); others benefit from **web search** (e.g. public threat intel, vendor docs). The desired behavior is to support both in one flow: narrative on memory + search on the web as needed.
|
|
12
|
-
- **narrix-web-scoper:** The package `@narrices/narrix-web-scoper` is a CNI-aware web context planner and mapper. It uses `@narrices/narrix-cni` and `@narrices/search-adapter` to plan what to search for from the CNI (and optional question) and map retrieval results into a structured web context. It is designed to run where CNI is already available.
|
|
13
|
-
- **Where CNI lives:** In the intended architecture, when ai-tasks runs the NARRIX pre-processor (resolve input → CNI conversion → engine-enrich → inject context → run task), CNI exists internally after the CNI conversion step. That is the right place to optionally run web-scoper before or in tandem with engine-enrich, so the task receives both NARRIX narrative and web-derived context.
|
|
14
|
-
|
|
15
|
-
## Problem
|
|
16
|
-
|
|
17
|
-
- There is no way for the NARRIX pre-processor to extend scoped data with web search.
|
|
18
|
-
- Tasks that could benefit from both narrative (memory) and web context currently get only one or the other, or require a separate graph node for web search (which we want to avoid).
|
|
19
|
-
|
|
20
|
-
## Proposed contract
|
|
21
|
-
|
|
22
|
-
### 1. Opt-in on request
|
|
23
|
-
|
|
24
|
-
When `request.narrix` is present, support an optional flag to enable web context (so existing behavior is unchanged):
|
|
25
|
-
|
|
26
|
-
- **Option A (recommended):** Extend the `narrix` object with `enableWebScope?: boolean`. If `true`, the pre-processor runs web-scoper when it has CNI and question/questionId.
|
|
27
|
-
- **Option B:** A separate request-level field, e.g. `narrixWebScope?: boolean` or `request.options?.enableNarrixWebScope`. Document that it is only honored when `request.narrix` is set.
|
|
28
|
-
|
|
29
|
-
worox-graphs (or other callers) would set this from e.g. `node.metadata.narrix.enableWebScope` or a graph-level variable.
|
|
30
|
-
|
|
31
|
-
### 2. When to run web-scoper
|
|
32
|
-
|
|
33
|
-
- **Precondition:** NARRIX pre-processor has already built or obtained CNI (after “CNI conversion” in the pre-processor flow).
|
|
34
|
-
- **Precondition:** A question is available for the current task: either `request.narrix.questionId` or `request.inputs?.question` / `request.input?.question` (or the same from executionMemory/jobContext if that is where the pre-processor reads question from).
|
|
35
|
-
- **Precondition:** Web scope is enabled (e.g. `request.narrix.enableWebScope === true`).
|
|
36
|
-
- **Action:** Call `@narrices/narrix-web-scoper` with (CNI, datasetId, optional questionId/question, and any options the package exposes). Obtain the planned/mapped web context (exact API to be taken from the package’s public API).
|
|
37
|
-
|
|
38
|
-
### 3. Where to inject web context
|
|
39
|
-
|
|
40
|
-
Merge the web-scoper output into the context that the task receives, in a well-defined place, for example:
|
|
41
|
-
|
|
42
|
-
- **Option A:** Merge into the same structure used for NARRIX enrichment (e.g. `executionMemory.narrixEnriched.webContext` or `jobContext._narrix.webContext`), so the task sees one enriched object that includes both narrative and web context.
|
|
43
|
-
- **Option B:** A dedicated path such as `executionMemory.webContext` or `jobContext.webContext` that the task and templates can reference.
|
|
44
|
-
|
|
45
|
-
Document the chosen path so that worox-graphs and skill templates can rely on it.
|
|
46
|
-
|
|
47
|
-
### 4. Dependencies
|
|
48
|
-
|
|
49
|
-
- ai-tasks (or the module that implements the NARRIX pre-processor) should add:
|
|
50
|
-
- `@narrices/narrix-web-scoper` (and its peer/transitive dependencies, e.g. `@narrices/narrix-cni`, `@narrices/search-adapter` as required by the package).
|
|
51
|
-
|
|
52
|
-
No change required in worox-graphs for this feature beyond optionally setting `enableWebScope` when building the request (once ai-tasks supports it).
|
|
53
|
-
|
|
54
|
-
### 5. Failure and fallback
|
|
55
|
-
|
|
56
|
-
- If web-scoper fails (e.g. search-adapter timeout, API error), the pre-processor should either:
|
|
57
|
-
- **Strict:** Fail the task with a clear error, or
|
|
58
|
-
- **Lenient (recommended default):** Log the error, omit web context for this run, and continue with only NARRIX narrative. Document the behavior.
|
|
59
|
-
|
|
60
|
-
### 6. Question availability
|
|
61
|
-
|
|
62
|
-
The pre-processor already has access to:
|
|
63
|
-
|
|
64
|
-
- `request.narrix` (datasetId, questionId, etc.)
|
|
65
|
-
- `request.input` / `request.inputs` (e.g. question text)
|
|
66
|
-
- Possibly `executionMemory` / `jobContext` (if question is passed from the graph there)
|
|
67
|
-
|
|
68
|
-
Use the same resolution order as for other NARRIX inputs so that questionId and/or question text are available when invoking web-scoper.
|
|
69
|
-
|
|
70
|
-
## Expected behavior summary
|
|
71
|
-
|
|
72
|
-
| Scenario | Behavior |
|
|
73
|
-
|----------|----------|
|
|
74
|
-
| `request.narrix` absent | No change; no NARRIX pre-processing. |
|
|
75
|
-
| `request.narrix` present, `enableWebScope` absent or false | Pre-processor runs as today (CNI → engine-enrich → inject narrative). No web-scoper call. |
|
|
76
|
-
| `request.narrix` present, `enableWebScope` true, question/questionId available, CNI built | Run web-scoper with CNI + question; merge web context into the injected context; then run engine-enrich (if applicable) and task with combined narrative + web context. |
|
|
77
|
-
| Web-scoper fails (lenient) | Log error; inject only NARRIX narrative; task runs without web context. |
|
|
78
|
-
|
|
79
|
-
## Implementation notes (for ai-tasks)
|
|
80
|
-
|
|
81
|
-
- **Placement:** In the NARRIX pre-processor path, after CNI is built and before (or in parallel with) engine-enrich. If engine-enrich consumes `sourceMeta` or similar, extend it with the web context so the runner can use it if needed.
|
|
82
|
-
- **API:** Consult `@narrices/narrix-web-scoper`’s public API (e.g. a `planAndMap(cni, options)` or similar) and wire it with datasetId, questionId/question, and any required adapter config (e.g. search-adapter API keys from env).
|
|
83
|
-
- **Tests:** Add unit/integration tests that mock the search-adapter and assert that when `enableWebScope` is true and question is present, web context is merged into the context passed to the task (and that when web-scoper fails, the chosen fallback behavior is applied).
|
|
84
|
-
|
|
85
|
-
## worox-graphs changes (when feature exists)
|
|
86
|
-
|
|
87
|
-
- Optional: Extend graph node schema to allow `metadata.narrix.enableWebScope` (or read from variables) and pass it through to `RunTaskRequest.narrix.enableWebScope` so authors can enable question-driven web scope per node or per graph without code changes.
|
|
88
|
-
|
|
89
|
-
## References
|
|
90
|
-
|
|
91
|
-
- [ai-tasks-narrix-pre-processor-feature-request.md](ai-tasks-narrix-pre-processor-feature-request.md) — NARRIX as task-level pre-processor (input contract, CNI, engine-enrich, inject context).
|
|
92
|
-
- `@narrices/narrix-web-scoper` — CNI-aware web context planner; uses `@narrices/search-adapter` for retrieval.
|
|
93
|
-
- [question-questionId-first-class-experience.md](question-questionId-first-class-experience.md) — Question and questionId as first-class in worox-graphs (resolution, request build).
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Moved
|
|
2
|
-
|
|
3
|
-
This document was split into focused pages. Start here:
|
|
4
|
-
|
|
5
|
-
**[flow-io/flow-README.md](./flow-io/flow-README.md)** — high-level blocks
|
|
6
|
-
|
|
7
|
-
| Topic | Doc |
|
|
8
|
-
|-------|-----|
|
|
9
|
-
| PRE — calling `@exellix/xynthesis` | [flow-io/xynthesis-pre.md](./flow-io/xynthesis-pre.md) |
|
|
10
|
-
| POST — calling `@exellix/xynthesis` | [flow-io/xynthesis-post.md](./flow-io/xynthesis-post.md) |
|
|
11
|
-
| NARRIX | [flow-io/narrix.md](./flow-io/narrix.md) |
|
|
12
|
-
| Web scoping | [flow-io/web-scoping.md](./flow-io/web-scoping.md) |
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
# Feature request: Activix first-class `identity` object
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
|
|
5
|
-
Extend `@xronoces/activix` to support a **first-class `identity` object** on activity records, so downstream systems can attach a stable identity envelope to every activity and query/group activities consistently.
|
|
6
|
-
|
|
7
|
-
This request is driven by the task methodology used in `@exellix/ai-tasks` (and the wider stack via `ai-skills`/`ai-gateway`).
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Problem
|
|
12
|
-
|
|
13
|
-
Today, many systems treat identity as “just more metadata” and bury it inside arbitrary blobs. That makes identity:
|
|
14
|
-
|
|
15
|
-
- inconsistent across producers,
|
|
16
|
-
- hard to query/index,
|
|
17
|
-
- easy to accidentally rename/flatten,
|
|
18
|
-
- easy to drop during updates,
|
|
19
|
-
- hard to standardize across a multi-package pipeline.
|
|
20
|
-
|
|
21
|
-
We want identity to be a **first-class citizen** in Activix, not an ad-hoc field hidden in random meta objects.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Proposed behavior (contract)
|
|
26
|
-
|
|
27
|
-
### 1) Record schema supports `identity`
|
|
28
|
-
|
|
29
|
-
Every Activix record should support a top-level field:
|
|
30
|
-
|
|
31
|
-
- `identity?: Record<string, unknown>`
|
|
32
|
-
|
|
33
|
-
Constraints:
|
|
34
|
-
|
|
35
|
-
- Must be persisted on `startRecord(...)` creation.
|
|
36
|
-
- Must remain intact across lifecycle operations (`completeRecord`, `failRecord`, `patchRecord`) unless explicitly changed.
|
|
37
|
-
- Must be returned by read/query APIs (`getRecord`, `findRecords`, etc).
|
|
38
|
-
|
|
39
|
-
### 2) Identity is preserved (no mutation by default)
|
|
40
|
-
|
|
41
|
-
Activix must not:
|
|
42
|
-
|
|
43
|
-
- rename keys inside `identity`,
|
|
44
|
-
- flatten `identity` into other fields,
|
|
45
|
-
- drop `identity` during updates.
|
|
46
|
-
|
|
47
|
-
### 3) Query by identity fields must be supported
|
|
48
|
-
|
|
49
|
-
Because `identity` is an object, querying by identity must be supported by the storage adapter. Minimum requirement:
|
|
50
|
-
|
|
51
|
-
- `findRecords({ "identity.taskId": "<id>" })` works (Mongo-style dotted-path query)
|
|
52
|
-
|
|
53
|
-
If Activix abstracts storage backends, the contract should specify which query patterns are supported (at least dotted-path equality for Mongo backend).
|
|
54
|
-
|
|
55
|
-
### 4) Indexing support (recommended)
|
|
56
|
-
|
|
57
|
-
To make querying scalable, Activix should support indexes over identity subfields (backend permitting). Recommended index patterns:
|
|
58
|
-
|
|
59
|
-
- `identity.taskId`
|
|
60
|
-
- optionally `identity.skillId`
|
|
61
|
-
|
|
62
|
-
This can be implemented as:
|
|
63
|
-
|
|
64
|
-
- a first-class `indexes` declaration (preferred), or
|
|
65
|
-
- documented guidance for consumers who configure collection indexes.
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## Required API / typing changes
|
|
70
|
-
|
|
71
|
-
### `startRecord`
|
|
72
|
-
|
|
73
|
-
Accept `identity` as a top-level field on the record meta payload:
|
|
74
|
-
|
|
75
|
-
- `ax.startRecord({ ..., identity })`
|
|
76
|
-
|
|
77
|
-
### `completeRecord` / `failRecord` / `patchRecord`
|
|
78
|
-
|
|
79
|
-
Ensure identity is not lost:
|
|
80
|
-
|
|
81
|
-
- If updates omit `identity`, the stored record keeps the previously set `identity`.
|
|
82
|
-
- If updates include `identity`, treat it as a full replace (or document merge semantics explicitly; default to replace to avoid surprising partial merges).
|
|
83
|
-
|
|
84
|
-
### Type exports
|
|
85
|
-
|
|
86
|
-
Expose a stable type for records that includes:
|
|
87
|
-
|
|
88
|
-
- `identity?: Record<string, unknown>`
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Interaction with `@exellix/ai-tasks`
|
|
93
|
-
|
|
94
|
-
`@exellix/ai-tasks` generates a unique per-run `taskId` and uses it to:
|
|
95
|
-
|
|
96
|
-
- attach `identity.taskId` to all activity records for that run, and
|
|
97
|
-
- retrieve “activities for the task” by that `taskId`.
|
|
98
|
-
|
|
99
|
-
Recommended alignment for the task methodology:
|
|
100
|
-
|
|
101
|
-
- `correlationId` remains the primary “group a run” field, but we will also carry `identity.taskId`.
|
|
102
|
-
- Optionally, stacks may choose to set `correlationId === identity.taskId` for convenience, but this should not be required by Activix.
|
|
103
|
-
|
|
104
|
-
See also: `documenations/identity-metadata-contract.md`
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Backward compatibility
|
|
109
|
-
|
|
110
|
-
- Records without `identity` remain valid.
|
|
111
|
-
- Existing producers may continue to omit identity.
|
|
112
|
-
- Query APIs should not require identity.
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## Acceptance criteria
|
|
117
|
-
|
|
118
|
-
- `identity` can be written on `startRecord`.
|
|
119
|
-
- `identity` remains present after `completeRecord` / `failRecord` unless explicitly overwritten.
|
|
120
|
-
- `identity` is returned by `getRecord` and `findRecords`.
|
|
121
|
-
- Dotted-path queries against identity subfields work for Mongo backend (`"identity.taskId"` equality).
|
|
122
|
-
- Index configuration supports `identity.taskId` (either natively or via documented index config).
|
|
123
|
-
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
# Bug report bundle: `@exellix/xynthesis` + `@exellix/ai-tasks` (synthesis / `runSynthesisCall`)
|
|
2
|
-
|
|
3
|
-
> **Superseded (xynthesis ≥ 3.6):** `runSynthesisCall` was removed upstream; ai-tasks now uses **`executeXynthesisAction`** (`ExecuteXynthesisActionRequest`). See [BREAKING-CHANGES.md](../BREAKING-CHANGES.md).
|
|
4
|
-
|
|
5
|
-
Use this document to open **GitHub issues** (xynthesis repo vs ai-tasks repo) or as an internal RCA. Each section is written so you can paste the **Issue** block into a tracker.
|
|
6
|
-
|
|
7
|
-
**Thread coverage (everything we discussed maps here):**
|
|
8
|
-
|
|
9
|
-
| Topic | Where |
|
|
10
|
-
|--------|--------|
|
|
11
|
-
| Failures: `flattenRunSynthesisCallRequest` / `systemPrompt` undefined; flat vs nested API | **§A** |
|
|
12
|
-
| Root cause: **ai-tasks** still used legacy flat `runSynthesisCall` args after xynthesis 3.5+ nested contract | **§A** |
|
|
13
|
-
| Why “synthesis” / **Xynthesis** naming and overload of `runSynthesisCall` | **§B** |
|
|
14
|
-
| “We don’t pass prompts—we pass catalog / skill refs” vs reality (resolution in ai-tasks today) | **§C** + **Target** |
|
|
15
|
-
| **Target API:** `actionId` + pre/post phase, **identity** object (not “workScope” as product term), **`config`** for model/tokens/timeout, **one** host entrypoint, xynthesis resolves content | **Target** (top) |
|
|
16
|
-
| E2E: **resolved model id** required | **§D** |
|
|
17
|
-
| Finalize warnings; **`missinngFields`** typo | **§E** |
|
|
18
|
-
| Activix owner, sidekick `trim`, required `jobId`/`taskId` types | **§F** → checklist |
|
|
19
|
-
| Paste-ready GitHub titles | Bottom list |
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Target: one clear AI-call contract (what we want vs what exists)
|
|
24
|
-
|
|
25
|
-
This section states the **intended** host-facing shape for “do an LLM hop through Xynthesis,” independent of today’s split between `runSynthesisCall`, sidekick gateway calls, and ai-tasks template resolution.
|
|
26
|
-
|
|
27
|
-
### What we need (desired)
|
|
28
|
-
|
|
29
|
-
1. **Single logical identifier for the step**
|
|
30
|
-
- Today you might think in terms of **`preActionId`** vs **`postActionId`**.
|
|
31
|
-
- **Unify** to one field, e.g. **`actionId`**, plus an explicit **phase**: **`"pre" | "post"`** (or an enum).
|
|
32
|
-
- Xynthesis (or a thin resolver next to it) uses **`actionId` + `phase`** to know **which catalog row / template bundle / evaluator** applies—**not** the caller shipping full system/user prompt text as the primary input.
|
|
33
|
-
|
|
34
|
-
2. **Runtime identity is not “workScope” in product language**
|
|
35
|
-
- Callers pass one **`identityObject`** (or keep the name **`identity`**): the **runtime correlation / run-context** object (session, job, task, agent, correlation ids, skill linkage—whatever the pipeline already carries).
|
|
36
|
-
- **Internally**, Activix / gateway may still map subsets of this to `jobId` / `taskId` / `runContext`; that is an **implementation detail**. The **public** story should be: “here is the **identity object** for this call,” not “here is workScope” as the mental model for product engineers.
|
|
37
|
-
|
|
38
|
-
3. **All LLM knobs live under `config`**
|
|
39
|
-
- **`model`**, **`maxTokens`** (and caps), **`timeoutMs`**, **`maxOutputLength`**, **`temperature`**, **`topP`**, **`outputExpectation`**, etc. should be grouped in a single **`config`** object on the request, not scattered as top-level siblings mixed with identity and action selection.
|
|
40
|
-
|
|
41
|
-
4. **One primary entrypoint for “AI calls” from hosts**
|
|
42
|
-
- However many modules exist inside `@exellix/xynthesis` today, **hosts (e.g. ai-tasks) should converge on one documented function** for: *given **action** + **phase** + **identity** + **config**, resolve prompts from the registry and invoke the gateway.*
|
|
43
|
-
- Optional escape hatch: **`overrides.prompts`** only for tests or extraordinary cases—not the default path.
|
|
44
|
-
|
|
45
|
-
**Illustrative target shape (conceptual TypeScript, not implemented):**
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
runXynthesisAiAction({
|
|
49
|
-
actionId: string; // catalog / strategy id for this pre or post step
|
|
50
|
-
actionPhase: "pre" | "post";
|
|
51
|
-
identity: IdentityObject; // full runtime correlation object (see above)
|
|
52
|
-
config: {
|
|
53
|
-
model?: string;
|
|
54
|
-
maxTokens?: number;
|
|
55
|
-
timeoutMs?: number;
|
|
56
|
-
maxOutputLength?: number;
|
|
57
|
-
temperature?: number;
|
|
58
|
-
topP?: number;
|
|
59
|
-
outputExpectation?: OutputExpectation;
|
|
60
|
-
// …
|
|
61
|
-
};
|
|
62
|
-
/** Optional: variables merged into resolved templates (record, web snippets, etc.) */
|
|
63
|
-
templateContext?: Record<string, unknown>;
|
|
64
|
-
/** Optional: gateway wire ids if not derived from `identity` */
|
|
65
|
-
gateway?: Partial<SynthesisCallGatewayContext>;
|
|
66
|
-
});
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Xynthesis (or a dedicated resolver it calls) is responsible for: **`(actionId, actionPhase)` → load template / instructions → build prompts → call invoker** using **`config`** and **`identity`** for logging and gateway requests.
|
|
70
|
-
|
|
71
|
-
### What we have today (reality)
|
|
72
|
-
|
|
73
|
-
| Area | Today |
|
|
74
|
-
|------|--------|
|
|
75
|
-
| **Entrypoints** | Multiple: **`runSynthesisCall`**, **`runSidekickGatewayCall`**, **`runStructuredSynthesisGatewayCall`**, finalize/repair paths, etc. Hosts must learn several shapes. |
|
|
76
|
-
| **Prompt source** | **Callers often materialize** `systemPrompt` / `userPrompt` (or `renderedInstructions` / `renderedPrompt`) **before** Xynthesis. Catalog/skill resolution for ai-tasks lives largely in **ai-tasks** (`skillKey`, `resolveRawTemplate`, `getRenderedTemplates`), not behind a single **`actionId`** API in Xynthesis. |
|
|
77
|
-
| **Identity** | **`workScope`** + **`gateway`** on `RunSynthesisCallRequest`: `workScope.jobId` / `taskId` / optional `identity`, plus separate **`gateway`** `{ aiRequestId, agentId, sessionId, temperature }`. Product-wise this splits “who/where” across two buckets. |
|
|
78
|
-
| **Config** | **`model`**, **`timeoutMs`**, **`maxTokens`**, **`maxOutputLength`**, **`topP`**, **`outputExpectation`** are **top-level** fields on `RunSynthesisCallRequest` (and duplicated patterns elsewhere)—not grouped under a single **`config`**. |
|
|
79
|
-
| **Pre vs post** | Expressed indirectly (different code paths, step types, env prefixes like `SYNTHESIS` vs `POST_STEP_*`), not as **`actionId` + `actionPhase`**. |
|
|
80
|
-
|
|
81
|
-
### What we need to do (gap closure)
|
|
82
|
-
|
|
83
|
-
| Step | Owner | Note |
|
|
84
|
-
|------|--------|------|
|
|
85
|
-
| Specify **catalog binding**: how **`actionId`** maps to rows (Catalox catalog id? strategy key? composite key including app id). | Architecture | Without this, Xynthesis cannot “know where to look.” |
|
|
86
|
-
| Either **implement resolution inside Xynthesis** or **define a single resolver interface** (injected) that Xynthesis calls so the **host does not pass raw prompts** on the default path. | Xynthesis (+ ai-tasks) | Pure ai-tasks-only resolver preserves one package boundary but does not unify “one Xynthesis entry” unless Xynthesis exports the façade. |
|
|
87
|
-
| Introduce **`runXynthesisAiAction`** (name TBD) that maps internally to today’s invoker + Activix, and **deprecate** scattered public shapes over time. | Xynthesis | Reduces host cognitive load; internal adapter can build `RunSynthesisCallRequest` for a transition period. |
|
|
88
|
-
| Refactor **ai-tasks** to pass **`actionId` + `actionPhase` + `identity` + `config`** into that façade; keep **`skillKey`** and pipeline context on **`identity`** or **`templateContext`** as needed. | ai-tasks | Aligns runtime with this document. |
|
|
89
|
-
| Document that **`workScope`** in low-level types is the **wire/Activix projection** of **`identity`**, not the product name for the object. | Docs | Reduces “it isn’t workScope” confusion. |
|
|
90
|
-
|
|
91
|
-
### Feasible ways to get there (short list)
|
|
92
|
-
|
|
93
|
-
1. **Facade in Xynthesis (preferred for “one thing”)** — New API resolves **`actionId` + `phase`** via Catalox/skills client injected at init; builds prompts; calls existing invoker. Legacy APIs remain as `@deprecated` wrappers.
|
|
94
|
-
2. **Facade in ai-tasks only** — Faster locally, but **does not** give “Xynthesis knows where to look” as a package guarantee; Xynthesis stays low-level.
|
|
95
|
-
3. **Hybrid** — Xynthesis exports the unified **`runXynthesisAiAction`** signature; default implementation delegates template fetch to a callback registered by ai-tasks (inversion of control), still one host call site.
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## A. What is the *actual* `runSynthesisCall` API? (not the flat shape)
|
|
100
|
-
|
|
101
|
-
**Answer for engineers:** The **only** supported input type is `RunSynthesisCallRequest` — **nested** `gateway`, `prompts`, and `workScope`. The package’s own `.d.ts` states: *“This is the only supported input shape for `runSynthesisCall`.”*
|
|
102
|
-
|
|
103
|
-
**Correct shape (conceptual):**
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
runSynthesisCall({
|
|
107
|
-
gateway: {
|
|
108
|
-
aiRequestId: string,
|
|
109
|
-
agentId: string,
|
|
110
|
-
sessionId: string,
|
|
111
|
-
temperature: number,
|
|
112
|
-
},
|
|
113
|
-
prompts: {
|
|
114
|
-
systemPrompt: string,
|
|
115
|
-
userPrompt: string,
|
|
116
|
-
},
|
|
117
|
-
workScope: {
|
|
118
|
-
jobId: string,
|
|
119
|
-
taskId: string,
|
|
120
|
-
identity?: ActivityRunContext,
|
|
121
|
-
},
|
|
122
|
-
model?: string | OpenRouterModel | ModelPick,
|
|
123
|
-
timeoutMs?: number,
|
|
124
|
-
maxTokens?: number,
|
|
125
|
-
// …see `RunSynthesisCallRequest` in `@exellix/xynthesis`
|
|
126
|
-
});
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**Legacy / wrong shape (still seen in some consumers):**
|
|
130
|
-
|
|
131
|
-
```ts
|
|
132
|
-
// NOT supported — was never the typed public contract after the nested migration
|
|
133
|
-
runSynthesisCall({
|
|
134
|
-
systemPrompt,
|
|
135
|
-
userPrompt,
|
|
136
|
-
jobId,
|
|
137
|
-
taskId,
|
|
138
|
-
agentId,
|
|
139
|
-
...
|
|
140
|
-
});
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Passing the flat object makes `flattenRunSynthesisCallRequest` read `r.prompts.systemPrompt` when `prompts` is missing → **`TypeError: Cannot read properties of undefined (reading 'systemPrompt')`**.
|
|
144
|
-
|
|
145
|
-
**Where this showed up:** ai-tasks **`npm test`** — multiple failures under **`intermediateSteps`** (and any path using **`runPostStepLlmCall`** → **`runSynthesisCall`**) with that stack trace; not a bug in “reading templates” inside xynthesis flatten—it is **missing `prompts` on the request object**.
|
|
146
|
-
|
|
147
|
-
| Repo | Issue type | Action |
|
|
148
|
-
|------------|------------|--------|
|
|
149
|
-
| **ai-tasks** | Defect | Migrate all `runSynthesisCall` call sites to `RunSynthesisCallRequest` (e.g. `runPostStepLlmCall.ts`). |
|
|
150
|
-
| **xynthesis** | DX / compat (optional) | At runtime, detect flat legacy objects and either adapt or throw a **single clear error** (“use `prompts` + `workScope` + `gateway`”). |
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
## B. Why is it called *synthesis* (and the package *Xynthesis*)?
|
|
155
|
-
|
|
156
|
-
- **English domain term:** In this product line, “synthesis” means **combining multiple sources** (Narrix, memory, web evidence, templates) into a **unified context** before or alongside LLM steps. The Greek root is σύνθεσις → English **synthesis** (standard spelling: **s-y-n-t-h-e-s-i-s**).
|
|
157
|
-
- **Package name `xynthesis`:** Branding (leading **X**) on the same concept; it is not a different technical term.
|
|
158
|
-
- **Naming overload (real confusion):** `runSynthesisCall` is also used for **any** single completion that goes through the same invoker path (e.g. audit / polish / question-driven PRE calls in ai-tasks). So the name reads like “only context synthesis,” but operationally it is **“one gateway-backed LLM completion with synthesis-style telemetry/config.”** That overload is a **documentation and API naming** problem, not a typo.
|
|
159
|
-
|
|
160
|
-
**Suggested upstream issue (xynthesis):** Document in JSDoc that `runSynthesisCall` is the **generic single-hop LLM invoke** for the package; optionally alias or document `runGatewayLlmCall` / similar in a future major if you want clearer vocabulary.
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## C. Product expectation: “catalog id only, never materialized prompts”
|
|
165
|
-
|
|
166
|
-
**Observation:** `@exellix/xynthesis` does **not** expose a first-class API of the form “Catalox catalog id + row id → fetch template → invoke.” Template/skill resolution for **ai-tasks** happens **before** xynthesis (e.g. `skillKey`, `resolveRawTemplate`, `getRenderedTemplates`), then **materialized** `systemPrompt` / `userPrompt` (or sidekick `renderedInstructions` / `renderedPrompt`) are passed in.
|
|
167
|
-
|
|
168
|
-
**This is architectural layering**, not necessarily a bug—unless the product mandate is that **no** layer below the catalog resolver may accept prompt strings. If that mandate is firm:
|
|
169
|
-
|
|
170
|
-
| Repo | Issue |
|
|
171
|
-
|------------|--------|
|
|
172
|
-
| **xynthesis** (feature) | Optional higher-level entry: accept **skill/catalog handles** and delegate resolution (or document explicitly that resolution is **out of scope**). |
|
|
173
|
-
| **ai-tasks** (docs) | State clearly: “xynthesis executes; ai-tasks + skills resolve templates.” |
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
## D. Resolved model id required (`runSynthesisCall requires a resolved model id`)
|
|
178
|
-
|
|
179
|
-
**Symptom:** E2E / real gateway tests fail with
|
|
180
|
-
`Error: runSynthesisCall requires a resolved model id (set model on the request or use a strategy pick that maps to a concrete model).`
|
|
181
|
-
|
|
182
|
-
**Classification:** Expected when **`model`** is omitted and no strategy/env resolves one. Fix is **callers/tests/env** (`SYNTHESIS_MODEL`, `LLM_MODEL_*`, or explicit `model` on the request), unless xynthesis intentionally guarantees a default (today it does not).
|
|
183
|
-
|
|
184
|
-
| Repo | Action |
|
|
185
|
-
|----------|--------|
|
|
186
|
-
| **ai-tasks** | Ensure E2E sets a resolvable model when the test is not skipped. |
|
|
187
|
-
| **xynthesis** (DX) | Optionally document default resolution order in one place. |
|
|
188
|
-
|
|
189
|
-
---
|
|
190
|
-
|
|
191
|
-
## E. Finalize / work-scope warnings and log typo
|
|
192
|
-
|
|
193
|
-
**Symptom:** Warnings such as missing `jobId` / `taskId` on `runXynthesisFinalize` when test payloads omit work scope.
|
|
194
|
-
|
|
195
|
-
**Symptom:** Log field typo **`missinngFields`** (double **n**) in warning payloads — hurts grep and professionalism.
|
|
196
|
-
|
|
197
|
-
| Repo | Action |
|
|
198
|
-
|------------|--------|
|
|
199
|
-
| **xynthesis** | Fix typo `missinngFields` → `missingFields` (consider backward compat if anything parses logs). |
|
|
200
|
-
| **ai-tasks / tests** | Pass `jobId` / `taskId` into finalize in tests where the contract requires them. |
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
## F. Related items already tracked in-repo
|
|
205
|
-
|
|
206
|
-
See [`xynthesis-upstream-fixes-checklist.md`](./xynthesis-upstream-fixes-checklist.md) for Activix `diagnostics.owner`, `runSidekickGatewayCall` `.trim()` on undefined ids, and TypeScript required `jobId`/`taskId` on structured params.
|
|
207
|
-
|
|
208
|
-
---
|
|
209
|
-
|
|
210
|
-
## Paste-ready issue titles (suggested)
|
|
211
|
-
|
|
212
|
-
1. **xynthesis:** `runSynthesisCall`: validate request shape / deprecate flat args with clear error (avoid `TypeError` on `prompts.systemPrompt`).
|
|
213
|
-
2. **xynthesis:** Document that `runSynthesisCall` is the generic single-hop LLM API; clarify “synthesis” vs audit/polish use cases.
|
|
214
|
-
3. **xynthesis:** Fix typo `missinngFields` in finalize / warning metadata.
|
|
215
|
-
4. **ai-tasks:** Migrate `runPostStepLlmCall` (and any other callers) to `RunSynthesisCallRequest` + full `SynthesisCallGatewayContext`.
|
|
216
|
-
5. **ai-tasks:** E2E synthesis: require resolvable `model` or skip with explicit reason (align with env docs).
|
|
217
|
-
6. **xynthesis (+ ai-tasks):** Design and implement a **single host-facing LLM entry** (`actionId` + `pre`/`post` phase, **`identity` object**, **`config`** blob, resolver for catalog content); deprecate multiple parallel public shapes over time.
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# Feature Request: AI-Skills Raw Template Access API
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
|
|
5
|
-
`@exellix/ai-tasks` needs a stable, public API from `@woroces/ai-skills` to retrieve **raw template content** (instructions/prompt) for a skill key, before rendering.
|
|
6
|
-
|
|
7
|
-
This is required for strict template-contract semantics (for example template core token discovery in structured synthesis).
|
|
8
|
-
|
|
9
|
-
## Problem
|
|
10
|
-
|
|
11
|
-
In `ai-tasks` synthesis pre-step, we must inspect template tokens before rendering.
|
|
12
|
-
Current integration paths are not reliable for this:
|
|
13
|
-
|
|
14
|
-
- `skillsClient.registry.resolve/get` may return `undefined` during runtime pre-step.
|
|
15
|
-
- `diagnoseSkillContent()` logs useful diagnostics but does not return the raw content.
|
|
16
|
-
- `listAvailable()` can be empty in contexts where execution still works later.
|
|
17
|
-
|
|
18
|
-
Result: `ai-tasks` cannot deterministically read raw instructions/prompt content at pre-step time, so strict token-based validation fails even when skill content exists.
|
|
19
|
-
|
|
20
|
-
## Requested API
|
|
21
|
-
|
|
22
|
-
Expose a public method on `WorecesSkillsClient` (or equivalent public content-resolver service):
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
export type TemplateSection = "instructions" | "prompt";
|
|
26
|
-
|
|
27
|
-
export interface ResolveRawTemplateResult {
|
|
28
|
-
key: string; // normalized internal key used by resolver
|
|
29
|
-
found: boolean;
|
|
30
|
-
content?: string; // raw template text (unrendered)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
resolveRawTemplate(
|
|
34
|
-
skillKey: string,
|
|
35
|
-
section: TemplateSection
|
|
36
|
-
): Promise<ResolveRawTemplateResult>;
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Alternative acceptable shape:
|
|
40
|
-
|
|
41
|
-
```ts
|
|
42
|
-
resolveRawTemplateByKey(key: string): Promise<string | undefined>;
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
as long as normalization rules are documented and stable.
|
|
46
|
-
|
|
47
|
-
## Behavioral Requirements
|
|
48
|
-
|
|
49
|
-
1. Returns **raw template text**, not rendered output.
|
|
50
|
-
2. Works consistently in the same runtime phase where `runSkill/runTask` executes.
|
|
51
|
-
3. No diagnostics-only behavior; must return programmatic result.
|
|
52
|
-
4. No side effects required (no forced diagnose/warmup calls needed by consumer).
|
|
53
|
-
5. Clear normalization rules for keys:
|
|
54
|
-
- `skills/<id>.instructions`
|
|
55
|
-
- `skills/<id>.prompt`
|
|
56
|
-
- and any officially supported aliases.
|
|
57
|
-
|
|
58
|
-
## Why This Is Needed
|
|
59
|
-
|
|
60
|
-
`ai-tasks` structured synthesis is now template-contract-driven:
|
|
61
|
-
|
|
62
|
-
- discover semantic tokens from raw template contract,
|
|
63
|
-
- validate required tokens,
|
|
64
|
-
- block execution if missing.
|
|
65
|
-
|
|
66
|
-
Without raw-template API, this validation is brittle and environment-dependent.
|
|
67
|
-
|
|
68
|
-
## Acceptance Criteria
|
|
69
|
-
|
|
70
|
-
1. Public API added to `WorecesSkillsClient` (or public content registry wrapper).
|
|
71
|
-
2. Works against local registry path and normal runtime registry.
|
|
72
|
-
3. Unit tests cover:
|
|
73
|
-
- found/missing instructions
|
|
74
|
-
- found/missing prompt
|
|
75
|
-
- normalized key mapping
|
|
76
|
-
- runtime call path parity with execution flow
|
|
77
|
-
4. Docs include examples for consumers (`ai-tasks` and other orchestrators).
|
|
78
|
-
|
|
79
|
-
## Backward Compatibility
|
|
80
|
-
|
|
81
|
-
Additive change only; no breaking behavior required.
|
|
82
|
-
|