Skip to content

docs(proxy): sharpen what the lost-credit counters can and cannot tell - #1105

Merged
amiddavid merged 4 commits into
mainfrom
docs/ping-counters-wording
Nov 12, 2026
Merged

amiddavid merged 4 commits into
mainfrom
docs/ping-counters-wording

Conversation

@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

What changed

  • docs/reference/reference.md, the two counter rows:
    • Key mismatch. The text no longer lists it as a cause of "missing rises, priced stays 0". A shared store with a key mismatch still prices pings, so priced rises too.
    • Failing pings. The same pattern also fits a host whose pings keep failing. The text now says how to tell the two apart. Read the keeper counters in /stats: pings, failed (refused ping or no usage) and skipped (429 or 5xx). The ping rows' status in the dashboard show the same.
    • Substitute ping. The sentence now covers a wired host and a committed substitute only. A substitute call that reported no usage stores no facts, so it can raise the counter.
  • proxy/promexport.go HELP text and metrics/metrics.go comment: same "or its pings keep failing" fix.

How it was tested

  • go test ./proxy/ ./metrics/ -run 'Prom|Stats|Golden|Unpriced|PingSavings|Coverage' passes.
  • gofmt -l on the two Go files reports nothing.

Data dependence

None. Docs and help text only.

Behavior change

HELP text only. No logic change.

Fix 3 wording notes from round 2 of the review of #1099.

- A key mismatch in one shared store also raises keepalive_pings_priced,
  so the "missing rises, priced stays 0" rule cannot see it.
- Failing pings give the same pattern as an unwired host. Say how to
  tell them apart: the keeper counters pings, failed and skipped.
- Say which case the substitute-ping sentence covers: a wired host and
  a committed substitute.

HELP text and comments change. No code logic changes.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session fresh 2 of 2 1 of 2 47a8aa64008d blocking

Verdict: blocking

The PR rewrites the help text of keepalive_rescue_facts_missing in three places. It is
docs only: no behavior change, no data-dependence change, so no row file is needed. I
checked every new claim against the code. Most claims hold. One sentence does not.

Findings

  1. docs/reference/reference.md:200 — "The ping rows' status in the dashboard show the same" is wrong for 2 of the 3 named failure kinds.
    • What fails: An operator follows the doc, looks at the ping rows in the dashboard, and draws the wrong conclusion. A refused ping (a 4xx, one of the doc's own examples of failed) leaves no ping row at all. A ping with no usage (the doc's other example of failed) leaves a row whose status is 2xx, so the status looks fine. Only the skipped kind (429 or 5xx) shows a failing status in a row.
    • Proof: keepalive/keeper.go:1553 — the code's own comment says outcomeFailed // stopped, no audit row. In fire, case outcomeFailed: return (keepalive/keeper.go:1520-1521) returns before record1, so no KeepAliveReport is emitted and no dashboard row is written. The 4xx branch (keepalive/keeper.go:1582-1587) and the 401/403 branch (keepalive/keeper.go:1566-1573) both return outcomeFailed; a transport error returns even earlier (keepalive/keeper.go:1509-1515). The no-usage branch returns outcomeFailedRecorded (keepalive/keeper.go:1589-1595), which does record a row — with the 2xx status the provider returned, not a failing one. Only outcomeTransient (429 or 5xx, keepalive/keeper.go:1577-1580) records a row whose status shows the failure. The only emission sites for ping rows are record1, recordSubstitutePing and the manual path (keepalive/keeper.go:1744, keepalive/substitute.go:278, keepalive/manual.go:190).
    • Fix: Restrict the sentence to the case that holds, for example: "A 429 or 5xx also shows as the status of the ping's row in the dashboard. A refused ping leaves no row, and a ping with no usage leaves a row with a 2xx status." Or drop the sentence.

Non-blocking

  • The new "either … or …" framing (docs/reference/reference.md:200) omits one wiring mistake: a host that calls PingSavings with a store other than Options.Pings. That host also shows keepalive_rescue_facts_missing rising with keepalive_pings_priced at 0 (proxy/proxy.go:3101 reads h.opts.Pings; the other store counts the priced pings no one reads). "Does not wire the ping side" can be read to cover it. Consider saying "or wires it to another store".
  • failed also counts transport errors (keepalive/keeper.go:1509), and skipped also counts pings never sent: no spare slot (keepalive/keeper.go:1445, 1480) or a body that could not be built (keepalive/keeper.go:1491). For those, "the pings fire and fail" is not exact — the ping never went out. The diagnosis "not an unwired host" still holds. The parentheticals name one cause each, not all.
  • metrics/metrics.go:1108: the new comment line runs past 300 characters. The file has long comment lines already, so this is a note, not a request.

