# QA ALIGN Engineer Remediation Plan

> Internal engineering artifact. Do not send this file as the client-facing advisory report.

## System Summary

- Framework: playwright
- Trust Level: high
- Release Decision: WARN
- Recommended Start Sprint: 6
- Recommended Route: 6 → 16 → 17
- Estimated Good Fix: $2400

## Engineer Execution Order

1. **Locator strategy not fully governed** (10 risk points) — Fix after critical trust blockers are under control.
2. **Release confidence remains below GO threshold** (8 risk points) — Fix after critical trust blockers are under control.
3. **Artifact contract rollout remains partial** (7 risk points) — Fix after critical trust blockers are under control.
4. **Owner routing still needs full CI adoption** (4 risk points) — Fix after critical trust blockers are under control.

## Locator strategy not fully governed

**Severity:** medium
**Impact:** causes_flake

### Pattern Detected
Detected framework risk pattern: Locator strategy not fully governed

### Evidence
- Accessibility-first approach exists but not enforced across all tests.

### Line-Level Remediation Targets
- `tests/UIBasics.spec.js:41` — Spec bypasses baseURL and page/domain fixtures, keeping navigation and locator governance scattered in tests.

```
await page.goto('https://rahulshettyacademy.com/loginpagePractise/');
```


### Deterministic Fix Card

```json
{
  "target_file": "tests/UIBasics.spec.js:41",
  "before_snippet": "await page.goto('https://rahulshettyacademy.com/loginpagePractise/');",
  "after_snippet": "await loginPage.open();\nawait loginPage.signInButton().click();\n\nsignInButton() {\n  return this.page.getByRole('button', { name: /sign in/i });\n}",
  "verification_command": "npx playwright test --grep @locator-contract",
  "agent_attribution": "Intelligent Locator Agent: classified selector governance risk and derived the role/label-based replacement path.",
  "matrix_source": "Playwright|Selectors & Locators|Brittle CSS chains (deep selectors)",
  "field_catalog_csv": null,
  "evidence_status": "line-level evidence provided by assessment"
}
```

### Engineering Intent
Reduce the risk represented by this finding without changing unrelated test behavior.

### Likely Files To Inspect
- Review files referenced in validation evidence.
- Review framework setup, test base, and CI configuration.

### Fix Steps
1. Review the finding evidence.
2. Locate the smallest safe code area responsible for the pattern.
3. Apply a focused fix.
4. Run the narrowest relevant validation first.
5. Then rerun the full assessment.

### Do Not
- Do not perform broad rewrites without preserving test intent.
- Do not hide the symptom without correcting the pattern.
- Do not skip validation.

### Verification
- Run the affected test area.
- Rerun QA ALIGN assessment.
- Confirm trust level or finding count improves.

### Expected Impact
Reduces framework risk associated with this finding.

## Release confidence remains below GO threshold

**Severity:** medium
**Impact:** slows_diagnosis

### Pattern Detected
Detected framework risk pattern: Release confidence remains below GO threshold

### Evidence
- The system is operationally mature enough for WARN, but locator governance still prevents a GO decision.

### Line-Level Remediation Targets
- `control-plane/release-gate-policy.json:1` — Owner routing removes blind manual triage, but the release remains WARN until Batch B locator risks are remediated.

```
"decision": "WARN"
```


### Deterministic Fix Card

```json
{
  "target_file": "control-plane/release-gate-policy.json:1",
  "before_snippet": "\"decision\": \"WARN\"",
  "after_snippet": "await loginPage.open();\nawait loginPage.signInButton().click();\n\nsignInButton() {\n  return this.page.getByRole('button', { name: /sign in/i });\n}",
  "verification_command": "npx playwright test --grep @locator-contract",
  "agent_attribution": "Intelligent Locator Agent: classified selector governance risk and derived the role/label-based replacement path.",
  "matrix_source": "Playwright|Selectors & Locators|Brittle CSS chains (deep selectors)",
  "field_catalog_csv": null,
  "evidence_status": "line-level evidence provided by assessment"
}
```

### Engineering Intent
Reduce the risk represented by this finding without changing unrelated test behavior.

### Likely Files To Inspect
- Review files referenced in validation evidence.
- Review framework setup, test base, and CI configuration.

