@exellix/ai-tasks 10.0.9 → 10.0.11
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 +25 -0
- package/README.md +32 -35
- package/RUNTASK_REQUEST.md +4 -4
- package/dist/activix/phaseTracking.d.ts +1 -1
- package/dist/activix/phaseTracking.d.ts.map +1 -1
- package/dist/activix/phaseTracking.js.map +1 -1
- package/dist/builders/task-request-builder.d.ts +1 -54
- package/dist/builders/task-request-builder.d.ts.map +1 -1
- package/dist/builders/task-request-builder.js +1 -180
- package/dist/builders/task-request-builder.js.map +1 -1
- package/dist/core/task-sdk.d.ts +4 -10
- package/dist/core/task-sdk.d.ts.map +1 -1
- package/dist/core/task-sdk.js +35 -117
- package/dist/core/task-sdk.js.map +1 -1
- package/dist/errors/runTaskExecutionError.d.ts +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/errors/smartInputValidationError.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/resolveRunTaskRuntimeKnobs.d.ts +2 -5
- package/dist/internal/resolveRunTaskRuntimeKnobs.d.ts.map +1 -1
- package/dist/internal/resolveRunTaskRuntimeKnobs.js +3 -36
- package/dist/internal/resolveRunTaskRuntimeKnobs.js.map +1 -1
- package/dist/localTasks/collectEvidence.d.ts.map +1 -1
- package/dist/localTasks/collectEvidence.js +13 -23
- package/dist/localTasks/collectEvidence.js.map +1 -1
- package/dist/localTasks/decideWebScope.js +1 -1
- package/dist/localTasks/decideWebScope.js.map +1 -1
- package/dist/localTasks/index.d.ts +0 -1
- package/dist/localTasks/index.d.ts.map +1 -1
- package/dist/localTasks/index.js +2 -4
- package/dist/localTasks/index.js.map +1 -1
- package/dist/localTasks/playgroundSeedMain.d.ts +4 -0
- package/dist/localTasks/playgroundSeedMain.d.ts.map +1 -0
- package/dist/localTasks/playgroundSeedMain.js +26 -0
- package/dist/localTasks/playgroundSeedMain.js.map +1 -0
- package/dist/logxer/aiTasksDiagnosticCodes.d.ts +1 -1
- package/dist/logxer/aiTasksDiagnosticCodes.js +1 -1
- package/dist/logxer/aiTasksDiagnosticCodes.js.map +1 -1
- package/dist/narrix/narrixUnitExecution.d.ts.map +1 -1
- package/dist/narrix/narrixUnitExecution.js +1 -6
- package/dist/narrix/narrixUnitExecution.js.map +1 -1
- package/dist/narrix/webContextMarkdown.d.ts +2 -25
- package/dist/narrix/webContextMarkdown.d.ts.map +1 -1
- package/dist/narrix/webContextMarkdown.js +33 -57
- package/dist/narrix/webContextMarkdown.js.map +1 -1
- package/dist/node-execution/buildRequestFromNodePlan.d.ts.map +1 -1
- package/dist/node-execution/buildRequestFromNodePlan.js +0 -12
- package/dist/node-execution/buildRequestFromNodePlan.js.map +1 -1
- package/dist/node-execution/createNodeExecutionHost.d.ts.map +1 -1
- package/dist/node-execution/createNodeExecutionHost.js +1 -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 +0 -15
- package/dist/node-execution/dispatchExecutionUnit.js.map +1 -1
- package/dist/node-execution/executeNodeFromPlan.d.ts.map +1 -1
- package/dist/node-execution/executeNodeFromPlan.js +0 -15
- package/dist/node-execution/executeNodeFromPlan.js.map +1 -1
- package/dist/node-execution/executePlaygroundElement.d.ts +23 -0
- package/dist/node-execution/executePlaygroundElement.d.ts.map +1 -0
- package/dist/node-execution/executePlaygroundElement.js +80 -0
- package/dist/node-execution/executePlaygroundElement.js.map +1 -0
- package/dist/node-execution/index.d.ts +2 -0
- package/dist/node-execution/index.d.ts.map +1 -1
- package/dist/node-execution/index.js +1 -0
- package/dist/node-execution/index.js.map +1 -1
- package/dist/node-execution/types.d.ts +0 -2
- package/dist/node-execution/types.d.ts.map +1 -1
- package/dist/observability/classifyRunTaskFailure.d.ts +1 -1
- package/dist/observability/classifyRunTaskFailure.d.ts.map +1 -1
- package/dist/observability/classifyRunTaskFailure.js +0 -3
- package/dist/observability/classifyRunTaskFailure.js.map +1 -1
- package/dist/observability/extractAiTasksObservability.d.ts.map +1 -1
- package/dist/observability/extractAiTasksObservability.js +0 -8
- package/dist/observability/extractAiTasksObservability.js.map +1 -1
- package/dist/planWebScopeQuestions/index.d.ts +1 -1
- package/dist/planWebScopeQuestions/index.js +1 -1
- package/dist/rendrixUpstreamExports.d.ts +1 -1
- package/dist/rendrixUpstreamExports.d.ts.map +1 -1
- package/dist/rendrixUpstreamExports.js +1 -1
- package/dist/rendrixUpstreamExports.js.map +1 -1
- package/dist/synthesis/index.d.ts +1 -1
- package/dist/synthesis/index.js +1 -1
- package/dist/synthesis/resolveSourceMaterial.d.ts +3 -7
- package/dist/synthesis/resolveSourceMaterial.d.ts.map +1 -1
- package/dist/synthesis/resolveSourceMaterial.js +15 -78
- package/dist/synthesis/resolveSourceMaterial.js.map +1 -1
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts +0 -1
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts.map +1 -1
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js +1 -9
- package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js.map +1 -1
- package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts +3 -4
- package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts.map +1 -1
- package/dist/task-strategies/canonicalInputExecutionStrategies.js +3 -4
- package/dist/task-strategies/canonicalInputExecutionStrategies.js.map +1 -1
- package/dist/task-strategies/canonicalTaskStrategies.d.ts +2 -2
- package/dist/task-strategies/canonicalTaskStrategies.js +1 -1
- package/dist/task-strategies/canonicalTaskStrategies.js.map +1 -1
- package/dist/task-strategies/cataloxCatalogViews.d.ts +2 -5
- package/dist/task-strategies/cataloxCatalogViews.d.ts.map +1 -1
- package/dist/task-strategies/cataloxCatalogViews.js +3 -6
- package/dist/task-strategies/cataloxCatalogViews.js.map +1 -1
- package/dist/task-strategies/constants.d.ts +0 -4
- package/dist/task-strategies/constants.d.ts.map +1 -1
- package/dist/task-strategies/constants.js +0 -4
- package/dist/task-strategies/constants.js.map +1 -1
- package/dist/task-strategies/index.d.ts +4 -6
- package/dist/task-strategies/index.d.ts.map +1 -1
- package/dist/task-strategies/index.js +4 -5
- package/dist/task-strategies/index.js.map +1 -1
- package/dist/task-strategies/listAiTaskStrategies.d.ts +0 -2
- package/dist/task-strategies/listAiTaskStrategies.d.ts.map +1 -1
- package/dist/task-strategies/listAiTaskStrategies.js +1 -5
- package/dist/task-strategies/listAiTaskStrategies.js.map +1 -1
- package/dist/types/index.d.ts +1 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/task-types.d.ts +9 -133
- package/dist/types/task-types.d.ts.map +1 -1
- package/dist/types/task-types.js +0 -4
- package/dist/types/task-types.js.map +1 -1
- package/dist/types/web-scope-types.d.ts +20 -0
- package/dist/types/web-scope-types.d.ts.map +1 -0
- package/dist/types/web-scope-types.js +2 -0
- package/dist/types/web-scope-types.js.map +1 -0
- package/dist/utils/runTaskRequestShape.d.ts +1 -5
- package/dist/utils/runTaskRequestShape.d.ts.map +1 -1
- package/dist/utils/runTaskRequestShape.js +0 -26
- package/dist/utils/runTaskRequestShape.js.map +1 -1
- package/dist/utils/templateContext.d.ts +16 -0
- package/dist/utils/templateContext.d.ts.map +1 -0
- package/dist/utils/templateContext.js +35 -0
- package/dist/utils/templateContext.js.map +1 -0
- package/dist/validation/helpers.d.ts.map +1 -1
- package/dist/validation/helpers.js +3 -22
- package/dist/validation/helpers.js.map +1 -1
- package/dist/validation/validateRunTaskConfig.d.ts.map +1 -1
- package/dist/validation/validateRunTaskConfig.js +2 -0
- package/dist/validation/validateRunTaskConfig.js.map +1 -1
- package/dist/validation/validateRunTaskInvoke.d.ts.map +1 -1
- package/dist/validation/validateRunTaskInvoke.js +2 -0
- package/dist/validation/validateRunTaskInvoke.js.map +1 -1
- package/dist/validation/validateWebScopeUnit.d.ts +16 -0
- package/dist/validation/validateWebScopeUnit.d.ts.map +1 -0
- package/dist/validation/validateWebScopeUnit.js +107 -0
- package/dist/validation/validateWebScopeUnit.js.map +1 -0
- package/dist/web-scope/applyWebScopeToRequest.d.ts +11 -0
- package/dist/web-scope/applyWebScopeToRequest.d.ts.map +1 -0
- package/dist/web-scope/applyWebScopeToRequest.js +42 -0
- package/dist/web-scope/applyWebScopeToRequest.js.map +1 -0
- package/dist/web-scope/buildSearchInput.d.ts +22 -0
- package/dist/web-scope/buildSearchInput.d.ts.map +1 -0
- package/dist/web-scope/buildSearchInput.js +108 -0
- package/dist/web-scope/buildSearchInput.js.map +1 -0
- package/dist/web-scope/client.d.ts +12 -0
- package/dist/web-scope/client.d.ts.map +1 -0
- package/dist/web-scope/client.js +72 -0
- package/dist/web-scope/client.js.map +1 -0
- package/dist/web-scope/renderWebQueryTemplate.d.ts +14 -0
- package/dist/web-scope/renderWebQueryTemplate.d.ts.map +1 -0
- package/dist/web-scope/renderWebQueryTemplate.js +44 -0
- package/dist/web-scope/renderWebQueryTemplate.js.map +1 -0
- package/dist/web-scope/webContextMarkdown.d.ts +22 -0
- package/dist/web-scope/webContextMarkdown.d.ts.map +1 -0
- package/dist/web-scope/webContextMarkdown.js +163 -0
- package/dist/web-scope/webContextMarkdown.js.map +1 -0
- package/documenations/run-task-execution-flow.md +3 -7
- package/documenations/web-scoping-in-ai-tasks.md +88 -428
- package/package.json +16 -33
- package/dist/narrix/applyWebScopeToRequest.d.ts +0 -9
- package/dist/narrix/applyWebScopeToRequest.d.ts.map +0 -1
- package/dist/narrix/applyWebScopeToRequest.js +0 -156
- package/dist/narrix/applyWebScopeToRequest.js.map +0 -1
- package/dist/narrix/buildWebScopeScopeInput.d.ts +0 -39
- package/dist/narrix/buildWebScopeScopeInput.d.ts.map +0 -1
- package/dist/narrix/buildWebScopeScopeInput.js +0 -193
- package/dist/narrix/buildWebScopeScopeInput.js.map +0 -1
- package/dist/narrix/webScoper.d.ts +0 -43
- package/dist/narrix/webScoper.d.ts.map +0 -1
- package/dist/narrix/webScoper.js +0 -144
- package/dist/narrix/webScoper.js.map +0 -1
- package/documenations/activix.md +0 -187
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialize executionMemory.webContext (`@x12i/web-scoper` WebScopeResult / WebScopePackResult) into markdown.
|
|
3
|
+
*/
|
|
4
|
+
import { isWebScopeSearchManyResult } from "./client.js";
|
|
5
|
+
function isRecord(v) {
|
|
6
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
7
|
+
}
|
|
8
|
+
function nonEmptyString(v) {
|
|
9
|
+
if (typeof v !== "string")
|
|
10
|
+
return undefined;
|
|
11
|
+
const t = v.trim();
|
|
12
|
+
return t ? t : undefined;
|
|
13
|
+
}
|
|
14
|
+
function normalizeUrlKey(url) {
|
|
15
|
+
try {
|
|
16
|
+
const u = new URL(url.trim());
|
|
17
|
+
u.hash = "";
|
|
18
|
+
return u.href;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return url.trim().split("#")[0] ?? url.trim();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function pickSourceUrl(src) {
|
|
25
|
+
return nonEmptyString(src.url) ?? nonEmptyString(src.link);
|
|
26
|
+
}
|
|
27
|
+
function pickSourceBody(src) {
|
|
28
|
+
return nonEmptyString(src.snippet) ?? nonEmptyString(src.title);
|
|
29
|
+
}
|
|
30
|
+
function resolveWebContext(entry) {
|
|
31
|
+
if (!isRecord(entry))
|
|
32
|
+
return undefined;
|
|
33
|
+
if (entry.ok === true && isRecord(entry.context))
|
|
34
|
+
return entry.context;
|
|
35
|
+
if (isWebScopeSearchManyResult(entry)) {
|
|
36
|
+
if (isRecord(entry.pack?.primary))
|
|
37
|
+
return entry.pack.primary;
|
|
38
|
+
for (const scope of Object.values(entry.pack?.scopes ?? {})) {
|
|
39
|
+
if (isRecord(scope) && scope.ok === true && isRecord(scope.context)) {
|
|
40
|
+
return scope.context;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
function formatFindings(findings) {
|
|
47
|
+
if (findings == null)
|
|
48
|
+
return undefined;
|
|
49
|
+
if (typeof findings === "string") {
|
|
50
|
+
const t = findings.trim();
|
|
51
|
+
return t ? `**Findings:**\n\n${t}` : undefined;
|
|
52
|
+
}
|
|
53
|
+
if (!Array.isArray(findings) || findings.length === 0)
|
|
54
|
+
return undefined;
|
|
55
|
+
const lines = ["**Findings:**", ""];
|
|
56
|
+
for (const f of findings) {
|
|
57
|
+
if (typeof f === "string" && f.trim())
|
|
58
|
+
lines.push(`- ${f.trim()}`);
|
|
59
|
+
else if (isRecord(f)) {
|
|
60
|
+
const claim = nonEmptyString(f.claim);
|
|
61
|
+
lines.push(`- ${claim ?? JSON.stringify(f)}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return lines.join("\n");
|
|
65
|
+
}
|
|
66
|
+
function parseMaxTotalCharsEnv() {
|
|
67
|
+
const raw = process.env.WEB_CONTEXT_MARKDOWN_MAX_CHARS;
|
|
68
|
+
if (!raw)
|
|
69
|
+
return undefined;
|
|
70
|
+
const n = parseInt(raw, 10);
|
|
71
|
+
return !Number.isNaN(n) && n > 0 ? n : undefined;
|
|
72
|
+
}
|
|
73
|
+
export function isWebContextEvidenceAvailable(webContextEntry) {
|
|
74
|
+
const ctx = resolveWebContext(webContextEntry);
|
|
75
|
+
if (!ctx)
|
|
76
|
+
return false;
|
|
77
|
+
const sources = Array.isArray(ctx.sources) ? ctx.sources : [];
|
|
78
|
+
const hasSourceMaterial = sources.some((s) => isRecord(s) && (pickSourceBody(s) || pickSourceUrl(s)));
|
|
79
|
+
const summary = nonEmptyString(ctx.summary);
|
|
80
|
+
const findingsBlock = formatFindings(ctx.findings);
|
|
81
|
+
return hasSourceMaterial || !!summary || !!findingsBlock;
|
|
82
|
+
}
|
|
83
|
+
export function buildWebContextEvidenceMarkdown(webContextEntry, options) {
|
|
84
|
+
const ctx = resolveWebContext(webContextEntry);
|
|
85
|
+
if (!ctx)
|
|
86
|
+
return "";
|
|
87
|
+
let sources = Array.isArray(ctx.sources) ? [...ctx.sources] : [];
|
|
88
|
+
const dedupeByUrl = options?.dedupeByUrl !== false;
|
|
89
|
+
const maxSources = options?.maxSources ?? 5;
|
|
90
|
+
if (dedupeByUrl && sources.length > 0) {
|
|
91
|
+
const seen = new Set();
|
|
92
|
+
const out = [];
|
|
93
|
+
for (const s of sources) {
|
|
94
|
+
if (!isRecord(s)) {
|
|
95
|
+
out.push(s);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const url = pickSourceUrl(s);
|
|
99
|
+
const key = url ? normalizeUrlKey(url) : `__nourl_${out.length}`;
|
|
100
|
+
if (seen.has(key))
|
|
101
|
+
continue;
|
|
102
|
+
seen.add(key);
|
|
103
|
+
out.push(s);
|
|
104
|
+
}
|
|
105
|
+
sources = out;
|
|
106
|
+
}
|
|
107
|
+
if (maxSources > 0 && sources.length > maxSources) {
|
|
108
|
+
sources = sources.slice(0, maxSources);
|
|
109
|
+
}
|
|
110
|
+
const summary = nonEmptyString(ctx.summary);
|
|
111
|
+
const findingsBlock = formatFindings(ctx.findings);
|
|
112
|
+
const hasSourceMaterial = sources.some((s) => isRecord(s) && (pickSourceBody(s) || pickSourceUrl(s)));
|
|
113
|
+
if (!hasSourceMaterial && !summary && !findingsBlock)
|
|
114
|
+
return "";
|
|
115
|
+
const lines = [
|
|
116
|
+
"",
|
|
117
|
+
"## Web sources (primary evidence)",
|
|
118
|
+
"",
|
|
119
|
+
"Ground factual claims in the **source excerpts** below. **Summary** and **findings** (if present) are overview hints only—not authoritative on their own.",
|
|
120
|
+
"",
|
|
121
|
+
];
|
|
122
|
+
if (summary || findingsBlock) {
|
|
123
|
+
lines.push("### Web overview (hints only)", "", "*Do not treat this subsection alone as sufficient evidence.*", "");
|
|
124
|
+
if (summary)
|
|
125
|
+
lines.push("**Summary:**", summary, "");
|
|
126
|
+
if (findingsBlock)
|
|
127
|
+
lines.push(findingsBlock, "");
|
|
128
|
+
}
|
|
129
|
+
lines.push("### Source excerpts (ground truth)", "");
|
|
130
|
+
for (let i = 0; i < sources.length; i++) {
|
|
131
|
+
const src = sources[i];
|
|
132
|
+
if (!isRecord(src))
|
|
133
|
+
continue;
|
|
134
|
+
const title = nonEmptyString(src.title) ?? nonEmptyString(src.name) ?? `Source ${i + 1}`;
|
|
135
|
+
const url = pickSourceUrl(src);
|
|
136
|
+
const body = pickSourceBody(src);
|
|
137
|
+
if (!body && !url)
|
|
138
|
+
continue;
|
|
139
|
+
lines.push(`#### ${title}`, "");
|
|
140
|
+
if (url)
|
|
141
|
+
lines.push(`- URL: ${url}`, "");
|
|
142
|
+
if (body)
|
|
143
|
+
lines.push(body, "");
|
|
144
|
+
}
|
|
145
|
+
let out = lines.join("\n");
|
|
146
|
+
const maxTotal = options?.maxTotalChars ?? parseMaxTotalCharsEnv();
|
|
147
|
+
if (maxTotal !== undefined && out.length > maxTotal) {
|
|
148
|
+
const marker = "\n\n[truncated — web source budget exceeded]";
|
|
149
|
+
const cut = Math.max(0, maxTotal - marker.length);
|
|
150
|
+
return out.slice(0, cut) + marker;
|
|
151
|
+
}
|
|
152
|
+
return out.endsWith("\n") ? out : `${out}\n`;
|
|
153
|
+
}
|
|
154
|
+
export function omitWebContextFromMemoryBundle(bundle) {
|
|
155
|
+
const ex = bundle.executionMemory;
|
|
156
|
+
if (!ex || typeof ex !== "object" || !("webContext" in ex)) {
|
|
157
|
+
return bundle;
|
|
158
|
+
}
|
|
159
|
+
const restExec = { ...ex };
|
|
160
|
+
delete restExec.webContext;
|
|
161
|
+
return { ...bundle, executionMemory: restExec };
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=webContextMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webContextMarkdown.js","sourceRoot":"","sources":["../../src/web-scope/webContextMarkdown.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,cAAc,CAAC,CAAU;IAChC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACnB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3B,CAAC;AAED,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9B,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;QACZ,OAAO,CAAC,CAAC,IAAI,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;IAChD,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,GAA4B;IACjD,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,cAAc,CAAC,GAA4B;IAClD,OAAO,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,cAAc,CAA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K,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IACpC,CAAC;IAED,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,MAI9C;IAKC,MAAM,EAAE,GAAG,MAAM,CAAC,eAAe,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,CAAC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,QAAQ,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IAC3B,OAAO,QAAQ,CAAC,UAAU,CAAC;IAC3B,OAAO,EAAE,GAAG,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -13,11 +13,7 @@ flowchart TD
|
|
|
13
13
|
B -- Yes --> N1[Resolve raw record]
|
|
14
14
|
N1 --> N2[Run Narrix pre-processor]
|
|
15
15
|
N2 --> N3[Attach _narrix to executionMemory and jobMemory]
|
|
16
|
-
N3 -->
|
|
17
|
-
N4 -- Yes --> N5[Run web scoper]
|
|
18
|
-
N5 --> N6[Set executionMemory.webContext]
|
|
19
|
-
N4 -- No --> B2
|
|
20
|
-
N6 --> B2
|
|
16
|
+
N3 --> B2
|
|
21
17
|
|
|
22
18
|
B2 -- Yes --> H1[Resolve narrixInput]
|
|
23
19
|
H1 --> H2[Run structured Narrix handler]
|
|
@@ -57,7 +53,7 @@ flowchart TD
|
|
|
57
53
|
- Resolve the raw record from `executionMemory`, `jobMemory`, or `input`.
|
|
58
54
|
- Run Narrix (ingest + runner).
|
|
59
55
|
- Attach result to `executionMemory._narrix` (or configured field) and mirror to `jobMemory._narrix`.
|
|
60
|
-
-
|
|
56
|
+
- NARRIX does **not** trigger web scoping. Web context comes from a standalone `webScope` PRE unit (see [web-scoping-in-ai-tasks.md](./web-scoping-in-ai-tasks.md)).
|
|
61
57
|
4. Else if **`narrixMode === "handler"`**, run structured Narrix from `narrixInput` (same behavior as legacy `narrix-then-direct` Narrix phase), **before** local tasks and pipeline PRE.
|
|
62
58
|
5. Check local task registry for `skillKey`.
|
|
63
59
|
6. If local handler exists, execute it and return immediately (skip enrichment/LLM path).
|
|
@@ -77,7 +73,7 @@ flowchart TD
|
|
|
77
73
|
|
|
78
74
|
- Default execution is effectively direct when no pipeline is provided.
|
|
79
75
|
- Local tasks are deterministic and bypass LLM execution.
|
|
80
|
-
- Web scoping is non-fatal
|
|
76
|
+
- Web scoping is a standalone `webScope` PRE unit (rendered `webQueryTemplate`); it is non-fatal at runtime and decoupled from NARRIX.
|
|
81
77
|
- POST steps (`audit`, `polish`) run only when declared in `executionPipeline`.
|
|
82
78
|
- For PRE `synthesized-context`, structured mode is additive and template-core-aware (`templateCores` + question), while markdown mode remains available for backward compatibility.
|
|
83
79
|
- Structured core discovery is pre-render from raw instructions/prompt templates and expects core directives in `{{core:...}}` form.
|