What I checked

  • The full diff: docs/reference/reference.md, metrics/metrics.go, proxy/promexport.go. Three lines, one claim rewritten in three places. No behavior change; no test pins the changed help wording (proxy/promexport_coverage_test.go and proxy/pingunpriced_test.go pin values only).
  • "Priced stays 0 when pings keep failing": PingSavings (proxy/accountant_ping.go:126-144) returns before notePriced for a non-2xx ping or one with no usage, and stores no facts. The next request then has kaPings > 0 and accPingWindow == "", so it counts as missing (proxy/dashcapture.go:850-852). Holds.
  • "A key mismatch inside one shared store does not fit this pattern": notePriced (proxy/accountant_ping.go:139) runs before the put under the key, so a mismatched key still raises keepalive_pings_priced. Holds.
  • The /stats counter names and meanings: keepalive/keeper.go:1798-1812 (pings, skipped, failed), noteOutcome (keepalive/keeper.go:1559): 429 or ≥500 → skipped; ≥400 → failed; no usage → failed. The /stats merge is proxy/proxy.go:3059-3063. Names and the 429/5xx reading hold; the parentheticals are partial (see Non-blocking).
  • "A committed substitute ping stores ping facts": both substitutes book through recordSubstitutePing (keepalive/substitute.go:241-296), which emits a KeepAliveReport with status 200 and the call's usage; the proxy's emitter then calls PingSavings (cmd/context-guru-proxy/main.go:1041), which stores the facts when usage is nonzero. The sweep increments e.pings before fire runs (keepalive/keeper.go:1359), so the span reads kaPings > 0 and needs those facts. Holds, including the no-usage caveat.
  • That the keeper's counters appear in /stats only after something pinged (proxy/proxy.go:3059), so "pings at 0 means nothing pinged" also covers an absent field.
  • That no other doc still carries the old "key mismatch" claim: only docs/reference/reference.md:200 mentions it.
  • Data dependence: no component or feature changed, so no row file is due. docs/data-dependence/ is untouched, correctly.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session fresh 1 of 2 1 of 2 47a8aa64008d blocking

Verdict: blocking

Findings

  1. docs/reference/reference.md:200 — "The ping rows' status in the dashboard show the same" is wrong for most failed causes.

    • What fails: An operator follows the doc to the dashboard to confirm failing pings. For a refused ping (a 4xx that is not 429) or a transport error, no ping row exists at all. For a no-usage ping, the row's status is 2xx. Only the 429 or 5xx case leaves a row with a failing status.
    • Proof: keepalive/keeper.go:1520-1521 — outcomeFailed returns without record1; the comment at keeper.go:1553 says "stopped, no audit row". Refused pings take that path (keeper.go:1581-1587, and 401/403 with a credential at keeper.go:1565-1573). A transport error returns before record1 (keeper.go:1508-1515). A no-usage ping records its row with the 2xx status it got (keeper.go:1594 → keeper.go:1522-1523). Only the transient case records the failing status (keeper.go:1516-1519).
    • Fix: Say the rows show only the 429 or 5xx answers. A refused ping or a transport error leaves no row; a no-usage ping shows a 2xx row with zero usage.
  2. docs/reference/reference.md:200 — skipped is not "(a 429 or 5xx)"; it counts about nine other causes, and most mean no ping was sent.

    • What fails: A tenant at its rate or concurrency limit has every ping turned away before dispatch. skipped rises, keeper pings stays 0, and missing rises while priced stays 0 — the exact pattern this row diagnoses. The operator reads "skipped (a 429 or 5xx)" and concludes the pings fire and fail. No ping fired.
    • Proof: skipped is incremented at keepalive/keeper.go:1577 (429 or 5xx) and also at keeper.go:859 (dead credential at record), keeper.go:866 (body over MaxBodyBytes), keeper.go:895 (thinking enabled), keeper.go:1011 and keeper.go:1017 (below limits, over budget, done), keeper.go:1268 (memory eviction), keeper.go:1445 and keeper.go:1480 (no rate or concurrency spare — the ping is never sent, and returns before k.pings.Add at keeper.go:1507), keeper.go:1491 (ping body could not be built), and keepalive/manualhold.go:238 (manual-hold eviction).
    • Fix: Define skipped as "a ping that was counted but not sent or not answered usefully: a 429 or 5xx answer, no spare rate or concurrency, a gate refusal at record, or an eviction". Or list only the causes that fit this diagnostic and say the rest mean no ping fired.
  3. docs/reference/reference.md:200 — failed also counts transport errors, which the definition omits.

    • What fails: A dead route or a network partition fails every ping before an answer. failed rises, but the doc defines it as "a refused ping, or one with no usage". The reader has no way to know the counter covers this case, although it is a main way "its pings keep failing".
    • Proof: keepalive/keeper.go:1508-1509 — a dispatch error increments failed ("a transport error: counted, not stopped") before any status exists.
    • Fix: Add "or one that never reached the provider" to the parenthetical.

Non-blocking

  • "pings at 0 means nothing pinged" is wrong for a manual-only span: PingNow (keepalive/manual.go:79) never increments the keeper's process-wide pings. A manual press is priced, so keepalive_pings_priced rises and the diagnostic pattern does not arise. Worth a clause, not a must.
  • proxy/promexport.go:696 and metrics/metrics.go:1108 name the counters without defining them, so findings 1-3 touch the reference page only.

What I checked

  • The key-mismatch claim: correct. PingSavings calls st.notePriced() on every converted ping through the shared store (proxy/accountant_ping.go:139), before the keyed put. A key mismatch inside one store leaves facts unreadable but still raises keepalive_pings_priced, which reads that store (proxy/proxy.go:3101).
  • The failing-pings cause: correct. A non-2xx or no-usage ping is not converted (proxy/accountant_ping.go:133-136), so nothing is priced and no facts are stored; the next return raises missing (proxy/dashcapture.go:850-851).
  • The substitute claim: correct. A committed substitute reports status 200 with usage and a window (keepalive/substitute.go:277-293), so PingSavings stores its facts and the next return does not raise missing. A substitute with no usage stores nothing, and the entry's ping count was already raised at keepalive/keeper.go:1359, so the return can raise it.
  • "Moves only with the dashboard on": correct and unchanged. The savings tracker exists only when opts.Dashboard != nil (proxy/proxy.go:447-449).
  • The /stats counters exist under keepalive with the names pings, failed, skipped (keepalive/keeper.go:1798-1807, proxy/proxy.go:3059-3061).
  • Data dependence: none needed. Docs and help text only; no component or feature changed.
  • No test pins the changed HELP text, so the commit needs no test updates for that.

