# KOPR R217 — Custom-elements repair final integration release-gate report

**Build base:** R216 `WSTACK_MPC_INTEGRITY`  
**Release:** R217 `CUSTOM_ELEMENTS_REPAIR_FINAL_INTEGRATION`  
**Date:** 2026-08-05  
**Result on available host:** `PASS_HEADLESS`  
**Fully qualified:** **NO** — PyQt5/offscreen and native Linux/Wayland qualification were not available on this host.

## Scope

R217 is an integration and qualification batch only. It adds no production
algorithm or scientific feature. The batch closes the headless integration of
the R212–R216 repair series and verifies the complete Custom-elements flow:

```text
editor mutation
  → atomic optimistic write
  → repository generation and stable snapshot
  → catalogue reconciliation
  → open-widget impact resolution
  → selector transaction and rollback
  → WStack typed preview
  → MPC HTTPS/identity trust boundary
```

No `CustomElements.dat` format, observation value, ephemeris policy,
photometric reduction, fit mathematics or Scenario format changed in R217.

## New R217 QA

- Added `tests/test_r217_custom_elements_repair_final_integration.py`.
- Added `r217_custom_elements_repair_final_integration_release_gate.py`.
- Added `docs/developer/CUSTOM_ELEMENTS_FLOW_ARCHITECTURE.md`.
- Advanced the cumulative unified Light Curves qualification marker through
  R217.
- Updated `README_QA.md`, `docs/CHANGELOG.md` and Markdown hygiene allowlists.

## Headless integration matrix

The new cumulative test verifies:

1. creation of a new designation;
2. creation of a new apparition;
3. replacement of a matching apparition;
4. exact selected-record update;
5. rename with old and new identity publication;
6. deletion while another apparition remains as fallback;
7. deletion without a remaining fallback;
8. optimistic stale-writer refusal;
9. one repository race followed by a stable retry;
10. double repository race with no primary or derived cache publication;
11. process-local generation publication;
12. refresh of multiple already-existing repository instances;
13. Analyzer catalogue reconciliation;
14. Planner `use_all` reconciliation;
15. global impact resolution across old and new designations;
16. WStack distinction between true missing elements and runtime failure;
17. MPC same-identity acceptance and different-identity rejection;
18. selector `PREPARE → COMMIT → rollback` fault injection.

A real PyQt5/offscreen selector/editor smoke is included, but is skipped rather
than simulated when PyQt5 is unavailable.

## Test results

### Focused R217 test

```text
10 passed, 1 skipped, 0 failed
```

The skip is the real PyQt5/offscreen integration smoke.

### Custom-elements matrix R203–R217

```text
132 passed, 19 skipped, 0 failed
```

### Current qualification set R135–R217

```text
569 passed, 24 skipped, 0 failed
```

All skips are genuine PyQt5/offscreen or Qt runtime tests unavailable on the
build host.

## Release gates

All **66** numbered release-gate scripts in the R150–R217 range returned a
successful exit status.

Additional gates passed:

- unified Light Curves merger gate — qualified through R217;
- Analyzer final runtime gate — `PASS_HEADLESS`;
- modal ephemeris gate;
- WPlanner performance gate;
- QA and CLEAN Markdown hygiene gates.

The R217 gate reports:

```text
status: PASS_HEADLESS
fully_qualified: false
qt_available: false
offscreen_qualified: false
wayland_available: false
native_wayland_qualified: false
```

## Distribution checks

- QA Python files syntax checked: **518**, errors: **0**
- CLEAN Python files syntax checked: **118**, errors: **0**
- QA/CLEAN shared production files compared: **128**
- QA/CLEAN production differences: **0**
- QA SHA-256 manifest entries: **576**
- CLEAN SHA-256 manifest entries: **128**
- QA manifest verification: **PASS**
- CLEAN manifest verification: **PASS**
- QA ZIP integrity: **PASS**
- CLEAN ZIP integrity: **PASS**
- `__pycache__`, `.pytest_cache`, `.pyc`, backup and scratch files in the
  distributions: **0**

## Qualification status and release decision

The implementation and all available headless qualification are complete.
R217 **must not be described as a fully qualified release** because the planned
acceptance condition requires both a real PyQt5 offscreen pass and a native
Linux/Wayland pass.

The release therefore remains on **native-qualification HOLD** until a target
host verifies:

1. parent-scoped `Qt.WindowModal` nesting;
2. global editor propagation into an open Analyzer;
3. active-target update during and after background loading;
4. WStack preview worker → editor → Save flow;
5. application shutdown while a worker is active;
6. selector fault/retry interaction;
7. successful verified MPC load and failure atomicity;
8. absence of Python tracebacks, `QSocketNotifier`, QObject thread-affinity,
   `QThread destroyed while running` and Wayland activation warnings.

A successful native run may promote the same codebase from `PASS_HEADLESS` to
`PASS_OFFSCREEN_QT` and finally `PASS_NATIVE_WAYLAND`; no additional production
feature is planned for that promotion.
