perf(rate-limit-guard): resolve tee by install record then version on cache miss (#4676) - #4719
Merged
Merged
Conversation
…on a shim cache miss (#4676) On a miss the shim picked the newest tee by mtime; cache copies can carry equal mtimes, so -nt never fired and the first glob match won (0.8.1 ran while 0.8.9 was installed). A miss now ranks the version directory that installed_plugins.json names first, then dotted-number names by value, then mtime for any other pair. The record, now documented in the plugins loading reference, is read with one builtin on a miss only; the hit path is unchanged. Shim revision 5; rate-limit-guard 0.8.29. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
…ion-resolve-37e9 # Conflicts: # plugins/rate-limit-guard/.claude-plugin/plugin.json # plugins/rate-limit-guard/CHANGELOG.md Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Contributor
|
PR body contract — issue linkage This PR body does not yet satisfy the issue-linkage contract:
Edit the body and this comment updates itself on the next run. |
The Windows installPath used a real user name, and the assertion text used the British spelling typos rejects. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
… gate The JSON-escaped <user> segment contains the GNU word-boundary token, and the gate wants that called out on the line. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
This was referenced Sep 29, 2026
kyle-sexton
added a commit
that referenced
this pull request
Sep 29, 2026
…5306) Closes #4676 ## Summary - #4676 AC3 asked for the statusline tee's measured per-render process count, or a statement that no diet was needed. #4719 (0.8.30) shipped AC1 and AC2 and closed the issue without either. This PR records the counts: the render path spawns 0 processes, the elected drain spawns 5 to 12 once per drain interval, so no diet was needed. - Five released CHANGELOG entries (0.8.29, 0.8.31, 0.8.33, 0.8.34, 0.8.35) described shared code this plugin never calls. They now say so in one line. Node.js is now declared as a requirement. ## Fix - `bench/trace-probe.sh --count` reports processes spawned per render shape (external commands and subshell forks, counted by pid with pid-logging stubs on `PATH`). `bench/bench.test.sh` gains four `--count` cases, including one that fails on an unstubbed external. `bench/README.md` records the table and the method. - No tee code changed. Version 0.8.36 to 0.8.37. - In-place corrections of released CHANGELOG entries, each reduced to a one-line sync note: - 0.8.29 (quadratic `hook::bash_parse_segments` prose; also dropped the #4528 link, since 0.8.29 shipped in PR #4711 for #4679) - 0.8.31 (`wsl` operand parsing prose) - 0.8.34 (`hook::repo_relative_path_to` prose) - 0.8.35 (prerequisite notice and format-hook prose; this plugin has no format hooks or `prerequisites.json`) - 0.8.33 (shared launcher prose that claimed the hook rows were unchanged after 0.8.32 rewrote them), reduced to "Shared launcher/library sync; no change to this plugin's behavior." The 0.8.37 entry names the same five corrections, which is what `check-changelog-parity.sh` requires for an in-place edit. - Declared Node.js: README Requirements now lists it and `skills/setup/SKILL.md` `check` step 1 probes `node` (a pre-computed `command -v node` row, so it works without the launcher), because the `StopFailure` row runs through `node hooks/exec-bash.mjs`. The launcher itself is unchanged. ## Verification Run in the worktree after merging origin/main: - `bash plugins/rate-limit-guard/bench/trace-probe.sh --count`: non-elected unchanged input 0, non-elected changed input 0, elected drain (no-change skip) 5, snapshot rewritten 8, orphan sweep due 9, first render on a machine 12. - `BENCH_LANES=1 bash plugins/rate-limit-guard/bench/bench.test.sh`: PASS=17 FAIL=0. - `bash plugins/rate-limit-guard/scripts/statusline-tee.test.sh`: PASS=146 FAIL=0. - `bash plugins/rate-limit-guard/scripts/statusline-shim.test.sh`: passed 104, failed 0. - `bash plugins/rate-limit-guard/hooks/record-rate-limit-stop.test.sh`: PASS=19 FAIL=0. - `scripts/check-changelog-parity.sh --check --check-order`: clean. - `scripts/validate-plugins.sh`: all manifests and the catalog validated. - `scripts/check-changed-skills.sh origin/main`: setup skill PASS, 0 errors. - Confirmed `record-rate-limit-stop.sh` calls only `hook::buffer_stdin_to`, `hook::json_escape` and `hook::append_jsonl` from hook-utils.sh. Wall clock on this host (WSL2, `bench-idle.sh 21`, throwaway HOME): median 5 to 6 ms per render. Not comparable to the Windows figures; process counts are the portable claim. Not measured: the bash older than 4.2 fallback (macOS `/bin/bash` 3.2), which this host cannot run. ## Related - Audit finding for #4676 (REPORT.md row 3b) and the `plugin-rate-limit-guard` changelog finding: `.work/audit/REPORT.md`. - Sibling: #4721 (context-guard tee), a separate plugin; #4675 is its closed context-guard issue. - #4719 shipped AC1 and AC2 of #4676. - Cross-group requests applied: hook-launcher F48 (0.8.33 wording and Node.js declaration; the launcher code ships in #5309). Tracker F88 was already met by this PR (0.8.37 CHANGELOG and `bench/README.md` state the measured counts). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EugXnFddtpHcY5gTuyEirB --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4676
Summary
On resolution-cache miss, rank tee candidates by (1)
installed_plugins.jsoninstallPath, (2) dotted version value, (3) mtime. Stops equal-mtime globs picking an older tee (e.g. 0.8.1 over 0.8.9).rate-limit-guard→ 0.8.30.Test plan