Repository navigation
refactor(accrec): move the accountant glue out of the proxy - #1337
Conversation
Move the accountant's body parsing, cache-mark reading and envelope diff out of proxy/ into the new accwire package. A Wire value, chosen once per body by accwire.For, holds the four reads of a wire: Body and Parse, Breakpoints, EnvelopeOps and MessageOps, and WireIndex. apply uses WireIndex for wireGroups and responsesWire. The write-side slot types stay as they are. No behaviour change. Closes #1164 Refs #1309 Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
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.331 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 2 | c2fab96fe97b |
approve |
Verdict: approve
Findings
None. The commit moves the accountant glue from proxy/ to the new accrec package. I compared each moved rule with its original at the base. I found no behavior change and no broken path.
Non-blocking
- docs/design.md — the package map has no
accrec/row. The map lists every other package.accwire/(the base commit) is missing too, so this follows a precedent. Add both rows in a docs PR if the map is meant to be complete. - proxy/proxy.go:1533 — a comment still names
responsesServerHeldHistory. That function now lives only as a test alias inproxy/accountant_accrec_view_test.go:16. A reader who greps for it finds it in tests only. Point the comment atschema.ServerHeldHistoryinstead. - Data dependence: no change.
accrecholds whatproxyheld: hashes, sizes, one bool per thread, ping facts. No row edit is needed. I state it here because CLAUDE.md asks each PR to say it.
What I checked
- Read the full diff (20 files, +652/−344) and the code around each change.
- Moved logic, rule by rule, against the base version:
BilledBody,DeferredStub,DeferredNames,OwnDeferred,IsStub,EnvelopeOpsFor,EntryFacts,BilledTTL,PingSavings,ShouldCompute,NoResultWhy,SiblingStore,TierStore. All are verbatim moves. Only names changed (exported). finish()rewrite (proxy/dashcapture.go:961). The old if/else chain and the newShouldComputecall agree on every input: rejected status, deferral unplaced, rounds > 1, and the compute path withaccBilledTTL,noteRescueFactsMissingandpings.dropin the same places.schema.ServerHeldHistorywide/narrow split. The three narrow callers (apply/responses.go:538,apply/restore.go:41,expand/anchor.go:186) each usedprevious_response_idonly before; the wide caller (proxy/proxy.go:1537) used the full old rule. Each keeps its old form. The doc comment defers the widening to #1298, so no edge-case behavior changed without permission.- Nil-safety chains. A nil
*PingStorereachesaccrecas a non-nil interface (pingSink{st},entryFacts's parameter). Every method it lands on (put,peek,notePriced) checks a nil receiver.TierStore.Get/SetandSiblingStore.SharedWarmare nil-safe.accrec.PingSavingsalso guards a nil sink interface. - Import direction. Only
proxyimportsaccrec.accrecimportsaccwire,apply,tooldefer,keepalive,thread,components,schema— none of these importaccrec, so no cycle.accrecdoes not importproxy, so the library/proxy boundary holds. - The panic-swap tests still work.
proxy/accountant_ping_test.go:464swaps thepingOpsandaccountantStandalonepackage vars. The wrapper reads them at call time, so the swap reachesaccrec.PingSavingsthroughPingCalls. - Test coverage. New tests cover
ShouldCompute(7 cases),NoResultWhy,BilledTTL(6 cases, traced againstkeepalive.BilledOneHour),PingSavings(normal, rejected, manual, nil sink),EnvelopeOpsFor(both operators), andServerHeldHistory(both forms, 7 bodies). Existing proxy tests cover the old names through the alias file. go vetonaccrec,proxy,schema,apply,expandran clean. Compile check only; I ran no tests.- Checked for dangling references to the removed names (
accThreadID,ownDeferred,isStub,oneHourIf,pingStart,billedBodyas code). Only comments and the test alias file mention them.
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.331 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 2 | c2fab96fe97b |
approve |
Verdict: approve
Findings
None. I traced every moved block against its base version and found no behavior change.
Non-blocking
- proxy/proxy.go:1533 — the comment says "see responsesServerHeldHistory". That function moved to
schema.ServerHeldHistory. The name now exists only in a test alias file. Point the comment at the new function. - docs/metrics/spec.md:639 — it names
proxy/accountant_*.goas "the accountant wiring". Part of that wiring now lives inaccrec/. Update the pointer when that spec is next edited. - docs/design.md — the package map has no row for
accrec.accwireis missing too, so the map was already short on accountant glue. A row would help a new reader. - proxy/accountant_accrec_view_test.go — the alias vars (
billedBody,accPingKey, ...) keep old test spellings alive. Fine for one move. Drop them when the tests are next touched, so the aliases do not outlive the move.
What I checked
- The branch logic in
finish(proxy/dashcapture.go:963-987). I comparedaccrec.ShouldComputeagainst the oldrejected / deferral_unplaced / roundselse-if chain, case by case. Rejected wins over an earlier reason in both.DeferralUnplacedkeeps its value in both.rounds <= 1computes in both. Arounds > 1skip leavesaccNoResultunchanged in both.NoResultWhyandRejectedmatch the old inline code the same way. schema.ServerHeldHistory(schema/wire.go:41). The wide form is byte-for-byte the oldresponsesServerHeldHistory. The narrow form checksprevious_response_idonly, which is whatapply/responses.go:538,apply/restore.go:41andexpand/anchor.go:186checked before. The proxy passeswide=true(proxy/proxy.go:1537), the three library callers passfalse. Each caller keeps its old rule.- The moved billed-body code (accrec/billed.go).
DeferredStub,DeferredNames,OwnDeferred,BilledBodyandEnvelopeOpsForare the old proxy functions verbatim, withclientrenamed toclientTools. The calleraccBilledandenvelopeOpsForpass the same arguments. BilledTTL(accrec/facts.go:63). The rule, the early return, theprev=truedefault for an unknown thread and the "read-only turn leaves the tier alone" case match the oldaccBilledTTLinline code. I checked the new test's expectations againstkeepalive.BilledOneHour(keeper.go:315); all five cases agree.PingSavings(accrec/ping.go:58). Filter, panic recovery,NotePricedordering and the "manual pings price but do not store" rule match the old proxy function. The proxy wrapper readspingOps/accountantStandaloneat call time, so the test injection that makes them panic still works.- Nil-safety through the new interfaces.
pingSink{nil}and a nil*PingStorepassed asPingLookupboth reach nil-safe methods (put,notePriced,peekall checks == nil). Old and new paths agree. - The renamed stores.
SiblingStore/TierStoreare rename-only moves (git sees 87% / 68% similarity); bodies unchanged apart from exported names. - Package boundaries.
accrecimportsaccwire,apply,tooldefer,keepalive,thread,componentsandinternal/modelinfo, and no package imports it back, so there is no cycle. It never importsproxy, which keeps the library/proxy boundary. Onlyproxyimportsaccrec. - Compile surface. I grepped for every removed symbol (
accThreadID,ownDeferred,isStub,oneHourIf,pingStart,responsesServerHeldHistory, ...) outsideaccrec. Non-test users are gone; test users go through the alias file. Removed imports (strconvin dashcapture.go,gjson/stringsin accountant_wire.go) have no remaining use. Remaining imports in each touched file are still used. - Tests. The new tests cover each extracted decision (
ShouldCompute,NoResultWhy,BilledTTL,PingSavingsrules,EnvelopeOpsForoperator attribution, both forms ofServerHeldHistory). No test sleeps; they wait on returned values. - I did not build or run tests; live tests were not approved for this review.
- Say "once per body" in the package doc. - Explain why For reads the body in place (GetBytes copies it). - Name the negative-index difference between the two WireIndex forms. - Test that only the Responses wire reads input. - Add accwire to docs/design.md. Refs #1164 Refs #1309 Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
c2fab96 to
4589035
Compare
|
Fixed in 4589035 (stacked on 862b178 of #1327), or kept with a reason.
No proxy code changed beyond a comment, so I did not re-run |
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.331 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 2 | 45890350d464 |
approve |
Verdict: approve
Findings
None. The new commit changes three doc lines and one comment. No code path changed. The rebase did not change the moved code (see "What I checked").
Status of the round-1 notes
Mine:
- proxy/proxy.go:1533 stale comment — Fixed in 4589035. The comment now names
schema.ServerHeldHistory, wide form. - docs/metrics/spec.md stale pointer — Fixed in 4589035. The line now names
proxy/accountant_*.go,accwire/andaccrec/. - docs/design.md package map row — Fixed in 4589035. The
accrec/row sits afteraccwire/and matches what the package holds. - The test alias file — Kept by the author, reason accepted. The reason: it keeps the existing proxy tests unedited, and the tests call the old names. I re-checked:
proxy/tooldefer_stub_body_test.go,proxy/accountant_defer_scope_test.go,proxy/accountant_ping_test.goandproxy/accountant_onehour_test.gocallbilledBody,accPingKey,pingFromReportand the other aliases. The reason is right.
Reviewer 2's:
- design.md row — fixed, same commit as mine.
- proxy.go comment — fixed, same commit as mine.
- Data dependence stated in the PR body — present. The body says "Same as before. Metadata only: hashes, sizes, ids and flags." That matches what
accrecholds (I verified the fields in round 1:SiblingStorekeeps hashes, sizes and breakpoints;TierStorekeeps one bool; the ping facts are counts and a window).
Non-blocking
- Commit a11e77b still says
Closes #1303. The PR body, the PR comment (item 11) and the comment on #1303 all say #1303 stays open, because thesavingsTrackeris left in the proxy. The commit message contradicts them. GitHub closes an issue from a closing keyword in a commit message when that commit lands on the default branch. This PR's base isfeat/mv-1164-accwire, so merging it closes nothing. The keyword fires only if the stack reachesmainby rebase or merge commit, which keeps the message. The repo's recent merges tomainare squash style ((#1297),(#1295),(#1293)titles, no merge commits since #1240), so the message most likely never lands. And a closed issue can be reopened. Still: reword the commit toRefs #1303before merge. A merged commit message cannot be amended later, and the fix is one word now.
What I checked
- Last review: round 1, c2fab96, 2026-11-24T09:38:42Z.
- New commits read: 3 —
862b1789refactor(accwire): address review notes (the base PR #1327's commit, now in this branch's history);a11e77berefactor(accrec): move the accountant glue out of the proxy (the reviewed commit, rebased);45890350docs(accrec): address review notes. - 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, and what I did about each:
- Reviewer 2's round-1 review (09:38:30Z, approve, no findings). Read. Its three non-blocking notes overlap mine; both fixed by 4589035. Nothing new to check.
- The author's comment (09:48:05Z, items 8 to 11). Checked each:
- Item 8 (proxy.go comment): fixed, verified in the 4589035 diff.
- Item 9 (metrics spec, design.md): fixed, verified in the 4589035 diff.
- Item 10 (keep the alias file): reason checked and accepted, see status list above.
- Item 11 ("the PR now says Refs #1303, not Closes. #1303 stays open"): partly true. The PR body says "It refs #1303 and does not close it" — verified. But commit a11e77b's message still ends with
Closes #1303— see Non-blocking. The comment on #1303 exists (posted 09:48:06Z) and #1303 is open — verified through the API.
- Commit 4589035 (docs). Read the full diff:
docs/design.md+1 row,docs/metrics/spec.mdone line rewritten,proxy/proxy.goone comment line. All three match the notes from round 1. No code change. - Commit 862b178 (the base PR's review notes). Read the full diff: comment fixes in
accwire/wire.go, one new testTestOnlyTheResponsesWireReadsInput, one design.md row foraccwire/. It belongs to PR #1327 and touches no file this PR's own commits touch. Nothing to act on here. - The rebase. I diffed
c2fab96f..a11e77be(my reviewed head against the rebased head). The diff contains exactly the changes of 862b178 and nothing else. So the accrec move itself is byte-identical to what I verified in round 1, and my round-1 trace still holds for the head.
- I did not build or run tests; live tests were not approved for this review.
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.331 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 2 | 45890350d464 |
blocking |
Verdict: blocking
The code is unchanged since round 1 and my round-1 approval of it stands. One new problem: the commit message says "Closes #1303", and everything else in this PR says that issue must stay open. The fix is a one-word amend.
Findings
- a11e77b (commit message) — "Closes #1303" will close the issue this PR must leave open
- What fails: the PR merges to
mainwith a merge commit or a rebase merge → the commita11e77belands on the default branch with "Closes #1303" in its message → GitHub closes issue #1303 automatically. Issue #1303 is open and tracks the work that is left: thesavingsTracker/ Recorder move (see the author's own comment on #1303, 2026-11-24T09:48:06Z: "It refs this issue and does not close it"). - Proof:
git log -1 --format=%B a11e77beends with "Closes #1303 / Refs #1309". Three statements say the opposite: the PR body ("It refs #1303 and does not close it: thesavingsTrackeris still in the proxy"), the author's PR comment item 11 ("Fixed: the PR now says 'Refs #1303', not 'Closes'. ... #1303 stays open"), and the comment on #1303. So the claimed fix changed the PR body only. The commit message still carries the closing keyword. This repo uses both squash merges (recent(#N)titles) and merge commits (49adbc67,f43d9fa5), so the merge method is not a guard. Only the squash path is safe. - Fix: amend the
a11e77bemessage from "Closes #1303" to "Refs #1303" (a rebase on the author's own branch), or state in the PR that the merge must be a squash.
- What fails: the PR merges to
Round-1 notes: status
- design.md package map (mine, reviewer 1): fixed.
accrec/row added in 4589035;accwire/row added in the new base 862b178. - proxy/proxy.go comment naming
responsesServerHeldHistory(mine, reviewer 1): fixed. It now says "seeschema.ServerHeldHistory, wide form", which matches the call at proxy/proxy.go:1537. - docs/metrics/spec.md pointer (reviewer 1): fixed. It now names
accwire/andaccrec/. - Alias file
proxy/accountant_accrec_view_test.go(reviewer 1): the author kept it with a reason: it keeps the existing proxy tests unedited. I accept the reason. The tests call the old names, and the file's comment says what it is for. - Data dependence (mine): the PR body now has the section. "Same as before. Metadata only." Agrees with what I found in round 1.
Non-blocking
- The PR body says "Review only the commits on top of that base. Merge PR 1 first." The new base 862b178 is the head of PR #1327's branch. Fine for a stack, but a reviewer of this PR alone sees
git diff 862b1789..HEAD, which is what I reviewed.
What I checked
- Last review: round 1, c2fab96, 2026-11-24T09:38:30Z.
- New commits read: 3 —
862b1789"refactor(accwire): address review notes" (the new base, from PR #1327's branch),a11e77be"refactor(accrec): move the accountant glue out of the proxy" (a verbatim rebase ofc2fab96f),45890350"docs(accrec): address review notes". - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt). - New items since my last review, and what I did about each:
- The rebase onto 862b178: I diffed
c2fab96fagainsta11e77be. The accrec commit content is identical; the tree diffc2fab96f..HEADis only the accwire docs, the design.md rows, the metrics spec line and the proxy comment. No code behavior changed since round 1, so my round-1 approval of the code stands. - Commit 862b178 (accwire notes): read in full. It is docs, three comment blocks and one test. I checked
TestOnlyTheResponsesWireReadsInputagainstaccwire/body.go:80-105:responsesSectionsruns only for the Responses wire, amessagesarray wins on both wires, and a stringinputis wrapped as one element. The test's four assertions match the code. - Commit 4589035 (docs notes): read in full. Three files, all documentation or a comment. The design.md
accrec/row and the metrics spec line describe the package correctly. The proxy comment now names the right function and the right form. - The author's PR comment (items 8-11): checked each fix. Items 8, 9 and 10 verified above. Item 11 is the finding: the PR body was fixed but the commit message was not.
- The comment on issue #1303: read in full. It lists what moved and what is left, and states the issue stays open. This is what makes the finding real.
- The rebase onto 862b178: I diffed
- Checked the PR body for a closing keyword by accident ("does not close it"): "close" is followed by "it", not an issue number, so the body itself closes nothing. Only the commit message carries the keyword.
- Read the PR title and body in full. The "How it was tested" section names the runs: build, vet, gofmt,
go testof the touched packages, and-raceruns, macOS, Go 1.27.4. I did not run tests; live tests are not approved for this review.
Move the accountant rules that a second host would have to copy into the new accrec package: the billed body of a deferral and its envelope operator, the entry facts and the billed-tier TTL rule, the sibling warm store, the ping pricing, and the no-result rules. Add schema.ServerHeldHistory with a wide and a narrow form. apply and expand use the narrow form, as before. The wide form is the accountant's. Widening apply and expand is held in #1298. No behaviour change. Refs #1303 Refs #1309 Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
- Name schema.ServerHeldHistory in the proxy comment. - Add accrec to docs/design.md and the metrics spec pointer. Refs #1303 Refs #1309 Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
4589035 to
2b6bdef
Compare
|
Fixed in 2b6bdef: message only, tree unchanged. The commit "refactor(accrec): move the accountant glue out of the proxy" now says "Refs #1303". No commit on the branch says "Closes #1303".
|
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.331 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 3 of 3 | 2b6bdefd9f82 |
approve |
Verdict: approve
Findings
None. The code is unchanged since round 2: git diff 45890350 2b6bdefd is empty. The only change is the commit message reword, which fixes the last open point.
Status of the earlier findings and notes
- My round-2 non-blocking note (commit message said
Closes #1303) — Fixed. Commit7b1ccf53(the reworded accrec commit) now ends withRefs #1303 / Refs #1309. I grepped every commit message in862b1789..HEADforCloses: no match. So no commit on this branch can auto-close #1303, whatever merge method lands it. - Reviewer 2's round-2 finding 1 (same point, raised as blocking) — Fixed by the same reword. I checked it myself: the message reword is the only difference, and the tree is identical (empty diff). The concern is gone.
- Round-1 notes — all fixed in
45890350or kept with an accepted reason, as I reported in round 2. Nothing changed since.
Non-blocking
- None new. The alias-file note stands as agreed in round 2: drop
proxy/accountant_accrec_view_test.gowhen the tests are next touched.
What I checked
- Last review: round 2, 4589035, 2026-11-24T09:53:06Z.
- New commits read: 2 —
7b1ccf53refactor(accrec): move the accountant glue out of the proxy (the accrec commit, message reworded fromCloses #1303toRefs #1303);2b6bdefddocs(accrec): address review notes (the docs commit, same message as before). - 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:
- Reviewer 2's round-2 review (09:54:21Z, blocking). Read in full. Its finding is the commit-message
Closes #1303, the same point I raised as non-blocking in round 2. I did not repeat it; I verified the fix instead (see the status list). - The author's comment (09:56:15Z). Every claim checked:
- "message only, tree unchanged":
git diff 45890350 2b6bdefdis empty — confirmed. - "the commit now says Refs #1303":
git log -1 --format=%B 7b1ccf53ends withRefs #1303 / Refs #1309— confirmed. - "no commit on the branch says Closes #1303": I grepped the full messages of
862b1789..HEADforCloses— no match — confirmed. - The
approval-still-valid.shoutput (equal patch-ids,SAME CHANGE): consistent with my own empty-diff check.
- "message only, tree unchanged":
- Reviewer 2's round-2 review (09:54:21Z, blocking). Read in full. Its finding is the commit-message
- I did not build or run tests; live tests were not approved for this review.
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.331 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 3 of 3 | 2b6bdefd9f82 |
approve |
Verdict: approve
The round-2 finding is fixed. The accrec commit was rewritten as 7b1ccf53 with "Refs #1303" in its message, and nothing else changed: git diff 45890350..HEAD is empty. The code is the code both reviewers approved in round 1.
Findings
None.
Round-2 finding: status
- "Closes #1303" in the accrec commit message — fixed.
git log -1 --format=%B 7b1ccf53now ends with "Refs #1303 / Refs #1309". I also scanned both commit messages on the branch (7b1ccf53,2b6bdefd) for any closing keyword (close, fix, resolve, in every form): none. The PR body has no closing keyword for #1303 either. Issue #1303 is open. The author's comment (09:56:15Z) shows agit range-diffand a matching patch-id for the two heads; my own empty tree diff agrees.
Non-blocking
- Reviewer 1's round-2 note asked for the same reword and is resolved by the same amend. I agree with their reading; the fix covers both.
- The alias file
proxy/accountant_accrec_view_test.gostays, per the author's accepted reason from round 2. No change.
What I checked
- Last review: round 2, 4589035, 2026-11-24T09:54:21Z.
- New commits read: 2 —
7b1ccf53"refactor(accrec): move the accountant glue out of the proxy" (rewritten: message only) and2b6bdefd"docs(accrec): address review notes" (rebased, content unchanged). - Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt). - New items since my last review, and what I did about each:
- Reviewer 1's round-2 review (09:53:06Z, approve). It was posted one minute before mine and was not in the conversation file I read for round 2, so I read it now, in full. No findings. Its non-blocking note is the same "Closes #1303" point I raised as a finding. Both are resolved by the same amend. Nothing else in it needs action.
- The author's comment (09:56:15Z). It states the fix: message only, tree unchanged, no commit on the branch says "Closes #1303". I verified each claim myself: the empty tree diff, the message scan across both commits, and the issue state. The range-diff output in the comment matches what I see locally.
- The rewritten commits. Read both messages in full and diffed the trees.
git diff 45890350..2b6bdefdis empty, so no file changed since the round-2 head. My round-1 code verification and round-2 status list still hold for this head. - The PR body. Re-read through the API. It still says the PR refs #1303 and does not close it, and carries no closing keyword (checked with a pattern over close/fix/resolve forms).
- Did not build or run tests; live tests are not approved for this review. The author's comment names the earlier runs (build, vet, gofmt,
go test,-race, macOS, Go 1.27.4), and no code changed since those runs.
Signed-off-by: DAVID AMID <[email protected]>
|
Merged Three conflicts. I resolved each by hand and kept this branch's side:
Main changed none of the moved code since the merge base. The only other proxy change on main is The PR's changed lines are unchanged. The Tests (macOS, Go 1.27.4): build, vet and |
Summary
The accountant's glue rules now live in the new library package
accrec. Cortex can call them. It refs #1303 and does not close it: thesavingsTrackeris still in the proxy. Part of #1309.This is PR 2 of a stack of 2. It is based on PR 1 (#1327), its base branch is
feat/mv-1164-accwire. Review only the commits on top of that base. Merge PR 1 first.What changed
Moved from
proxy/toaccrec/:billedBody,ownDeferred,deferredNames,deferredStub,isStub, and the operator rule ofenvelopeOpsFor(nowaccrec.EnvelopeOpsFor).entryFacts(nowaccrec.EntryFacts),accThreadID,accPingKey.accBilledTTL(nowaccrec.BilledTTL) and its store (TierStore).SiblingStore, with its TTL and 4096/64 bounds). Its test moved with it.PingSavingsandpingFromReport(nowaccrec.PingSavings,accrec.PingFromReport).accrec.ShouldCompute(rejected status, deferral not placed, upstream rounds) andaccrec.NoResultWhy.finishandnoResultWhycall them.New in
schema:ServerHeldHistory(body, wide).previous_response_id,conversation,item_reference.previous_response_idonly.apply/responses.go,apply/restore.goandexpand/anchor.gocall the narrow form. The comment points to decide: two proxy and library results that differ (server-held history, replay prefix floor) #1298. Nothing is widened.Left in the host (transport and state only):
capturefields and theaccBegin/accEnd/accWait/accRunjob flow, thePingStoremap, thedashEmitter.KeepAlivePingrow build (adash.Event), and thesavingsTrackerbegin/end/compute/shadow/state code. The first three are request state. The row build is display.savingsTrackeris the larger "Recorder" the issue names. It is not moved here. It holds the restart state and the shadow mode, and needs its own PR.PingSavings,entryFacts,envelopeOpsFor,noResultWhy) so the existing tests keep their spelling. Test-only name aliases are inproxy/accountant_accrec_view_test.go.Behaviour
None. No existing test changed. Two copies differ today, and each caller keeps its result:
Data dependence
Same as before. Metadata only: hashes, sizes, ids and flags. No feature or component is added. No
docs/data-dependence/row changes.How it was tested
macOS, Go 1.27.4.
go build ./... && go vet ./... && gofmt -l .: clean.go test ./accrec ./accwire ./schema ./apply ./expand ./proxy ./proxyapp: pass, exceptTestNoHooksKeepsTheBinaryDefaults(known failure onorigin/main).CGO_ENABLED=1 go test -race -timeout 30m ./proxy/...(about 19 min), and./apply ./accrec ./accwire ./schema ./expand: pass, no data race.ShouldCompute,NoResultWhy,BilledTTL,PingSavingsrules,EnvelopeOpsFor,ServerHeldHistory(both forms).rounds <= 1changed to<= 2inShouldCompute.TestShouldComputefails.BilledTTLchanged to false.TestBilledTTLand the old proxy testTestTheEntryTTLFollowsTheBilledTierfail.Technical notes
accrecimportsapply,accwire,keepalive,thread,tooldefer,components. It imports no host package.applydoes not importaccrec.PingSavingstakes aPingSinkandPingCalls. The proxy passes its store and its two test hooks (pingOps,accountantStandalone). This keeps the panic test inproxyunchanged.