Skip to content

Integrate Slurm plan and runtime-state contracts #880

Description

@nabinchha

Priority Level

High

Task Summary

Integrate the reviewed Slurm execution-plan and runtime-state contract families through pure, plan-aware validation. The integration must ensure that persisted state and finalization records cannot diverge from the immutable resolved plan while keeping the underlying schemas shared rather than duplicated.

Technical Details & Implementation Plan

Add package-owned integration validators that:

  • Compare the complete ordered ShardManifest set with ResolvedPlan.shards, including shard identity, zero-based index, record range, input partition, and resume-workspace path.
  • Anchor the initial AttemptReadiness snapshot to resolved deployments in authored order, including deployment identity, model alias, and expected backend count from the resolved topology.
  • Validate each AttemptManifest against its PlannedShard, including shard identity, scheduler array-task identity, attempt ordinal, and deterministic attempt ID.
  • Join ClientResult, AttemptManifest, CandidateOutputManifest, and ShardWinner before publication, validating identities, requested and actual counts, semantic outcome, dataset path, candidate-manifest reference and digest, and chronology.
  • Reuse the canonical public types from data_designer.slurm.contracts and the reviewed records from Define Slurm runtime and state record contracts #865 and Define shared Slurm configuration and execution-plan contracts #873. Do not introduce parallel identifiers, record bases, artifact references, ranges, or workspaces.
  • Keep validators deterministic and free of filesystem, scheduler, process, or network I/O.

Add focused positive, negative, and golden tests for every join.

Acceptance criteria

  • A state shard set that exactly matches the resolved plan validates successfully.
  • Missing, extra, reordered, gapped, or mismatched state shards fail before runtime or collection uses them.
  • Initial readiness fails when deployment order, identity, alias, or expected backend count differs from the resolved plan.
  • Attempts fail when their shard, array task, ordinal, or deterministic attempt identity differs from planned intent, even if scheduler identities are otherwise unique.
  • Only a complete, identity-consistent client result and candidate manifest can participate in winner finalization.
  • Partial, failed, stale, digest-mismatched, path-mismatched, or chronologically invalid finalization chains fail.
  • Shared contract objects retain exact class identity across plan and state imports.
  • Tests remain deterministic and require no Slurm commands, GPUs, containers, model services, or external services.

Out of scope

  • Scheduler submission, query, cancellation, or command parsing.
  • Filesystem persistence, locking, atomic writes, retry policy, winner publication I/O, or collection execution.
  • Redefining authored, resolved-plan, runtime-state, or client-result schemas.
  • Environment-specific configuration or acceptance evidence.

Investigation / Context

This is a focused integration child of #850. Issue #865 and PR #878 own runtime-state records and state-local validation. Issue #873 and PR #879 own authored configuration, resolved-plan records, resolved deployments, and semantic client results.

The contract families intentionally land separately. This issue owns the pure validation seam required before downstream runtime and persistent-state lanes consume both families.

Relevant review context:

Agent Plan / Findings

Sequence the work as follows:

  1. Land feat: define Slurm runtime and state record contracts #878 so the public shared primitives and runtime-state records are canonical.
  2. Rebase feat: define Slurm config and plan contracts #879, switch it to the canonical public primitives, and remove duplicate shared definitions.
  3. Implement the four plan-aware joins in this issue.
  4. Update contract-bound golden fixtures and unblock affected runtime and persistent-state work.

Keep unrelated fake-infrastructure scaffolding and independent implementation work parallel where reviewed contracts already permit it.

Dependencies

Blocked by #865 and #873. Coordinates with #872, #868, and #869 and gates their contract-bound integration paths.

Metadata

Metadata

Assignees

Labels

taskInternal development task

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions