Skip to content

fix: keep binary artifacts out of weekly brief text - #378

Merged
demegire merged 3 commits into
tin-computer:mainfrom
hamitarsln:codex/weekly-brief-binary-artifacts
Oct 12, 2026
Merged

demegire merged 3 commits into
tin-computer:mainfrom
hamitarsln:codex/weekly-brief-binary-artifacts

Conversation

@hamitarsln

@hamitarsln hamitarsln commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Weekly brief decoded every run artifact as UTF-8. A demo video stopped the report before the model call. Use the existing run metadata fallback for invalid UTF-8 or NUL bytes, and keep the artifact reference. Text still contributes its content; storage errors are not hidden.

The reporter also rejected a useful summary when the model omitted the main heading. Add a standard heading in that case. Keep an existing heading, remove model-written source lists, and reject an empty summary. Tin still appends the exact recorded sources.

Verification

  • Earlier live runs failed in both projects: invalid byte 0x85 / 0xbd at position 35. Those runs used deployed code, not this branch.
  • Local media fixtures cover both bytes and valid UTF-8 with NUL bytes. They now pass through source collection, report creation and artifact checks.
  • Reproduced the missing-heading failure twice. Plain text, a subheading and a proper heading now work with one model call. A sources-only response is rejected.
  • 47 local tests passed, no skips, with disposable PostgreSQL. Ruff and diff checks passed.

Limits

Provider and storage responses are synthetic. The fixed branch has not run against the deployed service; rerun both projects after rollout.

@hamitarsln
hamitarsln requested a review from a team as a code owner October 10, 2026 18:47
Copilot AI balanced review requested due to automatic review settings October 10, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused implementation matches the documented behavior and includes adequate regression coverage.

0 open findings

What changed in this PR

Prevents binary run artifacts from breaking weekly brief generation while retaining source references and run metadata.

Changes:

  • Falls back to run receipts for invalid UTF-8 or NUL-containing artifacts.
  • Preserves text artifacts and propagates storage failures.
  • Adds regression tests and documents the behavior.
File Description
src/​tin_lite/​activities.py Safely handles binary weekly brief sources.
tests/​test_weekly_brief_binary_sources.py Covers binary, NUL, text, and storage-error cases.
docs/​engineering.md Documents artifact fallback behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@demegire
demegire merged commit 182ceed into tin-computer:main Oct 12, 2026
5 checks passed
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.

3 participants