Skip to content

refactor(accrec): move the accountant glue out of the proxy - #1337

Merged
amiddavid merged 5 commits into
mainfrom
feat/mv-1303-accountant
Nov 24, 2026
Merged

amiddavid merged 5 commits into
mainfrom
feat/mv-1303-accountant

Conversation

@amiddavid

@amiddavid amiddavid commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

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: the savingsTracker is 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/ to accrec/:

  • billedBody, ownDeferred, deferredNames, deferredStub, isStub, and the operator rule of envelopeOpsFor (now accrec.EnvelopeOpsFor).
  • entryFacts (now accrec.EntryFacts), accThreadID, accPingKey.
  • The billed-tier TTL rule of accBilledTTL (now accrec.BilledTTL) and its store (TierStore).
  • The sibling warm store (SiblingStore, with its TTL and 4096/64 bounds). Its test moved with it.
  • PingSavings and pingFromReport (now accrec.PingSavings, accrec.PingFromReport).
  • The no-result rules: accrec.ShouldCompute (rejected status, deferral not placed, upstream rounds) and accrec.NoResultWhy. finish and noResultWhy call them.

New in schema: ServerHeldHistory(body, wide).

Left in the host (transport and state only):

  • The capture fields and the accBegin/accEnd/accWait/accRun job flow, the PingStore map, the dashEmitter.KeepAlivePing row build (a dash.Event), and the savingsTracker begin/end/compute/shadow/state code. The first three are request state. The row build is display.
  • The savingsTracker is 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.
  • The proxy keeps small wrappers (PingSavings, entryFacts, envelopeOpsFor, noResultWhy) so the existing tests keep their spelling. Test-only name aliases are in proxy/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, except TestNoHooksKeepsTheBinaryDefaults (known failure on origin/main).
  • CGO_ENABLED=1 go test -race -timeout 30m ./proxy/... (about 19 min), and ./apply ./accrec ./accwire ./schema ./expand: pass, no data race.
  • New library tests: ShouldCompute, NoResultWhy, BilledTTL, PingSavings rules, EnvelopeOpsFor, ServerHeldHistory (both forms).
  • Mutation 1: rounds <= 1 changed to <= 2 in ShouldCompute. TestShouldCompute fails.
  • Mutation 2: the "no earlier write" default in BilledTTL changed to false. TestBilledTTL and the old proxy test TestTheEntryTTLFollowsTheBilledTier fail.