Round 1 of the review found three wrong claims.

- Dashboard ping rows show a failure only for a 429 or 5xx. A refused
  ping or a transport error leaves no row. A no-usage ping leaves a
  row with a 2xx status.
- skipped also counts pings never sent, so it does not prove that
  pings fire and fail. Use pings with failed for that.
- failed also counts a transport error.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Round 1 replies

All 3 findings are fixed in d4956ee4. Both reviewers raised finding 1. I checked each cited keeper.go line against the code.

  1. "The ping rows' status shows the same" (reviewer 1, finding 1; reviewer 2, finding 1). Fixed. The row now says what each case leaves:

    • a 429 or 5xx ping leaves a row with that status;
    • a ping with no usage leaves a row with a 2xx status;
    • a refused ping or a transport error leaves no row.

    This follows outcomeFailed at keeper.go:1520-1521, with the comment at :1553.

  2. skipped is not "a 429 or 5xx" (reviewer 1, finding 2). Fixed.

    • The rule now reads: pings rising with failed rising means the pings went out and failed. skipped rising with pings flat means the keeper did not send them.
    • The row says that skipped also counts pings that were never sent: no spare rate or concurrency, a gate refusal, an eviction, or a body that could not be built. So skipped is not proof of a failed ping.
    • The HELP in proxy/promexport.go and the comment in metrics/metrics.go also listed skipped as a failure sign. They now point to pings and failed only.
  3. failed omits transport errors (reviewer 1, finding 3). Fixed. failed now reads "a refused ping, a ping with no usage, and a ping that never reached the provider (a transport error)". This follows keeper.go:1508-1509.

Tests: go test ./proxy/ ./metrics/ -run 'Prom|Stats|Golden|Unpriced|PingSavings|Coverage' passes, and gofmt -l is clean.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 1 of 2 2 of 2 d4956ee4607e blocking

Verdict: blocking

Findings

  1. docs/reference/reference.md:200 — the rewritten skipped guidance drops the 429/5xx cause, so the diagnostic has no rule for an overload storm and one sentence is wrong there.
    • What fails: A provider in overload answers every ping with 429 or 5xx. Every ping goes out, fails, is never priced, and missing rises with priced at 0 — the exact "its pings keep failing" case this row diagnoses. The counters then read: pings rising, failed flat, skipped rising. Neither new rule fires: rule 1 needs failed rising, rule 2 needs pings flat. Worse, "so do not read it as a failed ping" is wrong in this storm: there skipped counts exactly failed pings. The operator is left with no /stats reading, and the sentence points away from the right one.
    • Proof: keepalive/keeper.go:1576-1580 — a 429 or 5xx increments skipped (never failed; the status >= 400 branch at :1581 is checked after and never reached by a 429), the entry is not stopped, and the next ping slot retries, so pings keeps rising (keeper.go:1507). Such a ping is not priced and stores no facts (proxy/accountant_ping.go:133-136), so the next return raises missing (proxy/dashcapture.go:850-851). The how-to states the same cause: "A 429 or 5xx (an overload) is transient: counted skipped, and the next ping slot retries" (docs/how-to/cache-keepalive.md:300). The round-1 text named it ("skipped (a 429 or 5xx)"); the fix removed it instead of keeping it beside the never-sent causes. metrics/metrics.go:1108 and proxy/promexport.go:696 point to pings and failed only, so they carry the same gap.
    • Fix: Keep one clause for it, for example: "skipped counts a 429 or 5xx answer too — the ping went out and failed transiently, visible as pings and skipped rising together — and pings never sent (...), so skipped alone does not say which."

Non-blocking

  • The dashboard clause does soften finding 1 in practice: "a 429 or 5xx ping leaves a row with that status" gives the operator the storm's signature in the dashboard, so the passage is not wholly blind to it.
  • Reviewer 2's round-1 note about a host that calls PingSavings with a store other than Options.Pings is not addressed. It was non-blocking ("does not wire the ping side" can be read to cover it), and I agree with that reading. No change needed.
  • metrics/metrics.go:1108 is still one comment line of about 200 characters. Reviewer 2 already noted the length; the file has longer ones. No change needed.