### Fix Steps
1. Review the finding evidence.
2. Locate the smallest safe code area responsible for the pattern.
3. Apply a focused fix.
4. Run the narrowest relevant validation first.
5. Then rerun the full assessment.

### Do Not
- Do not perform broad rewrites without preserving test intent.
- Do not hide the symptom without correcting the pattern.
- Do not skip validation.

### Verification
- Run the affected test area.
- Rerun QA ALIGN assessment.
- Confirm trust level or finding count improves.

### Expected Impact
Reduces framework risk associated with this finding.

## Artifact contract rollout remains partial

**Severity:** low
**Impact:** scalability_risk_only

### Pattern Detected
Detected framework risk pattern: Artifact contract rollout remains partial

### Evidence
- The artifact chain exists, but full rollout across every workflow remains a scale-hardening task.

### Line-Level Remediation Targets
- `control-plane/artifact-contract.json:1` — The chain is now defined and used; full adoption remains a later hardening step.

```
Finding -> Screenshot -> Trace -> Console -> Fix
```


### Deterministic Fix Card

```json
{
  "target_file": "control-plane/artifact-contract.json:1",
  "before_snippet": "Finding -> Screenshot -> Trace -> Console -> Fix",
  "after_snippet": "use: { trace:'retain-on-failure', screenshot:'only-on-failure', video:'retain-on-failure' }",
  "verification_command": "Run the affected test area.",
  "agent_attribution": "CI Failure Triage Agent: separates missing diagnostic evidence from product failure so engineers do not rerun blindly.",
  "matrix_source": "Playwright|Reporting & Debuggability|No trace/screenshot on failure",
  "field_catalog_csv": null,
  "evidence_status": "line-level evidence provided by assessment"
}
```

### Engineering Intent
Reduce the risk represented by this finding without changing unrelated test behavior.

### Likely Files To Inspect
- Review files referenced in validation evidence.
- Review framework setup, test base, and CI configuration.

### Fix Steps
1. Review the finding evidence.
2. Locate the smallest safe code area responsible for the pattern.
3. Apply a focused fix.
4. Run the narrowest relevant validation first.
5. Then rerun the full assessment.

### Do Not
- Do not perform broad rewrites without preserving test intent.
- Do not hide the symptom without correcting the pattern.
- Do not skip validation.

### Verification
- Run the affected test area.
- Rerun QA ALIGN assessment.
- Confirm trust level or finding count improves.

### Expected Impact
Reduces framework risk associated with this finding.

## Owner routing still needs full CI adoption

**Severity:** low
**Impact:** degrades_trust

### Pattern Detected
Detected framework risk pattern: Owner routing still needs full CI adoption

### Evidence
- Autonomous owner routing exists, but every CI path must call it before the system can claim a GO signal.

### Line-Level Remediation Targets
- `control-plane/owner-routing-policy.json:1` — The routing map eliminates human classification dependency; remaining work is universal adoption.

```
category -> owner
```


### Deterministic Fix Card

```json
{
  "target_file": "control-plane/owner-routing-policy.json:1",
  "before_snippet": "category -> owner",
  "after_snippet": "await expect(locator).toBeVisible()",
  "verification_command": "Run the affected test area.",
  "agent_attribution": "QA ALIGN Remediation Agent: derived a deterministic fix target from framework assessment evidence.",
  "matrix_source": "Playwright|Waiting & Flakiness|time.sleep / setTimeout-based waits",
  "field_catalog_csv": null,
  "evidence_status": "line-level evidence provided by assessment"
}
```

### Engineering Intent
Reduce the risk represented by this finding without changing unrelated test behavior.

### Likely Files To Inspect
- Review files referenced in validation evidence.
- Review framework setup, test base, and CI configuration.

### Fix Steps
1. Review the finding evidence.
2. Locate the smallest safe code area responsible for the pattern.
3. Apply a focused fix.
4. Run the narrowest relevant validation first.
5. Then rerun the full assessment.

### Do Not
- Do not perform broad rewrites without preserving test intent.
- Do not hide the symptom without correcting the pattern.
- Do not skip validation.

### Verification
- Run the affected test area.
- Rerun QA ALIGN assessment.
- Confirm trust level or finding count improves.

### Expected Impact
Reduces framework risk associated with this finding.