Technical notes

  • accrec imports apply, accwire, keepalive, thread, tooldefer, components. It imports no host package. apply does not import accrec.
  • PingSavings takes a PingSink and PingCalls. The proxy passes its store and its two test hooks (pingOps, accountantStandalone). This keeps the panic test in proxy unchanged.

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 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.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 in proxy/accountant_accrec_view_test.go:16. A reader who greps for it finds it in tests only. Point the comment at schema.ServerHeldHistory instead.
  • Data dependence: no change. accrec holds what proxy held: 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 new ShouldCompute call agree on every input: rejected status, deferral unplaced, rounds > 1, and the compute path with accBilledTTL, noteRescueFactsMissing and pings.drop in the same places.
  • schema.ServerHeldHistory wide/narrow split. The three narrow callers (apply/responses.go:538, apply/restore.go:41, expand/anchor.go:186) each used previous_response_id only 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 *PingStore reaches accrec as a non-nil interface (pingSink{st}, entryFacts's parameter). Every method it lands on (put, peek, notePriced) checks a nil receiver. TierStore.Get/Set and SiblingStore.SharedWarm are nil-safe. accrec.PingSavings also guards a nil sink interface.
  • Import direction. Only proxy imports accrec. accrec imports accwire, apply, tooldefer, keepalive, thread, components, schema — none of these import accrec, so no cycle. accrec does not import proxy, so the library/proxy boundary holds.
  • The panic-swap tests still work. proxy/accountant_ping_test.go:464 swaps the pingOps and accountantStandalone package vars. The wrapper reads them at call time, so the swap reaches accrec.PingSavings through PingCalls.
  • Test coverage. New tests cover ShouldCompute (7 cases), NoResultWhy, BilledTTL (6 cases, traced against keepalive.BilledOneHour), PingSavings (normal, rejected, manual, nil sink), EnvelopeOpsFor (both operators), and ServerHeldHistory (both forms, 7 bodies). Existing proxy tests cover the old names through the alias file.
  • go vet on accrec, proxy, schema, apply, expand ran clean. Compile check only; I ran no tests.
  • Checked for dangling references to the removed names (accThreadID, ownDeferred, isStub, oneHourIf, pingStart, billedBody as code). Only comments and the test alias file mention them.

@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.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_*.go as "the accountant wiring". Part of that wiring now lives in accrec/. Update the pointer when that spec is next edited.
  • docs/design.md — the package map has no row for accrec. accwire is 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 compared accrec.ShouldCompute against the old rejected / deferral_unplaced / rounds else-if chain, case by case. Rejected wins over an earlier reason in both. DeferralUnplaced keeps its value in both. rounds <= 1 computes in both. A rounds > 1 skip leaves accNoResult unchanged in both. NoResultWhy and Rejected match the old inline code the same way.
  • schema.ServerHeldHistory (schema/wire.go:41). The wide form is byte-for-byte the old responsesServerHeldHistory. The narrow form checks previous_response_id only, which is what apply/responses.go:538, apply/restore.go:41 and expand/anchor.go:186 checked before. The proxy passes wide=true (proxy/proxy.go:1537), the three library callers pass false. Each caller keeps its old rule.
  • The moved billed-body code (accrec/billed.go). DeferredStub, DeferredNames, OwnDeferred, BilledBody and EnvelopeOpsFor are the old proxy functions verbatim, with client renamed to clientTools. The caller accBilled and envelopeOpsFor pass the same arguments.
  • BilledTTL (accrec/facts.go:63). The rule, the early return, the prev=true default for an unknown thread and the "read-only turn leaves the tier alone" case match the old accBilledTTL inline code. I checked the new test's expectations against keepalive.BilledOneHour (keeper.go:315); all five cases agree.
  • PingSavings (accrec/ping.go:58). Filter, panic recovery, NotePriced ordering and the "manual pings price but do not store" rule match the old proxy function. The proxy wrapper reads pingOps / accountantStandalone at call time, so the test injection that makes them panic still works.
  • Nil-safety through the new interfaces. pingSink{nil} and a nil *PingStore passed as PingLookup both reach nil-safe methods (put, notePriced, peek all check s == nil). Old and new paths agree.
  • The renamed stores. SiblingStore / TierStore are rename-only moves (git sees 87% / 68% similarity); bodies unchanged apart from exported names.
  • Package boundaries. accrec imports accwire, apply, tooldefer, keepalive, thread, components and internal/modelinfo, and no package imports it back, so there is no cycle. It never imports proxy, which keeps the library/proxy boundary. Only proxy imports accrec.
  • Compile surface. I grepped for every removed symbol (accThreadID, ownDeferred, isStub, oneHourIf, pingStart, responsesServerHeldHistory, ...) outside accrec. Non-test users are gone; test users go through the alias file. Removed imports (strconv in dashcapture.go, gjson/strings in 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, PingSavings rules, EnvelopeOpsFor operator attribution, both forms of ServerHeldHistory). 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]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Fixed in 4589035 (stacked on 862b178 of #1327), or kept with a reason.

  1. Fixed: the comment in proxy/proxy.go names schema.ServerHeldHistory (wide form).
  2. Fixed: docs/metrics/spec.md names accwire/ and accrec/. docs/design.md has the accrec/ row.
  3. Kept proxy/accountant_accrec_view_test.go. It keeps the existing proxy tests unedited. The tests call the old names (billedBody, accPingKey and others).
  4. Fixed: the PR now says "Refs refactor(accountant): move the rest of the accountant glue out of the proxy #1303", not "Closes". A comment on refactor(accountant): move the rest of the accountant glue out of the proxy #1303 lists what moved and what is left. refactor(accountant): move the rest of the accountant glue out of the proxy #1303 stays open.

No proxy code changed beyond a comment, so I did not re-run ./proxy race. The earlier full run passed (RC=0). Tests: build, vet, gofmt -l clean. go test of accrec accwire schema apply proxy (touched parts) pass. go test -race ./accwire ./accrec ./apply ./schema pass. macOS, Go 1.27.4.

@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.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:

  1. proxy/proxy.go:1533 stale comment — Fixed in 4589035. The comment now names schema.ServerHeldHistory, wide form.
  2. docs/metrics/spec.md stale pointer — Fixed in 4589035. The line now names proxy/accountant_*.go, accwire/ and accrec/.
  3. docs/design.md package map row — Fixed in 4589035. The accrec/ row sits after accwire/ and matches what the package holds.
  4. 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.go and proxy/accountant_onehour_test.go call billedBody, accPingKey, pingFromReport and 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 accrec holds (I verified the fields in round 1: SiblingStore keeps hashes, sizes and breakpoints; TierStore keeps 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 the savingsTracker is 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 is feat/mv-1164-accwire, so merging it closes nothing. The keyword fires only if the stack reaches main by rebase or merge commit, which keeps the message. The repo's recent merges to main are 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 to Refs #1303 before 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 — 862b1789 refactor(accwire): address review notes (the base PR #1327's commit, now in this branch's history); a11e77be refactor(accrec): move the accountant glue out of the proxy (the reviewed commit, rebased); 45890350 docs(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.md one line rewritten, proxy/proxy.go one 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 test TestOnlyTheResponsesWireReadsInput, one design.md row for accwire/. 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 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.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

  1. a11e77b (commit message) — "Closes #1303" will close the issue this PR must leave open
    • What fails: the PR merges to main with a merge commit or a rebase merge → the commit a11e77be lands 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: the savingsTracker / 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 a11e77be ends with "Closes #1303 / Refs #1309". Three statements say the opposite: the PR body ("It refs #1303 and does not close it: the savingsTracker is 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 a11e77be message 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.

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 "see schema.ServerHeldHistory, wide form", which matches the call at proxy/proxy.go:1537.
  • docs/metrics/spec.md pointer (reviewer 1): fixed. It now names accwire/ and accrec/.
  • 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 of c2fab96f), 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 c2fab96f against a11e77be. The accrec commit content is identical; the tree diff c2fab96f..HEAD is 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 TestOnlyTheResponsesWireReadsInput against accwire/body.go:80-105: responsesSections runs only for the Responses wire, a messages array wins on both wires, and a string input is 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.
  • 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 test of the touched packages, and -race runs, 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]>
@amiddavid
amiddavid force-pushed the feat/mv-1303-accountant branch from 4589035 to 2b6bdef Compare November 24, 2026 09:55
@amiddavid

Copy link
Copy Markdown
Collaborator Author

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". git diff 45890350 2b6bdefd is empty.

scripts/release/approval-still-valid.sh 1337 45890350d464:

approved: 45890350d464 (base 862b17898a6e) patch-id 756811298515
head:     2b6bdefd9f82 (base 862b17898a6e) patch-id 756811298515
--- git range-diff
1:  a11e77be ! 1:  7b1ccf53 refactor(accrec): move the accountant glue out of the proxy
    @@ Commit message
     
         No behaviour change.
     
    -    Closes #1303
    +    Refs #1303
         Refs #1309
     
         Assisted-By: Claude Opus 5.5 <[email protected]>
2:  45890350 = 2:  2b6bdefd docs(accrec): address review notes
SAME CHANGE: only the base moved. The approval of 45890350d464 still counts. Say so on the PR.

@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.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. Commit 7b1ccf53 (the reworded accrec commit) now ends with Refs #1303 / Refs #1309. I grepped every commit message in 862b1789..HEAD for Closes: 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 45890350 or 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.go when the tests are next touched.

What I checked

  • Last review: round 2, 4589035, 2026-11-24T09:53:06Z.
  • New commits read: 2 — 7b1ccf53 refactor(accrec): move the accountant glue out of the proxy (the accrec commit, message reworded from Closes #1303 to Refs #1303); 2b6bdefd docs(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 2b6bdefd is empty — confirmed.
      • "the commit now says Refs #1303": git log -1 --format=%B 7b1ccf53 ends with Refs #1303 / Refs #1309 — confirmed.
      • "no commit on the branch says Closes #1303": I grepped the full messages of 862b1789..HEAD for Closes — no match — confirmed.
      • The approval-still-valid.sh output (equal patch-ids, SAME CHANGE): consistent with my own empty-diff check.
  • I did not build or run tests; live tests were not approved for this review.

@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.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

  1. "Closes #1303" in the accrec commit message — fixed. git log -1 --format=%B 7b1ccf53 now 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 a git range-diff and 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.go stays, 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) and 2b6bdefd "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..2b6bdefd is 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.

@amiddavid
amiddavid changed the base branch from feat/mv-1164-accwire to main November 24, 2026 11:44
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Merged origin/main (after #1327, 807d217) into this branch: b6bc1a4. The PR now targets main.

Three conflicts. I resolved each by hand and kept this branch's side:

  1. docs/design.md: main already has the accwire/ row. I kept the accrec/ row this PR adds.
  2. proxy/accountant_savings.go: import block. I kept the accrec import.
  3. proxy/accountant_wire.go: the import block, and the body of envelopeOpsFor. Main still had the old inline copy. This PR moved it to accrec.EnvelopeOpsFor, so I kept the one-line call.

Main changed none of the moved code since the merge base. The only other proxy change on main is proxy/proxy.go, which merged on its own.

The PR's changed lines are unchanged. The +/- lines of git diff 862b1789 2b6bdefd and of git diff origin/main...b6bc1a46 are identical (diff is empty).

Tests (macOS, Go 1.27.4): build, vet and gofmt -l are clean. go test ./accwire ./accrec ./apply ./schema ./expand ./proxy ./proxyapp pass, except TestNoHooksKeepsTheBinaryDefaults (known failure on origin/main).

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