What I checked

  • Last review: round 1, 47a8aa6, 2026-11-11T19:30:52Z.
  • New commits read: 1 — d4956ee4 "docs(proxy): fix the failing-ping hints in the lost-credit counter text" (3 files, 3 lines).
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three saved files).
  • New items since my last review, and what I did about each:
    • Commit d4956ee4: read the full diff and the changed lines in each file. Verified every new claim against the code (below).
    • The author's reply comment at 2026-11-11T19:33:20Z: read in full. Its account of the three fixes matches the diff.
    • Reviewer 2's round-1 review (posted 4 seconds before mine): read in full now, as round 2 requires. Its finding 1 is my finding 1; its non-blocking notes are handled above.
  • My round-1 findings, and the other reviewer's:
    1. "The ping rows' status show the same" (mine 1, reviewer 2's 1): fixed. The new text names all three cases and each is correct — a 429/5xx ping records its row with that status (keeper.go:1516-1519), a no-usage ping records a 2xx row (keeper.go:1594 → :1522-1523), a refused ping or a transport error records no row (keeper.go:1520-1521, :1508-1515).
    2. skipped misdefined as "(a 429 or 5xx)" (mine 2): the wrong definition is gone and the never-sent list is correct — no spare (1445, 1480), gate refusals (859, 866, 895, 1011, 1017), evictions (1268, manualhold.go:238), body not built (1491). But the fix dropped the 429/5xx cause, which is finding 1 above.
    3. failed omits transport errors (mine 3): fixed. "failed counts a refused ping, a ping with no usage, and a ping that never reached the provider (a transport error)" matches keeper.go:1582, :1589 and :1509.
  • The two new /stats rules, checked on their own: "pings rising with failed rising means the pings went out and failed" — holds; failed increments only on dispatched pings (keeper.go:1509, :1566, :1582, :1589). "skipped rising with pings flat means the keeper did not send them" — holds; every skipped cause that can rise while pings stays flat sends no ping (all sites listed above sit before k.pings.Add at keeper.go:1507).
  • The rest of the row is unchanged from round 1 and stayed correct: the key-mismatch claim, the failing-pings cause, the substitute sentences, and the dashboard-bound claim were all verified in round 1 against the same code.
  • Data dependence: still none due. Docs and help text only; docs/data-dependence/ untouched.
  • Live tests were not run, per instructions. The author reports go test ./proxy/ ./metrics/ -run 'Prom|Stats|Golden|Unpriced|PingSavings|Coverage' passes; no test pins this wording, so the claim is plausible but unverified by me.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 2 of 2 2 of 2 d4956ee4607e blocking

Verdict: blocking

The fix commit d4956ee4 addresses every round-1 finding, and the new dashboard-rows
sentence now matches the code. But the rewrite of the skipped rules dropped one cause:
a ping that got a 429 or 5xx answer. That failure mode now falls through the new rules,
and one rule denies it. One finding.

Status of round-1 findings

  • Reviewer 1, finding 1 / my finding 1 — the dashboard ping rows claim: fixed. The new sentence ("a 429 or 5xx ping leaves a row with that status, a ping with no usage leaves a row with a 2xx status, and a refused ping or a transport error leaves no row") matches the code exactly. I re-checked it against outcomeFailed (keepalive/keeper.go:1520, comment at :1553), outcomeFailedRecorded (:1589) and outcomeTransient (:1577).
  • Reviewer 1, finding 2 — skipped is not "(a 429 or 5xx)": fixed in direction, but the fix overcorrected. The never-sent causes are now listed and complete. The fix also dropped the one sent-and-failed cause, which is my finding 1 below.
  • Reviewer 1, finding 3 — failed omits transport errors: fixed. "failed counts a refused ping, a ping with no usage, and a ping that never reached the provider (a transport error)" now matches all four failed.Add sites (keepalive/keeper.go:1509, :1566, :1582, :1589).
  • My non-blocking wrong-store note: not addressed. It was optional; "does not wire the ping side" can be read to cover it. No request.
  • Reviewer 1's non-blocking "pings at 0" note: addressed by removing that sentence.

Findings

  1. docs/reference/reference.md:200 — the new skipped rules drop the 429/5xx answer, so a real failing-pings mode falls through them, and "do not read it as a failed ping" denies it.
    • What fails: An upstream that answers 429 or 5xx to every keep-alive ping. Such a ping is not priced and stores no facts (proxy/accountant_ping.go:133-136), so keepalive_rescue_facts_missing keeps rising while keepalive_pings_priced stays 0 — the exact pattern this row diagnoses, and the row's own first sentence counts it ("a return after a ping that got a non-2xx answer"). In /stats this mode reads: pings rising, failed flat, skipped rising. None of the new rules fires: "pings rising with failed rising means the pings went out and failed" does not apply (failed is flat), "skipped rising with pings flat means the keeper did not send them" does not apply (pings rises). The reader is left with "do not read it as a failed ping" — but for this share of skipped the ping did go out and did fail. The natural conclusion is the other branch of the dichotomy, "the host does not wire the ping side", and the operator hunts a wiring bug that does not exist.
    • Proof: keepalive/keeper.go:1577 — a 429 or ≥500 answer increments skipped (outcomeTransient). This runs after the dispatch and after k.pings.Add(1) at :1507, so the ping went out and was counted. record1 runs for it (:1516-1518), so the dashboard row exists. PingSavings refuses a non-2xx ping (proxy/accountant_ping.go:133-136): not priced, no facts stored, so the next return raises missing (proxy/dashcapture.go:850-852). The round-1 text named this cause ("skipped (a 429 or 5xx)"); reviewer 1's round-1 fix proposal also kept it in the definition. The fix commit removed it from skipped's causes entirely. The pointers in metrics/metrics.go:1108 and proxy/promexport.go:696 were changed from "pings, failed and skipped" to "pings and failed" and inherit the same gap.
    • Fix: Name the 429/5xx answer as a skipped cause with its own rule, for example: "skipped also counts a ping that got a 429 or 5xx answer: that ping went out and was not priced either, so credit is lost the same way. The rest of skipped is pings never sent (no spare rate or concurrency, a gate refusal, an eviction, a body that could not be built); skipped alone is not proof of a failed ping." Then "pings, failed and skipped" is a sound pointer again in metrics/metrics.go and proxy/promexport.go.

Non-blocking

  • The wrong-store wiring (a host that calls PingSavings with a store other than Options.Pings) is still not named in the "either … or …" dichotomy. Unchanged from round 1, optional.

What I checked

  • Last review: round 1, 47a8aa6, 2026-11-11T19:30:48Z
  • New commits read: 1 — d4956ee4 "docs(proxy): fix the failing-ping hints in the lost-credit counter text"
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt)
  • New items since my last review: the fix commit d4956ee4 (read the full diff and the code around it); the author's round-1 reply at 2026-11-11T19:33:20Z (read, each claim checked against the code); reviewer 1's round-1 review at 19:30:52Z (posted 4 s after mine, so new to me — read in full, its three findings compared with mine and with the fix).
  • Every new claim in the rewritten row, against the code:
    • "pings rising with failed rising means the pings went out and failed": all four failed.Add sites (keepalive/keeper.go:1509, :1566, :1582, :1589) run after the dispatch and after k.pings.Add(1) at :1507. Holds.
    • "failed counts a refused ping, a ping with no usage, and a ping that never reached the provider (a transport error)": complete against the same four sites (401/403 with a credential at :1566 and other 4xx at :1582 are both refusals). Holds.
    • "skipped rising with pings flat means the keeper did not send them": every skipped.Add site except :1577 runs before any dispatch, and :1577 always comes with pings rising. Sound. Holds.
    • "skipped also counts pings never sent (no spare rate or concurrency, a gate refusal, an eviction, a body that could not be built)": complete against the never-sent sites — :1445 and :1480 (spare, k.spare at :597 reserves rate and concurrency headroom), :859, :866, :895, :1011, :1017 (gates at record), :1268 and keepalive/manualhold.go:238 (evictions), :1491 (body build). Holds for the never-sent share; the sent-and-failed share at :1577 is the finding above.
    • The dashboard-rows sentence: matches outcomeFailed (no row), outcomeFailedRecorded (2xx row) and outcomeTransient (429/5xx row). Holds.
  • That metrics/metrics.go:1108 and proxy/promexport.go:696 changed only their counter pointers, consistent with the reference row. No behavior change; no test pins the changed wording (checked in round 1, unchanged).
  • Data dependence: none due. Docs and help text only.

