chore(rate-limit-guard): commit the #2521 statusline benchmark harness (0.7.4) - #2583
Conversation
…s (0.7.4) The harness that produced #2521's headline render-path numbers (render.sh alone 234.4 ms vs 1047.1 ms behind the pre-#2521 tee, Windows/MSYS, n=9) lived only in an untracked scratch directory - the merged perf claim was unreproducible and unguardable against regression. Commit the four scripts worth keeping to plugins/rate-limit-guard/bench/, adapted to run from a clean checkout (STATUSLINE_ENTRY defaults to the repo's own tee in standalone mode instead of a machine-local entrypoint), plus a README recording the baseline numbers, platform, and spawn-floor method. Deliberately not wired into CI: wall-clock benchmarks on shared runners are noise, and none of these use the *.test.sh suffix the test runner discovers, so nothing new gates merges. Closes #2582 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aac8xjCjMxFsXGHCXKHY4W
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 5m 7s —— View job Claude's Task List
Review summaryThis lane is code-review-only here — Scope: the 4 new Findings posted inline (2):
Not flagged (checked, no issue found): the Verification note: the PR body's shellcheck/shfmt/portability/test-suite results are author-claimed — this sandbox's Bash execution required manual approval that wasn't available in this run, so I reviewed the scripts statically rather than re-running that tooling; I'm not asserting independent confirmation of those results. |
Security review complete
No security issues found. This PR adds a local benchmarking harness (
One non-security note for the author's awareness (not reported as a finding since it requires the operator to deliberately skip the documented isolation step, not an attacker-controlled path): |
|
Last security-reviewed head: |
|
Claude has reviewed this PR 2 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d1dd19e8f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… contract suite Address all five PR review findings: - Timer reads no longer fork: now_ms assigns via printf -v instead of a $(command substitution), which on MSYS added roughly a spawn floor to every sample (measured same-window on the repo tee: old instrument median 1434 ms vs new 510 ms). README carries an instrument note: the recorded #2521 absolutes are instrument-inclusive; the delta stands. - Missing EPOCHREALTIME (bash < 5.0) is now a loud refusal with rationale instead of a set -u unbound-variable abort; README reconciles this hard floor with the tee's own graceful 3.2+ degradation. - A failing render aborts the lane (bench-idle exits, bench-load marks and discards the run) instead of being timed as a plausible sample. - The load lane's pad-to-one-second arithmetic is computed properly in pace_sleep_arg: 0 ms spent now sleeps 1.000 s, not 0.1 s. - New co-located bench.test.sh contract smoke suite: unit-tests the lib helpers, runs each lane once with tiny parameters against the repo tee under an isolated HOME, and asserts the failure-abort paths — shape and behaviour only, never timing. scripts/affected-tests.sh --explain now maps every changed path (the P1 finding); exec bits set on all five scripts for the hygiene exec-bit gate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aac8xjCjMxFsXGHCXKHY4W
|
Claude finished @kyle-sexton's task in 2m 51s —— View job Claude's Task List
Review summaryCode-review lane only — this repo has a This review covers the delta since the last code-review pass on this PR ( All four previously-reported findings are fixed, correctly:
New code checked, no issues found: the new Verification note: this sandbox's Bash execution required manual approval not available in this run (including for No inline findings to post — the two prior code-review findings are resolved and no new issues surfaced in this round. |
|
Claude finished @kyle-sexton's task in 1m 8s —— View job Claude's Task List
Security review result: skip gate — no new security-relevant surfacePer
None of this touches trust boundaries, secrets/tokens, authorization, injection surfaces, or GitHub Actions workflow config — it's purely internal hardening of a local, non-CI-gated wall-clock benchmarking tool, addressing feedback already given. Per the skip gate, no new inline findings are posted. |
…ENTS.md (#2584) (#2585) Closes #2584 ## Summary Documents the Windows/git trap behind CI's `exec-bit=failure` in `AGENTS.md`: under `core.filemode=false` (every NTFS clone), `chmod +x` never reaches the index, so a newly added shebang file commits as `100644` and nothing looks wrong locally until the `hygiene` lane goes red. Two PRs hit this in one day (#2583 here, melodic-software/dotfiles#479). ## Fix Adds an `AGENTS.md` section, placed with the existing commit-mechanics rule ("Stage explicit paths"), that: - leads with the literal symptom string `exec-bit=failure` so a search from the red lane lands on it; - gives the two-line fix (`chmod +x` + `git update-index --chmod=+x`), which writes the index entry regardless of `core.filemode`; - explains why the defect is invisible locally on Windows and how to see it (`git ls-files --stage`); - points at the source-control commit skill's existing `exec-bit-check.sh` and its `reference/exec-bit.md` for depth — the trap bites only commits made without that skill. Deliberately documentation, not a new gate: the defect is already enforced fail-closed by the hygiene lane (whose per-file annotation prints the exact fix command) and auto-fixed at commit time by the commit skill; a third gate would duplicate the same CI round or introduce local git hooks, a mechanism this repo does not use. Rationale in #2584. ## Verification Mechanism verified empirically on a Windows/Git Bash box before documenting: fresh `git init` sets `core.filemode=false`; `chmod +x` + `git add` stages `100644`; `git update-index --chmod=+x` flips the entry to `100755`; a later `git add` of content edits preserves `100755`. The exec-bit action source at the pinned SHA (`ci-workflows` `c265418`) confirms the check is shebang-based and extension-agnostic, and mode-gated on `100644`. Local gates on the change: `markdownlint-cli2 AGENTS.md` (0 errors), `typos` (clean), `editorconfig-checker` (clean), `lychee --offline` (relative link OK), `gitleaks git` (no leaks), `scripts/affected-tests.sh` (no suites selected — every changed file is a recorded no-suite class). ## Related - Refs #2583 — this repo's occurrence (rate-limit-guard bench harness scripts) - Refs melodic-software/dotfiles#479 — same-day occurrence in a sibling repo - Refs #2569 / #2571 — the hook-portability gate precedent weighed (and distinguished) in the document-vs-enforce call 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Aac8xjCjMxFsXGHCXKHY4W --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
PR #2521's headline render-path measurement —
render.shalone 234.4 ms vs 1047.1 ms behind the pre-#2521 tee (Windows/MSYS, n=9, same-window) — was produced by a benchmark harness that lived only in an untracked local scratch directory. The merged perf claim was unreproducible, and nothing could catch a regression that quietly reintroduced the render-path cost. This PR commits the harness.bench/lib-bench.sh— shared helpers: the spawn-floor control (median of 11 barebash -c exitspawns, bracketing every timed section — on MSYS the process-creation floor dominates every number, so a run whose floor moved is discarded), the canonical statusline payload fixture,now_ms/median.bench/bench-idle.sh— the lane that produced the headline numbers: N sequential renders, floor before/after, median + mean + raw samples.bench/bench-load.sh— the concurrency lane: N virtual sessions rendering once a second for M seconds, the shape that stresses the spool/drain election.bench/trace-probe.sh— xtrace of a non-elected render, printing everything executed before passthrough: the check that the render path stays fork-free, which is the property perf(rate-limit-guard): spool the statusline snapshot, drain it on a cadence (0.7.0) #2521 exists to protect.bench/README.md— records what perf(rate-limit-guard): spool the statusline snapshot, drain it on a cadence (0.7.0) #2521 measured, on what platform, with what discipline, and how to re-run each lane (including isolating a run from the machine's live~/.claude/rate-limit-guard/contract file).Plugin
0.7.3 → 0.7.4with a changelog entry, per the shipped-contents-change convention.Adaptation from the scratch originals
STATUSLINE_ENTRYno longer defaults to a machine-local~/.claude/statusline/entrypoint.sh; it defaults to this repo'sscripts/statusline-tee.shin standalone mode, resolved relative to the bench dir — runnable from a clean checkout. The env override is documented for measuring a real machine entrypoint.trace-probe.shdefaults its tee argument to the repo copy the same way (it already isolated itself under a throwawayHOME).# shellcheck disable=SC2034on the payload fixture (consumed by the sourcing scripts), matching the hook-utils precedent..last-drainstamp,RLG_TEE_DRAIN_INTERVAL(default 30), and the{"e":…,"p":…}record shape all still match.Three scratch files were not brought over:
gates.sh(throwaway wrapper around repo CI gates, hardcoded to a dead worktree path),pr-body.md(byte-identical to #2521's merged body),gates.log(empty).CI stance
Deliberately no CI wiring: a wall-clock benchmark on shared runners is noise, not a gate. None of these files use the
*.test.shsuffix thatscripts/run-plugin-tests.shand the CI test lanes discover, so nothing new runs or gates in CI beyond the standard shell-lint gates. The tee's behavioural coverage remainsscripts/statusline-tee.test.sh.Verification
bench-idle.sh 3under an isolatedHOME, andtrace-probe.sh(pre-passthrough trace shows builtin-only work).shellcheck -x --rcfile=.shellcheckrc,shfmt -d,scripts/check-shell-portability.sh --pathson all four scripts: clean.markdownlint-cli2,typos,editorconfig-checkeron changed files: clean.scripts/check-changelog-parity.sh--check/--check-order/--check-bump origin/main/--check-preserved origin/main: pass.scripts/validate-plugins.sh: all manifests + catalog pass.scripts/affected-tests.sh origin/mainselected: pass.statusline-tee.test.sh96,statusline-shim.test.sh36,record-rate-limit-stop.test.sh19): all pass.Related
Closes #2582
🤖 Generated with Claude Code
https://claude.ai/code/session_01Aac8xjCjMxFsXGHCXKHY4W