ruff: fix 2x E501 in synthesis.py (repo fails its own CONTRACTS.md 1.6 gate) #1

Closed
opened 2026-11-23 23:11:28 +00:00 by alex · 1 comment
Owner

Summary

uv run ruff check . currently fails with two E501 errors in src/video_analyse/synthesis.py — the repo fails the lint gate that CONTRACTS.md 1.6 itself mandates ("uv run ruff check . must pass"). This is the first thing anyone running the documented gate sees.

Problem

  • src/video_analyse/synthesis.py:345 — E501, 309 > 100 (prompt line inside an implicitly-concatenated string literal)
  • src/video_analyse/synthesis.py:372 — E501, 121 > 100 (same pattern)

Fix

Split the offending string literals across lines with implicit concatenation inside parentheses. The rendered prompt text must stay byte-identical — the strings are part of the synthesis prompt, so their content is behaviour, not formatting.

Acceptance

  • uv run ruff check . passes with zero errors
  • uv run pytest tests/ -q stays green (331 passed, 2 skipped)
  • Concatenated prompt text unchanged (a snapshot/prompt-content test in tests/test_synthesis.py pins it, add one if none exists)

Notes

  • Tiny and self-contained; safe for an AFK agent.
  • Do not reformat PLAN.md/CONTRACTS.md (per CONTRACTS.md 1.6).
## Summary `uv run ruff check .` currently fails with two E501 errors in `src/video_analyse/synthesis.py` — the repo fails the lint gate that CONTRACTS.md 1.6 itself mandates ("`uv run ruff check .` must pass"). This is the first thing anyone running the documented gate sees. ## Problem - `src/video_analyse/synthesis.py:345` — E501, 309 > 100 (prompt line inside an implicitly-concatenated string literal) - `src/video_analyse/synthesis.py:372` — E501, 121 > 100 (same pattern) ## Fix Split the offending string literals across lines with implicit concatenation inside parentheses. **The rendered prompt text must stay byte-identical** — the strings are part of the synthesis prompt, so their content is behaviour, not formatting. ## Acceptance - [ ] `uv run ruff check .` passes with zero errors - [ ] `uv run pytest tests/ -q` stays green (331 passed, 2 skipped) - [ ] Concatenated prompt text unchanged (a snapshot/prompt-content test in `tests/test_synthesis.py` pins it, add one if none exists) ## Notes - Tiny and self-contained; safe for an AFK agent. - Do not reformat `PLAN.md`/`CONTRACTS.md` (per CONTRACTS.md 1.6).
alex added the ready-for-agentbug labels 2026-11-23 23:11:28 +00:00
Author
Owner

Landed on main in 593a29e: both E501 lines split via implicit concatenation, prompt text verified byte-identical (sha256 pre/post) and now pinned by a snapshot test so prompt drift fails the suite. Gates 3/3 green (lint, format, 332 passed at merge).

Landed on main in 593a29e: both E501 lines split via implicit concatenation, prompt text verified byte-identical (sha256 pre/post) and now pinned by a snapshot test so prompt drift fails the suite. Gates 3/3 green (lint, format, 332 passed at merge).
alex closed this issue 2026-11-23 23:22:09 +00:00
Sign in to join this conversation.