---
title: Extend team_attribution to team-stats-from-plays counting columns
type: task
status: completed
description: >-
  Deferred v1 scope: extend the team_attribution param (historical vs current) to
  team-stats-from-plays COUNTING columns and the select-string year-offset branch, gated on first
  MEASURING their current historical-vs-current default. Rate stats shipped first; counting columns
  deliberately left untouched.
base_uri: user:task/league/data-views/extend-team-attribution-to-counting-columns.md
created_at: '2026-06-21T13:28:05.952Z'
entity_id: 5f080c7d-b8f3-491b-95c4-f70d1a9f4668
finished_at: '2026-06-21T14:57:58.508Z'
observations:
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
owner_identity_uri: █████████████████████████
priority: Low
public_read: true
tags:
  - user:tag/league-xo-football.md
updated_at: '2026-08-12T03:10:12.469Z'
visibility_analyzed_at: '2026-11-05T23:48:48.278Z'
---

# Extend team_attribution to counting columns

## Context

[[user:task/league/data-views/make-team-rate-stat-attribution-configurable.md]]
shipped `team_attribution` ('historical' default | 'current') for team RATE
stats only (`per_game` + `per_team_play`). Team-stats-from-plays COUNTING columns
(the JOIN path in `apply_team_stats_join`) and the `select-string.mjs`
year-offset-range correlated-subquery branch were explicitly left OUT OF SCOPE
for v1: they do not declare the param, so their behavior is byte-for-byte
unchanged (whatever their current implicit default is).

A prior draft of the v1 plan expanded into these and would have shipped an
undiagnosed historical-vs-current default flip to counting columns (and
re-touched code the measure-first refactor had just rewritten). That expansion
was deferred here.

## Precondition (do this FIRST)

MEASURE the current implicit attribution of team-stats-from-plays counting
columns and the select-string year-offset branch before changing anything.
Determine, on live data, whether each currently attributes historically (per-year
team-of-record) or to current_nfl_team. The extension must preserve today's
observed default, then add the opt-in -- not silently flip it.

## Scope (after measurement)

- Thread `team_attribution` into the counting-column consumes_params / join
  resolution (the passive `resolve-team-join-target.mjs` already honors the
  param; counting columns route through it but do not declare it).
- Decide whether the select-string year-offset branch should honor it too.
- Mirror the consistency invariant and tests from the rate-stat work.

## Verify

- Measured baseline documented as an observation here.
- Counting columns' historical default unchanged; `current` opt-in works.
