Skip to content

refactor(harness-ops): simplify observability probe, report-path and session-compare scripts - #14999

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14579-42764453933-1
Nov 10, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14579-42764453933-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14579

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Simplified the three harness-ops observability scripts without changing their behavior. In probe-observability-state.sh, the Windows OSTYPE test that appeared twice is now one is_windows helper, the newest-session lookup reuses the already-globbed session_files array instead of globbing again, and a redundant SHARED_FILES reset is gone. In report-path.sh, the -d guard around the legacy-file loop is dropped because the loop's own -f test already covers a missing directory. In session-compare.sh, usage() uses one sed instead of two piped seds. The --help header comments and heredoc were left untouched because they are printed output.

Not verified

  • Did not run the probe-observability-state.test.sh, report-path.test.sh and session-compare.test.sh suites, because this lane runs no interpreter or test runner. Left to the PR's CI.
  • Tidy did not run every pass: passes 1-3 found nothing to change; passes 4-5 (markdown writing rules and ai-slop) were skipped because the fragment's body is fixed word for word by the issue's acceptance criteria.
  • Review note, not acted on: with an exported BASHOPTS=failglob and no reports/ directory, report-path.sh now prints a bash 'no match' error to stderr where the old -d guard skipped silently (stdout and exit 0 unchanged). The old code already shows the same error whenever reports/ exists with no…
  • ci-status green is a PR CI check, left to the PR's CI.

Fix

  • plugins/harness-ops/skills/observability/scripts/probe-observability-state.sh: added an is_windows helper, used in prune_task_state and the --otel-store backslash normalization; ls -t now reuses session_files; removed a redundant SHARED_FILES=() reset in --pipeline
  • plugins/harness-ops/skills/observability/scripts/report-path.sh: removed the redundant [[ -d ]] wrapper around the unkeyed-leftover loop
  • plugins/harness-ops/skills/observability/scripts/session-compare.sh: usage() is now a single sed instead of two piped seds, same output
  • .changes/harness-ops/work-resolve-issue-issue-14579-42764453933-1-a1669e85.md: new patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 57f604c:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

Left out: the items under Not verified.

Related

#14579

Merge-Risk: unrated reason=pending

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 57f604c6290a6819eb2d73a3d453ec3bf48f0626: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read every hunk of all 4 changed files. Each refactor matches the behavior on the base branch:

  • probe-observability-state.sh
    • The is_windows helper checks the same msys*/cygwin*/win* patterns as the two case blocks it replaces. The script runs set -uo pipefail with no -e, and the is_windows && STORE=... line is a case branch at top level, not the last command of a function. So when it evaluates false nothing aborts and no exit status leaks.
    • Only this file defines the name, so it doesn't clash with the sourced session-log-lib.sh.
    • ls -t "${session_files[@]}" only runs when session_count > 0. That array is the same sessions/*.jsonl glob (taken under nullglob), so the result is the same, including for paths with spaces.
    • Dropping SHARED_FILES=() changes nothing. The array is initialized at global scope (L192), and before the --pipeline check only shared_files writes to it. So it is still empty when ROOT_VALID=0, and set -u has no unbound variable to trip on.
  • report-path.sh: if the directory is missing, the glob stays literal and the [[ -f ]] || continue check skips it, as the PR describes. The PR body already notes the one difference, under an exported failglob (a stderr message only). I don't count it as a finding.
  • session-compare.sh: sed -n '2,17{s/^# \{0,1\}//;p;}' prints the same lines as the two piped seds, and the ;} ending works in both GNU and BSD sed.

Closing issue #14579, acceptance criteria

  • Behavior unchanged: met, by my reading of the code above. I ran no tests, so this is not test-confirmed. The repository's probe-observability-state.test.sh already exercises the OSTYPE branches (linux-gnu and msys).
  • Only the listed files plus a changelog fragment are edited: met.
  • Within 400 lines and 15 files: met.
  • The fragment uses bump: patch with ### Changed and "Internal simplification, no behavior change.": met.
  • ci-status green: not checked by this lane. The author also leaves it to the PR's CI.

The PR body's verification results (fragment and skill checks, check-affected) are the author's claims; I did not verify them. Nothing in the PR context told the lane what to do.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 57f604c6290a6819eb2d73a3d453ec3bf48f0626: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14999 (head 57f604c)

I found no security issues.

I read every hunk of all 4 changed files. None of them is on a trusted path or a trust control: no workflow, action, merge-hold script, manifest or instruction surface is touched.

  • probe-observability-state.sh: the new is_windows helper tests the same three OSTYPE patterns that the inline case statements tested. ls -t now gets the session_files array, which is already filled from the same "$ABS_ROOT"/sessions/*.jsonl glob under nullglob and stays quoted as a full path. Because the paths keep their $ABS_ROOT prefix, this adds no option-injection or word-splitting risk over the old glob. The removed SHARED_FILES=() reset was redundant: shared_files resets the array itself. Whether that reset matters when the root is invalid is a correctness question, not a security one, so it belongs to the code-review lane.
  • report-path.sh: removing the -d guard only changes what gets printed to stderr. The glob loop still skips names that are not files, and it reads or writes nothing new.
  • session-compare.sh: usage() now uses one sed instead of two piped, on the script's own header lines. There is no new input.
  • The changelog fragment is just text.

Prior findings: none, since this lane had not reviewed an earlier head. The PR context contains no embedded instructions aimed at the lane.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 57f604c6290a6819eb2d73a3d453ec3bf48f0626, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 57f604c

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14999-57f604c6290a6819eb2d73a3d453ec3bf48f0626, expires on 2026-12-10.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 6f2d813 Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14579-42764453933-1 branch November 10, 2026 06:35
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 6f2d813b7ef451fe4b21f1130c08f3bf47824c46; later checks count it verified from this comment.

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.

Simplify the observability harness-ops plugin code (3 of 3)

0 participants