---
title: Final block is masked by an overlapping finalized opt-in block
type: task
status: completed
description: >-
  resolve_auction_mode_at returns a finalized opt-in block as a non-final live session even when it
  overlaps the mandatory window, so the termination guarantee runs without its identity or
  announcement.
base_uri: user:task/league/fix-final-block-masked-by-overlapping-optin-block.md
created_at: '2026-09-07T22:09:12.841Z'
entity_id: f6757c33-3074-4499-94d2-daea06284398
finished_at: '2026-09-07T23:11:04.010Z'
observations:
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
owner_identity_uri: █████████████████████████
priority: Medium
public_read: true
relations:
  - relates [[█████████████████████-███████-█████-█████-████████████]]
tags:
  - user:tag/league-xo-football.md
updated_at: '2026-09-07T23:11:05.664Z'
visibility_analyzed_at: '2026-11-05T23:49:22.794Z'
---

## Problem

`resolve_auction_mode_at` scans finalized opt-in blocks before it checks the mandatory final block, so an opt-in block that overlaps the final-block window reports `is_final_block: false` for the overlap. The final block silently loses its identity for that duration.

The final block is the design's only termination guarantee: it holds the auction live to `period_end` and carries no opt-in. A finalized opt-in block is a different thing with a different `end_at` — it can end before `period_end` — so during the overlap the resolver reports a live session that is categorically not the final block.

## Evidence

- `repository/active/league/libs-server/auction-modes.mjs:43-54` — the `for (const block of blocks)` loop returns the first matching finalized block with `is_final_block: false`, before line 60's final-block branch is ever reached.
- `repository/active/league/api/sockets/auction.mjs:2162` — the socket adopts the resolved `is_final_block`.
- `repository/active/league/api/sockets/auction.mjs:2363` — `_announce_final_block` runs only when `_is_final_block`. A socket already live from the overlapping opt-in block when `final_block_at` arrives never transitions, never re-enters live mode as the final block, so the announcement can be skipped entirely for the whole mandatory window.

## Plan

- [x] Decide the precedence rule: the final-block branch must win over a finalized opt-in block whenever `final_block_at <= now < period_end`. Verify: factor the final-block start and period-end into the finalized-block loop's comparison, and spec an overlap case where the resolver returns `is_final_block: true`.
- [x] Make the spec fail on today's code: a block finalized across `final_block_at` must report `is_final_block: false` today (proving the test bites), then the fix flips it.
- [x] Surface the consequence in the mode's payload or the auction guide so a live overlapping opt-in block is never mistaken for the termination guarantee in a replay.

## Related

- `██████████████████████████████████████████████████████` — the final-block path this rides on.
