Skip to content

perf(skill-quality): summarize measure-invocation validate warnings - #12961

Merged
kyle-sexton merged 2 commits into
mainfrom
perf/12242-measure-invocation-quiet
Nov 3, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
perf/12242-measure-invocation-quiet

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #12242

Summary

Source 4 of #12242: measure-invocation.sh validate sent long stderr into agent sessions. 860 of
its roughly 1,000 lines over this repository's probe directories were one of three repeated
shapes: a WARN per cross-plugin competitor (388 lines, each repeating the same reason clause), and
two INFO lines per skill (230 listing <path> and 230 query-split lines). The default output is
now short. --verbose prints the old output byte for byte, so no signal is lost.

Fix

  • Default: one WARN per probe file naming every competitor not from the file's plugin, e.g.
    WARN: <file> (<skill>): 3 competitor(s) not from plugin 'p': 'a:x', 'b:y', 'c:z', and one INFO
    line per run giving the total, the reason, and a pointer to --verbose. The per-skill listing
    and query-split INFO lines print only under --verbose.
  • Unchanged in both modes: the warning count in the PASS (N warning(s)) line (still one per
    competitor), exit codes, FAIL lines, copied-span WARNs (17 today, each distinct), query-count
    and skill_dir WARNs, the unresolved-count INFO, and the validated-count INFO.
  • cmd_validate parses --copy-span N and --verbose in either order and rejects an unknown
    option with exit 2.
  • Shape choice: a flag rather than a file of per-item lines, because a file needs a location and
    a retention rule and a flag needs neither. Basis: judgment, plus CI reads only the exit code
    (.github/workflows/pr-require-checks.yml "Validate invocation probes" step, validate "$dir" || status=1), so CI needs no change.
  • Docs: probes/template.md described "warns on each cross-plugin rival" and now describes the
    per-file WARN and --verbose. The script's --help header is updated. skills/check/SKILL.md,
    the README and reference/invocation-probes.md do not describe the changed lines and are left
    alone. The changelog fragment states the new default, which supersedes the 0.32.1 entry's "a
    WARN for each probe competitor".

Verification

