Repository navigation
feat(keepalive): the audit-sink rule applies in hosted mode only (#1457) - #1470
Conversation
amiddavid
left a comment
There was a problem hiding this comment.
| 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.332 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 4 | c8847751feb8 |
blocking |
Verdict: blocking
Findings
- PR body, "Behavior change" section — the claim that per-session arming works with no dashboard in single-tenant mode is false
- What fails: the owner approved a behavior-change list that says "per-session arming (
arm) follows the same rule, so it works with no dashboard in single-tenant mode". No route can reacharmon a single-tenant proxy. A user who tries to arm gets a 404, not the promised behavior. - Proof:
MountControlmounts nothing whenOptions.Tenantsis nil (proxy/control.go:188-191). The arm routePOST /api/me/keepalive/sessionslives inctlRoutes(proxy/keepalivectl.go:45), mounted only byMountControl. The only caller ofkeeper.armisctlKeepAliveArm(proxy/keepalivectl.go:135). Inproxyapp,Tenantsis set only when--upstreamsis given (proxyapp/main_run.go:756), so a single-tenant proxy never mounts the control plane. ThemayHoldchange inarm(proxy/keepaliveoverride.go:133) is unreachable in single-tenant mode. - Fix: correct the PR body. Drop the "Also" bullet, or say the arm gate only changes its refusal message for hosted deployments. If single-tenant arming is wanted, mount the route in its own PR.
- What fails: the owner approved a behavior-change list that says "per-session arming (
Non-blocking
proxy/manualping.go:116-123— with no dashboard, the cold gate covers only threads the keeper holds now. The dashboard path covered every thread with a row in the last 2 hours. A thread whose hold ended answers 404 "unknown session", where the dashboard path answers 409 "not held" with a reason. Same status as before this PR for a missing route, so no regression. Consider the 409 shape later.keepalive/manualhold.go:118—WarmFactsrepeats the body ofkaEntry.cacheTTL()(cacheLifetime(e.provider, e.model, e.ttl1h),keepalive/keeper.go:1971). Calle.cacheTTL()so the two cannot drift.proxy/proxy.go:649-651— the comment aboveif h.api != nilstill says an unconfigured proxy's route table is unchanged, butmountManualPingnow adds a route with no dashboard. The comment is stale in spirit.- Test gap: the keep-alive-off, header-on hold (
x-context-guru-ping: 1) with no dashboard in single-tenant mode is a new reachable state and has no test. The new tests cover the keep-alive-on path only. keepalive/mayhold.go:141-151— the recover guards ahostedfunction that cannot panic today (k.h.opts.Tenants != nil). Harmless. The fail-closed direction is right.
What I checked
- The full diff, base
f9ec697cto headc8847751, and the code around each hunk. - The gate matrix:
mayHoldreplacesk.h.rec == nilinrecordTouch,canPing,armandmanualPing. For hosted with a recorder, hosted without one, and single-tenant with one, the old and new answers match. Only single-tenant without a dashboard changes, from no hold to hold. That is the named behavior change. - The hosted signal:
Options.Tenants != nilin the proxy,--upstreamsinproxyapp. Both mark the same deployments. The startup "IMPOSSIBLE" line now fires for hosted without a recorder only. - The no-dashboard Ping button:
WarmFactsreads the samelivemap, key form and tier rule (cacheLifetime) thatRecordwrites. The session form matches:scopedSessionwith an empty tenant gives the bare id, the same formservehands torecordTouch. - Production wiring with no dashboard: the
dashEmitteris built before the dashboard block (proxyapp/main_run.go:368),KeepAlivePingcallsBookPingbefore the recorder check, and the savings observer comes fromstartMetricsPush, which runs without a dashboard. The booking the data-dependence row promises is wired. - Auth on the newly mounted route:
adaptPrincipalwith no registry accepts direct loopback callers only, the same principal as/api/adapt/*. - The new tests: helpers referenced (
reportSink,fakeSender,testClock,waitPings,newMgrFixture,NewPingStore) all exist in the package;countObsmatchesacmetrics.Observer; no name collisions. The tests wait on conditions, not time. - Data dependence: the
keep-alive-pingsandaccountant-savingsrow files and the generated page carry the same text; the flags-table edit appears in both the template and the generated page. The change of level (in-memory hold with no dashboard, single-tenant only) is named and decided by David Amid, 2026-11-26. - Client rules: none added; no coverage-table change needed. Host boundary: the rule itself is
keepalive.MayHoldCredentials, a library function; the proxy only reads its own fields. - I did not run builds or tests (live tests not approved).
amiddavid
left a comment
There was a problem hiding this comment.
| 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.332 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 4 | c8847751feb8 |
approve |
Verdict: approve
Findings
None. I found no wrong behavior, no data loss, no broken fail-open path and no security problem.
Non-blocking
- proxy/manualping.go:29-31 — the file's header comment overstates the "not held" answer. It says a thread with keep-alive off gets "a distinct 409 'not held'". With no dashboard,
WarmFactsreturnsok=falsefor a thread that is not held (keep-alive off, or the hold expired), so the route answers 404 "unknown session", not 409. The dashboard path still answers 409 throughPingNow'sErrNotHeld. Doc-only: the plugin always passes--dashboard, so the mod never sees the 404. - keepalive/mayhold.go:147-150 — the panic fallback for
hasAuditSink=trueis unreachable.if hasAuditSink { return true }runs beforehosted(), so a panic can only occur withhasAuditSink=false, where the answer is already false.TestMayHoldCredentialsFailsToTheOldRulecallsMayHoldCredentials(boom, true), butboomnever runs there. Harmless, but the test does not prove what its name says for that case. - keepalive/manualhold.go:272-291 —
WarmFactshas no test for the 1-hour tier. The route test covers the 5-minute cold path only. A thread held at the 1-hour tier (e.ttl1h=true) should give a 59-minute window; nothing pins thatcacheLifetimeis read from the entry's own tier. - docs/data-dependence/features/body-stash.md:10 — the no-dashboard case is not named.
canPingis now true for a single-tenant proxy with no dashboard, so the sweep also keeps its 2 in-memory conversation copies for those threads, where before it kept none. The row's text ("for a thread the keep-alive can ping") stays true, and the keep-alive-pings row names the new mode. A sentence in this row would make the widening explicit.
What I checked
- The rule and its placement.
keepalive.MayHoldCredentialsis a library function; the proxy'skeeper.mayHoldonly reads the host signal (Options.Tenants) and the recorder. No business logic moved into a host package. No client rule touched. - The hosted signal.
Options.Tenantsis set exactly when--upstreamsis given (proxyapp/main_run.go:538-604), and the startup line's condition!*dashOn && *upstreamsPath != ""matchesmayHoldexactly. Onlycmd/context-guru-proxyconstructs a hosted handler. - The retention gate.
recordTouchsets a zero policy when!mayHold, which makes the keeper core retire the key;pol.ManualHoldis then never set, so thex-context-guru-pingheader cannot widen the rule (test pins this). No other keepalive gate inproxy/still readsh.recwithout a nil check. - The Ping button without a dashboard.
WarmFactsreadsrefreshedAt/startedAtandcacheTTL()under the keeper's lock — the same factsholdForand the core's own cold check use.ManualPingBlock,OneHourTouchLiveandPingNoware keeper-core and need no recorder.mountManualPingmoved out of theh.api != nilblock;adaptPrincipalandwebPrincipalare nil-api safe, and a hosted proxy with no recorder answers 404 throughmayHold. - The booking path.
dashEmitter.KeepAlivePingcallsBookPingbefore thereccheck; the emitter (metrics.Tee) is wired with or without--dashboard, so a ping's spend books with no dashboard. - Side effects of widening
canPing.Ctx.CanKeepAlivehas one consumer, the sweep'sregisterPing. The sweep's copies and its ping-time question (PrefixAsk,Store) need no dashboard. The predictive campaign needs no recorder. The idle-exit watchdog countsPendingPings, keeper-core. - Behavior change and data dependence. The PR names the change at the top, with who, old and new behavior, and the off switch. The decision is recorded (David Amid, 2026-11-26, #1457) in the keep-alive-pings and accountant-savings rows. The generated page matches the row files, and the flags-table edit is in both
page.md.tmpland the generated page. - Tests. Read the new
keepalive_singletenant_test.goand the three updated tests in full; helpers (kaPolicy,fakeSender,testClock,reportSink,syncBuffer,newMgrFixture.register) exist and the signatures match. No name collisions in the package.
- WarmFacts uses the entry's cacheTTL; a 1-hour-tier test pins it. - Test for the header hold with no dashboard. - Fix the route-table and Ping-route comments. - body-stash row: the in-memory copies now exist with no dashboard too. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Replies to round 1
Reviewer 1, finding 1: the PR body claimed per-session arming works single-tenant. Corrected. The arm route needs Non-blocking notes, both reviewers:
Tests (macOS, Go 1.27.4): build and vet are clean. Plain Local tests: waived (owner rule) |
amiddavid
left a comment
There was a problem hiding this comment.
| 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.332 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 4 | 8337883931a8 |
approve |
Verdict: approve
Findings
None. My round-1 finding is fixed and verified. The new commit adds no defect I can show.
Earlier findings
- Reviewer 1, finding 1 (PR body claimed single-tenant arming): fixed. The PR body's "Also" bullet now says the arm gate changes only the refusal text in hosted mode, that
MountControlneedsOptions.Tenants, and that this PR adds no single-tenant route. I read the live PR body and checked it againstproxy/control.go:188-191andproxy/keepalivectl.go:45. The claim now matches the code. The follow-up question sits in Open questions. - Reviewer 2, round-1 notes (all non-blocking): fixed. I checked each myself:
- The 409/404 comment in
proxy/manualping.go:31-32now states both answers. It matches the code paths (WarmFactsmiss → 404; held but off → 409). - The panic fallback in
keepalive/mayhold.go: the code is unchanged and harmless; the test now carries a comment that the panic case runs with no sink. Accept. TestWarmFactsReportsTheOneHourTierpins the 1-hour tier. I tracedResolveTier: the test body sets"ttl":"1h"on every breakpoint and billsCacheWrite1h == CacheWrite == 1200, sottl1his true andWarmFactsmust report 1 hour.docs/data-dependence/features/body-stash.mdnow names the no-dashboard case. The generated page carries the same sentence.
- The 409/404 comment in
Non-blocking
proxy/keepalive_singletenant_test.go:243-246— the press check inTestWarmFactsReportsTheOneHourTierfails only on a 409 whose body contains "cold". A 404 or another 409 would pass silently. The directttl == time.Hourassertion carries the test, so this is minor. Assertingw.Code == 200would be stronger.
What I checked
- Last review: round 1,
c8847751feb801bbadc98c6a38ecc5e339958b45, 2026-11-26T14:35:48Z. - New commits read: 3 —
ebd659bb(accountant v0.10.0, from main),ed4aff0d(merge of main),83378839(round-1 fixes). - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files).
- New items since my last review: reviewer 2's round-1 review (approve, 4 non-blocking notes — each checked above); the author's reply comment (checked each claim against the code); the fix commit (reviewed below); the main merge (checked below).
- The fix commit
83378839:WarmFactsnow callse.cacheTTL(), so it cannot drift from the core's rule. The two new tests:TestHeaderHoldWorksWithNoDashboardholds a thread with a zero policy and the header, presses it (200), and shows no scheduled ping follows — I tracedrecordTouch(ManualHoldset on the mayHold path) and the manual-only entry's retirement.TestWarmFactsReportsTheOneHourTieras above. The comment fixes inproxy/proxy.goandproxy/manualping.gomatch the code. - The merge
ed4aff0d:go.modpins released tags (accountant v0.10.0), which the merge brings in from main — allowed by the pin rule. The mergeddocs/data-dependence.mdkeeps both sides: the v0.10.0 metrics-push text and this PR's rows. The accountant change (Withhold,Check.Claims) touches nothing this PR's tests assert (Result.Opslength only). - Data dependence at head: the body-stash row and the generated page carry the same sentence; the other rows are as checked in round 1.
- I did not run builds or tests (live tests not approved).
amiddavid
left a comment
There was a problem hiding this comment.
| 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.332 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 4 | 8337883931a8 |
approve |
Verdict: approve
Findings
None. Every fix is in and correct. I found no new defect in the new commits.
Earlier findings
- Reviewer 1, finding 1 (the PR body claimed single-tenant arming works): fixed. The body now says the
armgate changes only the refusal text in hosted mode, namesMountControlandOptions.Tenantsas the reason, and says this PR adds no single-tenant arming. I checked the claim against the code in round 1:MountControlreturns early whenOptions.Tenantsis nil, andkeeper.armhas one caller, the control route. The corrected text matches the code. - My non-blocking notes: all addressed.
WarmFactsnow callse.cacheTTL()(keepalive/manualhold.go:291), so it cannot drift from the core's own rule. Fixed.- The manualping.go header comment now states the 404 answers (not held with no dashboard, hosted with no recorder). Fixed.
TestWarmFactsReportsTheOneHourTierpins the 1-hour tier. Added.- The body-stash row names the no-dashboard single-tenant case, and the generated page carries the same sentence. Fixed.
- The
mayhold.gorecover stays, with a comment on the panic test case. The author kept it as a fail-closed guard. I accept: it is harmless and the safe direction.
Non-blocking
- proxy/keepalive_singletenant_test.go:161-164 — the "not cold" assertion is weak. The test errors only when the answer is a 409 and the body says "cold". A 409 "not held" (the entry is past its hard deadline after 30 minutes with no sweep) would also pass. The first assertion (
ttl == time.Hour) is the real pin, so this costs little. - keepalive/mayhold.go —
MayHoldCredentials(boom, true)still does not exercise the panic path. The comment added to the test says the panic case useshasAuditSink=false, which is accurate. ThehasAuditSink=truefallback in the recover stays unreachable. Kept knowingly; no action needed.
What I checked
- Last review: round 1, c884775, 2026-11-26T14:36:14Z.
- New commits read: 2 (
ed4aff0dmerge: origin/main into feat/keepalive-audit-hosted-only;83378839fix(keepalive): round 1 of #1470). The merge brings main'sebd659bb(accountant v0.10.0 bump) with it. - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three saved files).
- New items since my last review: reviewer 1's round-1 review (14:35:48Z, read now for the first time), the author's reply comment (14:40:07Z), and the two commits. I checked each one; results above and below.
- The fix commit. Read the whole diff and the changed files around each hunk:
WarmFacts→e.cacheTTL(), the two comment fixes, the body-stash row and the regenerated page, and the two new tests. TestWarmFactsReportsTheOneHourTier. Traced the tier: the body asks extended TTL on every breakpoint (strings.ReplaceAllchanges all three),Usage.CacheWrite1h == CacheWrite, soResolveTier→BilledOneHour→e.ttl1h = true;cacheTTL()→modelinfo.CacheLifetime→AnthropicCacheTTL1h = time.Hour. The assertionttl == time.Houris right.TestHeaderHoldWorksWithNoDashboard. Keep-alive off (CachePolicy{}), header on:recordTouchsetspol.ManualHoldon themayHoldpath, the entry is held, the press sends one ping, and the sweep 10 minutes later retires the expired 300-second hold without a scheduled ping. The assertions match the keeper's rules.- The merge from main. The accountant bump pins released tags (v0.10.0, root and
metricssubfolder), and it comes in with a merge of main, so it is the integrator's check, not this PR's. The repo-side changes are the replay digests (with a comment saying why they changed) and version names in the metrics-push row,docs/data-dependence.mdanddocs/metrics/spec.md. The row file and the generated page carry the same text. - The conversation. The author's reply answers every finding from both reviewers. Each answer matches what the code and the PR body now say. No open request from a person is left unmet.
…1470) Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Round 2: both approve. One test fix.Both reviewers noted that The
Local tests: waived (owner rule) |
amiddavid
left a comment
There was a problem hiding this comment.
| 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.332 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 3 of 4 | eeb24a8c0152 |
approve --> |
Verdict: approve
Findings
None. The new commit changes test code only, and the change is right.
Earlier findings
- My round-2 note (the "not cold" assertion was weak): fixed.
eeb24a8cmakes the press assert200and exactly one upstream request. A 404, a 409 "not held" or a 409 "cold" now fails the test. Reviewer 1 raised the same note in round 2; I checked the fix once, for both. - All round-1 findings and notes: fixed or accepted, as recorded in my round-2 review. Nothing regressed: the fix touches no production file.
Non-blocking
- None new.
What I checked
- Last review: round 2, 8337883, 2026-11-26T14:43:11Z.
- New commits read: 1 (
eeb24a8ctest(keepalive): the 1-hour press must return 200 and send one ping). - Read in full: 3 reviews, 2 comments, 0 inline comments (from the three files).
- New items since my last review: reviewer 1's round-2 review (approve; one non-blocking note, the same weak assertion I raised), the author's round-2 reply (14:44:41Z), and the commit
eeb24a8c. I checked each one. - The new assertion is deterministic, not lucky. The entry is an automatic one (
kaPolicy(), no manual header), somanualExpireddoes not apply. Its hard-deadline timer is a real-clocktime.AfterFunc(keepalive/keeper.go:1240), which cannot fire inside the test's fake 30-minute advance, so the entry stays inliveandPingNowreaches it.WarmFactsgives last touch 30 minutes ago andttl1 hour, so the cold gate passes. The fake upstream sees exactly one request: with the inline runner no scheduled ping runs, because noSweepis called. The 200 and the count of 1 are forced by the code paths, not by timing. - The author's reply matches the code. The reply says the fix changes test code only, and that is what the diff shows:
proxy/keepalive_singletenant_test.go, 6 lines added, 2 removed. The reply also confirms thehasAuditSink=truerecover fallback stays unreachable, which both reviewers accepted in round 2. - The rest of the PR is unchanged since my round-2 review of head
83378839.
amiddavid
left a comment
There was a problem hiding this comment.
| 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.332 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 3 of 4 | eeb24a8c0152 |
approve |
Verdict: approve
Findings
None. The new commit changes test code only and fixes the one open note. I found no defect in it.
Earlier findings
- Reviewer 1, round-1 finding (PR body claimed single-tenant arming): fixed in round 2, still fixed. The PR body and Open questions are unchanged since round 2.
- Reviewer 1 and reviewer 2, round-2 non-blocking note (the weak "not cold" assertion in
TestWarmFactsReportsTheOneHourTier): fixed.eeb24a8cmakes the press assert a 200 (t.Fatalfon any other code) and asserts exactly one upstream request. A 404, a 409 "not held" or a 409 "cold" now fails the test. This is the fix I asked for. - Reviewer 2, round-2 note (the unreachable
hasAuditSink=truepanic fallback): kept knowingly. The author's comment says it stays; both reviewers accepted it in round 2. It is harmless and fails in the safe direction. No action.
Non-blocking
None new.
What I checked
- Last review: round 2,
8337883931a8e8f3ad3abc31318cba873f1e1343, 2026-11-26T14:43:06Z. - New commits read: 1 —
eeb24a8c(test(keepalive): the 1-hour press must return 200 and send one ping). - Read in full: 3 reviews, 2 comments, 0 inline comments (from the three files).
- New items since my last review: reviewer 2's round-2 review at 14:43:11Z (approve; its two non-blocking notes checked above); the author's comment at 14:44:41Z (its claims match the commit); commit
eeb24a8c(below). - The commit
eeb24a8c: test-only, inproxy/keepalive_singletenant_test.go. I traced the count it asserts:recorddispatches nothing upstream, noSweepruns in the test, and the press is synchronous, so the fake upstream sees exactly the one press. The keeper's background sweep ticker runs on real 2-second time while the test finishes in milliseconds, so it cannot add a call — the same pattern the file's other tests rely on. - Nothing outside the test file changed: no production code, no docs, no data-dependence rows since round 2.
- I did not run builds or tests (live tests not approved).
…signal (#1470) The test const fakeSecret clashed with #1469. The startup line now reads tenants != nil, the same signal the proxy decides on. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Merged main (with #1469), renamed a test const, aligned the log
Round 4 re-checks this delta. Local tests: waived (owner rule) |
amiddavid
left a comment
There was a problem hiding this comment.
| 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.332 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 4 of 4 | b2472bdaac56 |
approve --> |
Verdict: approve
Findings
None. The delta since round 3 holds one PR-owned fix commit and a merge of main. Both are clean.
Earlier findings
- All findings and notes from rounds 1 to 3 stay fixed or accepted. Nothing regressed: the fix commit touches one test file and one line of
proxyapp. - The unreachable
hasAuditSink=truerecover fallback stays, as both reviewers accepted in rounds 2 and 3.
Non-blocking
- The author's comment (15:30:38Z) says "
b2472bdamerges origin/main". The merge commit isbdc39b71;b2472bdasits on top of it with the rename and the log change. The branch head carries both, so nothing is wrong in the tree — only the sentence names the wrong sha. No action needed.
What I checked
- Last review: round 3, eeb24a8, 2026-11-26T14:46:29Z.
- New commits read: 3 in
eeb24a8c..HEAD—2c38eb58(main: the opencode v2 test waits on the condition),d0af063a(main: #1469, the recorder writes request headers by allowlist),bdc39b71(merge of main),b2472bda(this PR: rename the test key; log hosted mode by the decision signal). The two main commits came in with the merge and are the integrator's check; I read their diffs for interaction with this PR, below. - Read in full: 4 reviews, 3 comments, 0 inline comments (from the three files).
- New items since my last review: reviewer 1's round-3 review (approve, no new notes), the author's comment at 15:30:38Z, and the three commits. I checked each one.
- The
fakeSecretclash was real and is fixed. Main's #1469 addsproxy/credmask_test.gowithconst fakeSecret = "sk-test-SECRET-123"(line 16), in the same package as this PR's test. The merged tree would not compile. The rename tofakeSingleTenantKeycovers all six uses inkeepalive_singletenant_test.go, and no reference tofakeSecretremains there. No other symbol of this PR's test file (bookSink,countObs,noDashHost,newNoDashHost) appears in main's new test files. - The startup-line change is a drift fix, not a behavior change.
proxyapp/main_run.go:923now readstenants != nilinstead of*upstreamsPath != "".tenantsis set only inside the*upstreamsPath != ""block (main_run.go:535-604), so the two were equal before. The log now uses the same signalkeeper.mayHoldreads (Options.Tenants), so the two cannot disagree later. This closes the consistency check I made by hand in round 1. - The merge kept this PR's changes.
proxy/proxy.goat head still mounts the Ping button outside the dashboard block (line 663) with the round-2 comment (line 641), beside main's #1469 one-line change to the event queue. The body-stash row and the generated page both carry this PR's sentence;trace-recording.mdcarries main's allowlist text. - The full PR diff at the new base
d0af063amatches the files and hunks I reviewed in rounds 1 to 3, plus the two changes ofb2472bda.
amiddavid
left a comment
There was a problem hiding this comment.
| 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.332 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 4 of 4 | b2472bdaac56 |
approve |
Verdict: approve
Findings
None. The PR's own new commit fixes a real compile clash and aligns one log condition. I found no defect in it or in the merge.
Earlier findings
- Reviewer 1, round-1 finding (PR body claimed single-tenant arming): fixed in round 2, still fixed. The PR body is unchanged since.
- Round-2/3 notes (weak press assertion, unreachable panic fallback): fixed and accepted in round 3. Nothing regressed; the new commit touches none of that code.
Non-blocking
- The author's round-4 comment says "
b2472bdamerges origin/main". The merge isbdc39b71;b2472bdaholds the rename and the log change. The comment's substance is right; only the sha attribution is off. No action needed.
What I checked
- Last review: round 3,
eeb24a8c0152e3fa19f80baa55bb8cf16d5c4a08, 2026-11-26T14:46:33Z. - New commits read: 4 —
2c38eb58(opencode test wait, #1468, from main),d0af063a(record header allowlist, #1469, from main, the new base),bdc39b71(merge of main),b2472bda(rename the test key; log hosted mode by the decision signal). - Read in full: 4 reviews, 3 comments, 0 inline comments (from the three files).
- New items since my last review: reviewer 2's round-3 review at 14:46:29Z (approve; read, nothing new to check beyond round 3); the author's comment at 15:30:38Z (claims verified below); the merge and the fix commit.
- The compile clash was real. Main's #1469 adds
proxy/credmask_test.go:16withconst fakeSecret = "sk-test-SECRET-123". This PR's test declaredconst fakeSecretin the same package, so the merged tree did not compile. The rename tofakeSingleTenantKeycovers all 6 references, and nofakeSecretreference remains in this PR's test file. I also checked the other new #1469 test file (proxy/recordheaders_test.go) for collisions with this PR's helpers (bookSink,countObs,noDashHost): none. - The log condition is equivalent and now names the decision signal.
tenantsis set only inside theif *upstreamsPath != ""block (proxyapp/main_run.go:604), so!*dashOn && tenants != nilfires on exactly the same deployments as the old*upstreamsPath != "", and it reads the same variable that becomesOptions.Tenants. - The merge is clean. Both sides' changes to
proxy/proxy.goare present at head: this PR'smountManualPingmove and route-table comment, and #1469'srecord.AllowedHeaders(r.Header)inserve. The mergeddocs/data-dependence.mdkeeps both this PR's rows and #1469's trace-recording row. #1469's allowlist touches the trace recorder only; the keeper's in-memory header hold for pings is a different path, so the two changes do not interact. - I did not run builds or tests (live tests not approved).
A single-tenant proxy holds only its own user's credential, in memory. It now holds a thread and pings with no dashboard. A hosted proxy with no recorder still holds nothing. - keepalive.MayHoldCredentials decides; the proxy calls it from keeper.mayHold (hosted = Options.Tenants != nil). - The gate covers recordTouch, canPing, session arming and the Ping route. - With no dashboard the Ping route reads the cold gate from the keeper (Keeper.WarmFacts), and the route stays mounted. - The credential stays in memory: no new file, log or metric. Fixes #1457 Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
- WarmFacts uses the entry's cacheTTL; a 1-hour-tier test pins it. - Test for the header hold with no dashboard. - Fix the route-table and Ping-route comments. - body-stash row: the in-memory copies now exist with no dashboard too. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
…1470) Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
…signal (#1470) The test const fakeSecret clashed with #1469. The startup line now reads tenants != nil, the same signal the proxy decides on. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
b2472bd to
23215f9
Compare
Round 4: both approve. Commits re-signed.
The owner gave "1470 yes" in the integrator session. Local tests: waived (owner rule) |
The one conflict was in docs/data-dependence/features/accountant-savings.md. It takes main's text, with #1470's single-tenant ping wording, and keeps this PR's line that the tool deferral ledger reads the figure. The page is regenerated with go run ./cmd/gen-datadep. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Behavior change (needs the owner's yes)
--dashboard: a container or a hand-run binary. The personal installer always passes--dashboard, so it does not change.armgate follows the same rule. It changes only the refusal text in hosted mode. The arm route is mounted byMountControl, which needsOptions.Tenants, so single-tenant arming does not exist and this PR does not add it.none, or set the kill switchCONTEXT_GURU_KEEPALIVE=off.Decided by: David Amid, 2026-11-26 (design in #1457). The integrator confirms the yes before merge.
Summary
Options.Tenants != nil, the signal the proxy already uses. No new flag.keepalive.MayHoldCredentials. The proxy calls it fromkeeper.mayHold.What changed
keepalive/mayhold.go: hosted and no sink gives no hold. Everything else gives a hold. A failure in reading the signal falls back to the old rule (a sink is needed).proxy/keepalive.go:recordTouchandcanPingusemayHold.proxy/keepaliveoverride.go:armusesmayHold(only the hosted refusal changes in effect).proxy/manualping.go: the Ping route usesmayHold. With no dashboard it reads the cold gate from the keeper (Keeper.WarmFacts: last touch and lifetime, times only).proxy/proxy.go: the Ping route stays mounted with no dashboard.proxyapp/main_run.go: the startup line says "IMPOSSIBLE" only for hosted mode with no recorder. Comments updated.h.recwithout a nil check. The ping row is already nil-safe, andBookPing(fix(accountant): book ping savings without the dashboard, credit a manual ping's rescue #1461) runs first.How it was tested
macOS, Go 1.27.4.
go build ./...,go vet, plaingo testonkeepalive,proxy,proxyapp,components/all.-race -runon the new tests.canPingfalse, Ping route 404.TestAPingBooksSavingsWithNoDashboard(proxyapp) already pins thellm_savings_*booking from fix(accountant): book ping savings without the dashboard, credit a manual ping's rescue #1461.Data dependence
keep-alive-pingsandaccountant-savingsrows updated,docs/data-dependence.mdregenerated. Keep-alive now depends on stored data (body and credential, in memory) with no dashboard, in single-tenant mode only. Decided by: David Amid, 2026-11-26.Credential handling
The credential lives in process memory only.
sk-test-SECRET. It checks that the captured logs do not contain it, and that a temp state dir (alsoHOME,TMPDIR, and the working directory) holds no new file after a held ping and a manual ping.Open questions
Fixes #1457
Local tests: waived (owner rule)
🤖 Generated with Claude Code