fix(emit): disclose min_minutes-filtered frames in markdown - #59
Open
Sarcastic-Soul wants to merge 1 commit into
Open
fix(emit): disclose min_minutes-filtered frames in markdown#59Sarcastic-Soul wants to merge 1 commit into
Sarcastic-Soul wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #54
The gap
When
min_minutesdrops short frames,build_framesrecords how many on the document. Two of the three emitters pass that on. Markdown doesn't.Same document,
omitted_below_min = 1:to_json"omitted": {"below_min_minutes": 1, "min_minutes": 15.0}context_block(+1 brief frames under 15.0 min omitted)to_markdownSo the markdown table presents a filtered day as the whole day.
Why it's worth a patch
-f mdis a documented CLI format, and--min-minutesdefaults to 0.5, not 0 — soaframes 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.pystates the intent outright:The change
to_markdownalready ends with a footer for away gaps:This adds a matching one from the
omittedblock the document already produces:Bold-label footer, same shape as
**Away:**, appended only when something was actually dropped. No new state — it reads the dictto_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 onmainon 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_filterasserts 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.