Skip to content

Compile-to-weights ⑤: CompiledWorkflowNode + per-graph determinism knob (fully-compiled | hybrid | rules-only) #169

Description

@se-jo-ma

Pipeline block ⑤ (Call in-graph: the compiled node + the "how subterranean" knob). Part of the compile-to-weights epic.

Context. stargraph has no node kind that runs a compiled small model under a minimal system prompt. The compiled model is an opaque router — in tension with the "no LLM routes" thesis and with #117 (learned-policy retrieval = core non-goal). Resolution: ship it opt-in + provenance-tagged, with a per-graph knob.

Proposal. New CompiledWorkflowNode(NodeBase) + a determinism knob.

  • execute(state, ctx): read dialogue/transient state, call the registry-pinned small model (block ④) with ONLY the minimal system prompt + turns, merge the assistant turn back into state. Stamp emitted facts ProvenanceBundle origin='llm' (fathom/_provenance.py:25) so opacity is explicit in the audit trail.
  • Wire the declared-but-unused Skill.system_prompt (skills/base.py:58) as the minimal prompt seam (today it is never injected at LLM-call time).
  • Knob (per-graph): fully-compiled (whole workflow → one compiled model, no runtime rules), hybrid (compile fluent legs, keep Fathom/CLIPS rules + provenance at audited decision hubs), rules-only (no compiled node). Default = hybrid/rules-only to honor ADR: name learned-policy (GRPO) retrieval an explicit core non-goal #117.

Where.

  • New src/stargraph/nodes/compiled_workflow.py subclassing NodeBase (nodes/base.py:45, execute:63). Zero core change via NodeSpec.kind='module.path:ClassName' (cli/run.py:_resolve_node_factory:260, _resolve_class_kind:240); NodeSpec.config (ir/_models.py:267) carries model_id/version/system_prompt.
  • Hybrid hub transitions stay as RuleSpec/goto resolved by fathom/_adapter.py. Skill.state_schema (skills/base.py:59) whitelists the channels the compiled node may write.

Acceptance criteria.

  • CompiledWorkflowNode runs a registry-pinned model under a minimal system prompt; emitted facts tagged origin='llm'.
  • Per-graph knob selects fully-compiled | hybrid | rules-only; default does not violate ADR: name learned-policy (GRPO) retrieval an explicit core non-goal #117.
  • In hybrid mode, transient state marshals cleanly across the compiled node via state_schema channels.

Caveat. Which legs are "safe to compile" vs "must stay audited" is a judgment call with no automatic test — the eval harness (linked) is the guard.


Source: arXiv:2605.22502v1 — "Compiling Agentic Workflows into LLM Weights" (subterranean agents). Part of the end-to-end compile-to-weights pipeline epic; file refs verified against current main. Determinism: per-graph knob (fully-compiled | hybrid | rules-only) defaults to honor #117 (no learned core router).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority: roadmap gap or DX/toolingarea/runtimeGraphRun, dispatch, lifecycle, mirrorenhancementNew feature or requestneeds-designDesign not yet settled — please don't open a PR yetsize/M<2 days: multi-file feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions