Skip to content

perf(rate-limit-guard): resolve tee by install record then version on cache miss (#4676) - #4719

Merged
cursor[bot] merged 6 commits into
mainfrom
cursor/4676-shim-version-resolve-37e9
Sep 28, 2026
Merged

cursor[bot] merged 6 commits into
mainfrom
cursor/4676-shim-version-resolve-37e9

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

Closes #4676

Summary

On resolution-cache miss, rank tee candidates by (1) installed_plugins.json installPath, (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

  • shim suite 104/0 after main merge (per implementer)
Open in Web Open in Cursor 

cursoragent and others added 4 commits September 27, 2026 22:13
…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>
…two candidates to rank (#4676)

A single live tee needs no ranking, so the miss path skips the record
read. The ranking helpers are shared verbatim with the context-guard
shim (#4675).

Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
)

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>
@github-actions

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body does not yet satisfy the issue-linkage contract:

  • Missing a "## Fix" section. State the concrete change and how it addresses the problem.
  • Missing a "## Verification" section. Record concrete evidence the change works (commands, gates, output).
  • Missing a "## Related" section. List related PRs, ADRs, or decision-log entries this PR does not close.

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>
@cursor
cursor Bot marked this pull request as ready for review September 28, 2026 00:16
… 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>
@cursor
cursor Bot merged commit 63be30c into main Sep 28, 2026
19 checks passed
@cursor
cursor Bot deleted the cursor/4676-shim-version-resolve-37e9 branch September 28, 2026 00:33
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(rate-limit-guard): resolve the tee by version on a shim cache miss

2 participants