A ping with a 429 or 5xx answer adds to pings and to skipped, not to
failed. The round-1 text hid this. Restore it in the reference, the HELP
text and the Snapshot comment. Name the wrong-store wiring too.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Round 2 replies

The finding is fixed in 53d89e1f. Both reviewers raised it. The owner granted one more round.

skipped dropped the 429 or 5xx cause (reviewer 1, finding 1; reviewer 2, finding 1). Fixed.

  • I checked keeper.go:1576-1581. A 429 or 5xx answer adds to skipped (outcomeTransient) after pings.Add(1) at :1507. So the ping went out and failed.
  • The row now says: "skipped counts a ping that got a 429 or 5xx answer: it went out, was not priced, and lost credit the same way, so pings and skipped rise together. The rest of skipped is pings never sent (no spare rate or concurrency, a gate refusal, an eviction, a body that could not be built), so skipped alone does not say which."
  • The rules now read: "pings rising with failed or skipped rising means the pings went out and failed. skipped rising with pings flat means the keeper did not send them." So an overload storm (pings and skipped up, failed flat) fits the first rule.
  • The HELP in proxy/promexport.go and the comment in metrics/metrics.go again say "pings, failed and skipped".

Non-blocking: the wrong-store wiring. Added. The unwired list now reads "(no Options.Pings, no PingSavings call, or PingSavings on a store other than Options.Pings)".

Tests: go test ./proxy/ ./metrics/ -run 'Prom|Stats|Golden|Unpriced|PingSavings|Coverage' passes, and gofmt -l is clean.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 1 of 2 3 of 3 53d89e1f7a68 approve

Verdict: approve

Findings

None.

Non-blocking

  • None. The wrong-store wiring note from round 1 is now in the text, and the counter definitions match the code.

What I checked

  • Last review: round 2, d4956ee, 2026-11-11T19:37:46Z.
  • New commits read: 1 — 53d89e1f "docs(proxy): say that skipped also counts a ping that got a 429 or 5xx" (3 files, 3 lines).
  • Read in full: 4 reviews, 2 comments, 0 inline comments (from the three saved files).
  • New items since my last review, and what I did about each:
    • Commit 53d89e1f: read the full diff and each changed line. Verified every changed claim against the code (below).
    • Reviewer 2's round-2 review at 2026-11-11T19:37:47Z: read in full. Its finding 1 is my round-2 finding; the author's fix covers both. Its non-blocking wrong-store note is now addressed in the text.
    • The author's round-2 reply at 2026-11-12T07:11:13Z: read in full. Each claim in it matches the diff and the code.
  • My round-2 finding, and reviewer 2's round-2 finding (the same gap): fixed. The row now says "skipped counts a ping that got a 429 or 5xx answer: it went out, was not priced, and lost credit the same way, so pings and skipped rise together." I re-checked it: keepalive/keeper.go:1576-1580 increments skipped for a 429 or 5xx after k.pings.Add(1) at :1507, so the ping went out and pings rises with it; PingSavings refuses a non-2xx ping (proxy/accountant_ping.go:133-136), so it is not priced and stores no facts, and the next return raises missing (proxy/dashcapture.go:850-851). The first rule now reads "pings rising with failed or skipped rising means the pings went out and failed", so an overload storm (pings and skipped up, failed flat) fits it.
  • The new wrong-store clause, "PingSavings on a store other than Options.Pings": correct. keepalive_pings_priced reads h.opts.Pings.Priced() (proxy/proxy.go:3101, proxy/promexport.go:700) and the request path reads facts from the same store (proxy/dashcapture.go:219). A host that prices into another store shows missing rising with priced at 0.
  • The rest of the skipped text, unchanged from round 2 and still correct: "skipped rising with pings flat means the keeper did not send them" — every never-sent skipped site runs before k.pings.Add (keeper.go:1445, :1480, :1491, :859, :866, :895, :1011, :1017, :1268, keepalive/manualhold.go:238). "The rest of skipped is pings never sent (no spare rate or concurrency, a gate refusal, an eviction, a body that could not be built)" — matches those sites. "skipped alone does not say which" — true, both shares exist.
  • metrics/metrics.go:1108 and proxy/promexport.go:696 point to pings, failed and skipped again. Sound now that all three are defined correctly in the reference row.
  • All earlier-verified claims are unchanged at this head: the key-mismatch sentence, the failing-pings cause, the dashboard ping-rows sentence, the substitute sentences, and the dashboard-bound claim (rounds 1-2).
  • Data dependence: none due. Docs and help text only; docs/data-dependence/ untouched.
  • Live tests were not run, per instructions. The author reports the same test set passes; no test pins this wording.