stderr bytes of measure-invocation.sh validate <dir> over all 67 plugins/*/probes directories
(stdout is 0 bytes in every case; every directory exits 0, before and after):

Run Total stderr bytes
Before (origin/main 1e896ce) 214,393
After, default 57,595 (-73%)
After, --verbose 214,393; diff -r against the before capture is empty for all 67 directories (stderr, stdout and exit code)

Largest directories, before to after default: harness-ops 22,691 to 4,333; discipline 22,327 to
4,734; docs-hygiene 13,372 to 3,186; session-flow 12,565 to 5,630; planning 11,169 to 2,996. A
directory with no warnings goes from 300-3,000 bytes to 81. The issue's 74,671 chars covered 5
Bash results in one session; this sweep covers all 67 directories.

  • bash plugins/skill-quality/scripts/measure-invocation.test.sh: all passed. New rows cover the
    per-file default WARN (one line naming both rivals, warning count kept, no per-skill INFO),
    --verbose in three option orders (per-competitor WARNs and per-skill INFO return, no summary
    line), and an unknown option (exit 2).
  • bash scripts/check-affected.sh --tests: 14 passed, 2 skipped over 4 changed files.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015te8CsyoyMhoEcPAAHxicU

kyle-sexton and others added 2 commits November 3, 2026 16:59
validate printed a WARN per cross-plugin competitor, each repeating the
same reason clause, plus two INFO lines per skill. Over the 67 probe
directories that was 214,393 bytes of stderr, most of it repetition an
agent session had to read.

By default it now prints one WARN per probe file naming every foreign
competitor, one INFO line with the total and the reason, and no
per-skill listing or query-split INFO. --verbose restores the old
output byte for byte. The warning count, exit codes and every other
line are unchanged. Default stderr over the same directories is 57,595
bytes.

Refs: #12242

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8CsyoyMhoEcPAAHxicU
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 3, 2026 22:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T22:05:27.856181Z cd58f91 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #12961 (cd58f91)

I found no security issues in this pull request.

Scope: I read every hunk of all 4 changed files in .claude-lane/pr.diff:

  • the changelog fragment
  • plugins/skill-quality/probes/template.md
  • plugins/skill-quality/scripts/measure-invocation.sh
  • plugins/skill-quality/scripts/measure-invocation.test.sh

None of them match a trusted-path glob. None is a plugin manifest, a trust control, a merge hold or a standing-instruction file. The only instruction-like text touched is one sentence in template.md, and that sentence describes output; it is not a rule. Nothing in the diff deletes or narrows a guardrail.

What I checked in measure-invocation.sh:

  • Option parsing. The new cmd_validate loop handles --copy-span and --verbose in either order. --copy-span is still checked by positive_int before it is used, and any unknown --* option exits 2. This is a local dev and CI validator, and only its exit code is read.
  • Format strings. The new per-file WARN printf uses a fixed format string. The probe-file values ($f, $skill, $plugin and the competitor ids) go in as arguments, so a crafted probe JSON cannot inject format directives. printf "'%s', " "${foreign[@]}" | sed 's/, $//' only builds a display string.
  • jq. The query is unchanged. It moved from a while read loop into mapfile, and the plugin prefix is still passed with --arg, not interpolated.
  • No new attack surface. Nothing is eval'd, no commands are built from probe content, and no credentials or tokens are touched. The CI step that reads only the exit code (pr-require-checks.yml "Validate invocation probes") is unchanged, as the PR description says.

Test file: It adds fixture rows. The deliberate word-split of $args has a shellcheck annotation and uses fixed literals only.

The PR context contains no embedded instructions aimed at this review. The prior-findings file lists no earlier posts (0 rounds, cap 3), so the round cap did not apply.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #12961 (no findings)

I read every hunk of all 4 changed files: the changelog fragment, probes/template.md, measure-invocation.sh and measure-invocation.test.sh. I also read the cmd_validate code around the change at head.

What I checked by reading the code (I could not run anything):

  • Option parsing. --copy-span N and --verbose now parse in either order, and an unknown --* option exits 2. The new parsing still uses the existing positive_int check. The script runs under set -uo pipefail without -e, so a ((verbose)) && note … line that evaluates false cannot abort the run.
  • Byte-for-byte --verbose claim. It holds up in the code. The per-competitor warn loop runs over the same jq selection as before, and the competitor list is now read in with mapfile. The listing and query-split note lines print at their old positions. The cross/cross_files counters only grow in default mode, so --verbose never prints the new summary INFO line.
  • Warning count. The count in the PASS (N warning(s)) line stays the same in both modes. Default mode adds ${#foreign[@]} to warns once per file, and --verbose adds one through warn() per competitor.
  • Edge cases. With no cross-plugin competitors, the empty-array idiom ${foreign[@]+"${foreign[@]}"} keeps set -u from failing, and local -a foreign=() clears the list for each file.
  • Consumers of the old output. Nothing else in the repository reads the old per-competitor text. CI (.github/workflows/pr-require-checks.yml, "Validate invocation probes") only checks the exit code.
  • Tests. The new tests cover:
    • the default single WARN per file;
    • that grep -c 'not from plugin' finds one line (the summary INFO line says "file's plugin", so it doesn't match);
    • the warning count;
    • --verbose in three option orders;
    • the unknown-option exit 2.

Author-claimed and unverified: the stderr byte counts (214,393 to 57,595), the empty diff -r result for --verbose, and the test-suite and check-affected.sh passes.

Other checks:

  • Closing issue: none. The PR says Refs: #12242 and that the issue stays open, so there were no acceptance criteria to check.
  • Path-scoped rules: no rule's paths: glob under .claude/rules/ matches a changed file.
  • Paved paths: docs/standards has no paved-path entry.
  • Plugin manifests: no plugin.json or marketplace.json changed.
  • Prior findings: none (round 0 of a cap of 3).
  • Embedded text: I found no embedded instructions in the PR context.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 5ad580e Nov 3, 2026
56 checks passed
@kyle-sexton
kyle-sexton deleted the perf/12242-measure-invocation-quiet branch November 3, 2026 22:24
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 86%; mutation score 86%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/skill-quality/scripts/measure-invocation.sh 6 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/skill-quality/scripts/measure-invocation.sh:230 ROR productive no-assertion

The run's summary has the full report.

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