icm

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package icm implements the nexus.workflows.icm plugin: a file-driven multi-stage workflow runner inspired by the Interpretable Context Methodology (Van Clief & McDermott, arXiv:2603.16021).

A workspace is a folder on disk. Stages live under stages/NN_slug/, each with a contract.md (YAML frontmatter + role body) and an optional grounding/ folder. The plugin loads + validates the workspace at Init, registers a derived AgentPosture per stage at Ready, and dispatches each stage as a sub-agent via a private delegate.Runtime when an io.input arrives.

All comms flow through the bus. The plugin owns no LLM client directly — every model call routes through delegate (sub-agents + LLM judges) and every human interaction through hitl.requested.

Index

Constants

View Source
const (
	ICMRunStartedVersion     = icmtypes.ICMRunStartedVersion
	ICMRunCompletedVersion   = icmtypes.ICMRunCompletedVersion
	ICMRunHaltedVersion      = icmtypes.ICMRunHaltedVersion
	ICMStageStartedVersion   = icmtypes.ICMStageStartedVersion
	ICMStageCompletedVersion = icmtypes.ICMStageCompletedVersion
	ICMStageFailedVersion    = icmtypes.ICMStageFailedVersion
	ICMStageIterationVersion = icmtypes.ICMStageIterationVersion
	ICMTurnVersion           = icmtypes.ICMTurnVersion
	ICMFanoutItemVersion     = icmtypes.ICMFanoutItemVersion
)
View Source
const ICMPredicateFailedVersion = icmtypes.ICMPredicateFailedVersion

ICMPredicateFailedVersion re-exports the canonical version constant from icmtypes for callers used to the icm.ICMPredicateFailedVersion name.

Variables

This section is empty.

Functions

func New

func New() engine.Plugin

New returns a default-configured Plugin.

Types

type ConditionResult

type ConditionResult = icmtypes.ConditionResult

ConditionResult is re-exported from icmtypes so existing icm.ConditionResult references in this package and its sub-packages keep working. The canonical definition lives in icmtypes to avoid a cycle with the session sub-package.

type Config

type Config struct {
	Workspace                     string
	DefaultJudgePosture           string
	DefaultWorkflowPosture        string
	CacheSize                     int
	InlineArtifactLimitBytes      int
	LoopMaxRestarts               int
	InputFilename                 string
	TreatInputAsPathIfExists      bool
	WorkspaceInputsDir            string
	AutoIncludeSkillReferenceTool bool
	PredicateCommandTimeoutSecs   int
	EmitProgressThinkingSteps     bool
}

Config is the resolved plugin config (subset of schema.json relevant at runtime). Loaded once at Init.

type ICMFanoutItem

type ICMFanoutItem = icmtypes.ICMFanoutItem

Lifecycle event payload re-exports. The runtime sub-package emits these directly; the icm package surfaces the type aliases for ergonomic consumer code.

type ICMPredicateFailed

type ICMPredicateFailed = icmtypes.ICMPredicateFailed

ICMPredicateFailed is re-exported from icmtypes. The predicates sub-package emits values of this type; subscribers can keep using the short icm.ICMPredicateFailed name.

type ICMRunCompleted

type ICMRunCompleted = icmtypes.ICMRunCompleted

Lifecycle event payload re-exports. The runtime sub-package emits these directly; the icm package surfaces the type aliases for ergonomic consumer code.

type ICMRunHalted

type ICMRunHalted = icmtypes.ICMRunHalted

Lifecycle event payload re-exports. The runtime sub-package emits these directly; the icm package surfaces the type aliases for ergonomic consumer code.

type ICMRunStarted

type ICMRunStarted = icmtypes.ICMRunStarted

Lifecycle event payload re-exports. The runtime sub-package emits these directly; the icm package surfaces the type aliases for ergonomic consumer code.

type ICMStageCompleted

type ICMStageCompleted = icmtypes.ICMStageCompleted

Lifecycle event payload re-exports. The runtime sub-package emits these directly; the icm package surfaces the type aliases for ergonomic consumer code.

type ICMStageFailed

type ICMStageFailed = icmtypes.ICMStageFailed