@amiddavid

Copy link
Copy Markdown
Collaborator Author

Integrator note: the owner added this PR to v0.7.4 (2026-11-12). Reviewer 1 blocks in the last round. Please fix the finding, run the next offload-review round, then tell the integrator session.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 2 of 2 3 of 3 53d89e1f7a68 blocking

Verdict: blocking

The fix commit 53d89e1f restores the 429/5xx cause of skipped and names the
wrong-store wiring, so my round-2 finding is fixed. But the fix also folded skipped
into the failure rule: "pings rising with failed or skipped rising means the pings
went out and failed." The skipped limb of that rule is not sound, and it contradicts
the hedge in the same paragraph. One finding.

Status of earlier findings

  • My round-2 finding / reviewer 1's round-2 finding — skipped dropped the 429/5xx cause: fixed. The row now names the cause ("it went out, was not priced, and lost credit the same way, so pings and skipped rise together"), the pointers in metrics/metrics.go:1108 and proxy/promexport.go:696 say "pings, failed and skipped" again, and an overload storm now fits a rule. Verified against keepalive/keeper.go:1576-1580 (the 429/5xx branch increments skipped after k.pings.Add(1) at :1507).
  • My round-1 and round-2 non-blocking wrong-store note: added, and correct. "(PingSavings on a store other than Options.Pings)" matches the code: keepalive_pings_priced reads h.opts.Pings (proxy/proxy.go:3101), so facts priced into another store raise nothing the handler reads.
  • Round-1 findings (both reviewers): still fixed. This commit does not touch the dashboard-rows sentence, the failed definition, or the never-sent list; all were verified against the code in round 2.
  • Reviewer 1's round-2 non-blocking notes: read. I agree with all three (the dashboard clause softens the storm gap; the wrong-store note needed no change then; the comment length needs none now).

Findings

  1. docs/reference/reference.md:200 — the rule "pings rising with failed or skipped rising means the pings went out and failed" is wrong in its skipped limb, and it contradicts the paragraph's own hedge.
    • What fails: A host that never calls PingSavings (unwired — one of the two branches this diagnostic exists to tell apart), whose pings are healthy, with ordinary never-sent skips: a thinking-enabled session refused at record, a body over the limit, a spare refusal under load, an eviction. The counters read: pings rising (healthy pings, k.pings.Add(1) counts every dispatched ping at keepalive/keeper.go:1507), skipped rising (never-sent causes, no ping dispatched), failed flat. keepalive_rescue_facts_missing rises with keepalive_pings_priced at 0, because no facts are ever stored (proxy/accountant_ping.go:141 is never reached; the next return raises missing at proxy/dashcapture.go:850-852). The rule fires and says "the pings went out and failed". No ping failed — the host is unwired. The operator chases upstream failures instead of the missing PingSavings call. The same paragraph says "so skipped alone does not say which" — one sentence asserts what the other says cannot be read from skipped.
    • Proof: The never-sent skipped.Add sites run with no ping dispatched and do not stop other sessions' pings from raising pings: keepalive/keeper.go:895 (thinking enabled at record — the code's own comment measures 17 of 357 addressable misses with such a predecessor), :866 (body too large), :859 (dead credential), :1011/:1017 (below limits, over budget, done), :1268 and keepalive/manualhold.go:238 (evictions), :1445/:1480 (no spare), :1491 (body not built). Only :1577 (a 429 or 5xx answer) implies a dispatched ping. So pings rising with skipped rising has two live readings: the 429/5xx storm (pings went out and failed) and never-sent skips beside healthy pings (nothing failed). The counters alone cannot tell them apart — which is what the hedge says. The storm case my round-2 finding named needs only the signature "pings and skipped rise together", not this rule; both my and reviewer 1's round-2 fix proposals kept the failure rule on failed alone.
    • Fix: Keep the rule on failed alone: "pings rising with failed rising means the pings went out and failed." Then give the ambiguous signature its own sentence: "pings and skipped rising together with failed flat is either a 429 or 5xx storm or never-sent skips beside healthy pings; the ping rows in the dashboard tell them apart (a 429 or 5xx status against a 2xx with usage)." The dashboard sentence already in the row names both row shapes, so this adds one clause.

Non-blocking

  • metrics/metrics.go:1108 and proxy/promexport.go:696 say "pings, failed and skipped" without the rules. As pointers to the reference row they are fine; the finding above touches the reference page only.

