exports/pipeline

Pipeline module exports — V2 Pipeline OS types and adapters.

Classes

ArtifactStore

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:80

In-memory artifact store with bounded capacity.

When the store exceeds maxArtifacts, the oldest artifacts are evicted (FIFO — insertion order, never reordered on get()). Content size is validated on put().

This is a bounded in-memory working cache, NOT the durable audit substrate (#2867): once maxArtifacts is reached, old artifacts and their provenance are dropped. For tamper-evident, retained audit history use the on-disk Merkle audit log via the verify_audit_chain MCP tool.

Implements

Constructors

Constructor
new ArtifactStore(options?): ArtifactStore;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:86

Parameters
options?

ArtifactStoreOptions

Returns

ArtifactStore

Accessors

size
Get Signature
get size(): number;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:91

Returns

number

Implementation of

IArtifactStore.size

Methods

get()
get(ref): Artifact | undefined;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:113

Parameters
ref
id

string = ...

type

| "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote" = ...

Returns

Artifact | undefined

Implementation of

IArtifactStore.get

provenance()
provenance(ref): readonly ProvenanceEntry[];

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:137

Returns the full provenance chain for an artifact — the artifact itself plus every ancestor transitively reachable via inputRefs (#2867). Iterative DFS; the visited set makes it safe against cycles and diamond/multi-parent DAGs (each artifact appears once).

Entries are in reachability (start-node-first DFS) order, not topological order. An ancestor that has been FIFO-evicted from the store is silently skipped — the chain truncates there rather than throwing. A missing root returns [].

Parameters
ref
id

string = ...

type

| "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote" = ...

Returns

readonly ProvenanceEntry[]

Implementation of

IArtifactStore.provenance

put()
put(artifact): {
  id: string;
  type:   | "code"
     | "analysis"
     | "test"
     | "spec"
     | "review"
     | "report"
     | "plan"
     | "vote";
};

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:95

Parameters
artifact

Artifact

Returns
{
  id: string;
  type:   | "code"
     | "analysis"
     | "test"
     | "spec"
     | "review"
     | "report"
     | "plan"
     | "vote";
}
id
id: string;
type
type: 
  | "code"
  | "analysis"
  | "test"
  | "spec"
  | "review"
  | "report"
  | "plan"
  | "vote";
Implementation of

IArtifactStore.put

query()
query(filter): readonly {
  id: string;
  type:   | "code"
     | "analysis"
     | "test"
     | "spec"
     | "review"
     | "report"
     | "plan"
     | "vote";
}[];

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:117

Parameters
filter

ArtifactFilter

Returns

readonly { id: string; type: | "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote"; }[]

Implementation of

IArtifactStore.query


EventBus

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:53

In-memory event bus with bounded circular buffer.

Events are stored in a circular buffer. When the buffer is full, the oldest events are evicted. Subscribers receive events that match their filter. Handler errors are caught and logged.

Implements

Constructors

Constructor
new EventBus(options?): EventBus;

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:58

Parameters
options?

EventBusOptions

Returns

EventBus

Accessors

bufferSize
Get Signature
get bufferSize(): number;

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:68

Current buffer size.

Returns

number

Current buffer size.

Implementation of

IEventBus.bufferSize

subscriptionCount
Get Signature
get subscriptionCount(): number;

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:73

Number of active subscriptions (for observability/testing).

Returns

number

totalEmitted
Get Signature
get totalEmitted(): number;

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:64

Total events emitted (including evicted).

Returns

number

Total events emitted (including evicted).

Implementation of

IEventBus.totalEmitted

Methods

emit()
emit(event): void;

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:77

Emit an event. Handlers must not throw.

Parameters
event

PipelineEvent

Returns

void

Implementation of

IEventBus.emit

query()
query(filter, limit?): readonly PipelineEvent[];

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:92

Query recent events (bounded buffer).

Parameters
filter

EventFilter

limit?

number

Returns

readonly PipelineEvent[]

Implementation of

IEventBus.query

subscribe()
subscribe(filter, handler): Unsubscribe;

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:83

Subscribe to events matching filter. Returns unsubscribe function.

Parameters
filter

EventFilter

handler

EventHandler

Returns

Unsubscribe

Implementation of

IEventBus.subscribe


PipelineRunner

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:116

Compiles PlanContracts and executes them as graphs.

Constructors

Constructor
new PipelineRunner(): PipelineRunner;
Returns

PipelineRunner

Methods

compile()
compile(plan, options?): CompileResult;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:118

Compiles a PlanContract into a CompiledPipeline.

Parameters
plan
approvalRequired

boolean = ...

estimatedCost

{ estimatedCostUsd: number; modelCalls: number; totalTokensIn: number; totalTokensOut: number; } = CostEstimateSchema

estimatedCost.estimatedCostUsd

number = ...

estimatedCost.modelCalls

number = ...

estimatedCost.totalTokensIn

number = ...

estimatedCost.totalTokensOut

number = ...

maxIterations

number = ...

policyGates

{ afterStage: string; beforeStage: string; id: string; rules: string[]; }[] = ...

stages

{ config: Record<string, unknown>; dependencies: string[]; id: string; inputArtifacts: string[]; maxRetries?: number; outputArtifacts: string[]; pluginId: string; preferredCli?: string; timeoutMs?: number; type: "analyze" | "validate" | "execute" | "route" | "aggregate" | "gate"; }[] = ...

taskId

string = ...

timeoutMs

number = ...

options?

PlanCompileOptions

Returns

CompileResult

execute()
execute(
   pipeline, 
   task, 
   options?
): Promise<ExecuteResult>;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:141

Executes a compiled pipeline.

Parameters
pipeline

CompiledPipeline

task
analysis

{ ambiguityScore: number; complexity: string; taskType: string; } = TaskAnalysisSummarySchema

analysis.ambiguityScore

number = ...

analysis.complexity

string = ...

analysis.taskType

string = ...

artifacts

{ id: string; type: | "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote"; }[] = ...

capabilityGaps

{ allSatisfied: boolean; available: { experts: string[]; tools: string[]; }; gaps: unknown[]; gapsMeasured: boolean; } = CapabilityGapSummarySchema

capabilityGaps.allSatisfied

boolean = ...

Meaningful ONLY when gapsMeasured is true. gaps: [] from a detector that ran and gaps: [] from a builder that never called one are byte-identical on the wire; this field is what tells them apart.

capabilityGaps.available

{ experts: string[]; tools: string[]; } = ...

capabilityGaps.available.experts

string[] = ...

capabilityGaps.available.tools

string[] = ...

capabilityGaps.gaps

unknown[] = ...

capabilityGaps.gapsMeasured

boolean = ...

Whether a capability-gap detector actually ran (#5919).

buildBaseTaskContract writes allSatisfied: true with an EMPTY available set — a verdict from a detector that never ran, on the orchestrate and delegate_to_model paths. Nothing reads it today, which is camouflage rather than safety: it is the same shape as #5896’s ValidationHarness, where a missing consumer let a hard-coded verdict sit until someone eventually trusted it.

Named for the vocabulary this repo already uses for exactly this — tokensMeasured, policyEvaluated, routerTypeMeasured. A consumer that needs a real answer must branch on this, not on allSatisfied alone.

completedAt?

number = ...

constraints

{ quality?: string; scope: string[]; time?: string; } = TaskConstraintsSummarySchema

constraints.quality?

string = ...

constraints.scope

string[] = ...

constraints.time?

string = ...

createdAt

number = ...

description

string = ...

error?

string = ...

id

string = ...

metadata

Record<string, unknown> = ...

parentId?

string = ...

requiredCapabilities

{ experts: string[]; tools: string[]; } = RequiredCapabilitiesSummarySchema

requiredCapabilities.experts

string[] = ...

requiredCapabilities.tools

string[] = ...

status

| "failed" | "planning" | "done" | "approved" | "executing" | "intake" | "clarifying" | "validating" = ...

updatedAt

number = ...

options?

PipelineExecuteOptions

Returns

Promise<ExecuteResult>

retryFailed()
retryFailed(
   pipeline, 
   previousResult, 
   task, 
   options?
): Promise<ExecuteResult>;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:190

Retries a previous run’s failures selectively (#3534): prior successful nodes are replayed (not re-executed) via priorResults, so only the failed nodes and their dependents run again.

Gated on retryability: retries only when at least one failed node is isRetryable (transient). If every failure is permanent (validation/permission/business/internal) it returns previousResult unchanged rather than looping on errors that won’t clear.

Back-compat: a previousResult without nodeResults (e.g. an older caller) falls back to the prior whole-pipeline retry gated on stepResults.

NOTE: non-retryable failures that coexist with a retryable one still re-run (and re-fail) under continueOnFailure; pinning them as terminal is a future refinement.

Parameters
pipeline

CompiledPipeline

previousResult

PipelineResult

task
analysis

{ ambiguityScore: number; complexity: string; taskType: string; } = TaskAnalysisSummarySchema

analysis.ambiguityScore

number = ...

analysis.complexity

string = ...

analysis.taskType

string = ...

artifacts

{ id: string; type: | "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote"; }[] = ...

capabilityGaps

{ allSatisfied: boolean; available: { experts: string[]; tools: string[]; }; gaps: unknown[]; gapsMeasured: boolean; } = CapabilityGapSummarySchema

capabilityGaps.allSatisfied

boolean = ...

Meaningful ONLY when gapsMeasured is true. gaps: [] from a detector that ran and gaps: [] from a builder that never called one are byte-identical on the wire; this field is what tells them apart.

capabilityGaps.available

{ experts: string[]; tools: string[]; } = ...

capabilityGaps.available.experts

string[] = ...

capabilityGaps.available.tools

string[] = ...

capabilityGaps.gaps

unknown[] = ...

capabilityGaps.gapsMeasured

boolean = ...

Whether a capability-gap detector actually ran (#5919).

buildBaseTaskContract writes allSatisfied: true with an EMPTY available set — a verdict from a detector that never ran, on the orchestrate and delegate_to_model paths. Nothing reads it today, which is camouflage rather than safety: it is the same shape as #5896’s ValidationHarness, where a missing consumer let a hard-coded verdict sit until someone eventually trusted it.

Named for the vocabulary this repo already uses for exactly this — tokensMeasured, policyEvaluated, routerTypeMeasured. A consumer that needs a real answer must branch on this, not on allSatisfied alone.

completedAt?

number = ...

constraints

{ quality?: string; scope: string[]; time?: string; } = TaskConstraintsSummarySchema

constraints.quality?

string = ...

constraints.scope

string[] = ...

constraints.time?

string = ...

createdAt

number = ...

description

string = ...

error?

string = ...

id

string = ...

metadata

Record<string, unknown> = ...

parentId?

string = ...

requiredCapabilities

{ experts: string[]; tools: string[]; } = RequiredCapabilitiesSummarySchema

requiredCapabilities.experts

string[] = ...

requiredCapabilities.tools

string[] = ...

status

| "failed" | "planning" | "done" | "approved" | "executing" | "intake" | "clarifying" | "validating" = ...

updatedAt

number = ...

options?

PipelineExecuteOptions

Returns

Promise<ExecuteResult>


PluginRegistry

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:65

In-memory plugin registry with experimental gating.

Plugins are registered during startup. After freeze(), no further registrations are accepted.

Implements

Constructors

Constructor
new PluginRegistry(options?): PluginRegistry;

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:70

Parameters
options?

PluginRegistryOptions

Returns

PluginRegistry

Accessors

frozen
Get Signature
get frozen(): boolean;

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:74

Whether the registry is frozen.

Returns

boolean

Whether the registry is frozen.

Implementation of

IPluginRegistry.frozen

Methods

freeze()
freeze(): void;

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:125

Freeze the registry — no further registrations allowed.

Returns

void

Implementation of

IPluginRegistry.freeze

isEnabled()
isEnabled(pluginId): boolean;

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:121

Check if a plugin is registered and enabled.

Parameters
pluginId

string

Returns

boolean

Implementation of

IPluginRegistry.isEnabled

listEnabled()
listEnabled(): readonly {
  description: string;
  experimental: boolean;
  id: string;
  requiredCapabilities: string[];
  stages: ("analyze" | "validate" | "execute" | "route" | "aggregate" | "gate")[];
  trustLevel: "standard" | "external" | "experimental" | "core";
  version: string;
}[];

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:117

List all enabled plugins with their manifests.

Returns

readonly { description: string; experimental: boolean; id: string; requiredCapabilities: string[]; stages: ("analyze" | "validate" | "execute" | "route" | "aggregate" | "gate")[]; trustLevel: "standard" | "external" | "experimental" | "core"; version: string; }[]

Implementation of

IPluginRegistry.listEnabled

register()
register(plugin): Result<void, RegistrationError>;

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:78

Register a plugin. Validates manifest and config. Returns error if plugin ID conflicts or capabilities missing.

Parameters
plugin

PipelinePlugin

Returns

Result<void, RegistrationError>

Implementation of

IPluginRegistry.register

resolve()
resolve(pluginId): PipelinePlugin | undefined;

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:113

Resolve a plugin by ID. Returns undefined if not registered or disabled.

Parameters
pluginId

string

Returns

PipelinePlugin | undefined

Implementation of

IPluginRegistry.resolve


PolicyEngine

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:106

In-memory policy engine with priority-ordered rule evaluation.

Rules are evaluated in descending priority order. First blocking rule short-circuits evaluation.

Implements

Constructors

Constructor
new PolicyEngine(): PolicyEngine;
Returns

PolicyEngine

Methods

evaluate()
evaluate(gate, context): PolicyDecision;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:116

Parameters
gate
afterStage

string = ...

beforeStage

string = ...

id

string = ...

rules

string[] = ...

context

PolicyContext

Returns

PolicyDecision

Implementation of

IPolicyEngine.evaluate

listRules()
listRules(): readonly PolicyRule[];

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:134

Returns

readonly PolicyRule[]

Implementation of

IPolicyEngine.listRules

registerRule()
registerRule(rule): void;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:109

Parameters
rule

PolicyRule

Returns

void

Implementation of

IPolicyEngine.registerRule

Interfaces

AdaptiveOrchestratorOptions

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:40

Options for the adaptive orchestrator.

Extends

Properties

dryRun?
readonly optional dryRun?: boolean;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:30

When true, stop after the dryRunStopAfter stage.

Inherited from

GraphPipelineOptions.dryRun

maxSteps?
readonly optional maxSteps?: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:35

Maximum graph node executions (default: 20). Parallel super-steps are atomic and start only when their full batch fits in the remaining budget.

Inherited from

GraphPipelineOptions.maxSteps

signal?
readonly optional signal?: AbortSignal;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:43

Cancels the run at the next super-step boundary (#6305). Handed to the graph executor, which checks it before each super-step and fails the run with Graph execution aborted; a stage already in flight is not interrupted. run_pipeline threads cancel_job’s signal here. Absent: the run is not cancellable.

Inherited from

GraphPipelineOptions.signal

stages
readonly stages: StageRegistry;

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:44

Stage registry to use. If omitted, stages must be provided per-template.

stageTimeoutMs?
readonly optional stageTimeoutMs?: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:52

Deadline for EACH stage, in ms (#6730) — not a budget for the whole run. Replaces every stage’s default, the vote stage’s panel-sized one included, clamped to the pipeline class guard. Absent: the vote stage runs under the multi-llm-panel class guard, every other stage under GRAPH_TIMEOUTS.defaultMs. The run as a whole is bounded by the pipeline class guard either way.

Inherited from

GraphPipelineOptions.stageTimeoutMs

templateId?
readonly optional templateId?: string;

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:42

Force a specific template (skip auto-detection).


AdaptiveOrchestratorResult

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:48

Result of adaptive orchestration — extends GraphPipelineResult with metadata.

Extends

Properties

dryRun?
readonly optional dryRun?: true;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:68

Set when the run was a dry run. Mirrors DevPipelineResult.dryRun: a consumer reading success alone reported a truncated dry run as a full pipeline. Absent means a normal run.

Inherited from

GraphPipelineResult.dryRun

durationMs
readonly durationMs: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:60

Inherited from

GraphPipelineResult.durationMs

error?
readonly optional error?: string;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:62

Inherited from

GraphPipelineResult.error

finalState
readonly finalState: Readonly<Record<string, unknown>>;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:61

Inherited from

GraphPipelineResult.finalState

selectionMethod
readonly selectionMethod: "explicit" | "auto-detected";

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:50

How the template was selected.

stagesPlanned
readonly stagesPlanned: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:78

Stages the template declares, and stages this run actually executed.

templateId names the FULL template even when resolveEffectiveTemplate truncated it at dryRunStopAfter, so templateId: 'dev' with success: true used to be byte-identical whether qa and security ran or were sliced away. These two numbers are what makes the coverage legible without the consumer having to know dryRunStopAfter and the stage list.

Inherited from

GraphPipelineResult.stagesPlanned

stagesRun
readonly stagesRun: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:79

Inherited from

GraphPipelineResult.stagesRun

stepsExecuted
readonly stepsExecuted: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:59

Inherited from

GraphPipelineResult.stepsExecuted

success
readonly success: boolean;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:57

Inherited from

GraphPipelineResult.success

taskClassification
readonly taskClassification: TaskClassification;

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:52

Task classification used for selection.

templateId
readonly templateId: string;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:58

Inherited from

GraphPipelineResult.templateId


AgentExecutorConfig

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:203

Configuration for the agent executor.

Properties

budget?
readonly optional budget?: AgentBudgetConfig;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:226

Opt-in per-run token budget (#3395). When set, expert calls are metered through a BudgetGuard: once cumulative usage crosses the ceiling, further expert calls short-circuit to a failure result (stopping spend) rather than aborting mid-pipeline. Absent → no enforcement (default).

callerTrustTier?
readonly optional callerTrustTier?: string;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:233

Caller authentication from measuredTrustTier(), recorded at stage entry. Absent callerInfo means ‘unmeasured’; the MCP server supplies the connected transport as callerInfo (#6795), so a stdio caller records Tier 1. Record-only: no stage refuses on this value. Takes precedence over trustTier.

inputSanitization?
readonly optional inputSanitization?: "unmeasured" | "modified" | "unmodified";

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:240

Whether the handler’s sanitizer changed its input; absent means ‘unmeasured’.

inputSanitizationCounts?
readonly optional inputSanitizationCounts?: {
  commentsRemoved: number;
  fieldsModified: number;
  tagsRemoved: number;
};

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:242

Sanitizer counts, emitted beside inputSanitization only when it is ‘modified’.

commentsRemoved
readonly commentsRemoved: number;
fieldsModified
readonly fieldsModified: number;
tagsRemoved
readonly tagsRemoved: number;
issueNumber?
readonly optional issueNumber?: number;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:218

quickMode?
readonly optional quickMode?: boolean;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:216

Use 3 agents instead of the full 7-role panel for faster voting (default: false).

repo?
readonly optional repo?: string;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:219

scanTarget?
readonly optional scanTarget?: string;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:204

simulateVotes?
readonly optional simulateVotes?: boolean;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:205

tracker?
readonly optional tracker?: ITaskTracker;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:217

trustTier?
readonly optional trustTier?: string;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:238

Caller authentication, emitted with the same value as callerTrustTier.

Deprecated

Use callerTrustTier. Removal is scheduled for the next major.

votingStrategy?
readonly optional votingStrategy?: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning";

Defined in: packages/nexus-agents/src/pipeline/agent-executor-core.ts:207

Voting strategy for consensus stages (default: higher_order).


Artifact

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:24

Full artifact with content and metadata.

Properties

content
readonly content: unknown;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:27

createdAt
readonly createdAt: number;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:30

createdBy
readonly createdBy: string;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:29

id
readonly id: string;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:25

inputRefs
readonly inputRefs: readonly {
  id: string;
  type:   | "code"
     | "analysis"
     | "test"
     | "spec"
     | "review"
     | "report"
     | "plan"
     | "vote";
}[];

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:31

metadata
readonly metadata: Record<string, unknown>;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:28

type
readonly type: 
  | "code"
  | "analysis"
  | "test"
  | "spec"
  | "review"
  | "report"
  | "plan"
  | "vote";

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:26


ArtifactFilter

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:35

Filter for querying artifacts.

Properties

createdBy?
readonly optional createdBy?: string;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:37

type?
readonly optional type?: 
  | "code"
  | "analysis"
  | "test"
  | "spec"
  | "review"
  | "report"
  | "plan"
  | "vote";

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:36


ArtifactStoreOptions

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:58

Options for ArtifactStore behavior.

Properties

maxArtifacts?
readonly optional maxArtifacts?: number;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:59

maxContentSize?
readonly optional maxContentSize?: number;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:60


CompiledPipeline

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:35

Compiled pipeline ready for execution.

Properties

graph
readonly graph: CompiledGraph;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:36

plan
readonly plan: {
  approvalRequired: boolean;
  estimatedCost: {
     estimatedCostUsd: number;
     modelCalls: number;
     totalTokensIn: number;
     totalTokensOut: number;
  };
  maxIterations: number;
  policyGates: {
     afterStage: string;
     beforeStage: string;
     id: string;
     rules: string[];
  }[];
  stages: {
     config: Record<string, unknown>;
     dependencies: string[];
     id: string;
     inputArtifacts: string[];
     maxRetries?: number;
     outputArtifacts: string[];
     pluginId: string;
     preferredCli?: string;
     timeoutMs?: number;
     type: "analyze" | "validate" | "execute" | "route" | "aggregate" | "gate";
  }[];
  taskId: string;
  timeoutMs: number;
};

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:37

approvalRequired
approvalRequired: boolean;
estimatedCost
estimatedCost: {
  estimatedCostUsd: number;
  modelCalls: number;
  totalTokensIn: number;
  totalTokensOut: number;
} = CostEstimateSchema;
estimatedCost.estimatedCostUsd
estimatedCostUsd: number;
estimatedCost.modelCalls
modelCalls: number;
estimatedCost.totalTokensIn
totalTokensIn: number;
estimatedCost.totalTokensOut
totalTokensOut: number;
maxIterations
maxIterations: number;
policyGates
policyGates: {
  afterStage: string;
  beforeStage: string;
  id: string;
  rules: string[];
}[];
stages
stages: {
  config: Record<string, unknown>;
  dependencies: string[];
  id: string;
  inputArtifacts: string[];
  maxRetries?: number;
  outputArtifacts: string[];
  pluginId: string;
  preferredCli?: string;
  timeoutMs?: number;
  type: "analyze" | "validate" | "execute" | "route" | "aggregate" | "gate";
}[];
taskId
taskId: string;
timeoutMs
timeoutMs: number;

CorePluginRegistrationResult

Defined in: packages/nexus-agents/src/pipeline/core-plugins.ts:116

Result of core plugin registration.

Properties

errors
readonly errors: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/core-plugins.ts:119

failed
readonly failed: number;

Defined in: packages/nexus-agents/src/pipeline/core-plugins.ts:118

registered
readonly registered: number;

Defined in: packages/nexus-agents/src/pipeline/core-plugins.ts:117


DelegateInputLike

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:82

Minimal input shape matching DelegateInput. Avoids circular mcp/tools import.

Properties

billing_mode?
readonly optional billing_mode?: string;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:86

model_hint?
readonly optional model_hint?: string;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:85

preferred_capability?
readonly optional preferred_capability?: string;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:84

task
readonly task: string;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:83


DevPipelineOptions

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:417

Options for pipeline execution.

Properties

auditLogger?
readonly optional auditLogger?: IAuditLogger;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:501

Durable, hash-chained audit logger (#3710). When supplied (the MCP server threads its single startup auditLogger), the consensus→execute policy gate ALSO persists each policy.evaluated decision to the immutable store — carrying mode/ruleIds/stageType — so warn-mode soak evidence survives process exit and feeds the tune/readiness loop. MUST be the server’s single instance, not a competing FileAuditStorage (shared hash chain). When undefined (pure-CLI path), behavior is unchanged — the in-memory bus emit is the only sink.

beliefMemory?
readonly optional beliefMemory?: IHindsightBeliefMemory;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:446

Optional BeliefMemory for hindsight updates after plan outcomes (#1720).

dryRun?
readonly optional dryRun?: boolean;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:421

When true, stop after plan+vote and return partial result (#1717).

maxQaIterations?
readonly optional maxQaIterations?: number;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:444

Cap on implement→QA rounds (#4939). Omitted uses MAX_QA_ITERATIONS.

maxVoteIterations?
readonly optional maxVoteIterations?: number;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:442

Cap on plan→vote rounds (#4939). Omitted uses MAX_VOTE_ITERATIONS.

The MCP tool has advertised maxVoteIterations since it shipped — bounds checked, defaulted to 3, described in the generated tool reference — and nothing read it, so setting it changed nothing.

mode?
readonly optional mode?: PipelineMode;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:427

Pipeline mode (#1704):

  • ‘autonomous’ (default): full pipeline runs internally
  • ‘harness’: stops after decompose, returns tasks for external implementation
qualityGate?
readonly optional qualityGate?: QualityGateMode;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:434

Local pre-ship quality-gate mode (#3356). Default ‘off’ so the pipeline never wedges repos that lack standard build/test scripts. See QualityGateMode. Requires stages.qualityGate to be supplied; if the stage is absent the gate is skipped regardless of mode.

researchOverride?
readonly optional researchOverride?: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:463

Pre-seeded research text (#3643). When set, the RESEARCH stage uses this instead of calling stages.research() — so the IMPLEMENT phase can run the pipeline plan-only (from the typed RemediationPlan) with NO fresh untrusted read, while untrustedInputGuard still fail-closes any code path that forgets to seed it.

sessionId?
readonly optional sessionId?: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:419

Session ID for checkpoint/resume. Omit for no persistence.

signal?
readonly optional signal?: AbortSignal;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:509

Cancels the run (#6305). Checked immediately before every stage call; once it has fired the run rejects with an error naming the stage it stopped before, and no further stage runs. It also aborts the signal handed to the stage in flight (#6736), so that stage’s model calls stop. run_dev_pipeline threads cancel_job’s signal here. Absent: the run is not cancellable.

sourceTrustTier?
readonly optional sourceTrustTier?: "1" | "2" | "3" | "4";

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:491

The caller’s DECLARED tier for the task content itself (#6795) — same enum and meaning as memory_write’s sourceTrustTier. Omitted means Tier 3 (Untrusted): a trusted caller can relay content it did not write. The content tier is the least-trusted of this, trustTier and each measured source, so a declaration never raises trust above the caller. Recorded with the caller tier in the gate’s pipelineState.trustProvenance.

stageTimeoutMs?
readonly optional stageTimeoutMs?: number;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:519

Deadline for EACH stage call, in ms (#6736) — not a budget for the whole run. Every plan/vote and implement/QA iteration gets its own. Replaces every stage’s default, the vote’s included, and is clamped to the pipeline class guard. Absent: the vote runs under the multi-llm-panel class guard and every other stage under the pipeline class guard. A stage past its deadline fails the run with a timeout naming the stage, and the signal it was handed is aborted.

trustTier?
readonly optional trustTier?: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:482

The CALLER’s trust tier (‘1’–‘4’) — who invoked the run, not where its content came from (#3712, #6751). The MCP run_dev_pipeline handler and the run entry point thread RequestContext.trustTier; the auto-remediation IMPLEMENT path may pass '1' only because #3643’s typed RemediationPlan + CapabilityLedger confine untrusted input upstream (it also sets researchOverride, so no external source feeds that run). Since #6795 such a caller must ALSO declare sourceTrustTier '1': the caller tier alone no longer vouches for the task text.

The consensus→execute policy snapshot does NOT receive this value directly. It receives the CONTENT tier: the least-trusted of this caller tier, the task content’s tier (sourceTrustTier, 3 when omitted) and each source that fed a stage — fresh or resumed research counts as external (EXTERNAL_CONTENT_TRUST_TIER); a researchOverride adds no source. When undefined the snapshot carries no tier and the engine defaults to untrusted (4), fail-closed — never infer a trusted tier from absence.

untrustedInputGuard?
readonly optional untrustedInputGuard?: () => void;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:455

Fail-closed guard invoked at the RESEARCH stage — the untrusted-read chokepoint (#3643). The auto-remediation enforce path (#3618) wires this to CapabilityLedger.assertCapability('untrusted-input'), so running the untrusted research stage inside the write+secrets IMPLEMENT phase throws (Rule-of-Two). Not called when researchOverride is set (no untrusted read happens). Default: undefined (no guard — normal pipeline behavior).

Returns

void


DevPipelineResult

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:215

Overall pipeline result.

Properties

completed
readonly completed: boolean;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:222

Whether the pipeline completed successfully.

True only when every planned task is present in tasks with status ‘done’ AND the security gate passed (#5645).

dryRun?
readonly optional dryRun?: true;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:278

Whether this run stopped after plan+vote because the caller asked it to.

completed: false alone cannot distinguish “the pipeline failed” from “the pipeline did exactly what was requested and stopped” — and a consumer that reads completed as the verdict reports a successful dry run as an engine fault. Absent means a normal run.

harnessMode?
readonly optional harnessMode?: true;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:289

Present only for mode: 'harness' runs. Absent means a normal run.

The second legitimate completed: false, and it had no marker while the dry run had one (#5888). Harness mode hands the tasks back for external implementation and stops on purpose — exactly the distinction DevPipelineResult.dryRun exists to make, so a consumer reading completed as the verdict reported a successful harness run as an engine fault. run_dev_pipeline’s async job status is that consumer.

plan
readonly plan: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:223

planStatus?
readonly optional planStatus?: "empty" | "no_quorum" | "unapproved";

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:263

Terminal planning-gate state. Absent means the panel approved a usable plan. 'empty' means the planner returned nothing; 'no_quorum' means the retry budget ended without a valid panel; 'unapproved' means every permitted revision was rejected. Every present state stops before implementation.

planVoteApprovalPercentage?
readonly optional planVoteApprovalPercentage?: number;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:267

Last panel approval percentage for a terminal plan-vote outcome.

planVoteFeedback?
readonly optional planVoteFeedback?: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:269

Last rejection feedback when planStatus is 'unapproved'.

planVoteReason?
readonly optional planVoteReason?: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:265

Last quorum failure reason when planStatus is 'no_quorum'.

qaIterations
readonly qaIterations: number;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:226

securityNote?
readonly optional securityNote?: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:250

Security-stage feedback explaining why a skipped scan did not run.

securityPassed
readonly securityPassed: boolean;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:234

Whether the security gate passed.

Read together with DevPipelineResult.securityRan (#4772): false with securityRan: false means no scan produced a measured verdict and is NOT a failed security review.

securityRan?
readonly optional securityRan?: boolean;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:248

Whether the security gate actually ran (#4772).

Set on every path runDevPipeline can return through, so securityPassed: false is always readable as verdict-vs-absence. Four paths report false: a dry run (plan+vote only), harness mode (tasks are handed back for external implementation), a red quality gate in blocking mode, and a security scan that returned skip. Only a post-scan pass or fail verdict reports true.

Absent means the producer predates the distinction (#4782), not that the scan’s status is unknown — treat an absent value as unmeasured, not false.

tasks
readonly tasks: readonly PipelineTask[];

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:224

taskStatus?
readonly optional taskStatus?: "none" | "partial" | "all_done";

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:301

Aggregate completion status of planned tasks (#5645).

'all_done' when every planned task was implemented and passed QA; 'partial' when some but not all tasks completed with status 'done'; 'none' when zero tasks completed with status 'done' (including empty plans where nothing was planned).

Optional so early-return shapes that never ran the implement loop need not carry it.

voteIterations
readonly voteIterations: number;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:225

warnings?
readonly optional warnings?: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:256

Conditions the caller should know about that do not change the verdict (#6792), e.g. a quality gate that ran scripts in the directory the implement expert edited. Absent when there are none.


DevPipelineStages

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:319

Pluggable stage implementations — inject real or mock agents.

Every method takes a trailing optional signal (#6736). runDevPipeline passes each call its own signal, which aborts when the run is cancelled or the stage’s deadline passes; an implementation should hand it to its model calls, fetches and subprocesses so the work stops. One that ignores it still fails at the deadline, but its work runs on in the background. The built-in stages all honour it: research ends its source fetches, and qualityGate and securityScan end their subprocess trees (#6747).

Properties

implementWorkspace?
readonly optional implementWorkspace?: {
  accessMode: ExecutionAccessMode;
  directory: string;
};

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:350

Where and how implement edits files (#6792), when the stages declare it: the access mode its expert runs under and the directory it runs in. The pipeline reads it to warn when a quality gate will then run scripts in that directory. Absent means undeclared: no warning.

accessMode
readonly accessMode: ExecutionAccessMode;
directory
readonly directory: string;

Methods

decompose()
decompose(plan, signal?): Promise<PipelineTask[]>;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:341

PM decomposes approved plan into tasks.

Parameters
plan

string

signal?

AbortSignal

Returns

Promise<PipelineTask[]>

implement()
implement(task, signal?): Promise<string>;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:343

Code expert implements a task. Returns the work product.

Parameters
task

PipelineTask

signal?

AbortSignal

Returns

Promise<string>

plan()
plan(
   task, 
   research, 
   priorFeedback?, 
   signal?
): Promise<string>;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:327

Architect creates a plan from research + task.

Parameters
task

string

research

string

priorFeedback?

string

signal?

AbortSignal

Returns

Promise<string>

qaReview()
qaReview(
   task, 
   implementation, 
   signal?
): Promise<QaReviewResult>;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:355

QA expert reviews implementation.

Parameters
task

PipelineTask

implementation

string

signal?

AbortSignal

Returns

Promise<QaReviewResult>

qualityGate()?
optional qualityGate(signal?): Promise<{
  feedback: string;
  passed: boolean;
}>;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:367

Local QA quality gate (typecheck/lint/tests/build) run before ship (#3356). Optional: pipelines that don’t supply it simply skip the gate. Returns passed plus actionable feedback from the underlying runQualityGate engine. Whether a red gate fails the phase is governed by the qualityGate mode in DevPipelineOptions, not this method.

Parameters
signal?

AbortSignal

Returns

Promise<{ feedback: string; passed: boolean; }>

research()
research(task, signal?): Promise<ResearchContext>;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:325

Research expert gathers context for the task. Returns the full ResearchContext (#3234 seam 0): .text feeds plan/vote as before, .metadata is attached to decomposed tasks for routing-experience enrichment.

Parameters
task

string

signal?

AbortSignal

Returns

Promise<ResearchContext>

securityScan()
securityScan(signal?): Promise<{
  feedback: string;
  passed: boolean;
  verdict?: "pass" | "fail" | "skip";
}>;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:374

Security scan. verdict preserves the scanner’s tri-state so a skip (scanner absent or errored) is not recorded as a rejection (#5502). Optional so stage implementations that predate the field still satisfy the contract; when absent, passed is read as a measured pass/fail.

Parameters
signal?

AbortSignal

Returns

Promise<{ feedback: string; passed: boolean; verdict?: "pass" | "fail" | "skip"; }>

vote()
vote(
   plan, 
   research, 
   signal?
): Promise<VoteResult>;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:339

Consensus vote on the plan. Returns approval + feedback. research is the research-stage context, surfaced to voters so they can weigh research maturity (#3258) — appended to the proposal as informational, untrusted text (never as instructions).

Parameters
plan

string

research

string

signal?

AbortSignal

Returns

Promise<VoteResult>


EventBusBridgeOptions

Defined in: packages/nexus-agents/src/pipeline/event-bus-bridge.ts:23

Options for the EventBus bridge.

Properties

source
readonly source: IEventBus;

Defined in: packages/nexus-agents/src/pipeline/event-bus-bridge.ts:25

V2 pipeline EventBus to subscribe to.

topicPrefix?
readonly optional topicPrefix?: string;

Defined in: packages/nexus-agents/src/pipeline/event-bus-bridge.ts:27

Optional topic prefix for forwarded events. Defaults to ‘pipeline’.


EventBusOptions

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:29

Options for EventBus behavior.

Properties

maxBufferSize?
readonly optional maxBufferSize?: number;

Defined in: packages/nexus-agents/src/pipeline/event-bus.ts:30


EventFilter

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:306

Filter for subscribing to or querying events.

Properties

executionId?
readonly optional executionId?: string;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:309

since?
readonly optional since?: number;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:310

taskId?
readonly optional taskId?: string;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:308

type?
readonly optional type?: 
  | "task.created"
  | "task.status_changed"
  | "task.completed"
  | "task.failed"
  | "pipeline.started"
  | "pipeline.completed"
  | "pipeline.checkpoint"
  | "stage.started"
  | "stage.completed"
  | "stage.failed"
  | "stage.retrying"
  | "policy.evaluated"
  | "artifact.created"
  | "model.called"
  | "routing.decision"
  | "tool.invoked"
  | "tool.completed"
  | "wave.started"
  | "wave.completed"
  | "signal.fitness_declined"
  | "signal.swarm_unhealthy"
  | "signal.vote_rejected"
  | readonly (
  | "task.created"
  | "task.status_changed"
  | "task.completed"
  | "task.failed"
  | "pipeline.started"
  | "pipeline.completed"
  | "pipeline.checkpoint"
  | "stage.started"
  | "stage.completed"
  | "stage.failed"
  | "stage.retrying"
  | "policy.evaluated"
  | "artifact.created"
  | "model.called"
  | "routing.decision"
  | "tool.invoked"
  | "tool.completed"
  | "wave.started"
  | "wave.completed"
  | "signal.fitness_declined"
  | "signal.swarm_unhealthy"
  | "signal.vote_rejected")[];

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:307


ExpertBridgeResult

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:55

Result of an expert execution.

Properties

accessMode?
readonly optional accessMode?: ExecutionAccessMode;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:67

The access mode the arm that served the call reported enforcing (#6792), after routing. Absent when no arm served it (a failed route, a refusal) or the arm did not report one; routedArm / cli name the arm. Compare requestedAccessMode.

cli?
readonly optional cli?: "claude" | "gemini" | "codex" | "opencode";

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:88

CLI that actually executed the task, resolved from the underlying CliResponse.model via getCliForModelId. Undefined when the bridge failed before dispatch (no adapters / circuit-open / rate-limit cap). Callers writing to OutcomeStore should use this rather than hardcoding a cli — see #2823 (#1154 regression).

durationMs
readonly durationMs: number;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:59

error?
readonly optional error?: string;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:60

expertType
readonly expertType: BuiltInExpertType;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:58

gatewayArm?
readonly optional gatewayArm?: `api:${string}`;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:138

The gateway arm that served model, when a gateway model answered (#6624, CliResponse.gatewayArm). An outcome writer prices the call by the arm’s declaration instead of the model’s list rate.

model?
readonly optional model?: string;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:124

Concrete model id the underlying adapter reported (CliResponse.model), when present (#3387). Distinct from cli (the slot): one CLI can run several models. Undefined when the adapter didn’t report a model or the bridge failed before dispatch. Required to emit a model.called event.

permissionDenials?
readonly optional permissionDenials?: readonly CliPermissionDenial[];

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:80

Tool calls the serving CLI’s permission layer refused (#6792).

requestedAccessMode?
readonly optional requestedAccessMode?: ExecutionAccessMode;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:72

The access mode the caller asked for (#6792), 'default' when it named none. executeExpert always sets it; optional on the published type.

routedArm?
readonly optional routedArm?: RoutingArmId;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:95

Routing arm id the router ran (#6552), when it names one: api:anthropic for the Anthropic API arm, where cli reads the claude slot. An outcome row records this, so warm start credits the arm that ran. Undefined when no arm ran, or when the router named only a slot.

routedBy?
readonly optional routedBy?: "composite-router";

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:103

'composite-router' when CompositeRouter.executeTask selected the CLI that produced this result, success or failure (#6521). Set where the router’s decision and the execution meet (adaptCompositeRouter), so an outcome recorder copies it rather than asserting routing on its own. Undefined when no arm ran: routing failed, no adapters, circuit open.

routedDurationMs?
readonly optional routedDurationMs?: number;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:109

Wall time of the routed arm’s call alone (#6521), from the router. Unlike durationMs it excludes expert import, MCP-config setup and rate-limit backoff. Undefined when no arm ran.

success
readonly success: boolean;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:56

text
readonly text: string;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:57

textOnly?
readonly optional textOnly?: true;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:78

True when the arm that served the call runs nothing on the host (#6792): a direct-API or gateway arm. No file was read or edited, whatever the access mode allowed; the text is the whole output.

tokensIn?
readonly optional tokensIn?: number;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:131

Input/output token split from the adapter’s CliResponse.usage (#3387), when reported. Best-effort like tokensUsed; both undefined together when no usage was available. tokensIn + tokensOut reconciles with tokensUsed (single source of truth — both derive from the same record).

tokensOut?
readonly optional tokensOut?: number;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:132

tokensUsed?
readonly optional tokensUsed?: number;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:117

Total tokens (input + output) the underlying CLI/adapter reported for this call, when available (#3396). Best-effort: CliResponse.usage is optional — CLI-subprocess paths whose extractUsage returns null leave this undefined. Consumers (budget enforcement #3395, model.called attribution #3387, routing-experience metrics) must tolerate undefined.


GraphPipelineOptions

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:28

Options for graph-based pipeline execution.

Extended by

Properties

dryRun?
readonly optional dryRun?: boolean;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:30

When true, stop after the dryRunStopAfter stage.

maxSteps?
readonly optional maxSteps?: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:35

Maximum graph node executions (default: 20). Parallel super-steps are atomic and start only when their full batch fits in the remaining budget.

signal?
readonly optional signal?: AbortSignal;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:43

Cancels the run at the next super-step boundary (#6305). Handed to the graph executor, which checks it before each super-step and fails the run with Graph execution aborted; a stage already in flight is not interrupted. run_pipeline threads cancel_job’s signal here. Absent: the run is not cancellable.

stageTimeoutMs?
readonly optional stageTimeoutMs?: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:52

Deadline for EACH stage, in ms (#6730) — not a budget for the whole run. Replaces every stage’s default, the vote stage’s panel-sized one included, clamped to the pipeline class guard. Absent: the vote stage runs under the multi-llm-panel class guard, every other stage under GRAPH_TIMEOUTS.defaultMs. The run as a whole is bounded by the pipeline class guard either way.


GraphPipelineResult

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:56

Result of a graph-based pipeline execution.

Extended by

Properties

dryRun?
readonly optional dryRun?: true;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:68

Set when the run was a dry run. Mirrors DevPipelineResult.dryRun: a consumer reading success alone reported a truncated dry run as a full pipeline. Absent means a normal run.

durationMs
readonly durationMs: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:60

error?
readonly optional error?: string;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:62

finalState
readonly finalState: Readonly<Record<string, unknown>>;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:61

stagesPlanned
readonly stagesPlanned: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:78

Stages the template declares, and stages this run actually executed.

templateId names the FULL template even when resolveEffectiveTemplate truncated it at dryRunStopAfter, so templateId: 'dev' with success: true used to be byte-identical whether qa and security ran or were sliced away. These two numbers are what makes the coverage legible without the consumer having to know dryRunStopAfter and the stage list.

stagesRun
readonly stagesRun: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:79

stepsExecuted
readonly stepsExecuted: number;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:59

success
readonly success: boolean;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:57

templateId
readonly templateId: string;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:58


IArtifactStore

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:49

Artifact store interface.

Properties

size
readonly size: number;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:54

Methods

get()
get(ref): Artifact | undefined;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:51

Parameters
ref
id

string = ...

type

| "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote" = ...

Returns

Artifact | undefined

provenance()
provenance(ref): readonly ProvenanceEntry[];

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:53

Parameters
ref
id

string = ...

type

| "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote" = ...

Returns

readonly ProvenanceEntry[]

put()
put(artifact): {
  id: string;
  type:   | "code"
     | "analysis"
     | "test"
     | "spec"
     | "review"
     | "report"
     | "plan"
     | "vote";
};

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:50

Parameters
artifact

Artifact

Returns
{
  id: string;
  type:   | "code"
     | "analysis"
     | "test"
     | "spec"
     | "review"
     | "report"
     | "plan"
     | "vote";
}
id
id: string;
type
type: 
  | "code"
  | "analysis"
  | "test"
  | "spec"
  | "review"
  | "report"
  | "plan"
  | "vote";
query()
query(filter): readonly {
  id: string;
  type:   | "code"
     | "analysis"
     | "test"
     | "spec"
     | "review"
     | "report"
     | "plan"
     | "vote";
}[];

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:52

Parameters
filter

ArtifactFilter

Returns

readonly { id: string; type: | "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote"; }[]


IEventBus

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:323

Event bus interface — fire-and-forget event emission with typed subscriptions and bounded query.

Properties

bufferSize
readonly bufferSize: number;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:337

Current buffer size.

totalEmitted
readonly totalEmitted: number;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:334

Total events emitted (including evicted).

Methods

emit()
emit(event): void;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:325

Emit an event. Handlers must not throw.

Parameters
event

PipelineEvent

Returns

void

query()
query(filter, limit?): readonly PipelineEvent[];

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:331

Query recent events (bounded buffer).

Parameters
filter

EventFilter

limit?

number

Returns

readonly PipelineEvent[]

subscribe()
subscribe(filter, handler): Unsubscribe;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:328

Subscribe to events matching filter. Returns unsubscribe function.

Parameters
filter

EventFilter

handler

EventHandler

Returns

Unsubscribe


IPipelineStage

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:47

A pipeline stage that can be compiled into a graph node.

Properties

id
readonly id: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:49

Unique stage identifier (used as graph node ID).

name
readonly name: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:51

Human-readable stage name.

Methods

execute()
execute(context): Promise<StageOutput>;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:53

Execute the stage.

Parameters
context

PipelineContext

Returns

Promise<StageOutput>


IPluginRegistry

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:141

Plugin registry — manages plugin lifecycle and resolution.

Registry is frozen after startup — no runtime registration.

Properties

frozen
readonly frozen: boolean;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:161

Whether the registry is frozen.

Methods

freeze()
freeze(): void;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:158

Freeze the registry — no further registrations allowed.

Returns

void

isEnabled()
isEnabled(pluginId): boolean;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:155

Check if a plugin is registered and enabled.

Parameters
pluginId

string

Returns

boolean

listEnabled()
listEnabled(): readonly {
  description: string;
  experimental: boolean;
  id: string;
  requiredCapabilities: string[];
  stages: ("analyze" | "validate" | "execute" | "route" | "aggregate" | "gate")[];
  trustLevel: "standard" | "external" | "experimental" | "core";
  version: string;
}[];

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:152

List all enabled plugins with their manifests.

Returns

readonly { description: string; experimental: boolean; id: string; requiredCapabilities: string[]; stages: ("analyze" | "validate" | "execute" | "route" | "aggregate" | "gate")[]; trustLevel: "standard" | "external" | "experimental" | "core"; version: string; }[]

register()
register(plugin): Result<void, RegistrationError>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:146

Register a plugin. Validates manifest and config. Returns error if plugin ID conflicts or capabilities missing.

Parameters
plugin

PipelinePlugin

Returns

Result<void, RegistrationError>

resolve()
resolve(pluginId): PipelinePlugin | undefined;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:149

Resolve a plugin by ID. Returns undefined if not registered or disabled.

Parameters
pluginId

string

Returns

PipelinePlugin | undefined


IPolicyEngine

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:90

Policy engine interface.

Methods

evaluate()
evaluate(gate, context): PolicyDecision;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:91

Parameters
gate
afterStage

string = ...

beforeStage

string = ...

id

string = ...

rules

string[] = ...

context

PolicyContext

Returns

PolicyDecision

listRules()
listRules(): readonly PolicyRule[];

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:93

Returns

readonly PolicyRule[]

registerRule()
registerRule(rule): void;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:92

Parameters
rule

PolicyRule

Returns

void


IterativeConsensusConfig

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:23

Configuration for an iterative consensus vote.

Properties

errorPolicy?
readonly optional errorPolicy?: 
  | "reduce_denominator"
  | "count_as_abstain"
  | "fail_closed"
  | "absolute_quorum";

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:40

#4138: error policy for votes run by this reusable helper (default: ‘absolute_quorum’). An errored voter degrades to a recoverable no_quorum handled by maxNoQuorumRetries. Overridable per caller.

The production dev-pipeline plan gate applies the same policy directly through DevPipelineStages.vote; it does not call runIterativeConsensus.

logger?
readonly optional logger?: ILogger;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:52

Logger instance.

maxIterations?
readonly optional maxIterations?: number;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:25

Maximum plan→vote iterations (default: 3).

maxNoQuorumRetries?
readonly optional maxNoQuorumRetries?: number;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:48

#4135: how many times to re-run the SAME plan when a vote returns no_quorum — a missing/errored voice, not a rejection — before giving up (default: 2). Counted SEPARATELY from maxIterations: a quorum void is a recoverable “re-run the missing voice” state, not a plan-revision trigger, so it must not consume the refine budget.

maxProposalLength?
readonly optional maxProposalLength?: number;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:50

Max proposal length sent to voters (default: 4000).

pipelinePrefix?
readonly optional pipelinePrefix?: string;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:54

Pipeline prefix for observability events.

quickMode?
readonly optional quickMode?: boolean;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:29

Use quick mode (3 agents instead of the full 7-role panel).

simulateVotes?
readonly optional simulateVotes?: boolean;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:27

Use simulated votes (for testing).

strategy?
readonly optional strategy?: VotingStrategy;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:31

Voting strategy (default: ‘higher_order’).


IterativeConsensusResult

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:58

Result of the iterative consensus process.

Properties

durationMs
readonly durationMs: number;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:61

iterations
readonly iterations: number;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:60

vote
readonly vote: VoteResult;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:59


OrchestrateInputLike

Defined in: packages/nexus-agents/src/pipeline/v2-orchestrate.ts:29

Minimal shape of orchestrate input (avoids circular import).

Properties

context?
readonly optional context?: Record<string, unknown>;

Defined in: packages/nexus-agents/src/pipeline/v2-orchestrate.ts:31

maxIterations?
readonly optional maxIterations?: number;

Defined in: packages/nexus-agents/src/pipeline/v2-orchestrate.ts:32

task
readonly task: string;

Defined in: packages/nexus-agents/src/pipeline/v2-orchestrate.ts:30


PipelineBridgeResult

Defined in: packages/nexus-agents/src/pipeline/event-bus-bridge.ts:35

Result of bridge initialization.

Properties

dispose
readonly dispose: Unsubscribe;

Defined in: packages/nexus-agents/src/pipeline/event-bus-bridge.ts:39

Unsubscribe from the V2 bus (cleanup).

forwarded
readonly forwarded: () => number;

Defined in: packages/nexus-agents/src/pipeline/event-bus-bridge.ts:37

Number of events forwarded so far.

Returns

number


PipelineCheckpointState

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:54

Partial pipeline state loaded from checkpoints.

Properties

implementedTasks?
readonly optional implementedTasks?: readonly PipelineTask[];

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:62

lastCompletedStage?
readonly optional lastCompletedStage?: CheckpointPipelineStage;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:64

plan?
readonly optional plan?: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:56

research?
readonly optional research?: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:55

securityPassed?
readonly optional securityPassed?: boolean;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:63

tasks?
readonly optional tasks?: readonly PipelineTask[];

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:61

voteCaveats?
readonly optional voteCaveats?: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:60

voteConditional?
readonly optional voteConditional?: boolean;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:58

voteConditions?
readonly optional voteConditions?: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:59

voteIterations?
readonly optional voteIterations?: number;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:57


PipelineContext

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:15

Read-only pipeline context passed to every stage.

Properties

executionId
readonly executionId: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:17

Unique pipeline execution ID.

state
readonly state: Readonly<Record<string, unknown>>;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:29

Accumulated state from prior stages. The only cross-stage handoff channel — sharedMemory (the #1764 SharedMemoryStore) was removed in #2937 after being write-only since introduction. If you need structured cross-stage data, add a well-known key to PIPELINE_STATE_KEYS and write/read through state.

task
readonly task: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:19

The original task/prompt that started the pipeline.

templateId
readonly templateId: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:21

Pipeline template being executed.


PipelineDeps

Defined in: packages/nexus-agents/src/pipeline/pipeline-deps.ts:29

Injectable pipeline dependencies. Every field is optional; an unset field falls back to its documented process-global default at resolve time.

Properties

pluginRegistry?
readonly optional pluginRegistry?: IPluginRegistry;

Defined in: packages/nexus-agents/src/pipeline/pipeline-deps.ts:34

Plugin registry for resolving stage handlers. Defaults to the global pipeline registry (getPipelinePluginRegistry()) when unset.


PipelineExecuteOptions

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:77

Pipeline execution options.

Properties

continueOnFailure?
readonly optional continueOnFailure?: boolean;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:83

When true, continue executing independent steps after a failure.

eventBus?
readonly optional eventBus?: IEventBus;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:90

EventBus for trace persistence. When provided, creates a TraceWriter.

maxSteps?
readonly optional maxSteps?: number;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:79

onStageComplete?
readonly optional onStageComplete?: (stageId) => void;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:81

Parameters
stageId

string

Returns

void

priorResults?
readonly optional priorResults?: ReadonlyMap<string, NodeResult>;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:88

Prior NodeResults to replay (#3534) — succeeded nodes are reused instead of re-executed. Set by retryFailed so a retry re-runs only the failed nodes.

runsDir?
readonly optional runsDir?: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:96

Override base directory for trace output. Default: getDefaultRunsDir(), i.e. nexusDataPath('runs') — per-repo aware. NOT getNexusDataDir()/runs, which bypassed per-repo routing (#2889).

signal?
readonly optional signal?: AbortSignal;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:78

timeout?
readonly optional timeout?: number;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:80


PipelineGraphResult

Defined in: packages/nexus-agents/src/pipeline/pipeline-graph.ts:26

Result of compiling a pipeline template into a graph.

Properties

error?
readonly optional error?: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-graph.ts:29

graph?
readonly optional graph?: CompiledGraph;

Defined in: packages/nexus-agents/src/pipeline/pipeline-graph.ts:28

ok
readonly ok: boolean;

Defined in: packages/nexus-agents/src/pipeline/pipeline-graph.ts:27


PipelineMetrics

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:90

Metrics from V2 pipeline execution.

Properties

compiled
readonly compiled: boolean;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:91

durationMs
readonly durationMs: number;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:94

executed
readonly executed: boolean;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:92

policyBlocked?
readonly optional policyBlocked?: boolean;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:96

True only when policy actually stopped the run (block mode + denial).

policyMode?
readonly optional policyMode?: PipelinePolicyMode;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:109

The mode those violations were evaluated under, when there are any.

policyViolations?
readonly optional policyViolations?: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:107

Violations the policy evaluator found, present whether or not they stopped the run.

Under warn mode PolicyEvalResult.allowed is true regardless of violations, so a metrics object that only populated this alongside policyBlocked reported a warn-mode denial identically to a clean evaluation (#5862). Read policyBlocked for “did it stop”, this for “what did it find”.

stepsExecuted
readonly stepsExecuted: number;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:93


PipelinePlugin

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:86

Plugin interface — every stage implementation must conform.

Plugins are the ONLY way stage logic runs. They communicate via ArtifactStore and EventBus (injected via context).

Properties

manifest
readonly manifest: {
  description: string;
  experimental: boolean;
  id: string;
  requiredCapabilities: string[];
  stages: ("analyze" | "validate" | "execute" | "route" | "aggregate" | "gate")[];
  trustLevel: "standard" | "external" | "experimental" | "core";
  version: string;
};

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:88

Manifest declaring this plugin’s identity and capabilities.

description
description: string;
experimental
experimental: boolean;
id
id: string;
requiredCapabilities
requiredCapabilities: string[];
stages
stages: ("analyze" | "validate" | "execute" | "route" | "aggregate" | "gate")[];
trustLevel
trustLevel: "standard" | "external" | "experimental" | "core";
version
version: string;

Methods

execute()
execute(stage, context): Promise<{
  error?: string;
  metadata: Record<string, unknown>;
  outputArtifacts: {
     id: string;
     type:   | "code"
        | "analysis"
        | "test"
        | "spec"
        | "review"
        | "report"
        | "plan"
        | "vote";
  }[];
  success: boolean;
}>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:96

Execute a pipeline stage.

Parameters
stage

The stage specification from the PlanContract

config

Record<string, unknown> = ...

dependencies

string[] = ...

id

string = ...

inputArtifacts

string[] = ...

maxRetries?

number = ...

outputArtifacts

string[] = ...

pluginId

string = ...

preferredCli?

string = ...

timeoutMs?

number = ...

type

"analyze" | "validate" | "execute" | "route" | "aggregate" | "gate" = ...

context

StageContext

Runtime context with abort signal and task

Returns

Promise<{ error?: string; metadata: Record<string, unknown>; outputArtifacts: { id: string; type: | "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote"; }[]; success: boolean; }>

Stage result with output artifacts

onLoad()?
optional onLoad(): Promise<void>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:105

Optional lifecycle hook — called when plugin is loaded.

Returns

Promise<void>

onUnload()?
optional onUnload(): Promise<void>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:108

Optional lifecycle hook — called when plugin is unloaded.

Returns

Promise<void>

validateConfig()
validateConfig(config): Result<void, PluginValidationError>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:102

Validate plugin configuration at registration time. Called once when the plugin is registered, not per-execution.

Parameters
config

unknown

Returns

Result<void, PluginValidationError>


PipelinePolicyViolation

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:63

A single policy violation.

Properties

escalateTo?
readonly optional escalateTo?: string;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:66

reason
readonly reason: string;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:65

ruleId
readonly ruleId: string;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:64


PipelineResult

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:41

Pipeline execution result.

Properties

durationMs
readonly durationMs: number;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:44

error?
readonly optional error?: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:45

nodeResults?
readonly optional nodeResults?: readonly NodeResult[];

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:53

Raw per-node results from the run (#3534). Retained so retryFailed can replay prior successes and re-run only the failed nodes; carries the isRetryable signal used to gate the retry.

stepResults?
readonly optional stepResults?: readonly StepOutcome[];

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:47

Per-step breakdown when continueOnFailure is enabled.

stepsExecuted
readonly stepsExecuted: number;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:43

success
readonly success: boolean;

Defined in: packages/nexus-agents/src/pipeline/pipeline-runner.ts:42


PipelineTask

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:76

A task decomposed by the PM, potentially with conditional approval requirements.

Properties

assignedTo
readonly assignedTo: PipelineRole;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:80

caveats?
readonly optional caveats?: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:88

Caveats/warnings associated with the task (from conditional_go vote).

conditions?
readonly optional conditions?: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:86

Conditions required for task completion (from conditional_go vote).

description
readonly description: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:79

feedback?
readonly optional feedback?: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:82

id
readonly id: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:77

implementation?
readonly optional implementation?: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:84

Implementation text from the code expert (surfaced for harness use).

researchMaturity?
readonly optional researchMaturity?: number;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:94

#3234: deterministic research-maturity [0,1] of the run that produced this task, attached after decompose. RECORDED on the routing outcome and measured (the gated live-routing use is #3815). Absent → treated as no-research (0).

status
readonly status: "review" | "rejected" | "done" | "pending" | "in_progress";

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:81

title
readonly title: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:78


PipelineTemplate

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:71

A declarative pipeline template defining stages and their connections.

Properties

dryRunStopAfter?
readonly optional dryRunStopAfter?: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:81

Stage IDs that can be skipped via dryRun.

edges?
readonly optional edges?: readonly PipelineEdge[];

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:79

Edge overrides (for non-linear flows like vote→plan feedback loops).

id
readonly id: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:73

Unique template identifier.

name
readonly name: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:75

Human-readable name.

stages
readonly stages: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:77

Ordered stage IDs (for simple linear pipelines).


PlanCompileOptions

Defined in: packages/nexus-agents/src/pipeline/plan-compiler.ts:30

Options for plan compilation.

Properties

pluginRegistry?
readonly optional pluginRegistry?: IPluginRegistry;

Defined in: packages/nexus-agents/src/pipeline/plan-compiler.ts:33

Plugin registry for resolving stage handlers. When provided, stages with a registered pluginId will use the plugin’s execute() method.

policyEnforcement?
readonly optional policyEnforcement?: GatePolicyEnforcement;

Defined in: packages/nexus-agents/src/pipeline/plan-compiler.ts:40

Policy enforcement for gate nodes (#3177). When provided, each policy gate node evaluates evaluatePipelinePolicy at runtime — denying (in BLOCK mode) by throwing PolicyBlockedError, which halts the pipeline. When absent, gate nodes remain no-op passes (back-compat).


PluginRegistryOptions

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:38

Options for controlling plugin registry behavior.

Both fields are deprecated (#5097). No production construction sets them: registerCorePlugins / createCorePluginRegistry build the registry with no options, every CORE_PLUGINS manifest is experimental: false, and the registry is frozen right after core registration — so only core plugins ever load and the experimental gate cannot open. The fields stay accepted (and still deny) because they are public API; removal is tracked in #5097 for the next major.

Properties

experimentalAllow?
readonly optional experimentalAllow?: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:52

Explicit allowlist of experimental plugin IDs.

Deprecated

No production construction sets this; only core plugins load. Still accepted and still gates as before. Removal tracked in #5097 (next major).

experimentalEnabled?
readonly optional experimentalEnabled?: boolean;

Defined in: packages/nexus-agents/src/pipeline/plugin-registry.ts:45

Allow experimental plugins to be registered.

Deprecated

No production construction sets this; only core plugins load. Still accepted and still gates as before. Removal tracked in #5097 (next major).


PluginValidationError

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:116

Validation error from plugin config validation.

Properties

field?
readonly optional field?: string;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:118

message
readonly message: string;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:117


PolicyContext

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:75

Context provided to policy rules for evaluation.

Properties

pipelineState
readonly pipelineState: PipelineStateSnapshot;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:79

stageId
readonly stageId: string;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:77

stageType
readonly stageType: string;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:78

taskId
readonly taskId: string;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:76


PolicyEvalResult

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:56

Result of a policy evaluation at a stage boundary.

Properties

allowed
readonly allowed: boolean;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:57

mode
readonly mode: PipelinePolicyMode;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:59

violations
readonly violations: readonly PipelinePolicyViolation[];

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:58


PolicyEvaluatorOptions

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:40

Options for PolicyEvaluator.

Properties

auditTrail?
readonly optional auditTrail?: AuditTrail;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:52

Optional DURABLE audit trail (#3710). When present, each violation is ALSO appended to the hash-chained store (dual-emit) carrying mode/ruleIds/ stageType — so soak(warn)-vs-enforce(block) evidence survives process exit for the tune/readiness loop. The in-memory eventBus emit is unchanged (back-compat). When absent, behavior is byte-identical to before.

engine
readonly engine: IPolicyEngine;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:42

Only listRules() is consumed, so the interface — not the class — suffices.

eventBus?
readonly optional eventBus?: IEventBus;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:43

mode?
readonly optional mode?: PipelinePolicyMode;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:44


PolicyRule

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:83

A policy rule with priority-ordered evaluation.

Properties

id
readonly id: string;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:84

priority
readonly priority: number;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:85

Methods

evaluate()
evaluate(context): PolicyDecision;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:86

Parameters
context

PolicyContext

Returns

PolicyDecision


ProvenanceEntry

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:41

Provenance entry for artifact traceability.

Properties

artifactId
readonly artifactId: string;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:42

inputArtifacts
readonly inputArtifacts: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:45

plugin
readonly plugin: string;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:43

timestamp
readonly timestamp: number;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:44


QaReviewResult

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:200

QA review result.

Properties

coverage?
readonly optional coverage?: QaReviewCoverage;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:211

Portion of the implementation the reviewer actually consumed. ABSENT when the whole artifact was reviewed; present with partial: true when the implementation exceeded the prompt budget. Without this the verdict was byte-identical for a 500-char and a 500,000-char implementation (#4140 shape, applied to QA).

feedback
readonly feedback: string;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:202

issues
readonly issues: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:203

verdict
readonly verdict: "reject" | "pass" | "needs_work";

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:201


ResearchTriggerConfig

Defined in: packages/nexus-agents/src/pipeline/research-trigger.ts:23

Configuration for research trigger behavior.

Properties

existingTaskIds?
readonly optional existingTaskIds?: ReadonlySet<string>;

Defined in: packages/nexus-agents/src/pipeline/research-trigger.ts:31

Known task IDs to skip (dedup).

maxTriggers?
readonly optional maxTriggers?: number;

Defined in: packages/nexus-agents/src/pipeline/research-trigger.ts:27

Max tasks per invocation. Default: 3

qualityThreshold?
readonly optional qualityThreshold?: number;

Defined in: packages/nexus-agents/src/pipeline/research-trigger.ts:25

Minimum quality score to trigger (0-10). Default: 7

topic?
readonly optional topic?: string;

Defined in: packages/nexus-agents/src/pipeline/research-trigger.ts:29

Topic filter for research_discover.


ResolvedPipelineDeps

Defined in: packages/nexus-agents/src/pipeline/pipeline-deps.ts:38

Fully-resolved pipeline dependencies — every field concrete.

Properties

pluginRegistry
readonly pluginRegistry: IPluginRegistry;

Defined in: packages/nexus-agents/src/pipeline/pipeline-deps.ts:39


StageCompletedOptions

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:26

Options for emitting a stage completed event.

Properties

bus?
readonly optional bus?: IEventBus;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:27

durationMs
readonly durationMs: number;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:30

executionId
readonly executionId: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:28

stageId
readonly stageId: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:29

success?
readonly optional success?: boolean;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:31


StageContext

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:71

Runtime context passed to plugins during stage execution. Plugins communicate only via artifacts and events.

Properties

config
readonly config: Record<string, unknown>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:77

Stage configuration from the plan.

signal
readonly signal: AbortSignal;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:73

Abort signal for cancellation.

task
readonly task: Readonly<TaskContract>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:75

Task contract for reference (read-only).


StageFailedOptions

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:35

Options for emitting a stage failed event.

Properties

bus?
readonly optional bus?: IEventBus;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:36

error
readonly error: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:39

executionId
readonly executionId: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:37

model?
readonly optional model?: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:44

Concrete model id the failing stage’s executor reported, when known (#4194). Omit for stages with no single model — never guess.

stageId
readonly stageId: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:38


StageOutput

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:33

Result of executing a single pipeline stage.

Properties

durationMs
readonly durationMs: number;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:39

Duration in milliseconds.

error?
readonly optional error?: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:43

Error message if failed.

stateKey
readonly stateKey: string;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:35

The key to store this stage’s output under in pipeline state.

success
readonly success: boolean;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:41

Whether the stage succeeded.

value
readonly value: unknown;

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:37

The output value (stored in GraphState).


StageStartedOptions

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:18

Options for emitting a stage started event.

Extends

  • StageStartProvenance

Properties

bus?
readonly optional bus?: IEventBus;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:19

callerTrustTier?
readonly optional callerTrustTier?: string;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:106

Inherited from
StageStartProvenance.callerTrustTier
executionId
readonly executionId: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:20

inputSanitization?
readonly optional inputSanitization?: "unmeasured" | "modified" | "unmodified";

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:109

Inherited from
StageStartProvenance.inputSanitization
inputSanitizationCounts?
readonly optional inputSanitizationCounts?: {
  commentsRemoved: number;
  fieldsModified: number;
  tagsRemoved: number;
};

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:110

commentsRemoved
readonly commentsRemoved: number;
fieldsModified
readonly fieldsModified: number;
tagsRemoved
readonly tagsRemoved: number;
Inherited from
StageStartProvenance.inputSanitizationCounts
pluginId?
readonly optional pluginId?: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:22

stageId
readonly stageId: string;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:21

trustTier?
readonly optional trustTier?: string;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:108

Deprecated alias retained for existing stage-entry consumers.

Inherited from
StageStartProvenance.trustTier

TaskClassification

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:56

Classification of a task for template routing.

Properties

complexity
readonly complexity: "simple" | "complex" | "moderate";

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:58

confidence
readonly confidence: number;

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:59

keywords
readonly keywords: readonly string[];

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:60

pipelineType
readonly pipelineType: PipelineType;

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:57


ToolCompletedEvent

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:243

Extends

  • BaseEvent

Properties

durationMs
readonly durationMs: number;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:247

errorMessage?
readonly optional errorMessage?: string;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:249

invocationId
readonly invocationId: string;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:246

success
readonly success: boolean;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:248

timestamp
readonly timestamp: number;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:56

Inherited from
BaseEvent.timestamp
toolName
readonly toolName: string;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:245

type
readonly type: "tool.completed";

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:244


ToolInvokedEvent

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:237

MCP tool lifecycle events (Issue #1186).

Extends

  • BaseEvent

Properties

invocationId
readonly invocationId: string;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:240

timestamp
readonly timestamp: number;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:56

Inherited from
BaseEvent.timestamp
toolName
readonly toolName: string;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:239

type
readonly type: "tool.invoked";

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:238


V2Config

Defined in: packages/nexus-agents/src/pipeline/v2-config.ts:19

Resolved V2 configuration.

Properties

aorchestraEnabled
readonly aorchestraEnabled: boolean;

Defined in: packages/nexus-agents/src/pipeline/v2-config.ts:29

Whether AOrchestra dynamic agent planning is enabled (Issue #935).

delegateEnabled
readonly delegateEnabled: boolean;

Defined in: packages/nexus-agents/src/pipeline/v2-config.ts:23

Whether delegate_to_model uses V2 pipeline.

dispatchEnabled
readonly dispatchEnabled: boolean;

Defined in: packages/nexus-agents/src/pipeline/v2-config.ts:31

Whether AOrchestra worker dispatch is enabled (Issue #1321).

mode
readonly mode: V2Mode;

Defined in: packages/nexus-agents/src/pipeline/v2-config.ts:21

Overall V2 mode.

orchestrateEnabled
readonly orchestrateEnabled: boolean;

Defined in: packages/nexus-agents/src/pipeline/v2-config.ts:25

Whether orchestrate uses V2 pipeline.

policyMode
readonly policyMode: "warn" | "off" | "block";

Defined in: packages/nexus-agents/src/pipeline/v2-config.ts:27

Policy enforcement mode.

Type Aliases

ArtifactRef

type ArtifactRef = z.infer<typeof ArtifactRefSchema>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:199


ArtifactType

type ArtifactType = typeof ARTIFACT_TYPES[number];

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:57


CheckpointPipelineStage

type CheckpointPipelineStage = "research" | "plan" | "vote" | "decompose" | "implement" | "security";

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:27

Stages that can be checkpointed.


CostEstimate

type CostEstimate = z.infer<typeof CostEstimateSchema>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:198


EventHandler

type EventHandler = (event) => void;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:314

Event handler callback.

Parameters

event

PipelineEvent

Returns

void


PipelineEdge

type PipelineEdge = 
  | {
  from: string;
  to: string;
  type: "fixed";
}
  | {
  from: string;
  routerKey: string;
  targets: readonly string[];
  type: "conditional";
};

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:61

Edge definition in a pipeline template.


PipelineEvent

type PipelineEvent = 
  | TaskCreatedEvent
  | TaskStatusChangedEvent
  | TaskCompletedEvent
  | TaskFailedEvent
  | PipelineStartedEvent
  | PipelineCompletedEvent
  | PipelineCheckpointEvent
  | StageStartedEvent
  | StageCompletedEvent
  | StageFailedEvent
  | StageRetryingEvent
  | PolicyEvaluatedEvent
  | ArtifactCreatedEvent
  | ModelCalledEvent
  | RoutingDecisionEvent
  | ToolInvokedEvent
  | ToolCompletedEvent
  | WaveStartedEvent
  | WaveCompletedEvent
  | FitnessDeclinedSignalEvent
  | SwarmUnhealthySignalEvent
  | VoteRejectedSignalEvent;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:277

Discriminated union of all pipeline events.


PipelineEventType

type PipelineEventType = typeof PIPELINE_EVENT_TYPES[number];

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:48


PipelineMode

type PipelineMode = "autonomous" | "harness";

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:404

Pipeline execution mode.


PipelinePolicyMode

type PipelinePolicyMode = "off" | "warn" | "block";

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:37

Policy enforcement mode.


PipelineRole

type PipelineRole = "researcher" | "architect" | "pm" | "coder" | "qa" | "security";

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:73

Agent roles used in the pipeline.


PipelineStageData

type PipelineStageData = 
  | {
  text: string;
  type: "research";
}
  | {
  iterations: number;
  text: string;
  type: "plan";
}
  | {
  approved: boolean;
  caveats?: readonly string[];
  conditional: boolean;
  conditions?: readonly string[];
  iterations: number;
  type: "vote";
}
  | {
  tasks: readonly PipelineTask[];
  type: "decompose";
}
  | {
  tasks: readonly PipelineTask[];
  type: "implement";
}
  | {
  passed: boolean;
  type: "security";
};

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:38

Discriminated union of stage data.


PipelineType

type PipelineType = "dev" | "research" | "audit" | "greenfield" | "general";

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:64

Pipeline type derived from task analysis.


PlanContract

type PlanContract = z.infer<typeof PlanContractSchema>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:195


PluginManifest

type PluginManifest = z.infer<typeof PluginManifestSchema>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:62

Plugin manifest declaring identity and capabilities.


PluginTrustLevel

type PluginTrustLevel = typeof PLUGIN_TRUST_LEVELS[number];

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:32


PolicyDecision

type PolicyDecision = 
  | {
  allow: true;
}
  | {
  allow: false;
  escalateTo?: string;
  reason: string;
};

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:22

Decision returned by a policy rule evaluation.


PolicyGateSpec

type PolicyGateSpec = z.infer<typeof PolicyGateSpecSchema>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:197


RegistrationError

type RegistrationError = 
  | {
  pluginId: string;
  type: "duplicate_id";
}
  | {
  message: string;
  type: "invalid_manifest";
}
  | {
  capability: string;
  type: "missing_capability";
}
  | {
  message: string;
  type: "validation_failed";
}
  | {
  type: "registry_frozen";
};

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:122

Registration error when adding a plugin to the registry.


StageRegistry

type StageRegistry = ReadonlyMap<string, IPipelineStage>;

Defined in: packages/nexus-agents/src/pipeline/pipeline-graph.ts:33

Map of stage ID → stage implementation.


StageResult

type StageResult = z.infer<typeof StageResultSchema>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:65

Result of a plugin stage execution.


StageSpec

type StageSpec = z.infer<typeof StageSpecSchema>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:196


StageType

type StageType = typeof STAGE_TYPES[number];

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:56


TaskContract

type TaskContract = z.infer<typeof TaskContractSchema>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:194


TaskStatus

type TaskStatus = typeof TASK_STATUSES[number];

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:55


Unsubscribe

type Unsubscribe = () => void;

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:317

Unsubscribe function returned by subscribe.

Returns

void


V2Mode

type V2Mode = "off" | "partial" | "full";

Defined in: packages/nexus-agents/src/pipeline/v2-config.ts:16

V2 umbrella mode.


VoteResult

type VoteResult = 
  | {
  approvalPercentage: number;
  kind: "approved";
}
  | {
  approvalPercentage: number;
  feedback: string;
  kind: "rejected";
}
  | {
  approvalPercentage: number;
  caveats: readonly string[];
  conditions: readonly string[];
  kind: "conditional_go";
}
  | {
  approvalPercentage: number;
  kind: "no_quorum";
  reason: string;
};

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:98

Vote result from consensus — discriminated union with conditional approval support.

Variables

ARTIFACT_TYPES

const ARTIFACT_TYPES: readonly ["code", "review", "plan", "test", "report", "vote", "spec", "analysis"];

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:40

All valid artifact types.


ArtifactRefSchema

const ArtifactRefSchema: ZodObject<{
  id: ZodString;
  type: ZodEnum<{
     analysis: "analysis";
     code: "code";
     plan: "plan";
     report: "report";
     review: "review";
     spec: "spec";
     test: "test";
     vote: "vote";
  }>;
}, $strip>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:115

Reference to an artifact by ID and type.


AUDIT_PIPELINE_TEMPLATE

const AUDIT_PIPELINE_TEMPLATE: PipelineTemplate;

Defined in: packages/nexus-agents/src/pipeline/templates.ts:29

Security audit pipeline: analyze → scan → report.


BUILT_IN_RULES

const BUILT_IN_RULES: readonly PolicyRule[];

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:206

All built-in policy rules.


CORE_PLUGINS

const CORE_PLUGINS: readonly PipelinePlugin[];

Defined in: packages/nexus-agents/src/pipeline/core-plugins.ts:105

All core plugins in registration order.


CostEstimateSchema

const CostEstimateSchema: ZodObject<{
  estimatedCostUsd: ZodNumber;
  modelCalls: ZodNumber;
  totalTokensIn: ZodNumber;
  totalTokensOut: ZodNumber;
}, $strip>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:172

Cost estimate for a pipeline execution plan.


DEV_PIPELINE_TEMPLATE

const DEV_PIPELINE_TEMPLATE: PipelineTemplate;

Defined in: packages/nexus-agents/src/pipeline/templates.ts:17

Development pipeline: research → plan → vote → decompose → implement → qa → security.


GENERAL_PIPELINE_TEMPLATE

const GENERAL_PIPELINE_TEMPLATE: PipelineTemplate;

Defined in: packages/nexus-agents/src/pipeline/templates.ts:65

General-purpose pipeline for tasks that don’t match a specific template. Includes security gate (fail-safe: unclassified tasks must not bypass security).


PIPELINE_EVENT_TYPES

const PIPELINE_EVENT_TYPES: readonly ["task.created", "task.status_changed", "task.completed", "task.failed", "pipeline.started", "pipeline.completed", "pipeline.checkpoint", "stage.started", "stage.completed", "stage.failed", "stage.retrying", "policy.evaluated", "artifact.created", "model.called", "routing.decision", "tool.invoked", "tool.completed", "wave.started", "wave.completed", "signal.fitness_declined", "signal.swarm_unhealthy", "signal.vote_rejected"];

Defined in: packages/nexus-agents/src/pipeline/event-types.ts:18

All valid pipeline event types.


PIPELINE_STATE_KEYS

const PIPELINE_STATE_KEYS: {
  COMPLETED: "completed";
  FINDINGS: "findings";
  IMPLEMENTATIONS: "implementations";
  PARSED_SPEC: "parsedSpec";
  PLAN: "plan";
  QA_ITERATIONS: "qaIterations";
  RESEARCH: "research";
  SCAFFOLD_OUTPUT: "scaffoldOutput";
  SECURITY_PASSED: "securityPassed";
  TASK: "task";
  TASKS: "tasks";
  VOTE_FEEDBACK: "voteFeedback";
  VOTE_ITERATIONS: "voteIterations";
  VOTE_RESULT: "voteResult";
};

Defined in: packages/nexus-agents/src/pipeline/stage-types.ts:89

Standard state keys used across pipeline templates.

Type Declaration

COMPLETED
readonly COMPLETED: "completed" = 'completed';
FINDINGS
readonly FINDINGS: "findings" = 'findings';
IMPLEMENTATIONS
readonly IMPLEMENTATIONS: "implementations" = 'implementations';
PARSED_SPEC
readonly PARSED_SPEC: "parsedSpec" = 'parsedSpec';
PLAN
readonly PLAN: "plan" = 'plan';
QA_ITERATIONS
readonly QA_ITERATIONS: "qaIterations" = 'qaIterations';
RESEARCH
readonly RESEARCH: "research" = 'research';
SCAFFOLD_OUTPUT
readonly SCAFFOLD_OUTPUT: "scaffoldOutput" = 'scaffoldOutput';
SECURITY_PASSED
readonly SECURITY_PASSED: "securityPassed" = 'securityPassed';
TASK
readonly TASK: "task" = 'task';
TASKS
readonly TASKS: "tasks" = 'tasks';
VOTE_FEEDBACK
readonly VOTE_FEEDBACK: "voteFeedback" = 'voteFeedback';
VOTE_ITERATIONS
readonly VOTE_ITERATIONS: "voteIterations" = 'voteIterations';
VOTE_RESULT
readonly VOTE_RESULT: "voteResult" = 'voteResult';

PIPELINE_TEMPLATES

const PIPELINE_TEMPLATES: ReadonlyMap<string, PipelineTemplate>;

Defined in: packages/nexus-agents/src/pipeline/templates.ts:83

All available pipeline templates.


PlanContractSchema

const PlanContractSchema: ZodObject<{
  approvalRequired: ZodBoolean;
  estimatedCost: ZodObject<{
     estimatedCostUsd: ZodNumber;
     modelCalls: ZodNumber;
     totalTokensIn: ZodNumber;
     totalTokensOut: ZodNumber;
  }, $strip>;
  maxIterations: ZodNumber;
  policyGates: ZodArray<ZodObject<{
     afterStage: ZodString;
     beforeStage: ZodString;
     id: ZodString;
     rules: ZodArray<ZodString>;
  }, $strip>>;
  stages: ZodArray<ZodObject<{
     config: ZodRecord<ZodString, ZodUnknown>;
     dependencies: ZodArray<ZodString>;
     id: ZodString;
     inputArtifacts: ZodArray<ZodString>;
     maxRetries: ZodOptional<ZodNumber>;
     outputArtifacts: ZodArray<ZodString>;
     pluginId: ZodString;
     preferredCli: ZodOptional<ZodString>;
     timeoutMs: ZodOptional<ZodNumber>;
     type: ZodEnum<{
        aggregate: "aggregate";
        analyze: "analyze";
        execute: "execute";
        gate: "gate";
        route: "route";
        validate: "validate";
     }>;
  }, $strip>>;
  taskId: ZodString;
  timeoutMs: ZodNumber;
}, $strip>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:180

Execution plan contract.


PLUGIN_TRUST_LEVELS

const PLUGIN_TRUST_LEVELS: readonly ["core", "standard", "experimental", "external"];

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:21

All valid plugin trust levels.


PluginManifestSchema

const PluginManifestSchema: ZodObject<{
  description: ZodString;
  experimental: ZodBoolean;
  id: ZodString;
  requiredCapabilities: ZodArray<ZodString>;
  stages: ZodArray<ZodEnum<{
     aggregate: "aggregate";
     analyze: "analyze";
     execute: "execute";
     gate: "gate";
     route: "route";
     validate: "validate";
  }>>;
  trustLevel: ZodEnum<{
     core: "core";
     experimental: "experimental";
     external: "external";
     standard: "standard";
  }>;
  version: ZodString;
}, $strip>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:39

Schema for plugin manifests.


PolicyGateSpecSchema

const PolicyGateSpecSchema: ZodObject<{
  afterStage: ZodString;
  beforeStage: ZodString;
  id: ZodString;
  rules: ZodArray<ZodString>;
}, $strip>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:164

Policy gate inserted between pipeline stages.

NOTE on enforcement (#4019): the gate’s effective enforcement mode is resolved SOLELY by the runtime enforcement bundle — GatePolicyEnforcement.mode (or NEXUS_POLICY_GATE_MODE, warn-by-default per #3177). There is intentionally NO per-gate fail-action field here: the former onFail enum was inert (consumed nowhere — verified) and required every gate to declare a fail action that did nothing, so authoring onFail:'block' gave a false sense of enforcement. Removed (7/0 higher_order vote) so the contract cannot promise enforcement the runtime won’t deliver. Set the enforcement mode to make a gate block.


STAGE_TYPES

const STAGE_TYPES: readonly ["analyze", "route", "execute", "validate", "aggregate", "gate"];

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:30

All valid pipeline stage types.


StageResultSchema

const StageResultSchema: ZodObject<{
  error: ZodOptional<ZodString>;
  metadata: ZodRecord<ZodString, ZodUnknown>;
  outputArtifacts: ZodArray<ZodObject<{
     id: ZodString;
     type: ZodEnum<{
        analysis: "analysis";
        code: "code";
        plan: "plan";
        report: "report";
        review: "review";
        spec: "spec";
        test: "test";
        vote: "vote";
     }>;
  }, $strip>>;
  success: ZodBoolean;
}, $strip>;

Defined in: packages/nexus-agents/src/pipeline/plugin-types.ts:50

Schema for stage execution results.


StageSpecSchema

const StageSpecSchema: ZodObject<{
  config: ZodRecord<ZodString, ZodUnknown>;
  dependencies: ZodArray<ZodString>;
  id: ZodString;
  inputArtifacts: ZodArray<ZodString>;
  maxRetries: ZodOptional<ZodNumber>;
  outputArtifacts: ZodArray<ZodString>;
  pluginId: ZodString;
  preferredCli: ZodOptional<ZodString>;
  timeoutMs: ZodOptional<ZodNumber>;
  type: ZodEnum<{
     aggregate: "aggregate";
     analyze: "analyze";
     execute: "execute";
     gate: "gate";
     route: "route";
     validate: "validate";
  }>;
}, $strip>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:139

Pipeline stage specification.


TASK_STATUSES

const TASK_STATUSES: readonly ["intake", "clarifying", "planning", "approved", "executing", "validating", "done", "failed"];

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:18

All valid task lifecycle statuses.


TaskContractSchema

const TaskContractSchema: ZodObject<{
  analysis: ZodObject<{
     ambiguityScore: ZodNumber;
     complexity: ZodString;
     taskType: ZodString;
  }, $strip>;
  artifacts: ZodArray<ZodObject<{
     id: ZodString;
     type: ZodEnum<{
        analysis: "analysis";
        code: "code";
        plan: "plan";
        report: "report";
        review: "review";
        spec: "spec";
        test: "test";
        vote: "vote";
     }>;
  }, $strip>>;
  capabilityGaps: ZodObject<{
     allSatisfied: ZodBoolean;
     available: ZodObject<{
        experts: ZodArray<ZodString>;
        tools: ZodArray<ZodString>;
     }, $strip>;
     gaps: ZodArray<ZodUnknown>;
     gapsMeasured: ZodBoolean;
  }, $strip>;
  completedAt: ZodOptional<ZodNumber>;
  constraints: ZodObject<{
     quality: ZodOptional<ZodString>;
     scope: ZodArray<ZodString>;
     time: ZodOptional<ZodString>;
  }, $strip>;
  createdAt: ZodNumber;
  description: ZodString;
  error: ZodOptional<ZodString>;
  id: ZodString;
  metadata: ZodRecord<ZodString, ZodUnknown>;
  parentId: ZodOptional<ZodString>;
  requiredCapabilities: ZodObject<{
     experts: ZodArray<ZodString>;
     tools: ZodArray<ZodString>;
  }, $strip>;
  status: ZodEnum<{
     approved: "approved";
     clarifying: "clarifying";
     done: "done";
     executing: "executing";
     failed: "failed";
     intake: "intake";
     planning: "planning";
     validating: "validating";
  }>;
  updatedAt: ZodNumber;
}, $strip>;

Defined in: packages/nexus-agents/src/pipeline/task-contract.ts:121

Unified task lifecycle contract.

Functions

checkForResearchTriggers()

function checkForResearchTriggers(config?): Promise<PipelineTask[]>;

Defined in: packages/nexus-agents/src/pipeline/research-trigger.ts:187

Check for research discoveries and convert high-quality ones to pipeline tasks.

Calls research_discover via expert-bridge, filters by quality threshold, deduplicates against known tasks, and rate-limits output.

Returns empty array when expert-bridge is unavailable (graceful degradation).

Parameters

config?

ResearchTriggerConfig = {}

Returns

Promise<PipelineTask[]>


checkPipelinePolicy()

function checkPipelinePolicy(task, stageType): PolicyEvalResult;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:195

Evaluates pipeline policy before execution. Builds PolicyContext from TaskContract metadata and stage type. Uses the default PolicyEngine, whose BUILT_IN_RULES is the single trustTierRule. The four siblings that once sat beside it were removed as unwired (policy-engine.ts), so no cost, security or high-risk gate runs on this path.

Parameters

task
analysis

{ ambiguityScore: number; complexity: string; taskType: string; } = TaskAnalysisSummarySchema

analysis.ambiguityScore

number = ...

analysis.complexity

string = ...

analysis.taskType

string = ...

artifacts

{ id: string; type: | "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote"; }[] = ...

capabilityGaps

{ allSatisfied: boolean; available: { experts: string[]; tools: string[]; }; gaps: unknown[]; gapsMeasured: boolean; } = CapabilityGapSummarySchema

capabilityGaps.allSatisfied

boolean = ...

Meaningful ONLY when gapsMeasured is true. gaps: [] from a detector that ran and gaps: [] from a builder that never called one are byte-identical on the wire; this field is what tells them apart.

capabilityGaps.available

{ experts: string[]; tools: string[]; } = ...

capabilityGaps.available.experts

string[] = ...

capabilityGaps.available.tools

string[] = ...

capabilityGaps.gaps

unknown[] = ...

capabilityGaps.gapsMeasured

boolean = ...

Whether a capability-gap detector actually ran (#5919).

buildBaseTaskContract writes allSatisfied: true with an EMPTY available set — a verdict from a detector that never ran, on the orchestrate and delegate_to_model paths. Nothing reads it today, which is camouflage rather than safety: it is the same shape as #5896’s ValidationHarness, where a missing consumer let a hard-coded verdict sit until someone eventually trusted it.

Named for the vocabulary this repo already uses for exactly this — tokensMeasured, policyEvaluated, routerTypeMeasured. A consumer that needs a real answer must branch on this, not on allSatisfied alone.

completedAt?

number = ...

constraints

{ quality?: string; scope: string[]; time?: string; } = TaskConstraintsSummarySchema

constraints.quality?

string = ...

constraints.scope

string[] = ...

constraints.time?

string = ...

createdAt

number = ...

description

string = ...

error?

string = ...

id

string = ...

metadata

Record<string, unknown> = ...

parentId?

string = ...

requiredCapabilities

{ experts: string[]; tools: string[]; } = RequiredCapabilitiesSummarySchema

requiredCapabilities.experts

string[] = ...

requiredCapabilities.tools

string[] = ...

status

| "failed" | "planning" | "done" | "approved" | "executing" | "intake" | "clarifying" | "validating" = ...

updatedAt

number = ...

stageType

string

Returns

PolicyEvalResult


checkpointToResult()

function checkpointToResult(state): Partial<DevPipelineResult>;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:292

Build a DevPipelineResult from checkpoint state (for resume scenarios).

Parameters

state

PipelineCheckpointState

Returns

Partial<DevPipelineResult>


classifyTask()

function classifyTask(task): TaskClassification;

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:155

Classify a task for pipeline routing.

Parameters

task

string

Returns

TaskClassification


cleanupCheckpoint()

function cleanupCheckpoint(sessionId, customDir?): boolean;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:280

Delete checkpoint file on successful completion.

Parameters

sessionId

string

customDir?

string

Returns

boolean


compilePipelineGraph()

function compilePipelineGraph(
   template, 
   stages, 
   options?
): PipelineGraphResult;

Defined in: packages/nexus-agents/src/pipeline/pipeline-graph.ts:78

Compile a pipeline template + stages into an executable graph.

Each IPipelineStage is wrapped as a GraphBuilder node handler. Linear edges are auto-generated from template.stages order. Custom edges override the linear flow for feedback loops.

Parameters

template

PipelineTemplate

stages

StageRegistry

options?

PipelineGraphCompileOptions

Returns

PipelineGraphResult


compilePlan()

function compilePlan(plan, options?): CompileResult;

Defined in: packages/nexus-agents/src/pipeline/plan-compiler.ts:56

Compiles a PlanContract into a CompiledGraph.

  • Each stage becomes a node with a handler (plugin-backed or placeholder)
  • Dependencies become fixed edges
  • Policy gates become gate nodes between stages
  • Stages with no dependencies get edges from START
  • Stages with no dependents get edges to END

Parameters

plan
approvalRequired

boolean = ...

estimatedCost

{ estimatedCostUsd: number; modelCalls: number; totalTokensIn: number; totalTokensOut: number; } = CostEstimateSchema

estimatedCost.estimatedCostUsd

number = ...

estimatedCost.modelCalls

number = ...

estimatedCost.totalTokensIn

number = ...

estimatedCost.totalTokensOut

number = ...

maxIterations

number = ...

policyGates

{ afterStage: string; beforeStage: string; id: string; rules: string[]; }[] = ...

stages

{ config: Record<string, unknown>; dependencies: string[]; id: string; inputArtifacts: string[]; maxRetries?: number; outputArtifacts: string[]; pluginId: string; preferredCli?: string; timeoutMs?: number; type: "analyze" | "validate" | "execute" | "route" | "aggregate" | "gate"; }[] = ...

taskId

string = ...

timeoutMs

number = ...

options?

PlanCompileOptions

Returns

CompileResult


createAgentStages()

function createAgentStages(config?): DevPipelineStages;

Defined in: packages/nexus-agents/src/pipeline/agent-executor.ts:50

Parameters

config?

AgentExecutorConfig = {}

Returns

DevPipelineStages


createCorePluginRegistry()

function createCorePluginRegistry(): PluginRegistry;

Defined in: packages/nexus-agents/src/pipeline/core-plugins.ts:151

Creates a PluginRegistry with core plugins pre-registered and frozen. Convenience function for server startup.

Returns

PluginRegistry


createDefaultPolicyEngine()

function createDefaultPolicyEngine(): PolicyEngine;

Defined in: packages/nexus-agents/src/pipeline/policy-engine.ts:211

Creates a PolicyEngine with all built-in rules registered.

Returns

PolicyEngine


createDelegatePipeline()

function createDelegatePipeline(task): DelegatePipelineResult;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:71

Creates a compiled V2 pipeline for delegate_to_model from a TaskContract.

The pipeline has a single ‘route’ stage and no policy gate (#4657), so the compile call passes no policyEnforcement bundle: with zero gates there is no node that would consult one, and supplying it read as “policy enforced at the stage boundary” when nothing was. Routing logic lives in the stage handler (placeholder here, real handler injected by the MCP tool).

Parameters

task
analysis

{ ambiguityScore: number; complexity: string; taskType: string; } = TaskAnalysisSummarySchema

analysis.ambiguityScore

number = ...

analysis.complexity

string = ...

analysis.taskType

string = ...

artifacts

{ id: string; type: | "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote"; }[] = ...

capabilityGaps

{ allSatisfied: boolean; available: { experts: string[]; tools: string[]; }; gaps: unknown[]; gapsMeasured: boolean; } = CapabilityGapSummarySchema

capabilityGaps.allSatisfied

boolean = ...

Meaningful ONLY when gapsMeasured is true. gaps: [] from a detector that ran and gaps: [] from a builder that never called one are byte-identical on the wire; this field is what tells them apart.

capabilityGaps.available

{ experts: string[]; tools: string[]; } = ...

capabilityGaps.available.experts

string[] = ...

capabilityGaps.available.tools

string[] = ...

capabilityGaps.gaps

unknown[] = ...

capabilityGaps.gapsMeasured

boolean = ...

Whether a capability-gap detector actually ran (#5919).

buildBaseTaskContract writes allSatisfied: true with an EMPTY available set — a verdict from a detector that never ran, on the orchestrate and delegate_to_model paths. Nothing reads it today, which is camouflage rather than safety: it is the same shape as #5896’s ValidationHarness, where a missing consumer let a hard-coded verdict sit until someone eventually trusted it.

Named for the vocabulary this repo already uses for exactly this — tokensMeasured, policyEvaluated, routerTypeMeasured. A consumer that needs a real answer must branch on this, not on allSatisfied alone.

completedAt?

number = ...

constraints

{ quality?: string; scope: string[]; time?: string; } = TaskConstraintsSummarySchema

constraints.quality?

string = ...

constraints.scope

string[] = ...

constraints.time?

string = ...

createdAt

number = ...

description

string = ...

error?

string = ...

id

string = ...

metadata

Record<string, unknown> = ...

parentId?

string = ...

requiredCapabilities

{ experts: string[]; tools: string[]; } = RequiredCapabilitiesSummarySchema

requiredCapabilities.experts

string[] = ...

requiredCapabilities.tools

string[] = ...

status

| "failed" | "planning" | "done" | "approved" | "executing" | "intake" | "clarifying" | "validating" = ...

updatedAt

number = ...

Returns

DelegatePipelineResult


createDevStageRegistry()

function createDevStageRegistry(stages): Map<string, IPipelineStage>;

Defined in: packages/nexus-agents/src/pipeline/stage-wrappers.ts:328

Create a complete stage registry for the dev pipeline template.

Parameters

stages

DevPipelineStages

Returns

Map<string, IPipelineStage>


createEventBusBridge()

function createEventBusBridge(options): PipelineBridgeResult;

Defined in: packages/nexus-agents/src/pipeline/event-bus-bridge.ts:85

Creates a bridge that forwards V2 pipeline events to the V1 agent EventBus.

Each V2 event is converted to a V1 DomainEvent with:

  • topic: {prefix}.{v2EventType} (e.g. pipeline.task.created)
  • payload: all V2 event fields except type/timestamp
  • correlationId: executionId or taskId from V2 event

The bridge is fire-and-forget: forwarding errors are logged, not thrown.

Parameters

options

EventBusBridgeOptions

Returns

PipelineBridgeResult


createFeedbackSubscriber()

function createFeedbackSubscriber(bus, store): Unsubscribe;

Defined in: packages/nexus-agents/src/pipeline/feedback-subscriber.ts:54

Creates a subscriber that bridges EventBus events to OutcomeStore.

Listens for stage.failed events and records them as failed TaskOutcome entries in the OutcomeStore.

Returns an Unsubscribe handle; the caller owns the lifecycle.

There is deliberately no server-wide singleton. #2938 added a startFeedbackSubscriber / shutdownFeedbackSubscriber pair, and #5003’s panel then removed this bridge from the server: StageFailedEvent carries no cli, so the subscriber hardcoded cli: 'claude' on every stage failure and double-counted against agent-executor, which is now the single canonical outcome writer. The start half was dropped from initV2PipelineSubsystems and the pair was left behind — shutdown still called from cli-server.ts as an unconditional no-op, and the init log still reporting feedbackSubscriber: 'active'. Both are gone; this function stays because it is public API for SDK embedders who DO manage their own store.

Parameters

bus

IEventBus

store

OutcomeStore

Returns

Unsubscribe

Unsubscribe function to stop the bridge.


delegateInputToTaskContract()

function delegateInputToTaskContract(input, opts?): {
  analysis: {
     ambiguityScore: number;
     complexity: string;
     taskType: string;
  };
  artifacts: {
     id: string;
     type:   | "code"
        | "analysis"
        | "test"
        | "spec"
        | "review"
        | "report"
        | "plan"
        | "vote";
  }[];
  capabilityGaps: {
     allSatisfied: boolean;
     available: {
        experts: string[];
        tools: string[];
     };
     gaps: unknown[];
     gapsMeasured: boolean;
  };
  completedAt?: number;
  constraints: {
     quality?: string;
     scope: string[];
     time?: string;
  };
  createdAt: number;
  description: string;
  error?: string;
  id: string;
  metadata: Record<string, unknown>;
  parentId?: string;
  requiredCapabilities: {
     experts: string[];
     tools: string[];
  };
  status:   | "failed"
     | "planning"
     | "done"
     | "approved"
     | "executing"
     | "intake"
     | "clarifying"
     | "validating";
  updatedAt: number;
};

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:122

Converts delegate_to_model input into a V2 TaskContract. Input fields are preserved in metadata for downstream pipeline stages.

Parameters

input

DelegateInputLike

opts?

DelegateContractOpts = {}

Returns

{
  analysis: {
     ambiguityScore: number;
     complexity: string;
     taskType: string;
  };
  artifacts: {
     id: string;
     type:   | "code"
        | "analysis"
        | "test"
        | "spec"
        | "review"
        | "report"
        | "plan"
        | "vote";
  }[];
  capabilityGaps: {
     allSatisfied: boolean;
     available: {
        experts: string[];
        tools: string[];
     };
     gaps: unknown[];
     gapsMeasured: boolean;
  };
  completedAt?: number;
  constraints: {
     quality?: string;
     scope: string[];
     time?: string;
  };
  createdAt: number;
  description: string;
  error?: string;
  id: string;
  metadata: Record<string, unknown>;
  parentId?: string;
  requiredCapabilities: {
     experts: string[];
     tools: string[];
  };
  status:   | "failed"
     | "planning"
     | "done"
     | "approved"
     | "executing"
     | "intake"
     | "clarifying"
     | "validating";
  updatedAt: number;
}
analysis
analysis: {
  ambiguityScore: number;
  complexity: string;
  taskType: string;
} = TaskAnalysisSummarySchema;
analysis.ambiguityScore
ambiguityScore: number;
analysis.complexity
complexity: string;
analysis.taskType
taskType: string;
artifacts
artifacts: {
  id: string;
  type:   | "code"
     | "analysis"
     | "test"
     | "spec"
     | "review"
     | "report"
     | "plan"
     | "vote";
}[];
capabilityGaps
capabilityGaps: {
  allSatisfied: boolean;
  available: {
     experts: string[];
     tools: string[];
  };
  gaps: unknown[];
  gapsMeasured: boolean;
} = CapabilityGapSummarySchema;
capabilityGaps.allSatisfied
allSatisfied: boolean;

Meaningful ONLY when gapsMeasured is true. gaps: [] from a detector that ran and gaps: [] from a builder that never called one are byte-identical on the wire; this field is what tells them apart.

capabilityGaps.available
available: {
  experts: string[];
  tools: string[];
};
capabilityGaps.available.experts
experts: string[];
capabilityGaps.available.tools
tools: string[];
capabilityGaps.gaps
gaps: unknown[];
capabilityGaps.gapsMeasured
gapsMeasured: boolean;

Whether a capability-gap detector actually ran (#5919).

buildBaseTaskContract writes allSatisfied: true with an EMPTY available set — a verdict from a detector that never ran, on the orchestrate and delegate_to_model paths. Nothing reads it today, which is camouflage rather than safety: it is the same shape as #5896’s ValidationHarness, where a missing consumer let a hard-coded verdict sit until someone eventually trusted it.

Named for the vocabulary this repo already uses for exactly this — tokensMeasured, policyEvaluated, routerTypeMeasured. A consumer that needs a real answer must branch on this, not on allSatisfied alone.

completedAt?
optional completedAt?: number;
constraints
constraints: {
  quality?: string;
  scope: string[];
  time?: string;
} = TaskConstraintsSummarySchema;
constraints.quality?
optional quality?: string;
constraints.scope
scope: string[];
constraints.time?
optional time?: string;
createdAt
createdAt: number;
description
description: string;
error?
optional error?: string;
id
id: string;
metadata
metadata: Record<string, unknown>;
parentId?
optional parentId?: string;
requiredCapabilities
requiredCapabilities: {
  experts: string[];
  tools: string[];
} = RequiredCapabilitiesSummarySchema;
requiredCapabilities.experts
experts: string[];
requiredCapabilities.tools
tools: string[];
status
status: 
  | "failed"
  | "planning"
  | "done"
  | "approved"
  | "executing"
  | "intake"
  | "clarifying"
  | "validating";
updatedAt
updatedAt: number;

emitPipelineStageEvent()

function emitPipelineStageEvent(
   prefix, 
   stage, 
   status, 
   details?
): void;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:187

Parameters

prefix

string

stage

string

status

"failed" | "completed" | "started"

details?

Record<string, unknown>

Returns

void


emitStageCompleted()

function emitStageCompleted(options): void;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:97

Emit a stage.completed event.

Parameters

options

StageCompletedOptions

Returns

void


emitStageFailed()

function emitStageFailed(options): void;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:111

Emit a stage.failed event.

Parameters

options

StageFailedOptions

Returns

void


emitStageStarted()

function emitStageStarted(options): void;

Defined in: packages/nexus-agents/src/pipeline/pipeline-observability.ts:76

Emit a stage.started event.

Parameters

options

StageStartedOptions

Returns

void


evaluatePipelinePolicy()

function evaluatePipelinePolicy(options, context): PolicyEvalResult;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:207

Evaluates all registered policy rules for a stage boundary.

In WARN mode, violations are logged and emitted but execution continues. In BLOCK mode, violations halt the pipeline. In OFF mode, evaluation is skipped entirely.

Parameters

options

PolicyEvaluatorOptions

context

PolicyContext

Returns

PolicyEvalResult


executeDelegatePipeline()

function executeDelegatePipeline(task): Promise<PipelineMetrics>;

Defined in: packages/nexus-agents/src/pipeline/v2-delegate.ts:161

Compiles and executes a V2 pipeline for the given TaskContract. Returns metrics for observability — never throws.

This path performs no route-stage policy evaluation (#5485): the only built-in rule denies execute stages, so such a check could not fail. The enforcing seams remain the execute check in v2-orchestrate.ts and enforceConsensusExecutePolicy in dev-pipeline.ts.

Parameters

task
analysis

{ ambiguityScore: number; complexity: string; taskType: string; } = TaskAnalysisSummarySchema

analysis.ambiguityScore

number = ...

analysis.complexity

string = ...

analysis.taskType

string = ...

artifacts

{ id: string; type: | "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote"; }[] = ...

capabilityGaps

{ allSatisfied: boolean; available: { experts: string[]; tools: string[]; }; gaps: unknown[]; gapsMeasured: boolean; } = CapabilityGapSummarySchema

capabilityGaps.allSatisfied

boolean = ...

Meaningful ONLY when gapsMeasured is true. gaps: [] from a detector that ran and gaps: [] from a builder that never called one are byte-identical on the wire; this field is what tells them apart.

capabilityGaps.available

{ experts: string[]; tools: string[]; } = ...

capabilityGaps.available.experts

string[] = ...

capabilityGaps.available.tools

string[] = ...

capabilityGaps.gaps

unknown[] = ...

capabilityGaps.gapsMeasured

boolean = ...

Whether a capability-gap detector actually ran (#5919).

buildBaseTaskContract writes allSatisfied: true with an EMPTY available set — a verdict from a detector that never ran, on the orchestrate and delegate_to_model paths. Nothing reads it today, which is camouflage rather than safety: it is the same shape as #5896’s ValidationHarness, where a missing consumer let a hard-coded verdict sit until someone eventually trusted it.

Named for the vocabulary this repo already uses for exactly this — tokensMeasured, policyEvaluated, routerTypeMeasured. A consumer that needs a real answer must branch on this, not on allSatisfied alone.

completedAt?

number = ...

constraints

{ quality?: string; scope: string[]; time?: string; } = TaskConstraintsSummarySchema

constraints.quality?

string = ...

constraints.scope

string[] = ...

constraints.time?

string = ...

createdAt

number = ...

description

string = ...

error?

string = ...

id

string = ...

metadata

Record<string, unknown> = ...

parentId?

string = ...

requiredCapabilities

{ experts: string[]; tools: string[]; } = RequiredCapabilitiesSummarySchema

requiredCapabilities.experts

string[] = ...

requiredCapabilities.tools

string[] = ...

status

| "failed" | "planning" | "done" | "approved" | "executing" | "intake" | "clarifying" | "validating" = ...

updatedAt

number = ...

Returns

Promise<PipelineMetrics>


executeExpert()

Execute with an optional working directory for the expert’s CLI subprocess, an optional signal that aborts the routed call (#6736), and an optional access mode (#6768).

Call Signature

function executeExpert(expertType, prompt): Promise<ExpertBridgeResult>;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:586

Execute an expert task with the full nexus-agents expert pipeline.

Creates a built-in expert, executes via CompositeRouter (for intelligent CLI routing), and records outcomes. Falls back gracefully on failure.

Parameters
expertType

BuiltInExpertType

Built-in expert type (code, architecture, security, qa, etc.)

prompt

string

Task prompt for the expert

Returns

Promise<ExpertBridgeResult>

Expert result with text output

Throws

TypeError when options.accessMode is not an ExecutionAccessMode

Call Signature

function executeExpert(
   expertType, 
   prompt, 
   options
): Promise<ExpertBridgeResult>;

Defined in: packages/nexus-agents/src/pipeline/expert-bridge.ts:590

Execute an expert task with the full nexus-agents expert pipeline.

Creates a built-in expert, executes via CompositeRouter (for intelligent CLI routing), and records outcomes. Falls back gracefully on failure.

Parameters
expertType

BuiltInExpertType

Built-in expert type (code, architecture, security, qa, etc.)

prompt

string

Task prompt for the expert

options
accessMode?

ExecutionAccessMode

Host access the expert’s call may use (#6768). Under 'read-only-analysis' or 'workspace-edit' (#6792) the expert gets no nexus-agents MCP config (an MCP server’s tools fall outside the mode’s allow list) and the router only selects an arm that enforces the mode.

signal?

AbortSignal

Aborts the routed CLI call (#6736): a stage deadline or a job cancel.

workDir?

string

Returns

Promise<ExpertBridgeResult>

Expert result with text output

Throws

TypeError when options.accessMode is not an ExecutionAccessMode


executeOrchestratePipeline()

function executeOrchestratePipeline(task): Promise<PipelineMetrics>;

Defined in: packages/nexus-agents/src/pipeline/v2-orchestrate.ts:73

Executes the V2 orchestrate pipeline and returns metrics.

Parameters

task
analysis

{ ambiguityScore: number; complexity: string; taskType: string; } = TaskAnalysisSummarySchema

analysis.ambiguityScore

number = ...

analysis.complexity

string = ...

analysis.taskType

string = ...

artifacts

{ id: string; type: | "code" | "analysis" | "test" | "spec" | "review" | "report" | "plan" | "vote"; }[] = ...

capabilityGaps

{ allSatisfied: boolean; available: { experts: string[]; tools: string[]; }; gaps: unknown[]; gapsMeasured: boolean; } = CapabilityGapSummarySchema

capabilityGaps.allSatisfied

boolean = ...

Meaningful ONLY when gapsMeasured is true. gaps: [] from a detector that ran and gaps: [] from a builder that never called one are byte-identical on the wire; this field is what tells them apart.

capabilityGaps.available

{ experts: string[]; tools: string[]; } = ...

capabilityGaps.available.experts

string[] = ...

capabilityGaps.available.tools

string[] = ...

capabilityGaps.gaps

unknown[] = ...

capabilityGaps.gapsMeasured

boolean = ...

Whether a capability-gap detector actually ran (#5919).

buildBaseTaskContract writes allSatisfied: true with an EMPTY available set — a verdict from a detector that never ran, on the orchestrate and delegate_to_model paths. Nothing reads it today, which is camouflage rather than safety: it is the same shape as #5896’s ValidationHarness, where a missing consumer let a hard-coded verdict sit until someone eventually trusted it.

Named for the vocabulary this repo already uses for exactly this — tokensMeasured, policyEvaluated, routerTypeMeasured. A consumer that needs a real answer must branch on this, not on allSatisfied alone.

completedAt?

number = ...

constraints

{ quality?: string; scope: string[]; time?: string; } = TaskConstraintsSummarySchema

constraints.quality?

string = ...

constraints.scope

string[] = ...

constraints.time?

string = ...

createdAt

number = ...

description

string = ...

error?

string = ...

id

string = ...

metadata

Record<string, unknown> = ...

parentId?

string = ...

requiredCapabilities

{ experts: string[]; tools: string[]; } = RequiredCapabilitiesSummarySchema

requiredCapabilities.experts

string[] = ...

requiredCapabilities.tools

string[] = ...

status

| "failed" | "planning" | "done" | "approved" | "executing" | "intake" | "clarifying" | "validating" = ...

updatedAt

number = ...

Returns

Promise<PipelineMetrics>


extractStateValue()

function extractStateValue(state, key): unknown;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:322

Reads one key out of the final pipeline state.

UNTYPED, which the header above used to deny — it promised “typed access to well-known state keys” (#5771). The well-known keys do exist (PIPELINE_STATE_KEYS in stage-types.ts), but this function does not use them: key is a bare string, so a typo compiles, and the return is unknown, so every caller narrows it itself. Narrowing the parameter to (typeof PIPELINE_STATE_KEYS)[keyof typeof PIPELINE_STATE_KEYS] would make the old header true, but this is published API and that is a breaking change — queued with the next-major batch rather than done here.

Returns undefined for a key the run never set, which is indistinguishable from a key set to undefined; a caller needing to tell those apart must inspect the state object directly. Falsy values come back as themselves.

Published (exports/pipeline.ts) and, as of #5771, with no consumer at all — not even a test. These assertions exist so the behaviour is pinned rather than merely exported.

Parameters

state

Readonly<Record<string, unknown>>

key

string

Returns

unknown


flushPipelineMemory()

function flushPipelineMemory(): void;

Defined in: packages/nexus-agents/src/pipeline/agent-executor-memory.ts:80

Flush pipeline memory session.

Returns

void


getPipelineArtifactStore()

function getPipelineArtifactStore(): IArtifactStore;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:189

Returns the global ArtifactStore (created lazily on first call).

Returns

IArtifactStore


getPipelinePluginRegistry()

function getPipelinePluginRegistry(): PluginRegistry;

Defined in: packages/nexus-agents/src/pipeline/core-plugins.ts:164

Returns the global PluginRegistry (created lazily on first call).

Returns

PluginRegistry


getPolicyMode()

function getPolicyMode(): PipelinePolicyMode;

Defined in: packages/nexus-agents/src/pipeline/policy-evaluator.ts:196

Reads policy mode from V2 config (umbrella + individual override). Default: block in full mode, warn in partial, off when V2 is off.

Returns

PipelinePolicyMode


getTemplate()

function getTemplate(id): PipelineTemplate | undefined;

Defined in: packages/nexus-agents/src/pipeline/templates.ts:99

Get a pipeline template by ID.

Parameters

id

string

Returns

PipelineTemplate | undefined


listTemplateIds()

function listTemplateIds(): readonly string[];

Defined in: packages/nexus-agents/src/pipeline/templates.ts:104

List all available template IDs.

Returns

readonly string[]


loadCheckpointState()

function loadCheckpointState(sessionId, customDir?): PipelineCheckpointState | null;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:125

Load checkpoint state for a session. Returns null if no checkpoints exist.

Parameters

sessionId

string

customDir?

string

Returns

PipelineCheckpointState | null


orchestrateInputToTaskContract()

function orchestrateInputToTaskContract(input, opts?): {
  analysis: {
     ambiguityScore: number;
     complexity: string;
     taskType: string;
  };
  artifacts: {
     id: string;
     type:   | "code"
        | "analysis"
        | "test"
        | "spec"
        | "review"
        | "report"
        | "plan"
        | "vote";
  }[];
  capabilityGaps: {
     allSatisfied: boolean;
     available: {
        experts: string[];
        tools: string[];
     };
     gaps: unknown[];
     gapsMeasured: boolean;
  };
  completedAt?: number;
  constraints: {
     quality?: string;
     scope: string[];
     time?: string;
  };
  createdAt: number;
  description: string;
  error?: string;
  id: string;
  metadata: Record<string, unknown>;
  parentId?: string;
  requiredCapabilities: {
     experts: string[];
     tools: string[];
  };
  status:   | "failed"
     | "planning"
     | "done"
     | "approved"
     | "executing"
     | "intake"
     | "clarifying"
     | "validating";
  updatedAt: number;
};

Defined in: packages/nexus-agents/src/pipeline/v2-orchestrate.ts:46

Converts orchestrate input to a TaskContract.

Parameters

input

OrchestrateInputLike

opts?

OrchestrateContractOpts = {}

Returns

{
  analysis: {
     ambiguityScore: number;
     complexity: string;
     taskType: string;
  };
  artifacts: {
     id: string;
     type:   | "code"
        | "analysis"
        | "test"
        | "spec"
        | "review"
        | "report"
        | "plan"
        | "vote";
  }[];
  capabilityGaps: {
     allSatisfied: boolean;
     available: {
        experts: string[];
        tools: string[];
     };
     gaps: unknown[];
     gapsMeasured: boolean;
  };
  completedAt?: number;
  constraints: {
     quality?: string;
     scope: string[];
     time?: string;
  };
  createdAt: number;
  description: string;
  error?: string;
  id: string;
  metadata: Record<string, unknown>;
  parentId?: string;
  requiredCapabilities: {
     experts: string[];
     tools: string[];
  };
  status:   | "failed"
     | "planning"
     | "done"
     | "approved"
     | "executing"
     | "intake"
     | "clarifying"
     | "validating";
  updatedAt: number;
}
analysis
analysis: {
  ambiguityScore: number;
  complexity: string;
  taskType: string;
} = TaskAnalysisSummarySchema;
analysis.ambiguityScore
ambiguityScore: number;
analysis.complexity
complexity: string;
analysis.taskType
taskType: string;
artifacts
artifacts: {
  id: string;
  type:   | "code"
     | "analysis"
     | "test"
     | "spec"
     | "review"
     | "report"
     | "plan"
     | "vote";
}[];
capabilityGaps
capabilityGaps: {
  allSatisfied: boolean;
  available: {
     experts: string[];
     tools: string[];
  };
  gaps: unknown[];
  gapsMeasured: boolean;
} = CapabilityGapSummarySchema;
capabilityGaps.allSatisfied
allSatisfied: boolean;

Meaningful ONLY when gapsMeasured is true. gaps: [] from a detector that ran and gaps: [] from a builder that never called one are byte-identical on the wire; this field is what tells them apart.

capabilityGaps.available
available: {
  experts: string[];
  tools: string[];
};
capabilityGaps.available.experts
experts: string[];
capabilityGaps.available.tools
tools: string[];
capabilityGaps.gaps
gaps: unknown[];
capabilityGaps.gapsMeasured
gapsMeasured: boolean;

Whether a capability-gap detector actually ran (#5919).

buildBaseTaskContract writes allSatisfied: true with an EMPTY available set — a verdict from a detector that never ran, on the orchestrate and delegate_to_model paths. Nothing reads it today, which is camouflage rather than safety: it is the same shape as #5896’s ValidationHarness, where a missing consumer let a hard-coded verdict sit until someone eventually trusted it.

Named for the vocabulary this repo already uses for exactly this — tokensMeasured, policyEvaluated, routerTypeMeasured. A consumer that needs a real answer must branch on this, not on allSatisfied alone.

completedAt?
optional completedAt?: number;
constraints
constraints: {
  quality?: string;
  scope: string[];
  time?: string;
} = TaskConstraintsSummarySchema;
constraints.quality?
optional quality?: string;
constraints.scope
scope: string[];
constraints.time?
optional time?: string;
createdAt
createdAt: number;
description
description: string;
error?
optional error?: string;
id
id: string;
metadata
metadata: Record<string, unknown>;
parentId?
optional parentId?: string;
requiredCapabilities
requiredCapabilities: {
  experts: string[];
  tools: string[];
} = RequiredCapabilitiesSummarySchema;
requiredCapabilities.experts
experts: string[];
requiredCapabilities.tools
tools: string[];
status
status: 
  | "failed"
  | "planning"
  | "done"
  | "approved"
  | "executing"
  | "intake"
  | "clarifying"
  | "validating";
updatedAt
updatedAt: number;

registerCorePlugins()

function registerCorePlugins(registry?): CorePluginRegistrationResult;

Defined in: packages/nexus-agents/src/pipeline/core-plugins.ts:126

Registers all core plugins into a PluginRegistry and freezes it. Returns registration summary. Never throws.

Parameters

registry?

PluginRegistry

Returns

CorePluginRegistrationResult


resetPipelineArtifactStore()

function resetPipelineArtifactStore(): void;

Defined in: packages/nexus-agents/src/pipeline/artifact-store.ts:195

Resets the global ArtifactStore (for testing).

Returns

void


resetPipelinePluginRegistry()

function resetPipelinePluginRegistry(): void;

Defined in: packages/nexus-agents/src/pipeline/core-plugins.ts:170

Resets the global PluginRegistry (for testing).

Returns

void


resolvePipelineDeps()

function resolvePipelineDeps(deps?): ResolvedPipelineDeps;

Defined in: packages/nexus-agents/src/pipeline/pipeline-deps.ts:48

Resolves a PipelineDeps bundle, filling any unset field from its documented global default. An injected field is returned untouched; an omitted field returns the process-global default. The only side effect is the lazy, idempotent creation of the global registry inside getPipelinePluginRegistry().

Parameters

deps?

PipelineDeps

Returns

ResolvedPipelineDeps


resolveV2Config()

function resolveV2Config(): V2Config;

Defined in: packages/nexus-agents/src/pipeline/v2-config.ts:73

Resolves the full V2 configuration from environment variables.

Priority: individual flag > umbrella flag > defaults.

NEXUS_V2_MODE delegate orchestrate policy
full (default) true true block
partial true false warn
off false false off

Returns

V2Config


runAdaptiveOrchestrator()

function runAdaptiveOrchestrator(task, options): Promise<AdaptiveOrchestratorResult>;

Defined in: packages/nexus-agents/src/pipeline/adaptive-orchestrator.ts:337

Run the adaptive orchestrator — classify task, select template, execute.

This is the single entry point for all pipeline execution.

Parameters

task

string

options

AdaptiveOrchestratorOptions

Returns

Promise<AdaptiveOrchestratorResult>


runDevPipeline()

function runDevPipeline(
   task, 
   stages, 
   options?
): Promise<DevPipelineResult>;

Defined in: packages/nexus-agents/src/pipeline/dev-pipeline.ts:533

Execute the full multi-agent development pipeline.

When sessionId is provided, each stage checkpoints to disk. On crash, re-running with the same sessionId resumes from the last completed stage.

Parameters

task

string

High-level task description

stages

DevPipelineStages

Pluggable stage implementations

options?

DevPipelineOptions

Pipeline options (sessionId for checkpoint/resume)

Returns

Promise<DevPipelineResult>

Pipeline result with all outputs


runGraphPipeline()

function runGraphPipeline(
   task, 
   template, 
   stages, 
   options?
): Promise<GraphPipelineResult>;

Defined in: packages/nexus-agents/src/pipeline/graph-pipeline-runner.ts:98

Run a pipeline using graph-based execution.

Compiles the template + stages into a graph, then executes via the graph executor (super-step BSP model).

Parameters

task

string

template

PipelineTemplate

stages

StageRegistry

options?

GraphPipelineOptions

Returns

Promise<GraphPipelineResult>


runIterativeConsensus()

function runIterativeConsensus(
   initialPlan, 
   revisePlan, 
   config?
): Promise<IterativeConsensusResult>;

Defined in: packages/nexus-agents/src/pipeline/iterative-consensus.ts:171

Parameters

initialPlan

string

revisePlan

(plan, feedback) => Promise<string>

config?

IterativeConsensusConfig

Returns

Promise<IterativeConsensusResult>


saveStageCheckpoint()

function saveStageCheckpoint(
   sessionId, 
   stage, 
   data, 
   customDir?
): boolean;

Defined in: packages/nexus-agents/src/pipeline/pipeline-checkpoint.ts:91

Append a stage checkpoint to disk.

Parameters

sessionId

string

stage

CheckpointPipelineStage

data

PipelineStageData

customDir?

string

Returns

boolean