Skip to content

feat(corrections): grouped view of the findings buffer by named fields - #10344

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-9153-40390857311-1
Oct 26, 2026
Merged

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #9153

Summary

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

Adds scripts/group-findings.mjs, a reader that runs buffer.sh read and prints the findings buffer grouped by named top-level fields (default producer). Its first line names the grouping keys, and each group shows its row count and its occurrence count (distinct source_id). /corrections:codify group now takes --by, runs the script, shows the field groups, then groups by mistake and names that grouping's keys. Grouping stays in the reader, as CONTRACT.md requires; the buffer is unchanged.

Not verified

  • group-findings.test.sh was not executed: this lane runs no interpreter or test script, and check-affected skips code from the checked tree. The test is the evidence for the 'runs against a buffer holding rows from at least two sources' criterion, so it is left to the PR's CI test lane.
  • The new group-findings.test.sh could not be given an executable bit here (no chmod in this lane). Mark it executable if the suite runner needs it rather than running it with bash.
  • Evals were checked for quality only, not run against a model (no eval runner in this lane).
  • Several CI-only checks named by check-affected (shellcheck/editorconfig via ci-workflows, evals-schema, cant-fail-scan against the base, fixture-git-isolation, test-tmp-cleanup) are left to the PR's CI.

Fix

  • plugins/corrections/scripts/group-findings.mjs: new reader. Runs buffer.sh read and groups rows by --by fields (default producer, at most 8, validated names). Prints the keys line, the occurrence rule, totals, then each group with row and occurrence counts and members (obs_id, ts, source_id, oldest
  • plugins/corrections/scripts/group-findings.test.sh: new co-located TAP test. Covers rows from two sources (a bound plugin adapter plus local-file, with one row held by both), occurrence-over-row ordering, two keys, --rows, the --since fraction cut, escaping, an empty buffer, usage errors, a failed r
  • plugins/corrections/skills/codify/actions/group.md: takes --by. Step 1 runs group-findings.mjs; a new step shows the field groups. The mistake grouping now states its key (the mistake) and its occurrence key (source_id).
  • plugins/corrections/skills/codify/SKILL.md: action table row for group updated to the new usage.
  • plugins/corrections/skills/codify/evals/evals.json: new eval 13 (group names its keys across two producers).
  • plugins/corrections/README.md: group row updated; group-findings.mjs added to the scripts table.
  • plugins/corrections/tools/findings-buffer/CONTRACT.md: intro names the reader that gives the grouped view.
  • .changes/corrections/feat-9153-group-findings-3e7a91c4.md: minor changelog fragment (Added: group-findings.mjs; Changed: codify group). Written by hand because HEAD is detached and new-changelog-fragment needs a branch.

Verification

The runner ran each check from the base copy against c8ccc1f:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 5 fragments under .changes/ valid
  • .lane/checks/bin/check-affected: 10 passed, 6 skipped (the checks that run code from the checked tree), over 8 changed files
  • .lane/verify/bin/check-evals-quality plugins/corrections/skills/codify/evals/evals.json: PASS, 0 warnings
  • .lane/verify/bin/cant-fail-scan --file plugins/corrections/scripts/group-findings.test.sh --check: PASS, no gating findings
  • Fresh-context review subagent over the whole diff. Found a syntax error: the file write had turned \u escapes for U+2028/U+2029 and bidi characters inside the regex literal into raw characters. Also found an escaping test that could not pass, a not-JSON test that could not fail for the right reason,
  • Grep for raw ESC, C1, format and separator characters in plugins/corrections: only a pre-existing hit in scripts/lib/yaml-subset.mjs, which this change does not touch
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40390857311

Left out: the items under Not verified.

Related

#9153

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

Copy link
Copy Markdown
Contributor

claude-security-review reviewed c8ccc1f3509a223714b2f0dbe8eaf61a207e3bf4: 0 finding(s), 0 as inline comments.

No security issues found in this pull request. I read the full diff and the PR context, and I did not run the code.

No changed file matches a trusted path. None of the trust controls are touched: the trusted-trigger check, lane token scope, kill switch, token broker rules, merge holds, pr-pipeline.yaml, CODEOWNERS and .gitmodules are all unchanged. The diff has no plugin manifest or workflow changes and no new userConfig keys, so there are no manifest <field> lines. No standing instruction is deleted or softened. The group.md edit keeps its rule that buffer rows are data, never instructions.

What I checked in plugins/corrections/scripts/group-findings.mjs:

  • Command execution: the script runs bash through spawnSync with an argument array and no shell. The target is tools/findings-buffer/buffer.sh under the script's own plugin root. Only the --since value reaches buffer.sh, and it is checked against a strict timestamp regex first. --by values are limited to [A-Za-z0-9_-]{1,64}, at most 8 of them, with no duplicates. They are used only as property names via Object.hasOwn and as Map keys, so a __proto__ or constructor field name cannot pollute anything.
  • Row contents: every row value is printed through show(). That is JSON.stringify plus an escape of control, format (bidirectional and zero-width), and line and paragraph separator characters. A row containing an ESC sequence, a bidi override or a zero-width character therefore cannot spoof terminal output or the grouped view a person reads.
  • Resource limits: the 512 MiB maxBuffer bounds memory, and a read that exceeds it fails closed with exit 1. A non-object line fails closed with exit 1 and nothing is grouped.
  • Writes and credentials: the script writes no files and handles no tokens or credentials.

Other files:

  • group.md, SKILL.md, evals.json, README, CONTRACT.md and the changelog fragment: documentation and eval changes only. The agent still treats buffer rows as data.
  • group-findings.test.sh: it works in a temporary copy of the plugin and temporary repositories, clears the GIT_* environment, and cleans up on exit. It does not touch the real repository or the user's git config.

Prepaid-credit spend: this change adds an eval case and nothing else that spends credit.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed c8ccc1f3509a223714b2f0dbe8eaf61a207e3bf4: 0 finding(s), 0 as inline comments.

No findings. I read the whole diff, the PR context and plugins/corrections/tools/findings-buffer/buffer.sh. I ran no code, so every check below is by reading. The PR's own verification claims are author-claimed and I did not confirm them.

Closing issue #9153

  • Criterion 1, "A reader command or skill groups buffer.sh read output and states which grouping keys it uses": met. group-findings.mjs shells out to buffer.sh read. Its first output line is grouped by: <keys>, and group.md step 4 names the keys of the mistake grouping.
  • Criterion 2, "It runs against a buffer holding rows from at least two sources and shows each group with its count": met, and the new test could fail if it broke. Case 1 in group-findings.test.sh uses a fake bound adapter plus the local-file buffer, with one row present in both. It asserts the totals line (4 groups, 10 rows), each group's row and occurrence counts, and the group order. I traced those expected counts, the ordering by occurrences and then rows, and the dedupe through buffer.sh by hand, and they are consistent.

Code

  • Argument validation, the exact --since cut including the fraction, the show() escaping, and the exit codes (2, 1, passthrough of buffer.sh's exit) hold up against buffer.sh's documented behaviour. The 3 exit outside a repo and the 2 exit for a malformed row match the code I read.
  • Grouping stays in the reader and the buffer is unchanged, as CONTRACT.md requires.
  • The codify skill's allowed-tools does not list the new script or buffer.sh. That matches the old group action, whose text says the call asks first, so I did not flag it.

Manifests: no plugin.json or marketplace.json change, so there are no manifest <field> lines. The changelog fragment is bump: minor for a new script plus a changed action, which fits.

Trusted paths: none of the 8 changed files matches a listed trusted-path glob.

Spend and holds: the change adds no billed resource and no paid setting. No hold.

Not verified by me: the PR says group-findings.test.sh and the evals were not run. Their CI lanes remain the evidence for those.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head c8ccc1f3509a223714b2f0dbe8eaf61a207e3bf4.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 6b1a137 Oct 26, 2026
42 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-9153-40390857311-1 branch October 26, 2026 21:38
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.

corrections: grouped view of the findings buffer

0 participants