What I checked

  • Last review: round 2, d4956ee, 2026-11-11T19:37:47Z
  • New commits read: 1 — 53d89e1f "docs(proxy): say that skipped also counts a ping that got a 429 or 5xx" (3 files, 3 lines)
  • Read in full: 4 reviews, 2 comments, 0 inline comments (from .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt)
  • New items since my last review, and what I did about each:
    • Commit 53d89e1f: read the full diff and the code around each change. Verified every new claim (below).
    • The author's round-2 reply at 2026-11-12T07:11:13Z: read in full. Each claim about the diff checks out against the code; the rule change it describes is my finding 1.
    • Reviewer 1's round-2 review at 2026-11-11T19:37:46Z: posted one second before mine, so new to me. Read in full. Its finding 1 is my round-2 finding; its non-blocking notes are addressed under "Status".
  • Every new claim in the rewritten row, against the code:
    • The wrong-store addition ("PingSavings on a store other than Options.Pings"): accurate, proxy/proxy.go:3101 reads h.opts.Pings only.
    • "skipped counts a ping that got a 429 or 5xx answer: it went out, was not priced, and lost credit the same way, so pings and skipped rise together": holds — keepalive/keeper.go:1576-1580 increments skipped after the dispatch and pings.Add at :1507; a non-2xx ping is not priced (proxy/accountant_ping.go:133-136).
    • "skipped rising with pings flat means the keeper did not send them": still holds — every skipped cause except :1577 sends no ping, and :1577 always comes with pings rising.
    • "The rest of skipped is pings never sent (no spare rate or concurrency, a gate refusal, an eviction, a body that could not be built)": complete against the never-sent sites (verified in round 2, unchanged).
    • "pings rising with failed or skipped rising means the pings went out and failed": the failed limb holds (all failed.Add sites are post-dispatch); the skipped limb is finding 1.
    • The dashboard-rows sentence, the failed definition and the substitute sentences: unchanged by this commit, verified in rounds 1 and 2.
  • metrics/metrics.go:1108 and proxy/promexport.go:696: pointer text only, consistent with the reference row. No behavior change; no test pins this wording (checked in round 1).
  • Live tests were not run, per instructions. The author reports go test ./proxy/ ./metrics/ -run 'Prom|Stats|Golden|Unpriced|PingSavings|Coverage' passes and gofmt -l is clean; plausible, unverified by me.
  • Data dependence: none due. Docs and help text only; docs/data-dependence/ untouched.

skipped counts both a 429 or 5xx answer and pings never sent. Only
failed rising with pings proves failing pings. Say how the dashboard
rows tell the skipped causes apart.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Round 3 replies

The owner granted a 4th round.

Reviewer 2, finding 1: the skipped side of the failure rule also fires on an unwired host with healthy pings. Fixed in 29fb2157, with the text you proposed.

  • The failure rule now uses failed only: "pings rising with failed rising means the pings went out and failed."
  • The row says what skipped counts: a ping that got a 429 or 5xx answer (it went out and was not priced), and also pings never sent (no spare rate or concurrency, a gate refusal, an eviction, a body that could not be built).
  • It gives the unclear pattern its own sentence: "pings and skipped rising together with failed flat is either a 429 or 5xx storm or never-sent skips beside healthy pings. The dashboard ping rows tell them apart: a 429 or 5xx status against a 2xx with usage."
  • No sentence in the row now says that a rising skipped means a ping failed.
  • The HELP text and the metrics comment keep the pointer "pings, failed and skipped", as your non-blocking note accepts.

This change is .md only, so no tests ran.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 1 of 2 4 of 4 29fb21579108 approve

Verdict: approve

Findings

None.

Non-blocking

  • None.

What I checked

  • Last review: round 3, 53d89e1, 2026-11-12T07:13:06Z.
  • New commits read: 1 — 29fb2157 "docs(proxy): do not read a rising skipped as a failed ping" (1 file, 1 line).
  • Read in full: 6 reviews, 4 comments, 0 inline comments (from the three saved files).
  • New items since my last review, and what I did about each:
    • Reviewer 2's round-3 review at 2026-11-12T07:15:47Z (blocking): read in full and checked. Its finding is right, and my round-3 approve missed it: I read the failure rule's skipped limb as sound "under the diagnostic premise", but that premise holds only on a wired host. The unwired branch of the dichotomy — healthy pings, no PingSavings call, priced at 0 — plus ordinary never-sent skips also makes pings and skipped rise with failed flat, and the rule then names the wrong branch. Reviewer 2's scenario stands.
    • The integrator note at 2026-11-12T07:13:18Z: read. It asks for the fix and the next review round; both happened.
    • The author's round-3 reply at 2026-11-12T07:26:36Z: read in full. Its account of the fix matches the diff.
    • Commit 29fb2157: read the full diff and the changed row in the file. Verified every new claim (below).
  • Reviewer 2's round-3 finding: fixed. The failure rule now uses failed alone — "pings rising with failed rising means the pings went out and failed" — which holds: every failed.Add site runs after the dispatch (keeper.go:1509, :1566, :1582, :1589). The ambiguous signature now has its own sentence: "pings and skipped rising together with failed flat is either a 429 or 5xx storm or never-sent skips beside healthy pings." I checked both readings against the code. The storm: each dispatched ping raises pings (keeper.go:1507) and then skipped on the 429 or 5xx (keeper.go:1576-1580), never failed. The other reading: the never-sent skipped sites (keeper.go:859, :866, :895, :1011, :1017, :1268, :1445, :1480, :1491, keepalive/manualhold.go:238) run with no ping dispatched, while healthy pings on an unwired host raise pings without raising priced. No sentence in the row now reads a rising skipped as a failed ping.
  • The new disambiguation sentence, "The dashboard ping rows tell them apart: a 429 or 5xx status against a 2xx with usage": correct. A transient ping records its row with the failing status (keeper.go:1516-1519); a healthy ping records a 2xx row with its usage (record1 → the emitter, keeper.go:1744), and the row is written whether or not PingSavings is called (cmd/context-guru-proxy/main.go:1041-1044), so an unwired host still shows it.
  • The rest of the row is unchanged from round 3 and stayed correct: the failed definition, the never-sent list, "skipped rising with pings flat means the keeper did not send them", the wrong-store clause, the key-mismatch sentence, the dashboard-rows sentence, the substitute sentences, and the dashboard-bound claim.
  • metrics/metrics.go and proxy/promexport.go are untouched by this commit; their "pings, failed and skipped" pointers remain sound as pointers to the reference row, as reviewer 2's non-blocking note accepts.
  • Data dependence: none due. Docs only; docs/data-dependence/ untouched.
  • Live tests were not run, per instructions. The change is .md only, so none were needed.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 2 of 2 4 of 4 29fb21579108 approve

