Skip to content

1.6.6 hardening follow-up: copy-ctor drift detector + doc fixes + stale test fix

Placeholder ppxd requested to merge chore/1.6.6-followup-clone-and-doc-fixes into main

Summary

Three follow-ups from the P0 deep code review (PRs #285-#288), plus a broken-main fix surfaced during review:

  1. VariableDto copy-constructor + reflection-based drift detector — replaces the fragile 14-field manual clone in ExecuteStepsPhase.EncryptIfSensitive. Future field additions to VariableDto are caught by the drift detector at PR review, not silently in production checkpoint round-trips.

  2. P0-5 doc-code drift fix (no behaviour change) — the comment said "doubles" but the code uses × 3. The doc also claimed "cumulative ~2.6s" but only ~800ms of backoff actually applies with MaxAttempts=3. Doc now states the exact sequence (200ms → 600ms → terminal-error).

  3. Stale-test fix from #288 merge-order — CheckpointPersistRetryTests (added by #288) was branched before #286 merged. The squash-merge produced no conflict because the test file had no overlap with #286's changes, BUT the test's new ExecuteStepsPhase(...) call was missing the IVariableEncryptionService param. main has been failing to build since #288 merged — this PR is the fix.

Test plan

  • VariableDtoCopyConstructorTests: 5 cases
    • CopyConstructor_NullSource_Throws
    • CopyConstructor_PreservesAllPublicProperties — reflection-based drift detector
    • CopyConstructor_ScopesIsSharedReference_DocumentedShallowCopyContract — pins the documented shallow-copy contract for Scopes
    • CopyConstructor_SourceMutationAfterClone_DoesNotAffectClone_ForValueTypes
    • CopyConstructor_AllowsValueOverrideViaObjectInitializer — confirms new VariableDto(v) { Value = ... } works for the encrypt-for-checkpoint use case
  • CheckpointPersistRetryTests 6/6 pass after stale-test fix
  • Full unit suite: 5129/5129

Why this PR before 1.6.6 release

  1. main is broken right now (build error from stale test) — nobody can sync
  2. P0-3's silent-clone fragility is the kind of bug that ships and bites in 6 months
  3. P0-5's doc-code drift sets a bad precedent (test passed because the doc claim 200ms/600ms cumulative ≥700ms happened to align with × 3's actual 800ms)

All three are small, focused, and well-tested. Should land before 1.6.6 cut.

🤖 Generated with Claude Code

Merge request reports

Loading