feat(controlplane): add dry-run and status/revision reporting to contract apply

Merged
JA
4mo ago
+686-62

Summary

Brings the WorkflowContract apply API to parity with the compliance resources by reporting the outcome of an apply (created, updated, or unchanged) together with the contract's current revision, and by supporting a dry run that validates and computes the result without persisting any change.

  • Adds dry_run to the Apply request and an ApplyStatus enum plus current_revision to the Apply response, keeping the existing changed flag for backward compatibility.
  • Adds change detection in the contract use case that reuses the existing data-layer rule to determine whether a revision would change, without persisting.
  • Updates the Apply handler to report status and current revision and to support dry run for the create, update and unchanged cases.

This is the OSS-side change; the CLI --dry-run flag and status/revision display for contracts will be wired up in the platform repo after a release.

Linear: PFM-6429

AI disclosure

This contribution was produced with the assistance of Claude Code, disclosed via the Assisted-by: trailer on the commit.