Skip to content

fix(emit): disclose min_minutes-filtered frames in markdown - #59

Open
Sarcastic-Soul wants to merge 1 commit into
nossa-y:mainfrom
Sarcastic-Soul:fix/markdown-discloses-omitted-frames
Open

fix(emit): disclose min_minutes-filtered frames in markdown#59
Sarcastic-Soul wants to merge 1 commit into
nossa-y:mainfrom
Sarcastic-Soul:fix/markdown-discloses-omitted-frames

Conversation

@Sarcastic-Soul

Copy link
Copy Markdown
Contributor

Fixes #54

The gap

When min_minutes drops short frames, build_frames records how many on the document. Two of the three emitters pass that on. Markdown doesn't.

Same document, omitted_below_min = 1:

Emitter Output
to_json "omitted": {"below_min_minutes": 1, "min_minutes": 15.0}
context_block (+1 brief frames under 15.0 min omitted)
to_markdown nothing

So the markdown table presents a filtered day as the whole day.

Why it's worth a patch

-f md is a documented CLI format, and --min-minutes defaults to 0.5, not 0 — so aframes today -f md, the plain invocation, is already filtering. A reader has no way to tell that frames were removed or how many.

It's also the one place the codebase truncates without saying so. The same disclosure appears everywhere else, and communications.py states the intent outright:

omitted_titles: int = 0   # distinct titles beyond max_titles (disclosed, never silent)

The change

to_markdown already ends with a footer for away gaps:

if cov.get("gaps"):
    lines.append("")
    ...
    lines.append(f"**Away:** {gaps}")

This adds a matching one from the omitted block the document already produces:

**Omitted:** 1 frames under 15.0 min

Bold-label footer, same shape as **Away:**, appended only when something was actually dropped. No new state — it reads the dict to_dict() already builds.

Tests

Two in tests/test_frames_emit.py:

  • test_every_emitter_discloses_frames_dropped_by_min_minutes — asserts all three emitters disclose the same count from one document, so the three can't drift apart again. Fails on main on the markdown assertion.
  • test_unfiltered_markdown_has_no_omitted_footer — nothing dropped, no footer. Guards against a footer that always fires.

The fixture's frames run 14.0 / 19.7 / 24.0 min, so the test uses a 15 min floor: drops exactly one and still leaves a populated table to disclose against. (A 5 min floor drops nothing here — worth knowing, since test_min_minutes_filter asserts only <= and so passes either way.)

Full suite: 109 passed (107 before, +2).

Note on placement

The new tests are inserted mid-file rather than appended, so they don't collide with #40, which appends to the end of this same file. The two should merge cleanly in either order.

to_json reports {"omitted": {...}} and context_block prints "(+N brief
frames ... omitted)", but to_markdown said nothing -- so a filtered day
rendered as if it were the whole day. --min-minutes defaults to 0.5, so
`aframes today -f md` was already filtering silently.

Add an **Omitted:** footer alongside the existing **Away:** one. This is
the only place the package truncated without saying so; communications.py
states the intent for its own cap: "disclosed, never silent".

Fixes nossa-y#54

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

to_markdown silently drops frames filtered by min_minutes

1 participant