Skip to content

mia-data: split the poller, simplify the job builders and the checks - #48

Merged
krokicki merged 1 commit into
mainfrom
mia-structure
Oct 15, 2026
Merged

krokicki merged 1 commit into
mainfrom
mia-structure

Conversation

@krokicki

@krokicki krokicki commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Summary

Structural cleanup of the mia-data hotspots ruff's complexity rules flagged. No behaviour change intended; the poll and replay tests pass unchanged.

  • mia_data/poll.py (new): the poll activity's body, as run_poll plus one function per job: deliver_label (a human label on a dataset issue becomes a signal, or is removed with a reason), wake_dataset_workflow (a changed snippet PR signals pr_update), pass_status_without_snippet (PRs with no snippet get the mia-data/crops status). Activities.poll delegates. activities.py loses ~100 lines; poll was 17 branches.
  • Job builders take JobArgs. crop_job went from 12 positional parameters to (cfg, args, snapshot, existing); smoke_job, verify_job and match_job likewise. The activity already had every value in args; the builders were unpacking it. binding.yaml and record.yaml are now module constants, since every workspace uses those names.
  • mia check's csub policy check is _csub_problems, _mount_problems and _queue_problems at module level instead of one 20-branch closure. Messages unchanged (the CLI tests assert on them).
  • Config._finish calls five named checks (_check_github, _resolve_paths, _check_limits, _check_agent, _check_network).

Still above the complexity line and left alone on purpose: run_test_pr and publish are long but linear; check_binding is a validator whose branches are the rules; cmd_check is now a list of small closures.

Test plan

  • pixi run lint, pixi run typecheck clean
  • pixi run test: 367 passed, including poll and replay tests
  • CI

🤖 Generated with Claude Code

@StephanPreibisch

… split

- poll.py: run_poll walks issues and PRs; deliver_label, wake_dataset_workflow
  and pass_status_without_snippet each handle one item and fail alone. Same
  behaviour, same log lines; the poll tests in test_mia_workflows cover it.
- jobspec builders take the submit activity's JobArgs instead of unpacking
  it into up to twelve positional parameters; binding.yaml / record.yaml
  are module constants since every workspace uses those names.
- cmd_check's csub policy check becomes _csub_problems with _mount_problems
  and _queue_problems; config._finish calls five named checks.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@krokicki
krokicki merged commit 270ca1c into main Oct 15, 2026
1 check passed
@krokicki
krokicki deleted the mia-structure branch October 15, 2026 15:52
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.

1 participant