Verdict: approve

The fix commit 29fb2157 adopts the text proposed in round 3. The failure rule uses
failed alone, the unclear pings+skipped signature gets its own sentence, and the
dashboard rows are named as the discriminator. Every sentence in the row now matches the
code. No findings.

Status of earlier findings

  • My round-3 finding — the skipped limb of the failure rule: fixed. The rule reads "pings rising with failed rising means the pings went out and failed" (failed only, sound: every failed.Add site runs after the dispatch, keepalive/keeper.go:1509, :1566, :1582, :1589). The ambiguous signature has its own sentence: "pings and skipped rising together with failed flat is either a 429 or 5xx storm or never-sent skips beside healthy pings." That is exactly the two readings the counters cannot tell apart. The contradiction with the hedge is gone; no sentence now reads a rising skipped as a failed ping. I checked the author's claim of that in the row text — it holds.
  • My round-2 finding (429/5xx cause restored), my round-1 finding (dashboard rows), reviewer 1's round-1 findings: all still fixed. This commit touches only the counter sentences; the other parts of the row are unchanged from 53d89e1f and were verified in earlier rounds.
  • My round-1 non-blocking wrong-store note: added in round 3, still correct.

Findings

None.

Non-blocking

  • None. metrics/metrics.go:1108 and proxy/promexport.go:696 keep the pointer "pings, failed and skipped" without the rules; the reference row defines all three, so the pointers are sound.

What I checked

  • Last review: round 3, 53d89e1, 2026-11-12T07:15:47Z
  • New commits read: 1 — 29fb2157 "docs(proxy): do not read a rising skipped as a failed ping" (1 file, 1 line: docs/reference/reference.md)
  • Read in full: 6 reviews, 4 comments, 0 inline comments (from .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt)
  • New items since my last review, and what I did about each:
    • Commit 29fb2157: read the full diff. Verified each new and changed sentence against the code (below).
    • Reviewer 1's round-3 review at 2026-11-12T07:13:06Z (approve, posted while I wrote mine): read in full. It accepted the failed-or-skipped rule as sound; my round-3 finding showed the skipped limb was not, and the author fixed it. Nothing else in it to act on.
    • The integrator note at 2026-11-12T07:13:18Z: read. It asks for the fix, this round, and then a word to the integrator session. The finding is fixed and this review closes the round.
    • The author's round-3 reply at 2026-11-12T07:26:36Z: read in full. Every claim in it matches the diff and the code, including "No sentence in the row now says that a rising skipped means a ping failed".
  • The changed sentences, against the code:
    • "pings rising with failed rising means the pings went out and failed": sound, all four failed.Add sites are post-dispatch and post-pings.Add (keepalive/keeper.go:1507).
    • "skipped counts a ping that got a 429 or 5xx answer (it went out and was not priced), and also pings never sent (no spare rate or concurrency, a gate refusal, an eviction, a body that could not be built)": both shares named, complete against every skipped.Add site — keepalive/keeper.go:1577 for the answer, :1445, :1480, :1491, :859, :866, :895, :1011, :1017, :1268 and keepalive/manualhold.go:238 for never sent.
    • "So pings and skipped rising together with failed flat is either a 429 or 5xx storm or never-sent skips beside healthy pings": sound — only :1577 ties a skipped increment to a dispatched ping, and never-sent skips do not stop other sessions' pings from raising pings.
    • "The dashboard ping rows tell them apart: a 429 or 5xx status against a 2xx with usage": sound — outcomeTransient records a row with the 429/5xx status (keepalive/keeper.go:1516-1518), healthy pings record 2xx rows with usage through record1.
    • "skipped rising with pings flat means the keeper did not send them": unchanged, sound (verified in rounds 2 and 3).
    • The rest of the row is unchanged from 53d89e1f: the unwired list with the wrong-store clause, the key-mismatch sentence, the failed definition, the dashboard-rows sentence, the dashboard-bound claim and the substitute sentences were all verified in rounds 1 to 3.
  • This commit is .md only, so no test run is due. No behavior change anywhere in the PR; no test pins the changed wording (checked in round 1).
  • Data dependence: none due. Docs and help text only; docs/data-dependence/ untouched.

@amiddavid
amiddavid merged commit e13ba47 into main Nov 12, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 12, 2026
amiddavid pushed a commit that referenced this pull request Nov 12, 2026
Bob setup skips a context-guru-proxy that cannot serve the preset it
writes: older than v0.7.1 (cannot list its cache strategies), or older
than v0.7.2 for the default preset bob-ultrahigh. Setup then downloads
the latest release, so a Mac with an old proxy on PATH (for example
from brew) still installs cleanly.

Behavior change: Bob users who run setup with such an old proxy on
PATH or in the plugin's own path. Old: setup used it, and the cache
strategy commands then failed with the update error. New: setup skips
it and downloads the latest release.
Owner's yes, 2026-11-12, in the integrator session: "1111 approve".

Data dependence: none.

Reviews: 3 offload review rounds (Claude backend). Round 3: both
approve at f9108e6, which is the PR head (a merge of main after #1093
and #1105).

Signed-off-by: Vitaly Zabershinsky <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant