# KOPR R247 — post-R239 repair final-integration release-gate report

**Build base:** R246 `WCCD_REFERENCE_STARS_AUTHORITATIVE_EMPTY_REPAIR`  
**Release:** R247 `POST_R239_REPAIR_FINAL_INTEGRATION`  
**Date:** 2026-08-06  
**Result:** `PASS_HEADLESS`

## Scope

R247 closes the R240–R247 repair plan by qualifying the hardened WPlanner
**Generate maps** branch together with the WCCD background, ACF and
reference-star repairs. R247 adds no new scientific production algorithm. Its
source changes are QA integration gates, a repeatable real-PyQt5 WCCD smoke
harness, documentation and the narrowly corrected R228 historical supersession
test.

## Integrated Generate maps contract

- Frozen Planner ICRS/J2000 points remain the sole comet-coordinate source.
- Ephemeris recomputations: **0**.
- TYC2 cancellation stops after the first tested row and writes no cache.
- VizieR cancellation stops after the first tested mirror.
- Atomic PDF commit has terminal precedence over a late Cancel.
- TYC2 qualification cache uses schema v2 and 37 SHA-256-bound source entries.
- Same-size/same-mtime TYC2 mutation invalidates both cache and active catalogue.
- GSC cache checksum, spherical footprint, magnitude bounds and `Class = 0` provenance are revalidated.
- Setup inventory found and qualified **36/36** TYC2 tiles.
- Existing output is rejected before catalogue work unless replacement was explicitly approved.

### Map integration metrics

```text
planner points received/mapped: 3/3
sheets/pages: 1/1
minimum containment margin: 1.000000000000 deg
orientation: portrait
TYC2/GSC accepted stars: 1/2
GSC tiles/cache hits/network tiles: 4/3/1
cross-catalogue deduplications: 1
label collisions resolved/unresolved: 3/0
PDF bytes: 17454
```

## Integrated WCCD contract

- The complete requested background geometry is validated before pixel sampling.
- One-pixel overflow at every image edge is a typed hard failure.
- Zero and negative ring medians do not disable valid upper-only ACF clipping.
- Annular raw and filtered flux remain signed.
- Degenerate sigma and invalid angular coverage have explicit typed states.
- `None` is unhydrated reference state; `[]` is authoritative empty state.
- **Clear all stars** atomically clears canonical, legacy, diagnostic, image-slot and measured-artist state while preserving the comet, catalogue overlays and frozen ACF context.

### WCCD integration metrics

```text
valid background expected samples: 53040
edge overflow diagnostics L/R/T/B: 1/1/1/1 px
zero-median ACF status/clipped: ACF_APPLIED_CLIPPED/2
negative-median ACF status/clipped: ACF_APPLIED_CLIPPED/2
signed raw/filtered annular flux: -36.000000000000/-36.000000000000
invalid coverage status/max gap: ACF_INVALID_COVERAGE/41.0 deg
reference counts before (canonical/legacy/artists): 3/3/9
reference counts after (canonical/legacy/artists): 0/0/0
empty solution: FAIL_INSUFFICIENT_STARS
comet/catalogue overlay/frozen ACF preserved: yes/yes/yes
```

## Cleanup audit

No additional production removal was safe or necessary:

- the erroneous `ring_median <= 0` no-op is absent;
- the forced non-negative annular clamp is absent;
- typed ACF application status is authoritative;
- the remaining `acf_applied` compatibility value still represents the active
  radius policy and has live call sites;
- WCCD uses one shared fail-closed background geometry contract;
- generic non-WCCD background utilities remain because they have active uses;
- truthiness-based legacy reference hydration is absent;
- weak cache schemas are explicitly rejected rather than silently migrated.

The complete integration run found one QA-only issue: the R228 historical hash
test had not listed the later approved R244–R246 WCCD supersessions. It was
narrowly updated with characteristic contract checks for each changed file.

## Test results

### R247 focused tests

```text
9 passed, 0 failed
```

### R240–R247 focused tests, isolated by release

```text
106 passed, 0 failed
```

### Cumulative current qualification R135–R247

```text
994 passed, 31 skipped, 0 failed
```

The 31 skips are genuine PyQt5/offscreen tests on a host without PyQt5.
Historical PyQt test doubles were isolated per release to prevent module-state
cross-contamination.

### Release and common gates

- numbered release gates R150–R247: **96/96 passed**;
- unified Light Curves merger: **PASS**, qualified through R247;
- Analyzer release gate: **PASS**;
- modal ephemeris release gate: **PASS**;
- WPlanner performance release gate: **PASS**;
- aggregate performance/distribution validator: **PASS**;
- synthetic photometry release validation: **PASS**;
- Markdown hygiene QA/CLEAN: **PASS**.

The photometry validator's archival-field subtest remains `not_run` because no
archival FITS observations are bundled; its source contract, automatic
reference calculation and synthetic 1/rho validation passed.

## Distribution checks

- QA Python files syntax checked: **612**, errors: **0**
- CLEAN Python files syntax checked: **136**, errors: **0**
- QA/CLEAN shared production files compared: **147**
- QA/CLEAN production differences: **0**
- QA SHA-256 manifest entries: **758**
- CLEAN SHA-256 manifest entries: **147**
- Runtime cache, bytecode, backup and temporary artifacts: **0**
- Tests, generated PDFs, TYC2 data and catalogue caches in CLEAN: **0**
- ZIP integrity and post-extraction manifest verification: **PASS**

## Native qualification

```text
Generate maps PyQt5/offscreen: HOLD
Generate maps native Wayland: HOLD
WCCD PyQt5/offscreen: HOLD
WCCD native Wayland: HOLD
```

PyQt5 is not installed and `WAYLAND_DISPLAY` is not available on the build
host. Both real-Qt harnesses are included in QA, but R247 is honestly reported
as `PASS_HEADLESS`, not as a native GUI qualification.

## Release state

```text
functional_result: PASS_HEADLESS
production_source_changed_in_r247: false
generate_maps_branch: PASS_HEADLESS
wccd_repair_branch: PASS_HEADLESS
native_gui_qualification: HOLD
map_ephemeris_recomputations: 0
background_policy: FAIL_CLOSED
acf_algorithm: pa-adaptive-upper-v2
reference_empty_state: AUTHORITATIVE
```
