@x12i/graphenix-trace-format 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -186,9 +186,12 @@ const summary = summarizeExecutionTrace(trace);
186
186
  | `deriveGraphStatus` | Overall run status from events |
187
187
  | `deriveNodeStatusFromUnits` | Per-node status |
188
188
  | `summarizeExecutionTrace` | Compact summary for dashboards |
189
+ | `createContentPipelineReferenceTrace(plan, options?)` | Build completed CP trace for tests and golden fixtures |
189
190
 
190
191
  Trace event types include graph/node lifecycle, execution unit lifecycle (`unit.started` / `unit.completed`), model invocation, fallback applied, validation failures, and warnings.
191
192
 
193
+ **Event catalog (required fields per type):** [execution-logs.md](../../docs/guides/execution-logs.md#event-catalog-v2) · golden trace: `fixtures/content-pipeline.trace.json`
194
+
192
195
  ---
193
196
 
194
197
  ## Validation tier
@@ -214,7 +217,7 @@ EXECUTION_TRACE_FORMAT_V2 // v2 — when plan is v2
214
217
 
215
218
  ## Dependencies
216
219
 
217
- - `@x12i/graphenix-executable-contracts` ^1.0.0
220
+ - `@x12i/graphenix-executable-contracts` ^1.1.0
218
221
 
219
222
  ---
220
223
 
@@ -0,0 +1,13 @@
1
+ import type { ExecutableGraphPlanV2, GraphExecutionTraceV2, GraphRuntimeObject } from "@x12i/graphenix-executable-contracts";
2
+ export interface CreateContentPipelineReferenceTraceOptions {
3
+ traceId?: string;
4
+ now?: string;
5
+ runtime?: GraphRuntimeObject;
6
+ }
7
+ /**
8
+ * Build a completed v2 trace for a content-pipeline plan — all units and nodes
9
+ * marked completed with synthetic model invocations for AI-backed units.
10
+ * Used as golden fixture input and lifecycle acceptance tests.
11
+ */
12
+ export declare function createContentPipelineReferenceTrace(plan: ExecutableGraphPlanV2, options?: CreateContentPipelineReferenceTraceOptions): GraphExecutionTraceV2;
13
+ //# sourceMappingURL=create-content-pipeline-reference-trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-content-pipeline-reference-trace.d.ts","sourceRoot":"","sources":["../../src/fixtures/create-content-pipeline-reference-trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;AAI9C,MAAM,WAAW,0CAA0C;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,qBAAqB,EAC3B,OAAO,GAAE,0CAA+C,GACvD,qBAAqB,CA+HvB"}
@@ -0,0 +1,121 @@
1
+ import { appendTraceEvent } from "../trace/append-trace-event.js";
2
+ import { createEmptyExecutionTrace } from "../trace/create-empty-execution-trace.js";
3
+ /**
4
+ * Build a completed v2 trace for a content-pipeline plan — all units and nodes
5
+ * marked completed with synthetic model invocations for AI-backed units.
6
+ * Used as golden fixture input and lifecycle acceptance tests.
7
+ */
8
+ export function createContentPipelineReferenceTrace(plan, options = {}) {
9
+ const now = options.now ?? "2026-06-07T12:00:01.000Z";
10
+ const runtime = options.runtime ??
11
+ {
12
+ jobId: plan.runtimeBinding.jobId,
13
+ job: { id: plan.runtimeBinding.jobId, jobId: plan.runtimeBinding.jobId },
14
+ input: { priority: "normal" },
15
+ mode: "simulate"
16
+ };
17
+ let trace = createEmptyExecutionTrace({
18
+ traceId: options.traceId ?? `trace:${plan.runtimeBinding.jobId}`,
19
+ plan,
20
+ runtime,
21
+ now: options.now ?? "2026-06-07T12:00:00.000Z"
22
+ });
23
+ let seq = 1;
24
+ const append = (event) => {
25
+ trace = appendTraceEvent(trace, { ...event, sequence: seq++ });
26
+ };
27
+ append({ id: "evt:graph:start", ts: now, level: "info", type: "graph.started" });
28
+ for (const [unitId, unit] of Object.entries(trace.unitExecutions)) {
29
+ trace.unitExecutions[unitId] = {
30
+ ...unit,
31
+ status: "completed",
32
+ startedAt: now,
33
+ completedAt: now,
34
+ durationMs: 10
35
+ };
36
+ append({
37
+ id: `evt:${unitId}:start`,
38
+ ts: now,
39
+ level: "info",
40
+ type: "unit.started",
41
+ unitId,
42
+ nodeId: unit.nodeId,
43
+ unitKind: unit.unitKind
44
+ });
45
+ append({
46
+ id: `evt:${unitId}:done`,
47
+ ts: now,
48
+ level: "info",
49
+ type: "unit.completed",
50
+ unitId,
51
+ nodeId: unit.nodeId,
52
+ unitKind: unit.unitKind
53
+ });
54
+ const aiBacked = unit.unitKind !== "localSkill" &&
55
+ unit.unitKind !== "mapping" &&
56
+ unit.unitKind !== "validation" &&
57
+ unit.modelSlot;
58
+ if (aiBacked && unit.modelSlot) {
59
+ const invocationId = `inv:${unitId}:1`;
60
+ const selection = unit.plannedModelSelection ?? {
61
+ kind: "profileChoice",
62
+ key: "vol/default"
63
+ };
64
+ trace.modelInvocations[invocationId] = {
65
+ invocationId,
66
+ nodeId: unit.nodeId,
67
+ unitId,
68
+ slot: unit.modelSlot,
69
+ attempt: 1,
70
+ status: "completed",
71
+ startedAt: now,
72
+ completedAt: now,
73
+ durationMs: 5,
74
+ plannedSelection: selection,
75
+ resolvedInvocation: {
76
+ provider: "openrouter",
77
+ modelId: "gpt-4o-mini",
78
+ profileChoiceKey: selection.kind === "profileChoice" ? selection.key : undefined,
79
+ registryVersion: plan.profileRegistry.version,
80
+ registryHash: plan.profileRegistry.registryHash,
81
+ resolutionSource: "profileRegistry"
82
+ },
83
+ usage: { inputTokens: 100, outputTokens: 50, totalTokens: 150 },
84
+ cost: { costUsd: 0.001, costStatus: "known" }
85
+ };
86
+ trace.unitExecutions[unitId].modelInvocationIds = [invocationId];
87
+ }
88
+ trace.graphExecution.startedUnitIds.push(unitId);
89
+ trace.graphExecution.completedUnitIds.push(unitId);
90
+ }
91
+ for (const nodeId of Object.keys(trace.nodeExecutions)) {
92
+ trace.nodeExecutions[nodeId] = {
93
+ ...trace.nodeExecutions[nodeId],
94
+ status: "completed",
95
+ startedAt: now,
96
+ completedAt: now,
97
+ durationMs: 20
98
+ };
99
+ trace.graphExecution.startedNodeIds.push(nodeId);
100
+ trace.graphExecution.completedNodeIds.push(nodeId);
101
+ append({
102
+ id: `evt:${nodeId}:done`,
103
+ ts: now,
104
+ level: "info",
105
+ type: "node.completed",
106
+ nodeId
107
+ });
108
+ }
109
+ trace.finalOutput = {
110
+ producedByNodeId: plan.topology.finalizerNodeIds[0],
111
+ valueHash: "sha256:cp-reference-output",
112
+ responseShapePath: plan.contracts.response.responseShapePath,
113
+ schemaValidation: { valid: true }
114
+ };
115
+ trace.completedAt = now;
116
+ trace.startedAt = now;
117
+ append({ id: "evt:graph:done", ts: now, level: "info", type: "graph.completed" });
118
+ trace.status = "completed";
119
+ return trace;
120
+ }
121
+ //# sourceMappingURL=create-content-pipeline-reference-trace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-content-pipeline-reference-trace.js","sourceRoot":"","sources":["../../src/fixtures/create-content-pipeline-reference-trace.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAQrF;;;;GAIG;AACH,MAAM,UAAU,mCAAmC,CACjD,IAA2B,EAC3B,UAAsD,EAAE;IAExD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,0BAA0B,CAAC;IACtD,MAAM,OAAO,GACX,OAAO,CAAC,OAAO;QACd;YACC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK;YAChC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE;YACxE,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;YAC7B,IAAI,EAAE,UAAU;SACa,CAAC;IAElC,IAAI,KAAK,GAAG,yBAAyB,C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AE,gBAAgB,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAClF,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,KAAK,CAAC;AACf,CAAC"}
package/dist/index.d.ts CHANGED
@@ -8,4 +8,5 @@ export { validateExecutionTrace, assertExecutionTrace } from "./validators/valid
8
8
  export { validateExecutionTraceV1 } from "./validators/validate-execution-trace-v1.js";
9
9
  export { validateExecutionTraceV2 } from "./validators/validate-execution-trace-v2.js";
10
10
  export { validateTraceAgainstPlan } from "./validators/validate-trace-against-plan.js";
11
+ export { createContentPipelineReferenceTrace, type CreateContentPipelineReferenceTraceOptions } from "./fixtures/create-content-pipeline-reference-trace.js";
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF,OAAO,EACL,mCAAmC,EACnC,KAAK,0CAA0C,EAChD,MAAM,uDAAuD,CAAC"}
package/dist/index.js CHANGED
@@ -8,4 +8,5 @@ export { validateExecutionTrace, assertExecutionTrace } from "./validators/valid
8
8
  export { validateExecutionTraceV1 } from "./validators/validate-execution-trace-v1.js";
9
9
  export { validateExecutionTraceV2 } from "./validators/validate-execution-trace-v2.js";
10
10
  export { validateTraceAgainstPlan } from "./validators/validate-trace-against-plan.js";
11
+ export { createContentPipelineReferenceTrace } from "./fixtures/create-content-pipeline-reference-trace.js";
11
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF,OAAO,EACL,mCAAmC,EAEpC,MAAM,uDAAuD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=golden-fixtures.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"golden-fixtures.test.d.ts","sourceRoot":"","sources":["../../src/test/golden-fixtures.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ import assert from "node:assert/strict";
2
+ import { readFileSync } from "node:fs";
3
+ import { dirname, join } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { describe, it } from "node:test";
6
+ import { createContentPipelineReferenceTrace } from "../fixtures/create-content-pipeline-reference-trace.js";
7
+ import { validateTraceAgainstPlan } from "../validators/validate-trace-against-plan.js";
8
+ const TEST_DIR = dirname(fileURLToPath(import.meta.url));
9
+ const TRACE_FIXTURE = join(TEST_DIR, "../../fixtures/content-pipeline.trace.json");
10
+ const PLAN_FIXTURE = join(TEST_DIR, "../../../plan-format/fixtures/content-pipeline.plan.json");
11
+ describe("trace-format golden fixtures", () => {
12
+ it("content-pipeline.trace.json validates against golden plan", () => {
13
+ const plan = JSON.parse(readFileSync(PLAN_FIXTURE, "utf8"));
14
+ const golden = JSON.parse(readFileSync(TRACE_FIXTURE, "utf8"));
15
+ assert.equal(validateTraceAgainstPlan(golden, plan).valid, true);
16
+ assert.equal(golden.status, "completed");
17
+ });
18
+ it("createContentPipelineReferenceTrace is deterministic for golden plan", () => {
19
+ const plan = JSON.parse(readFileSync(PLAN_FIXTURE, "utf8"));
20
+ const opts = {
21
+ traceId: "trace:job-content-pipeline-reference",
22
+ now: "2026-06-07T12:00:01.000Z"
23
+ };
24
+ const a = createContentPipelineReferenceTrace(plan, opts);
25
+ const b = createContentPipelineReferenceTrace(plan, opts);
26
+ const golden = JSON.parse(readFileSync(TRACE_FIXTURE, "utf8"));
27
+ assert.equal(validateTraceAgainstPlan(a, plan).valid, true);
28
+ assert.deepEqual(a.plan, b.plan);
29
+ assert.equal(golden.traceId, a.traceId);
30
+ assert.equal(golden.events.length, a.events.length);
31
+ assert.equal(golden.status, a.status);
32
+ });
33
+ });
34
+ //# sourceMappingURL=golden-fixtures.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"golden-fixtures.test.js","sourceRoot":"","sources":["../../src/test/golden-fixtures.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CA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AO,EAAE,sCAAsC;YAC/C,GAAG,EAAE,0BAA0B;SAChC,CAAC;QACF,MAAM,CAAC,GAAG,mCAAmC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1D,MAAM,CAAC,GAAG,mCAAmC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;QAE/D,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC5D,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reference-fixtures.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference-fixtures.test.d.ts","sourceRoot":"","sources":["../../src/test/reference-fixtures.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import assert from "node:assert/strict";
2
+ import { describe, it } from "node:test";
3
+ import { createContentPipelineReferencePlan } from "@x12i/graphenix-plan-compiler";
4
+ import { createContentPipelineReferenceTrace } from "../fixtures/create-content-pipeline-reference-trace.js";
5
+ import { validateTraceAgainstPlan } from "../validators/validate-trace-against-plan.js";
6
+ const PROFILE_REGISTRY = {
7
+ version: "3.2.0",
8
+ registryHash: "sha256:profiles-content-pipeline-reference"
9
+ };
10
+ describe("trace-format reference fixtures", () => {
11
+ it("createContentPipelineReferenceTrace validates against CP plan", () => {
12
+ const plan = createContentPipelineReferencePlan({
13
+ jobId: "job-content-pipeline-reference",
14
+ profileRegistry: PROFILE_REGISTRY
15
+ });
16
+ const trace = createContentPipelineReferenceTrace(plan);
17
+ assert.equal(trace.status, "completed");
18
+ assert.equal(trace.format, "graphenix.execution-trace/v2");
19
+ assert.ok(Object.keys(trace.nodeExecutions).length >= 3);
20
+ assert.equal(validateTraceAgainstPlan(trace, plan).valid, true);
21
+ });
22
+ it("CP trace includes model invocations for AI-backed units", () => {
23
+ const plan = createContentPipelineReferencePlan({
24
+ profileRegistry: PROFILE_REGISTRY
25
+ });
26
+ const trace = createContentPipelineReferenceTrace(plan);
27
+ assert.ok(Object.keys(trace.modelInvocations).length >= 3);
28
+ });
29
+ });
30
+ //# sourceMappingURL=reference-fixtures.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference-fixtures.test.js","sourceRoot":"","sources":["../../src/test/reference-fixtures.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,mCAAmC,EAAE,MAAM,wDAAwD,CAAC;AAC7G,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAExF,MAAM,gBAAgB,GAAG;IACvB,OAAO,EAAE,OAAO;IAChB,YAAY,EAAE,4CAA4C;CAC3D,CAAC;AAEF,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,IAAI,GAAG,kCAAkC,CAAC;YAC9C,KAAK,EAAE,gCAAgC;YACvC,eAAe,EAAE,gBAAgB;SAClC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,mCAAmC,CAAC,IAAI,CAAC,CAAC;QAExD,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;QAC3D,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;QACzD,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,IAAI,GAAG,kCAAkC,CAAC;YAC9C,eAAe,EAAE,gBAAgB;SAClC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,mCAAmC,CAAC,IAAI,CAAC,CAAC;QACxD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,779 @@
1
+ {
2
+ "format": "graphenix.execution-trace/v2",
3
+ "traceId": "trace:job-content-pipeline-reference",
4
+ "jobId": "job-content-pipeline-reference",
5
+ "createdAt": "2026-06-07T12:00:01.000Z",
6
+ "status": "completed",
7
+ "source": {
8
+ "graphId": "graph:content-pipeline",
9
+ "graphRevision": "1.0.0",
10
+ "graphHash": "sha256:9efc44d3e758f84cf8297e18a0a33316a7e0a0b9c82a962acc6c9153fb334149",
11
+ "authoringFormatVersion": "2.0.0"
12
+ },
13
+ "plan": {
14
+ "planId": "plan:content-pipeline:job-content-pipeline-reference",
15
+ "planFormat": "graphenix.executable-plan/v2",
16
+ "planHash": "sha256:28c75c7688fb5541416bdcc61edceb6204eee96f455f85d56940cd059fe1642a",
17
+ "normalizedGraphHash": "sha256:e8d59f85d015ba9cb2ce67b934caa21157939caaf08ee045c65d739f82a324c4",
18
+ "schedulingPolicyHash": "sha256:2f68aea898f10ab48851b6890fd9ad03202c555a4617e38cfb17a332ac6065ec",
19
+ "topologyHash": "sha256:35b4314fd54a6ddc6e23a87ff50a0595223e61cf128540629033d3f41e6ccf2c",
20
+ "deferredGatesHash": "sha256:fbeb1be60839d552b55cdc08eaeb4f4c6740e60abed55f09446c22a0bd08e4f7",
21
+ "nodePlansHash": "sha256:28548ceff2edc788135bad9ee6d53ff3ff72c1f239878b2ca1e6a2fb3b550f9d"
22
+ },
23
+ "runtime": {
24
+ "jobId": "job-content-pipeline-reference",
25
+ "mode": "simulate",
26
+ "inputHash": "sha256:64b22edb276304aee419e0837dff25ed0bc307e664edbf362ca0062129387343",
27
+ "contextHash": "sha256:ce8d4c0a1d149f7f4da8ae9da3e22d02071343dd647edde27f00b12931eed820"
28
+ },
29
+ "profileRegistry": {
30
+ "package": "@x12i/ai-profiles",
31
+ "version": "3.2.0",
32
+ "registryHash": "sha256:profiles-content-pipeline-reference"
33
+ },
34
+ "events": [
35
+ {
36
+ "id": "evt:trace:job-content-pipeline-reference:created",
37
+ "ts": "2026-06-07T12:00:01.000Z",
38
+ "sequence": 0,
39
+ "level": "info",
40
+ "type": "graph.created",
41
+ "message": "Execution trace created."
42
+ },
43
+ {
44
+ "id": "evt:graph:start",
45
+ "ts": "2026-06-07T12:00:01.000Z",
46
+ "level": "info",
47
+ "type": "graph.started",
48
+ "sequence": 1
49
+ },
50
+ {
51
+ "id": "evt:unit:node:audience-insights:pre:0:start",
52
+ "ts": "2026-06-07T12:00:01.000Z",
53
+ "level": "info",
54
+ "type": "unit.started",
55
+ "unitId": "unit:node:audience-insights:pre:0",
56
+ "nodeId": "node:audience-insights",
57
+ "unitKind": "externalPreUtility",
58
+ "sequence": 2
59
+ },
60
+ {
61
+ "id": "evt:unit:node:audience-insights:pre:0:done",
62
+ "ts": "2026-06-07T12:00:01.000Z",
63
+ "level": "info",
64
+ "type": "unit.completed",
65
+ "unitId": "unit:node:audience-insights:pre:0",
66
+ "nodeId": "node:audience-insights",
67
+ "unitKind": "externalPreUtility",
68
+ "sequence": 3
69
+ },
70
+ {
71
+ "id": "evt:unit:node:audience-insights:main:start",
72
+ "ts": "2026-06-07T12:00:01.000Z",
73
+ "level": "info",
74
+ "type": "unit.started",
75
+ "unitId": "unit:node:audience-insights:main",
76
+ "nodeId": "node:audience-insights",
77
+ "unitKind": "mainSkill",
78
+ "sequence": 4
79
+ },
80
+ {
81
+ "id": "evt:unit:node:audience-insights:main:done",
82
+ "ts": "2026-06-07T12:00:01.000Z",
83
+ "level": "info",
84
+ "type": "unit.completed",
85
+ "unitId": "unit:node:audience-insights:main",
86
+ "nodeId": "node:audience-insights",
87
+ "unitKind": "mainSkill",
88
+ "sequence": 5
89
+ },
90
+ {
91
+ "id": "evt:unit:node:audience-insights:mapping:start",
92
+ "ts": "2026-06-07T12:00:01.000Z",
93
+ "level": "info",
94
+ "type": "unit.started",
95
+ "unitId": "unit:node:audience-insights:mapping",
96
+ "nodeId": "node:audience-insights",
97
+ "unitKind": "mapping",
98
+ "sequence": 6
99
+ },
100
+ {
101
+ "id": "evt:unit:node:audience-insights:mapping:done",
102
+ "ts": "2026-06-07T12:00:01.000Z",
103
+ "level": "info",
104
+ "type": "unit.completed",
105
+ "unitId": "unit:node:audience-insights:mapping",
106
+ "nodeId": "node:audience-insights",
107
+ "unitKind": "mapping",
108
+ "sequence": 7
109
+ },
110
+ {
111
+ "id": "evt:unit:node:competitor-angles:pre:0:start",
112
+ "ts": "2026-06-07T12:00:01.000Z",
113
+ "level": "info",
114
+ "type": "unit.started",
115
+ "unitId": "unit:node:competitor-angles:pre:0",
116
+ "nodeId": "node:competitor-angles",
117
+ "unitKind": "externalPreUtility",
118
+ "sequence": 8
119
+ },
120
+ {
121
+ "id": "evt:unit:node:competitor-angles:pre:0:done",
122
+ "ts": "2026-06-07T12:00:01.000Z",
123
+ "level": "info",
124
+ "type": "unit.completed",
125
+ "unitId": "unit:node:competitor-angles:pre:0",
126
+ "nodeId": "node:competitor-angles",
127
+ "unitKind": "externalPreUtility",
128
+ "sequence": 9
129
+ },
130
+ {
131
+ "id": "evt:unit:node:competitor-angles:main:start",
132
+ "ts": "2026-06-07T12:00:01.000Z",
133
+ "level": "info",
134
+ "type": "unit.started",
135
+ "unitId": "unit:node:competitor-angles:main",
136
+ "nodeId": "node:competitor-angles",
137
+ "unitKind": "mainSkill",
138
+ "sequence": 10
139
+ },
140
+ {
141
+ "id": "evt:unit:node:competitor-angles:main:done",
142
+ "ts": "2026-06-07T12:00:01.000Z",
143
+ "level": "info",
144
+ "type": "unit.completed",
145
+ "unitId": "unit:node:competitor-angles:main",
146
+ "nodeId": "node:competitor-angles",
147
+ "unitKind": "mainSkill",
148
+ "sequence": 11
149
+ },
150
+ {
151
+ "id": "evt:unit:node:competitor-angles:mapping:start",
152
+ "ts": "2026-06-07T12:00:01.000Z",
153
+ "level": "info",
154
+ "type": "unit.started",
155
+ "unitId": "unit:node:competitor-angles:mapping",
156
+ "nodeId": "node:competitor-angles",
157
+ "unitKind": "mapping",
158
+ "sequence": 12
159
+ },
160
+ {
161
+ "id": "evt:unit:node:competitor-angles:mapping:done",
162
+ "ts": "2026-06-07T12:00:01.000Z",
163
+ "level": "info",
164
+ "type": "unit.completed",
165
+ "unitId": "unit:node:competitor-angles:mapping",
166
+ "nodeId": "node:competitor-angles",
167
+ "unitKind": "mapping",
168
+ "sequence": 13
169
+ },
170
+ {
171
+ "id": "evt:unit:node:seo-keywords:pre:0:start",
172
+ "ts": "2026-06-07T12:00:01.000Z",
173
+ "level": "info",
174
+ "type": "unit.started",
175
+ "unitId": "unit:node:seo-keywords:pre:0",
176
+ "nodeId": "node:seo-keywords",
177
+ "unitKind": "externalPreUtility",
178
+ "sequence": 14
179
+ },
180
+ {
181
+ "id": "evt:unit:node:seo-keywords:pre:0:done",
182
+ "ts": "2026-06-07T12:00:01.000Z",
183
+ "level": "info",
184
+ "type": "unit.completed",
185
+ "unitId": "unit:node:seo-keywords:pre:0",
186
+ "nodeId": "node:seo-keywords",
187
+ "unitKind": "externalPreUtility",
188
+ "sequence": 15
189
+ },
190
+ {
191
+ "id": "evt:unit:node:seo-keywords:main:start",
192
+ "ts": "2026-06-07T12:00:01.000Z",
193
+ "level": "info",
194
+ "type": "unit.started",
195
+ "unitId": "unit:node:seo-keywords:main",
196
+ "nodeId": "node:seo-keywords",
197
+ "unitKind": "mainSkill",
198
+ "sequence": 16
199
+ },
200
+ {
201
+ "id": "evt:unit:node:seo-keywords:main:done",
202
+ "ts": "2026-06-07T12:00:01.000Z",
203
+ "level": "info",
204
+ "type": "unit.completed",
205
+ "unitId": "unit:node:seo-keywords:main",
206
+ "nodeId": "node:seo-keywords",
207
+ "unitKind": "mainSkill",
208
+ "sequence": 17
209
+ },
210
+ {
211
+ "id": "evt:unit:node:seo-keywords:mapping:start",
212
+ "ts": "2026-06-07T12:00:01.000Z",
213
+ "level": "info",
214
+ "type": "unit.started",
215
+ "unitId": "unit:node:seo-keywords:mapping",
216
+ "nodeId": "node:seo-keywords",
217
+ "unitKind": "mapping",
218
+ "sequence": 18
219
+ },
220
+ {
221
+ "id": "evt:unit:node:seo-keywords:mapping:done",
222
+ "ts": "2026-06-07T12:00:01.000Z",
223
+ "level": "info",
224
+ "type": "unit.completed",
225
+ "unitId": "unit:node:seo-keywords:mapping",
226
+ "nodeId": "node:seo-keywords",
227
+ "unitKind": "mapping",
228
+ "sequence": 19
229
+ },
230
+ {
231
+ "id": "evt:unit:node:finalizer:package:finalizer:start",
232
+ "ts": "2026-06-07T12:00:01.000Z",
233
+ "level": "info",
234
+ "type": "unit.started",
235
+ "unitId": "unit:node:finalizer:package:finalizer",
236
+ "nodeId": "node:finalizer:package",
237
+ "unitKind": "finalizer",
238
+ "sequence": 20
239
+ },
240
+ {
241
+ "id": "evt:unit:node:finalizer:package:finalizer:done",
242
+ "ts": "2026-06-07T12:00:01.000Z",
243
+ "level": "info",
244
+ "type": "unit.completed",
245
+ "unitId": "unit:node:finalizer:package:finalizer",
246
+ "nodeId": "node:finalizer:package",
247
+ "unitKind": "finalizer",
248
+ "sequence": 21
249
+ },
250
+ {
251
+ "id": "evt:node:audience-insights:done",
252
+ "ts": "2026-06-07T12:00:01.000Z",
253
+ "level": "info",
254
+ "type": "node.completed",
255
+ "nodeId": "node:audience-insights",
256
+ "sequence": 22
257
+ },
258
+ {
259
+ "id": "evt:node:competitor-angles:done",
260
+ "ts": "2026-06-07T12:00:01.000Z",
261
+ "level": "info",
262
+ "type": "node.completed",
263
+ "nodeId": "node:competitor-angles",
264
+ "sequence": 23
265
+ },
266
+ {
267
+ "id": "evt:node:seo-keywords:done",
268
+ "ts": "2026-06-07T12:00:01.000Z",
269
+ "level": "info",
270
+ "type": "node.completed",
271
+ "nodeId": "node:seo-keywords",
272
+ "sequence": 24
273
+ },
274
+ {
275
+ "id": "evt:node:finalizer:package:done",
276
+ "ts": "2026-06-07T12:00:01.000Z",
277
+ "level": "info",
278
+ "type": "node.completed",
279
+ "nodeId": "node:finalizer:package",
280
+ "sequence": 25
281
+ },
282
+ {
283
+ "id": "evt:graph:done",
284
+ "ts": "2026-06-07T12:00:01.000Z",
285
+ "level": "info",
286
+ "type": "graph.completed",
287
+ "sequence": 26
288
+ }
289
+ ],
290
+ "graphExecution": {
291
+ "startedNodeIds": [
292
+ "node:audience-insights",
293
+ "node:competitor-angles",
294
+ "node:seo-keywords",
295
+ "node:finalizer:package"
296
+ ],
297
+ "completedNodeIds": [
298
+ "node:audience-insights",
299
+ "node:competitor-angles",
300
+ "node:seo-keywords",
301
+ "node:finalizer:package"
302
+ ],
303
+ "failedNodeIds": [],
304
+ "skippedNodeIds": [],
305
+ "startedUnitIds": [
306
+ "unit:node:audience-insights:pre:0",
307
+ "unit:node:audience-insights:main",
308
+ "unit:node:audience-insights:mapping",
309
+ "unit:node:competitor-angles:pre:0",
310
+ "unit:node:competitor-angles:main",
311
+ "unit:node:competitor-angles:mapping",
312
+ "unit:node:seo-keywords:pre:0",
313
+ "unit:node:seo-keywords:main",
314
+ "unit:node:seo-keywords:mapping",
315
+ "unit:node:finalizer:package:finalizer"
316
+ ],
317
+ "completedUnitIds": [
318
+ "unit:node:audience-insights:pre:0",
319
+ "unit:node:audience-insights:main",
320
+ "unit:node:audience-insights:mapping",
321
+ "unit:node:competitor-angles:pre:0",
322
+ "unit:node:competitor-angles:main",
323
+ "unit:node:competitor-angles:mapping",
324
+ "unit:node:seo-keywords:pre:0",
325
+ "unit:node:seo-keywords:main",
326
+ "unit:node:seo-keywords:mapping",
327
+ "unit:node:finalizer:package:finalizer"
328
+ ],
329
+ "failedUnitIds": [],
330
+ "skippedUnitIds": [],
331
+ "finalizerNodeIds": [
332
+ "node:finalizer:package"
333
+ ]
334
+ },
335
+ "gateEvaluations": {},
336
+ "nodeExecutions": {
337
+ "node:audience-insights": {
338
+ "nodeId": "node:audience-insights",
339
+ "nodeType": "task",
340
+ "executionClass": "aiTask",
341
+ "status": "completed",
342
+ "selectedCases": {
343
+ "graphModelCaseId": "default"
344
+ },
345
+ "unitIds": [
346
+ "unit:node:audience-insights:pre:0",
347
+ "unit:node:audience-insights:main",
348
+ "unit:node:audience-insights:mapping"
349
+ ],
350
+ "startedAt": "2026-06-07T12:00:01.000Z",
351
+ "completedAt": "2026-06-07T12:00:01.000Z",
352
+ "durationMs": 20
353
+ },
354
+ "node:competitor-angles": {
355
+ "nodeId": "node:competitor-angles",
356
+ "nodeType": "task",
357
+ "executionClass": "aiTask",
358
+ "status": "completed",
359
+ "selectedCases": {
360
+ "graphModelCaseId": "default"
361
+ },
362
+ "unitIds": [
363
+ "unit:node:competitor-angles:pre:0",
364
+ "unit:node:competitor-angles:main",
365
+ "unit:node:competitor-angles:mapping"
366
+ ],
367
+ "startedAt": "2026-06-07T12:00:01.000Z",
368
+ "completedAt": "2026-06-07T12:00:01.000Z",
369
+ "durationMs": 20
370
+ },
371
+ "node:seo-keywords": {
372
+ "nodeId": "node:seo-keywords",
373
+ "nodeType": "task",
374
+ "executionClass": "aiTask",
375
+ "status": "completed",
376
+ "selectedCases": {
377
+ "graphModelCaseId": "default"
378
+ },
379
+ "unitIds": [
380
+ "unit:node:seo-keywords:pre:0",
381
+ "unit:node:seo-keywords:main",
382
+ "unit:node:seo-keywords:mapping"
383
+ ],
384
+ "startedAt": "2026-06-07T12:00:01.000Z",
385
+ "completedAt": "2026-06-07T12:00:01.000Z",
386
+ "durationMs": 20
387
+ },
388
+ "node:finalizer:package": {
389
+ "nodeId": "node:finalizer:package",
390
+ "nodeType": "finalizer",
391
+ "executionClass": "finalizer",
392
+ "status": "completed",
393
+ "unitIds": [
394
+ "unit:node:finalizer:package:finalizer"
395
+ ],
396
+ "startedAt": "2026-06-07T12:00:01.000Z",
397
+ "completedAt": "2026-06-07T12:00:01.000Z",
398
+ "durationMs": 20
399
+ }
400
+ },
401
+ "unitExecutions": {
402
+ "unit:node:audience-insights:pre:0": {
403
+ "unitId": "unit:node:audience-insights:pre:0",
404
+ "nodeId": "node:audience-insights",
405
+ "unitKind": "externalPreUtility",
406
+ "invokeMode": "externalRunTask",
407
+ "order": 0,
408
+ "status": "completed",
409
+ "plannedModelSelection": {
410
+ "kind": "profileChoice",
411
+ "key": "cheap/default"
412
+ },
413
+ "modelSlot": "preActionModel",
414
+ "startedAt": "2026-06-07T12:00:01.000Z",
415
+ "completedAt": "2026-06-07T12:00:01.000Z",
416
+ "durationMs": 10,
417
+ "modelInvocationIds": [
418
+ "inv:unit:node:audience-insights:pre:0:1"
419
+ ]
420
+ },
421
+ "unit:node:audience-insights:main": {
422
+ "unitId": "unit:node:audience-insights:main",
423
+ "nodeId": "node:audience-insights",
424
+ "unitKind": "mainSkill",
425
+ "invokeMode": "mainRunTask",
426
+ "order": 1,
427
+ "status": "completed",
428
+ "plannedModelSelection": {
429
+ "kind": "profileChoice",
430
+ "key": "vol/default"
431
+ },
432
+ "modelSlot": "skillModel",
433
+ "startedAt": "2026-06-07T12:00:01.000Z",
434
+ "completedAt": "2026-06-07T12:00:01.000Z",
435
+ "durationMs": 10,
436
+ "modelInvocationIds": [
437
+ "inv:unit:node:audience-insights:main:1"
438
+ ]
439
+ },
440
+ "unit:node:audience-insights:mapping": {
441
+ "unitId": "unit:node:audience-insights:mapping",
442
+ "nodeId": "node:audience-insights",
443
+ "unitKind": "mapping",
444
+ "invokeMode": "none",
445
+ "order": 2,
446
+ "status": "completed",
447
+ "startedAt": "2026-06-07T12:00:01.000Z",
448
+ "completedAt": "2026-06-07T12:00:01.000Z",
449
+ "durationMs": 10
450
+ },
451
+ "unit:node:competitor-angles:pre:0": {
452
+ "unitId": "unit:node:competitor-angles:pre:0",
453
+ "nodeId": "node:competitor-angles",
454
+ "unitKind": "externalPreUtility",
455
+ "invokeMode": "externalRunTask",
456
+ "order": 0,
457
+ "status": "completed",
458
+ "plannedModelSelection": {
459
+ "kind": "profileChoice",
460
+ "key": "cheap/default"
461
+ },
462
+ "modelSlot": "preActionModel",
463
+ "startedAt": "2026-06-07T12:00:01.000Z",
464
+ "completedAt": "2026-06-07T12:00:01.000Z",
465
+ "durationMs": 10,
466
+ "modelInvocationIds": [
467
+ "inv:unit:node:competitor-angles:pre:0:1"
468
+ ]
469
+ },
470
+ "unit:node:competitor-angles:main": {
471
+ "unitId": "unit:node:competitor-angles:main",
472
+ "nodeId": "node:competitor-angles",
473
+ "unitKind": "mainSkill",
474
+ "invokeMode": "mainRunTask",
475
+ "order": 1,
476
+ "status": "completed",
477
+ "plannedModelSelection": {
478
+ "kind": "profileChoice",
479
+ "key": "vol/default"
480
+ },
481
+ "modelSlot": "skillModel",
482
+ "startedAt": "2026-06-07T12:00:01.000Z",
483
+ "completedAt": "2026-06-07T12:00:01.000Z",
484
+ "durationMs": 10,
485
+ "modelInvocationIds": [
486
+ "inv:unit:node:competitor-angles:main:1"
487
+ ]
488
+ },
489
+ "unit:node:competitor-angles:mapping": {
490
+ "unitId": "unit:node:competitor-angles:mapping",
491
+ "nodeId": "node:competitor-angles",
492
+ "unitKind": "mapping",
493
+ "invokeMode": "none",
494
+ "order": 2,
495
+ "status": "completed",
496
+ "startedAt": "2026-06-07T12:00:01.000Z",
497
+ "completedAt": "2026-06-07T12:00:01.000Z",
498
+ "durationMs": 10
499
+ },
500
+ "unit:node:seo-keywords:pre:0": {
501
+ "unitId": "unit:node:seo-keywords:pre:0",
502
+ "nodeId": "node:seo-keywords",
503
+ "unitKind": "externalPreUtility",
504
+ "invokeMode": "externalRunTask",
505
+ "order": 0,
506
+ "status": "completed",
507
+ "plannedModelSelection": {
508
+ "kind": "profileChoice",
509
+ "key": "cheap/default"
510
+ },
511
+ "modelSlot": "preActionModel",
512
+ "startedAt": "2026-06-07T12:00:01.000Z",
513
+ "completedAt": "2026-06-07T12:00:01.000Z",
514
+ "durationMs": 10,
515
+ "modelInvocationIds": [
516
+ "inv:unit:node:seo-keywords:pre:0:1"
517
+ ]
518
+ },
519
+ "unit:node:seo-keywords:main": {
520
+ "unitId": "unit:node:seo-keywords:main",
521
+ "nodeId": "node:seo-keywords",
522
+ "unitKind": "mainSkill",
523
+ "invokeMode": "mainRunTask",
524
+ "order": 1,
525
+ "status": "completed",
526
+ "plannedModelSelection": {
527
+ "kind": "profileChoice",
528
+ "key": "vol/default"
529
+ },
530
+ "modelSlot": "skillModel",
531
+ "startedAt": "2026-06-07T12:00:01.000Z",
532
+ "completedAt": "2026-06-07T12:00:01.000Z",
533
+ "durationMs": 10,
534
+ "modelInvocationIds": [
535
+ "inv:unit:node:seo-keywords:main:1"
536
+ ]
537
+ },
538
+ "unit:node:seo-keywords:mapping": {
539
+ "unitId": "unit:node:seo-keywords:mapping",
540
+ "nodeId": "node:seo-keywords",
541
+ "unitKind": "mapping",
542
+ "invokeMode": "none",
543
+ "order": 2,
544
+ "status": "completed",
545
+ "startedAt": "2026-06-07T12:00:01.000Z",
546
+ "completedAt": "2026-06-07T12:00:01.000Z",
547
+ "durationMs": 10
548
+ },
549
+ "unit:node:finalizer:package:finalizer": {
550
+ "unitId": "unit:node:finalizer:package:finalizer",
551
+ "nodeId": "node:finalizer:package",
552
+ "unitKind": "finalizer",
553
+ "invokeMode": "finalizer",
554
+ "order": 0,
555
+ "status": "completed",
556
+ "startedAt": "2026-06-07T12:00:01.000Z",
557
+ "completedAt": "2026-06-07T12:00:01.000Z",
558
+ "durationMs": 10
559
+ }
560
+ },
561
+ "modelInvocations": {
562
+ "inv:unit:node:audience-insights:pre:0:1": {
563
+ "invocationId": "inv:unit:node:audience-insights:pre:0:1",
564
+ "nodeId": "node:audience-insights",
565
+ "unitId": "unit:node:audience-insights:pre:0",
566
+ "slot": "preActionModel",
567
+ "attempt": 1,
568
+ "status": "completed",
569
+ "startedAt": "2026-06-07T12:00:01.000Z",
570
+ "completedAt": "2026-06-07T12:00:01.000Z",
571
+ "durationMs": 5,
572
+ "plannedSelection": {
573
+ "kind": "profileChoice",
574
+ "key": "cheap/default"
575
+ },
576
+ "resolvedInvocation": {
577
+ "provider": "openrouter",
578
+ "modelId": "gpt-4o-mini",
579
+ "profileChoiceKey": "cheap/default",
580
+ "registryVersion": "3.2.0",
581
+ "registryHash": "sha256:profiles-content-pipeline-reference",
582
+ "resolutionSource": "profileRegistry"
583
+ },
584
+ "usage": {
585
+ "inputTokens": 100,
586
+ "outputTokens": 50,
587
+ "totalTokens": 150
588
+ },
589
+ "cost": {
590
+ "costUsd": 0.001,
591
+ "costStatus": "known"
592
+ }
593
+ },
594
+ "inv:unit:node:audience-insights:main:1": {
595
+ "invocationId": "inv:unit:node:audience-insights:main:1",
596
+ "nodeId": "node:audience-insights",
597
+ "unitId": "unit:node:audience-insights:main",
598
+ "slot": "skillModel",
599
+ "attempt": 1,
600
+ "status": "completed",
601
+ "startedAt": "2026-06-07T12:00:01.000Z",
602
+ "completedAt": "2026-06-07T12:00:01.000Z",
603
+ "durationMs": 5,
604
+ "plannedSelection": {
605
+ "kind": "profileChoice",
606
+ "key": "vol/default"
607
+ },
608
+ "resolvedInvocation": {
609
+ "provider": "openrouter",
610
+ "modelId": "gpt-4o-mini",
611
+ "profileChoiceKey": "vol/default",
612
+ "registryVersion": "3.2.0",
613
+ "registryHash": "sha256:profiles-content-pipeline-reference",
614
+ "resolutionSource": "profileRegistry"
615
+ },
616
+ "usage": {
617
+ "inputTokens": 100,
618
+ "outputTokens": 50,
619
+ "totalTokens": 150
620
+ },
621
+ "cost": {
622
+ "costUsd": 0.001,
623
+ "costStatus": "known"
624
+ }
625
+ },
626
+ "inv:unit:node:competitor-angles:pre:0:1": {
627
+ "invocationId": "inv:unit:node:competitor-angles:pre:0:1",
628
+ "nodeId": "node:competitor-angles",
629
+ "unitId": "unit:node:competitor-angles:pre:0",
630
+ "slot": "preActionModel",
631
+ "attempt": 1,
632
+ "status": "completed",
633
+ "startedAt": "2026-06-07T12:00:01.000Z",
634
+ "completedAt": "2026-06-07T12:00:01.000Z",
635
+ "durationMs": 5,
636
+ "plannedSelection": {
637
+ "kind": "profileChoice",
638
+ "key": "cheap/default"
639
+ },
640
+ "resolvedInvocation": {
641
+ "provider": "openrouter",
642
+ "modelId": "gpt-4o-mini",
643
+ "profileChoiceKey": "cheap/default",
644
+ "registryVersion": "3.2.0",
645
+ "registryHash": "sha256:profiles-content-pipeline-reference",
646
+ "resolutionSource": "profileRegistry"
647
+ },
648
+ "usage": {
649
+ "inputTokens": 100,
650
+ "outputTokens": 50,
651
+ "totalTokens": 150
652
+ },
653
+ "cost": {
654
+ "costUsd": 0.001,
655
+ "costStatus": "known"
656
+ }
657
+ },
658
+ "inv:unit:node:competitor-angles:main:1": {
659
+ "invocationId": "inv:unit:node:competitor-angles:main:1",
660
+ "nodeId": "node:competitor-angles",
661
+ "unitId": "unit:node:competitor-angles:main",
662
+ "slot": "skillModel",
663
+ "attempt": 1,
664
+ "status": "completed",
665
+ "startedAt": "2026-06-07T12:00:01.000Z",
666
+ "completedAt": "2026-06-07T12:00:01.000Z",
667
+ "durationMs": 5,
668
+ "plannedSelection": {
669
+ "kind": "profileChoice",
670
+ "key": "vol/default"
671
+ },
672
+ "resolvedInvocation": {
673
+ "provider": "openrouter",
674
+ "modelId": "gpt-4o-mini",
675
+ "profileChoiceKey": "vol/default",
676
+ "registryVersion": "3.2.0",
677
+ "registryHash": "sha256:profiles-content-pipeline-reference",
678
+ "resolutionSource": "profileRegistry"
679
+ },
680
+ "usage": {
681
+ "inputTokens": 100,
682
+ "outputTokens": 50,
683
+ "totalTokens": 150
684
+ },
685
+ "cost": {
686
+ "costUsd": 0.001,
687
+ "costStatus": "known"
688
+ }
689
+ },
690
+ "inv:unit:node:seo-keywords:pre:0:1": {
691
+ "invocationId": "inv:unit:node:seo-keywords:pre:0:1",
692
+ "nodeId": "node:seo-keywords",
693
+ "unitId": "unit:node:seo-keywords:pre:0",
694
+ "slot": "preActionModel",
695
+ "attempt": 1,
696
+ "status": "completed",
697
+ "startedAt": "2026-06-07T12:00:01.000Z",
698
+ "completedAt": "2026-06-07T12:00:01.000Z",
699
+ "durationMs": 5,
700
+ "plannedSelection": {
701
+ "kind": "profileChoice",
702
+ "key": "cheap/default"
703
+ },
704
+ "resolvedInvocation": {
705
+ "provider": "openrouter",
706
+ "modelId": "gpt-4o-mini",
707
+ "profileChoiceKey": "cheap/default",
708
+ "registryVersion": "3.2.0",
709
+ "registryHash": "sha256:profiles-content-pipeline-reference",
710
+ "resolutionSource": "profileRegistry"
711
+ },
712
+ "usage": {
713
+ "inputTokens": 100,
714
+ "outputTokens": 50,
715
+ "totalTokens": 150
716
+ },
717
+ "cost": {
718
+ "costUsd": 0.001,
719
+ "costStatus": "known"
720
+ }
721
+ },
722
+ "inv:unit:node:seo-keywords:main:1": {
723
+ "invocationId": "inv:unit:node:seo-keywords:main:1",
724
+ "nodeId": "node:seo-keywords",
725
+ "unitId": "unit:node:seo-keywords:main",
726
+ "slot": "skillModel",
727
+ "attempt": 1,
728
+ "status": "completed",
729
+ "startedAt": "2026-06-07T12:00:01.000Z",
730
+ "completedAt": "2026-06-07T12:00:01.000Z",
731
+ "durationMs": 5,
732
+ "plannedSelection": {
733
+ "kind": "profileChoice",
734
+ "key": "vol/default"
735
+ },
736
+ "resolvedInvocation": {
737
+ "provider": "openrouter",
738
+ "modelId": "gpt-4o-mini",
739
+ "profileChoiceKey": "vol/default",
740
+ "registryVersion": "3.2.0",
741
+ "registryHash": "sha256:profiles-content-pipeline-reference",
742
+ "resolutionSource": "profileRegistry"
743
+ },
744
+ "usage": {
745
+ "inputTokens": 100,
746
+ "outputTokens": 50,
747
+ "totalTokens": 150
748
+ },
749
+ "cost": {
750
+ "costUsd": 0.001,
751
+ "costStatus": "known"
752
+ }
753
+ }
754
+ },
755
+ "memory": {
756
+ "reads": [],
757
+ "writes": []
758
+ },
759
+ "diagnostics": {
760
+ "dataPolicy": {
761
+ "storeFullInputs": false,
762
+ "storeFullOutputs": false,
763
+ "storePrompts": false,
764
+ "storeProviderResponses": false,
765
+ "maxPreviewChars": 512,
766
+ "requireDataRefsForLargeValues": true
767
+ }
768
+ },
769
+ "finalOutput": {
770
+ "producedByNodeId": "node:finalizer:package",
771
+ "valueHash": "sha256:cp-reference-output",
772
+ "responseShapePath": "/graph/metadata/graphResponse",
773
+ "schemaValidation": {
774
+ "valid": true
775
+ }
776
+ },
777
+ "completedAt": "2026-06-07T12:00:01.000Z",
778
+ "startedAt": "2026-06-07T12:00:01.000Z"
779
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/graphenix-trace-format",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "GraphExecutionTrace format: append-only events, validation, and trace helpers.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,10 +15,12 @@
15
15
  },
16
16
  "scripts": {
17
17
  "build": "tsc -p tsconfig.json",
18
- "clean": "rimraf dist"
18
+ "clean": "rimraf dist",
19
+ "test": "npm run build && node --test dist/test/*.test.js"
19
20
  },
20
21
  "files": [
21
22
  "dist",
23
+ "fixtures",
22
24
  "README.md"
23
25
  ],
24
26
  "keywords": [
@@ -45,6 +47,7 @@
45
47
  },
46
48
  "devDependencies": {
47
49
  "@types/node": "^22.10.1",
50
+ "@x12i/graphenix-plan-compiler": "^1.1.1",
48
51
  "rimraf": "^6.0.1",
49
52
  "typescript": "^5.6.3"
50
53
  }