Skip to content

smoke.py is at 776/800 lines — extract before the next live probe (blocks the #105 conflict-retry probe) #108

Description

@thewrz

This was written agentically; verify its assertions and edit accordingly:

agilesync/tools/smoke.py is 776 lines against the 800-line hard cap, so the next live probe cannot land without an extraction first ("never add to a file already over budget -- extract first").

Two probes are already waiting on it:

  1. Issue Version-conflict retry can never recover a card carrying a /description op — apply run aborts on HTTP 428 #105 conflict-retry recovery (~25 lines): snapshot a card, bump its version out of band with a tag write, then patch_card the stale snapshot with an op_description -> must recover through the one refetch-validate-retry; then edit the description out of band and confirm the retry REFUSES rather than clobbering it. This is the live counterpart to tests/test_agileplace_version_refetch.py, which can only prove it against a fake tenant.
  2. Issue Confirm whether dependency/connection writes bump a card's resource version — if so, flush card PATCHes before them #107 version-bump probe: a card version read before and after POST /card/dependency / POST /card/connections.

Suggested shape

Move the optimistic-concurrency checks (_check_stale_patch plus the new ones) into a sibling agilesync/tools/smoke_conflict.py, with the shared reporting primitives (_step, _print_http_failure, EXPECTED_CONFLICT_CODES) in a small smoke_report.py that both import. Dependencies stay one-way (smoke -> {smoke_conflict, smoke_report}, smoke_conflict -> smoke_report) -- no cycle, matching the boundary discipline tests/test_board_layout_import_boundary.py already enforces elsewhere. Check tests/test_smoke.py for monkeypatching that assumes those names live on the smoke module.

Testing

  • Every existing smoke step still runs in the same order with the same step numbers
  • tests/test_smoke.py green without loosening any assertion
  • No module import cycle; both files under the cap
  • Live python -m agilesync.tools.smoke run passes end to end

🤖 Co-authored by Claude Opus 5.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions