Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
This repository was archived by the owner on Jul 29, 2026. It is now read-only.

[S3] max(cs,1) floor silently inflates ratio metrics for zero-constraint windows #53

Description

@erinepshovel-code

constraint_statement_proxy_count returns max(cs, 1), so CS is always at least 1. This prevents a ZeroDivisionError (see retracted #45), but introduces a subtler problem: zero-constraint windows are silently treated as having one phantom constraint statement.

R_den = Rw / CS and L_den = Lw / CS are denominated against 1 instead of 0 whenever a transcript window contains no constraint markers. Metrics are emitted as if constraint presence was detected when it was not.

Impact: Short transcripts, informal dialogue, and early windows routinely produce zero constraint markers. Those windows' R_den/L_den values are not zero-signalled — they look like normal constraint-present windows with low Rw/Lw. Any downstream analysis that groups windows by constraint presence will conflate genuine low-constraint windows with constraint-absent windows.

Options:

  1. Return a sentinel value (e.g. None, float("nan"), or a dedicated empty-window marker) when CS == 0 before flooring.
  2. Add a companion boolean cs_present field to the window output so consumers can distinguish floored-zero from genuine constraint presence.
  3. Document the floor explicitly in the module docstring so analysis consumers know CS is never 0 and adjust their interpretation accordingly.

Option 3 is the lowest-effort accurate fix; option 1 or 2 is the honest fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions