Skip to content

Fix: find_active_run treats skill artifacts as loop-state candidates (GH-36) - #38

Merged
hpieris-dm merged 1 commit into
mainfrom
fix-gh-36-find-active-run-artifact-collision
Sep 11, 2026
Merged

hpieris-dm merged 1 commit into
mainfrom
fix-gh-36-find-active-run-artifact-collision

Conversation

@hpieris-dm

Copy link
Copy Markdown
Contributor

Fixes #36.

Problem

find_active_run globbed every *.json under .dmx/jobs/{job_id}/ and treated a missing status field as non-terminal. A skill's own artifact written into the same directory — e.g. validate writing validation-report.json (no status/loop_name/task_id, per spec_adherence.py's expected shape) — was therefore mistaken for a second, permanently-non-terminal loop run, and loop_advance/loop_continue raised AmbiguousActiveRun on every attempt to proceed.

Fix

A JSON file is now only treated as a loop-state candidate if it actually has loop_name, task_id, and status all present. Anything else under the job directory — including any future skill artifact, not just this one — is skipped outright instead of defaulting to "non-terminal."

Testing

  • Added 3 cases to TestFindActiveRun: artifact alongside a real paused run (must still resolve the real run, not raise), artifact alone with no real run (must return None), and a non-dict JSON file (must not crash the scan).
  • Full suite: 483 passed. Ruff + mypy clean on changed files.

…H-36)

find_active_run globbed every *.json under a job directory and treated
missing status as non-terminal, so a skill artifact written into the same
directory (e.g. validate's validation-report.json, which has no status,
loop_name, or task_id) was mistaken for a second live run, raising
AmbiguousActiveRun on every loop_advance/loop_continue call.

A JSON file is now only a run candidate if it actually carries loop_name,
task_id, and status. Anything else in the job directory is skipped
outright.

Fixes #36
@hpieris-dm hpieris-dm added the bug Something isn't working label Sep 11, 2026
@hpieris-dm
hpieris-dm merged commit 9498d18 into main Sep 11, 2026
13 checks passed
@hpieris-dm
hpieris-dm deleted the fix-gh-36-find-active-run-artifact-collision branch September 11, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: find_active_run treats validation-report.json as a second live loop run

1 participant