# Feature Specification: Test Generation Deprecation Migration

> Feature ID: FEATURE-045-F
> Epic ID: EPIC-045
> Version: v1.0
> Status: Deferred
> Last Updated: 2025-07-15

## Version History

| Version | Date | Description |
|---------|------|-------------|
| v1.0 | 2025-07-15 | Initial specification — documents deferred Phases 2-3 |

## Overview

This feature documents the 3-phase deprecation strategy for `x-ipe-tool-test-generation` as AAA scenario generation (introduced in FEATURE-045-A) matures. **Phases 2 and 3 are DEFERRED** to future iterations. This spec serves as the migration plan.

### Phase Summary

| Phase | Name | Status | Trigger |
|-------|------|--------|---------|
| 1 | Coexistence | ✅ DONE (FEATURE-045-A) | N/A — shipped with orchestrator refactor |
| 2 | Adapter | ⏳ DEFERRED | ≥95% AAA success rate over 10+ features |
| 3 | Removal | ⏳ DEFERRED | 100% AAA success rate over 20+ features |

## Phase 1: Coexistence (COMPLETE)

Implemented in [FEATURE-045-A](../FEATURE-045-A/specification.md). The orchestrator generates AAA scenarios as its primary path and falls back to `x-ipe-tool-test-generation` when AAA generation fails (ambiguous spec). No further work needed.

## Phase 2: Adapter

Refactor `x-ipe-tool-test-generation` to consume AAA scenarios as an alternative input, bridging the two systems.

### Acceptance Criteria

- [ ] AC-2.1: `x-ipe-tool-test-generation` accepts AAA scenario JSON as an alternative input format alongside its current spec-based input
- [ ] AC-2.2: When given AAA scenarios, test-gen output maps each generated test to its source AAA Assert clause (traceability)
- [ ] AC-2.3: Existing spec-based input path continues to work unchanged (backward compatibility)
- [ ] AC-2.4: Transition trigger met: ≥95% AAA success rate measured over 10+ consecutive features

### Phase 2 Transition Criteria

The orchestrator switches from Phase 1 → Phase 2 when:
1. AAA generation success rate ≥95% over the last 10+ features
2. Success rate is tracked in `x-ipe-docs/metrics/aaa-success-log.md` (or equivalent)
3. Human approval confirms readiness to proceed

## Phase 3: Removal

Remove `x-ipe-tool-test-generation` entirely. The orchestrator's AAA pipeline becomes the sole test generation path.

### Acceptance Criteria

- [ ] AC-3.1: All references to `x-ipe-tool-test-generation` removed from orchestrator SKILL.md
- [ ] AC-3.2: All references removed from workflow skills, documentation, and config files
- [ ] AC-3.3: Orchestrator no longer has a fallback path — AAA generation is the only path
- [ ] AC-3.4: `x-ipe-tool-test-generation/` skill folder archived or deleted
- [ ] AC-3.5: Transition trigger met: 100% AAA success rate over 20+ consecutive features

### Phase 3 Transition Criteria

The orchestrator switches from Phase 2 → Phase 3 when:
1. AAA generation success rate is 100% over the last 20+ features
2. No fallback invocations recorded in the last 20 features
3. Human approval confirms readiness for full removal

## Functional Requirements

| ID | Requirement | Phase |
|----|-------------|-------|
| FR-1 | Adapter interface: `x-ipe-tool-test-generation` SHALL accept AAA scenario JSON as input via a new `aaa_scenarios` input field | 2 |
| FR-2 | Output mapping: Each generated test SHALL reference its source AAA Assert clause ID | 2 |
| FR-3 | Success tracking: The orchestrator SHALL log AAA generation success/failure per feature to a metrics file | 2 |
| FR-4 | Migration script: A checklist/script SHALL identify all files referencing `x-ipe-tool-test-generation` for Phase 3 cleanup | 3 |
| FR-5 | Rollback: Each phase transition SHALL be reversible by restoring the previous orchestrator SKILL.md version | 2-3 |

## Non-Functional Requirements

| ID | Requirement |
|----|-------------|
| NFR-1 | **Backward compatibility**: Phase 2 adapter MUST NOT break existing test-gen consumers |
| NFR-2 | **Rollback capability**: Each phase transition MUST be reversible within one git revert |
| NFR-3 | **Zero data loss**: Existing test suites generated by test-gen MUST NOT be deleted or modified during migration |
| NFR-4 | **Observability**: Success rate metrics MUST be human-readable and auditable |

## Out of Scope

- Automatic conversion of existing test-gen tests to AAA format
- Runtime performance optimization of the adapter
- Changes to FEATURE-045-A's Phase 1 coexistence logic

## Dependencies

| Dependency | Relationship |
|------------|-------------|
| FEATURE-045-A | Must be complete (Phase 1 coexistence is the foundation) |
| AAA success metrics | Must be collected before Phase 2 trigger can be evaluated |

## Notes

> **This entire feature is DEFERRED.** Phases 2 and 3 will be scheduled when the AAA success rate thresholds are met in production use. This specification exists to document the migration plan and ensure the team has a clear path forward.
