Skip to content

[Substrate Engineering · Phase 3] Validate flow transitions against a substrate's temporal constraints #470

Description

@dgenio

Context

Part of the cross-repo Substrate Engineering roadmap (proposal in weaver-spec).

ChainWeaver already models operators (tools), sequencing (FlowStep, depends_on), and a determinism taxonomy (FULL/PARTIAL/NONE). A DomainSubstrate declares which state transitions are admissible; ChainWeaver can validate flows against that.

Scope

Allow a Flow / DAGFlow to reference a DomainSubstrate. At compile/validate time, check that every step transition is admissible under the substrate's temporal-constraint + admissible-state facets. Surface violations as a ChainWeaverError subclass with step_index / detail.

Constraints

  • Validation happens at build time, not in executor.py. The three executor invariants (no LLM, no network I/O, no randomness) are untouched and non-negotiable.
  • Keep DeterminismLevel honesty — do not claim token-level determinism.
  • from __future__ import annotations, export new public symbols in __all__, all exceptions inherit from ChainWeaverError.

Acceptance criteria

  • Flow/DAGFlow may reference a substrate; build-time admissibility check with a dedicated error type.
  • Executor unchanged; ruff check, ruff format --check, mypy, pytest all pass.
  • Docs/AGENTS.md updated if a public API or invariant surface changes.

Dependency / phase

Phase 3. Depends on the DomainSubstrate contract from dgenio/weaver-spec#167.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions