Skip to content

Refuse an Explicit --run With No Process Log in find_run - #1150

Merged
ptr727 merged 1 commit into
developfrom
fix/explicit-run-no-log-1138
Nov 1, 2026
Merged

ptr727 merged 1 commit into
developfrom
fix/explicit-run-no-log-1138

Conversation

@ptr727

@ptr727 ptr727 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

An explicit --run naming a directory with no PlexCleaner_process.log was accepted by find_run. parse_log reads a missing log as no findings, so:

  • audit_physical.py stamped every reduced entry with shape_coverage 1.0 and printed no GAP line, rewriting the reduced catalog.json with coverage it never measured.
  • catalog_corpus.py built a full catalog with empty detections, verify_errors, decode_subtypes, and tracks.

find_run now exits on an explicit --run whose process log is missing, naming the resolved log path. Both ground-truth tools pick their run through find_run, and both call it before reading or writing anything else, so the refusal lands before the reduced catalog is touched.

parse_log keeps returning {} for a missing log. reduce_corpus.py calls it on a per-clip clip_process.log that a failed clip run may not write, and handles that case from the missing results file.

Verification

  • python3 -m unittest discover -s tests in RegressionTests: 33 tests OK, including new cases for a missing run directory and a directory without a process log.
  • uvx ruff@latest check ., uvx ruff@latest format --check ., uvx mypy@latest: clean.
  • The issue's repro with constructed inputs (a one-entry catalog.json, --run 0.0.0-gmissing): both audit_physical.py and catalog_corpus.py exit 1 with ERROR: --run 0.0.0-gmissing has no process log at <results>/0.0.0-gmissing/PlexCleaner_process.log, and the reduced catalog.json is unchanged.
  • Local strict review (frontier tier) over the full diff against develop: no findings. prose_lint.py --diff reported nothing.

Fixes #1138

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Explicit run paths are now verified to contain the expected process log. Missing directories or logs produce an error instead of returning an unusable path.

parse_log reads a missing log as no findings. So audit_physical.py stamped
full shape coverage, and catalog_corpus.py built a catalog with no detections,
for a --run naming a directory that holds no PlexCleaner_process.log. find_run
now exits naming the missing log path, which covers both ground-truth tools.
parse_log keeps returning {} for a missing log, since reduce_corpus.py relies
on that for a clip run that wrote none.

Fixes #1138

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 1, 2026 18:32
@ptr727

ptr727 commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 3443c5aa72625ddaa77880c8d06f9f09056fca3d, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b47768ba-4ecd-472e-bec7-adcd02ff46f7
Commits

Reviewing files that changed from the base of the PR and between 7d1ccbc and 3443c5a.

Files selected for processing: 2
  • RegressionTests/corpus_common.py
  • RegressionTests/tests/test_corpus_common.py

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

find_run now resolves relative explicit run paths under REG_DIR and requires the run directory to contain PlexCleaner_process.log. Tests cover valid paths and missing-run or missing-log failures.

Changes: Explicit run validation

Layer / File(s) Summary
Resolve and validate explicit runs
RegressionTests/corpus_common.py, RegressionTests/tests/test_corpus_common.py
find_run checks for PlexCleaner_process.log before returning an explicit run path. Tests cover valid absolute and relative paths, a missing run, and a directory without a process log.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Merge Risk: Minimal · up to 3443c

The change rejects explicit runs without a process log and identifies the missing path. No actionable merge-blocking issue remains after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: find_run rejects an explicit --run when PlexCleaner_process.log is missing.
Linked Issues check Passed Issue #1138 requires standalone audit_physical.py to reject an explicit --run when its run directory or PlexCleaner_process.log is missing, and to name the missing path. audit_physical.py call…
Out of Scope Changes check Passed The pull request changes the shared run-selection guard and its focused regression tests. These changes directly implement issue #1138 and support the stated standalone-tool behavior. No unrelated sou…
Full details: Linked Issues check

Explanation

Issue #1138 requires standalone audit_physical.py to reject an explicit --run when its run directory or PlexCleaner_process.log is missing, and to name the missing path. audit_physical.py calls find_run before reading catalog.json or writing it. In the reviewed head, find_run resolves relative paths, checks PlexCleaner_process.log with is_file(), and exits with an error containing the resolved log path. The added tests cover a missing directory and a directory without a log. The behavior also protects catalog_corpus.py, which uses the same helper.

Full details: Out of Scope Changes check

Explanation

The pull request changes the shared run-selection guard and its focused regression tests. These changes directly implement issue #1138 and support the stated standalone-tool behavior. No unrelated source changes are present in the whole-PR diff.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Reject explicit runs without a process log

🐞 Bug fix 🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Reject explicit --run paths without a process log before either ground-truth tool processes
 data.
• Preserve missing-log behavior for per-clip parsing while covering valid and invalid run paths with
 tests.
Diagram

graph TD
  Run["Explicit run"] --> Gate{"Log exists?"} -->|yes| Log["Process log"] --> Audit["Physical audit"] --> Output["Catalog JSON"]
  Log --> Builder["Catalog builder"] --> Output
  Gate -->|no| Exit["Error exit"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Make missing logs fatal in parse_log
  • ➕ Centralizes missing-log handling at the file reader.
  • ➖ Would change per-clip behavior relied on by reduce_corpus.py, requiring caller-specific exceptions or a strictness flag.

Recommendation: Keep validation in find_run: it protects both ground-truth tools at run selection without changing parse_log's useful missing-clip-log behavior.

Files changed (2) +28 / -3

Bug fix (1) +5 / -1
corpus_common.pyValidate the process log for explicit runs +5/-1

Validate the process log for explicit runs

• find_run now resolves an explicit run path and exits with the expected log path if PlexCleaner_process.log is not a file. Automatic run selection and parse_log behavior remain unchanged.

RegressionTests/corpus_common.py

Tests (1) +23 / -2
test_corpus_common.pyCover valid and logless explicit run paths +23/-2

Cover valid and logless explicit run paths

• Replaces path-only assertions with absolute and relative runs containing a process log. Adds tests for a missing run directory and an existing directory without a process log.

RegressionTests/tests/test_corpus_common.py

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

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 reviewed changes address missing-process-log failure modes for explicit runs and include regression coverage for valid and invalid paths.

No open issues 🎉

What changed in this PR

This pull request prevents explicitly selected runs without PlexCleaner_process.log from being treated as valid, avoiding false coverage results and empty catalog data.

Changes:

  • Validate the process log for explicit --run selections.
  • Report a clear error when the run directory or process log is missing.
  • Add regression tests for valid paths and missing-log cases.
  • Preserve missing-log handling for per-clip reduction logs.
File Description
RegressionTests/​tests/​test_corpus_common.py Covers valid explicit runs, missing directories, and missing process-log failures.
RegressionTests/​corpus_common.py Rejects explicit runs that lack PlexCleaner_process.log.

Review effort: Lite

@ptr727
ptr727 merged commit 365b47a into develop Nov 1, 2026
15 checks passed
@ptr727
ptr727 deleted the fix/explicit-run-no-log-1138 branch November 1, 2026 19:07
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.

2 participants