Lifecycle event payload re-exports. The runtime sub-package emits these directly; the icm package surfaces the type aliases for ergonomic consumer code.

type ICMStageIteration

type ICMStageIteration = icmtypes.ICMStageIteration

Lifecycle event payload re-exports. The runtime sub-package emits these directly; the icm package surfaces the type aliases for ergonomic consumer code.

type ICMStageStarted

type ICMStageStarted = icmtypes.ICMStageStarted

Lifecycle event payload re-exports. The runtime sub-package emits these directly; the icm package surfaces the type aliases for ergonomic consumer code.

type ICMTurn

type ICMTurn = icmtypes.ICMTurn

Lifecycle event payload re-exports. The runtime sub-package emits these directly; the icm package surfaces the type aliases for ergonomic consumer code.

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin is the nexus.workflows.icm plugin instance. Multiple instances coexist via the instance-suffix mechanism (nexus.workflows.icm/script, nexus.workflows.icm/research) — each pinned to its own workspace.

func (*Plugin) Capabilities

func (p *Plugin) Capabilities() []engine.Capability

Capabilities advertises workflow.runner so other plugins can detect the presence of a workflow runner without string-matching plugin IDs.

func (*Plugin) ConfigSchema

func (p *Plugin) ConfigSchema() []byte

ConfigSchema implements engine.ConfigSchemaProvider.

func (*Plugin) Dependencies

func (p *Plugin) Dependencies() []string

Dependencies declares ordering-only deps. None: ICM resolves all required capabilities through Requires().

func (*Plugin) Emissions

func (p *Plugin) Emissions() []string

Emissions lists the events ICM may emit. Read by contract tests.

func (*Plugin) ID

func (p *Plugin) ID() string

ID returns the configured plugin ID (with instance suffix when set).

func (*Plugin) Init

func (p *Plugin) Init(ctx engine.PluginContext) error

Init parses config, resolves the posture registry, builds the private delegate runtime, and subscribes to bus events. Workspace loading + posture registration happen in Ready (after every other plugin has initialized).

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns the human-readable name.

func (*Plugin) Ready

func (p *Plugin) Ready() error

Ready registers per-stage output schemas, derives + registers a posture per stage and verifier, then registers the LLM-facing icm_validate tool. Halts boot on any failure so an invalid workspace contract never reaches dispatch.

func (*Plugin) Requires

func (p *Plugin) Requires() []engine.Requirement

Requires declares the capabilities ICM must have active.

func (*Plugin) Shutdown

func (p *Plugin) Shutdown(_ context.Context) error

Shutdown unsubscribes from the bus and deregisters any postures the plugin owns. Schemas are not deregistered here — the engine teardown drops the SchemaRegistry wholesale, and there is no per-source removal in the public surface.

func (*Plugin) Subscriptions

func (p *Plugin) Subscriptions() []engine.EventSubscription

Subscriptions lists the events ICM consumes.

func (*Plugin) Version

func (p *Plugin) Version() string

Version returns the plugin version string.

Directories

Path Synopsis
Package icmtypes holds tiny shared value types used by both the nexus.workflows.icm plugin (events.go) and its session and predicates subpackages (artifact sidecars, run state, predicate failure events).
Package icmtypes holds tiny shared value types used by both the nexus.workflows.icm plugin (events.go) and its session and predicates subpackages (artifact sidecars, run state, predicate failure events).
Package predicates implements the ICM workflow predicate evaluator.
Package predicates implements the ICM workflow predicate evaluator.
builtins
Package builtins ships the four baked-in native predicate handlers for the ICM workflow plugin: word_count_under, word_count_over, contains_required_ids, and json_path_exists.
Package builtins ships the four baked-in native predicate handlers for the ICM workflow plugin: word_count_under, word_count_over, contains_required_ids, and json_path_exists.
Package runtime — top-level ICM orchestrator.
Package runtime — top-level ICM orchestrator.
Package session owns the on-disk layout of a single ICM workflow run.
Package session owns the on-disk layout of a single ICM workflow run.
Package workspace is the pure-Go loader and validator for an ICM workspace folder.
Package workspace is the pure-Go loader and validator for an ICM workspace folder.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL