@tdd_issue @tdd_issue_9131 @mock_only
Feature: TDD Issue #9131 — invariant_enforced decisions not propagated to child plans on subplan spawn
  As a developer
  I want to verify that SubplanService.spawn() propagates invariant_enforced decisions
  from the parent plan to each child plan's decision tree
  So that child plans start Strategize with the parent's enforced invariant set

  The spec states: "recorded as invariant_enforced decisions that propagate to child plans."
  SubplanService.spawn() currently creates child Plan objects with no invariant_enforced
  decisions, violating the spec's propagation requirement.

  @tdd_issue @tdd_issue_9131
  Scenario: Child plan receives parent invariant_enforced decisions on spawn
    Given a parent plan with invariant_enforced decisions recorded
    And a valid spawn entry for the parent plan
    When I spawn a child plan via SubplanService
    Then the decision service should have recorded invariant_enforced decisions for the child plan

  @tdd_issue @tdd_issue_9131
  Scenario: Child plan receives all parent invariant_enforced decisions
    Given a parent plan with 3 invariant_enforced decisions recorded
    And a valid spawn entry for the parent plan
    When I spawn a child plan via SubplanService
    Then the child plan should have 3 invariant_enforced decisions recorded

  @tdd_issue @tdd_issue_9131
  Scenario: Non-overridable global invariants are propagated to child plans
    Given a parent plan with a non_overridable invariant_enforced decision
    And a valid spawn entry for the parent plan
    When I spawn a child plan via SubplanService
    Then the child plan should have the non_overridable invariant decision propagated

  @tdd_issue @tdd_issue_9131
  Scenario: Child plan with no parent invariant_enforced decisions spawns cleanly
    Given a parent plan with no invariant_enforced decisions
    And a valid spawn entry for the parent plan
    When I spawn a child plan via SubplanService
    Then the spawn should succeed with no invariant decisions recorded for the child
