<?xml version="1.0" encoding="UTF-8"?>
<gsl-prompt id="20250805T114055+0000" type="feat">
<gsl-header>

# Migrate `gsl-test` to `gsl-acceptance-test` Structure
</gsl-header>
<gsl-block>

<gsl-purpose>
<gsl-label>

## 1. Purpose
</gsl-label>
<gsl-description>

Implement the migration of all legacy `gsl-test` elements and `gsl-tdd` containers to the new `gsl-acceptance-tests` and `gsl-acceptance-test` structure, as outlined in `gsl-acceptance-test-migration-plan.md`.
</gsl-description>
</gsl-purpose>

<gsl-inputs>
<gsl-label>

## 2. Inputs
</gsl-label>
<gsl-description>

| Input | Notes |
| --- | --- |
| `gsl-acceptance-test-migration-plan.md` | Migration phases and mapping details |
| `AGENTS.md` | Updated element dictionary and definitions |
| GSL XSD schema | For validating changes |
| `prompt-template-for-codex-agents.md` | Prompt formatting standards |

</gsl-description>
</gsl-inputs>

<gsl-outputs>
<gsl-label>

## 3. Outputs
</gsl-label>
<gsl-description>

- Updated prompt files with `gsl-acceptance-tests` and `gsl-acceptance-test` elements replacing legacy structures
- New element to log breaking changes named `<gsl-migration>`
- An updated GSL XSD schema 
- A changelog or migration report documenting changes and rationale
- Fully validated prompt files that conform to the latest schema and conventions
- Additional automated tests created or updated as needed to achieve 100% test coverage for all migrated code and prompt structures


</gsl-description>
</gsl-outputs>

<gsl-workflows>
<gsl-label>

## 4. Workflows
</gsl-label>
<gsl-description>

- Review `gsl-acceptance-test-migration-plan.md` for requirements and phases
- Update `AGENTS.md` with new element definitions if not already present
- Update XSD schema if required (ensure all new elements and global elements are allowed)
- Identify all `gsl-tdd` containers and `gsl-test` elements in target files
- Replace `gsl-tdd` with `gsl-acceptance-tests`
- Migrate each `gsl-test` to `gsl-acceptance-test`, mapping original description to `gsl-performed-action` and `gsl-expected-result`
- Add `gsl-acceptance-criteria` or `gsl-filename` where applicable
- Validate documents against the updated schema
- Document the migration in changelog or relevant documentation
</gsl-description>
</gsl-workflows>

<gsl-acceptance-tests>
<gsl-label>

## 5. Acceptance Tests
</gsl-label>
<gsl-acceptance-test id="1">
<gsl-performed-action>

1. When I open any random historical prompt file or do a search for `<gsl-tdd>` or `<gsl-test>`...
</gsl-performed-action>
<gsl-expected-result>

    I will not see `<gsl-tdd>` containers or `<gsl-test>` elements in a prompt file.
</gsl-expected-result>
</gsl-acceptance-test>

<gsl-acceptance-test id="2">
<gsl-performed-action>

2. When run the command `obk validate-all`
</gsl-performed-action>
<gsl-expected-result>

    Then I will not see errors due to the system not recognizing `<gsl-acceptance-tests>` and `<gsl-acceptance-test>` element.

</gsl-expected-result>
</gsl-acceptance-test>

<gsl-acceptance-test id="3">
<gsl-performed-action>

3. When I review the git history
</gsl-performed-action>
<gsl-expected-result>

    Then I expect to see a commit message expressing the backfill of historical prompts to use the new elements for `<gsl-acceptance-tests>` 
</gsl-expected-result>
</gsl-acceptance-test>

<gsl-acceptance-test id="4">
<gsl-performed-action>

4. When I run the automated test suite after migration
</gsl-performed-action>
<gsl-expected-result>

    Then I expect all tests to pass and coverage to be close to 100 percent
</gsl-expected-result>
</gsl-acceptance-test>
</gsl-acceptance-tests>
<gsl-breaking-change>
<gsl-title>

## 6. Migrate to Structured Acceptance Tests
</gsl-title>
<gsl-description>

All prompt and test files must be refactored to use the new `<gsl-acceptance-tests>` and `<gsl-acceptance-test>` elements, replacing all legacy `<gsl-tdd>` and `<gsl-test>` usage.
</gsl-description>
<gsl-language-maintenance>

#### Language Maintenance

The GSL XSD schema, `AGENTS.md` documentation, and all prompt templates have been updated to support the new acceptance test structure. Harmonization, validation, and downstream tooling now require the new elements and attributes. Legacy elements `<gsl-tdd>` and `<gsl-test>` are no longer supported.
</gsl-language-maintenance>
<gsl-content-migration>

#### Content Migration

All existing prompt files and tests must be migrated: 
- Replace each `<gsl-tdd>` with `<gsl-acceptance-tests>`.
- Convert each `<gsl-test>` into a `<gsl-acceptance-test>` with child `<gsl-performed-action>` and `<gsl-expected-result>` elements.
- Annotate with `<gsl-acceptance-criteria>` or `<gsl-filename>` if needed.
All files must be validated against the updated schema before use.
</gsl-content-migration>
</gsl-breaking-change>
</gsl-block>
</gsl-prompt>
