Skip to content

Add contract test for topological import ordering #16808

@davidahmann

Description

@davidahmann

Problem

Operators depend on deterministic semantic import ordering in compiled outputs; if ordering regresses to lexical during refactors, dependency behavior can change silently and create hard-to-debug execution drift.

Why now

Import/topology codepaths are actively evolving, and ordering regressions are historically easy to reintroduce when tests only validate happy-path compile success.

Evidence packet

  • Commit under test: f5a6c65a740bb4286bfdcb27dea7691bbd7ebc07 (origin/main, 2026-02-19)
  • Runtime environment: go1.25.7 darwin/arm64, macOS 26.3
  • Minimal repro:
    1. Create fixtures where dependency order conflicts with lexical filename order.
    2. Compile via import processor path and dependency graph path.
    3. Compare emitted import/workflow ordering.
  • Expected: output ordering is topological (dependency semantics first), regardless of lexical names.
  • Actual: current coverage does not lock this as an explicit cross-path contract, leaving room for lexical-order regressions.

Acceptance

  • Add regression tests that fail if import output ordering deviates from topological constraints for the same graph.
  • Keep ordering deterministic for independent nodes (explicit tie-break rule documented in test expectations).

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions