Skip to content

refactor(campaign): move the arm-to-strategy mapping out of the proxy (2/3, #1302) - #1333

Merged
amiddavid merged 6 commits into
mainfrom
feat/mv-1302-campaign-arms
Nov 24, 2026
Merged

amiddavid merged 6 commits into
mainfrom
feat/mv-1302-campaign-arms

Conversation

@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

Second of 3 stacked PRs for #1302. Based on feat/mv-1302-campaign-replay. Moves the arm-to-strategy mapping out of proxy/campaign.go into campaign. Part of #1309.

What changed

  • ArmFor, ResolveCell, MarkOverlaps, DuplicateCell, WeekdaysFromNames, TileHours, Coalesce, StrategyForGroup, CellOutcome moved to campaign/arms.go.
  • The dashboard type stays in the host. The proxy converts dash.KVCacheSuggestion to campaign.Cell.
  • Mirror constants are gone. The library reads config.DefaultKeepAliveIdle (240), DefaultKeepAliveMaxPings (2), DefaultKeepAliveMinPrefix (80000) and DefaultHeadTTLMinTokens (50000). Values are equal to the old copies. The pre-Workstream B: cache keep-alive and lifecycle prediction #435 floor (20000) stays a named local constant.
  • Third copy found in cmd/cg-cache-campaign: its summarise repeated the rule "every model honors the 1h tier, and at least one model" (it is also in tenantHonorsHeadTTL1h). Both now call campaign.HonorsHeadTTL1h.
  • proxy.CampaignCellOutcome, CampaignArmEnforceable and HeadTTL1hHonored stay as one-line wrappers, so cmd/cg-cache-campaign and its tests need no change.
  • The proxy keeps routes, views, and validateGroupStrategy. That function calls validStrategyBounds, validWindows and validPredictorRef. refactor(keepalive): move keep-alive policy resolution out of the proxy #1301 owns those, so it moves after refactor(keepalive): move keep-alive policy resolution out of the proxy #1301.

Behaviour

None. campaign.HonorsHeadTTL1h returns false for no models, as both old copies did.

Data dependence

Same as before. The mapping reads suggest cells (counts, dollars, arm names). No stored text.

How it was tested

macOS, Go 1.27.4. Build, vet and gofmt clean. go test ./campaign ./proxy ./cmd/cg-cache-campaign pass. Moved tests run unchanged in campaign/arms_test.go apart from renames. Mutation: dropping the "no models" check fails TestHonorsHeadTTL1hFailsClosed. Changing the keepalive-5m floor fails TestCampaignNonRecommendedArmsKeepTheirOldFloor.

Refs #1302, #1309.

…the proxy

Add the library package `campaign`. It holds the calibrated constants, the
closed-form replay, the fidelity model, the ship gate, the auto builder and the
decision math that proxy/predictive.go, campaignauto.go, adaptreplay.go and
adaptcache.go used to hold. The proxy reads history and files and calls it.

No behaviour change. The rowFloor wait-cause gap stays as it is (#1298).

Refs #1309
Closes #1302 (with the next PR in the stack)

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 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 bc42e0f05093 approve

Verdict: approve

Findings

None. The change is a faithful move. I found no behavior difference.

Non-blocking

  • campaign/arms.go:273 — DefaultWeekdays is an exported, mutable slice. WeekdaysFromNames returns this one shared slice when no name is recognized. Any importer can now append to it or edit it, and change the fallback work week for every other caller. Before, the variable was unexported, so only the proxy could touch it. Suggestion: return a copy, or keep the variable unexported behind a function.
  • campaign/arms.go:101 — the code now uses config.DefaultHeadTTLMinTokens, which config itself marks DEPRECATED (config/config.go:314). The value is the same 50,000 the old mirror had, and tenant.Strategy.HeadTTLMinTokens is the token-shaped column, so the use is coherent. But a future reader of config's doc will see new code told not to use this constant. Worth a one-line comment in arms.go, or nothing.
  • Stale names in comments. kvcache/registry.go:340 still says "proxy's campaignDefaultMaxPings"; that constant no longer exists. proxy/campaign_test.go:417,426,484,495,635 still name resolveCampaignCell, coalesceCampaignCells and headTTL1hHonoredModels, now campaign.ResolveCell etc. Comments only; no code effect.
  • docs/design.md package map has no campaign/ row. The row was missing since the first stacked PR (a0c73c5), not from this one. This PR only grows the package.

What I checked

  • Read the full diff a0c73c59..HEAD (one commit, 5 files) and the code around each change: campaign/arms.go, campaign/arms_test.go, proxy/campaign.go, proxy/campaign_test.go, cmd/cg-cache-campaign/run.go.
  • Move fidelity, function by function. I compared each moved function (ArmFor, ResolveCell, MarkOverlaps, DuplicateCell, WeekdaysFromNames, TileHours, Coalesce, hourSetKey, StrategyForGroup, CellOutcome, ArmEnforceable, HeadTTL1hHonored) against its old copy in proxy/campaign.go at the base commit. Control flow, check order, and every skip-reason string are identical.
  • The mirror constants became config reads. I verified each value is equal today: config.DefaultKeepAliveIdle = 240 (config/config.go:288) = old campaignKeepAlive5mIdle; DefaultKeepAliveMaxPings = 2 (config.go:290) = old campaignDefaultMaxPings; DefaultKeepAliveMinPrefix = 80000 (config.go:302) = old campaignDefaultMinPrefixTokens; DefaultHeadTTLMinTokens = 200000/4 = 50000 (config.go:313-318) = old campaignDefaultHeadTTLMinTokens. All four are compile-time constants, not runtime-configurable, so no behavior change today. The legacyMinPrefixTokens (20000) and the 280 s / 3360 s simulator cadences stay literal, as before. This de-mirroring is declared in the PR description.
  • HonorsHeadTTL1h consolidation. The old tenantHonorsHeadTTL1h in proxy (err → false, empty model list → false, any unmeasured model → false) and the old honors closure in run.go/summarise both collapse to campaign.HonorsHeadTTL1h, which fails closed on an empty list. I traced both call sites; semantics are identical. The new function has its own test (TestHonorsHeadTTL1hFailsClosed).
  • campaignCellOf copies all 9 fields the old resolveCampaignCell read from dash.KVCacheSuggestion (User, HourUTC, Requests, BestStrategy, SavingUSD, BaselineUSD, OptimalSavingUSD, InsufficientData, UnpricedRequests). The dash type's other fields (Candidates, Valued, SavingPct...) were never read by the moved logic.
  • Tests. Every unit test that left proxy/campaign_test.go reappears in campaign/arms_test.go with only renames; every HTTP-level test stayed in proxy. The bounds test (TestCampaignArmForStaysWithinValidStrategyBounds) correctly stayed in proxy, where validStrategyBounds lives. The value-pinning tests kept their pins (240/2/80000, 280/20000), and TestCtlCreateCampaignEndToEnd still pins idle 240 and the 80k floor through the real route. TestCellOutcomeAndTenantCell covers the new TenantCell conversion.
  • Package rules. campaign imports only config, kvcache, tenant — no proxy import, so the library/proxy boundary holds. No import cycle: nothing in config, kvcache or tenant imports campaign. No identifier conflicts with the campaign package's existing files (decision.go, replay.go, eval.go, adapt.go, fidelity.go).
  • No leftover references to the removed proxy identifiers (campaignArmFor, resolveCampaignCell, campaignDefault*, headTTL1hHonoredModels, ...) outside comments.
  • The local campaign variable in ctlCreateCampaign was renamed to camp, so the package import is not shadowed where "created via campaign: "+camp.Name is built.
  • Live tests were not approved, so I did not build or run anything; all verification above is by reading the code.

@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 bc42e0f05093 approve

Verdict: approve

Findings

None. The change is a code move with no behavior change. I verified this claim, not just read it.

Non-blocking

  • Stale comments in files this PR does not touch. Three comments still point at the old location or a deleted constant:
    • tenant/keepalivestrategy.go:236 says "campaign.go's tileHours". The function is now campaign.TileHours in campaign/arms.go.
    • tenant/campaign.go:73 says "see proxy/campaign.go's arm-mapping table". The table is now campaign.ArmFor.
    • kvcache/registry.go:340 says "proxy's campaignDefaultMaxPings". That constant no longer exists anywhere. The value is now config.DefaultKeepAliveMaxPings.
  • campaign/arms.go:107 — the old explanation of the token-named field is gone. The proxy comment said 50,000 tokens is the 200,000-byte gate, because resolveHeadTTL reads tokens x 4 bytes. config.DefaultHeadTTLMinTokens is marked DEPRECATED in config/config.go:314. The new code uses it with no note. A future reader may "fix" the deprecated use and break the byte math.
  • proxy/campaign.go:441 — mangled comment. The rename left "is in honors the 1h tier (campaign.HonorsHeadTTL1h)". It should read "is in the honored set (campaign.HeadTTL1hHonored)".
  • proxy/campaign_test.go:32 — the bounds test passes the default floor for every arm. TestCampaignArmForStaysWithinValidStrategyBounds passes config.DefaultKeepAliveMinPrefix (80000) as the minPrefix argument, not a.MinPrefixTokens. Arms with a 20000 floor are checked at 80000. Pre-existing: the old code passed campaignDefaultMinPrefixTokens the same way. TestCampaignEnforcesTheKPingArmsBudget does pass a.MinPrefixTokens, and other tests pin each floor, so the gap is covered.

What I checked

  • Value parity, constant by constant. The old proxy-local literals versus what the new code reads:
    • campaignDefaultMinPrefixTokens 80000 = config.DefaultKeepAliveMinPrefix (config/config.go:302).
    • campaignKeepAlive5mIdle 240 = config.DefaultKeepAliveIdle (config/config.go:288).
    • campaignDefaultMaxPings 2 = config.DefaultKeepAliveMaxPings (config/config.go:290).
    • campaignDefaultHeadTTLMinTokens 50000 = config.DefaultHeadTTLMinTokens (200000 / 4, config/config.go:313-318).
    • campaignDefaultPredictorThreshold 0.5 = defaultPredictorThreshold 0.5.
    • campaignLegacyMinPrefixTokens 20000 = legacyMinPrefixTokens 20000.
    • campaignLegacyIdle5m/1h = legacyIdle5m/1h, same kvcache.DefaultPingIdle (280 s) and DefaultPingIdle1h (3360 s) expressions.
      So no number changes today. The new coupling to config is named in the PR body and in the code. TestCampaignKeepAlive5mIsTheRecommendedPolicy still pins 240 / 2 / 80000, so a later config re-fit trips a test instead of moving an arm silently.
  • Logic parity, function by function. ResolveCell, MarkOverlaps, DuplicateCell, WeekdaysFromNames, TileHours, Coalesce, StrategyForGroup and ArmFor are the old bodies with field renames only. I read both versions side by side in the diff. Gate order is unchanged: hour range, arm enforceable, 1h model gate, insufficient data, unpriced rows.
  • HonorsHeadTTL1h dedupe. The proxy's tenantHonorsHeadTTL1h (proxy/campaign.go:444-452) and cmd/cg-cache-campaign's old inline loop both become calls to campaign.HonorsHeadTTL1h. The new function returns false for no models and false on any unmeasured model. Both old copies did the same. The error path in tenantHonorsHeadTTL1h still fails closed.
  • Callers kept working. proxy.CampaignCellOutcome, CampaignArmEnforceable and HeadTTL1hHonored stay as one-line wrappers. cmd/cg-cache-campaign/run.go and proxy/campaignoutcome_test.go still call them. campaignCellOf copies every field of dash.KVCacheSuggestion that Cell declares.
  • No leftover references. I grepped the repo for every deleted identifier (campaignArmFor, resolveCampaignCell, tileHours, coalesceCampaignCells, campaignDefault*, headTTL1hHonoredModels, and the rest). Only the stale comments listed above remain.
  • Package hygiene. campaign imports config, kvcache, tenant only. It imports nothing from proxy, so the CLAUDE.md library boundary holds. The campaign package already existed and already imported config (decision.go, from commit a0c73c5), and proxy non-test files already imported config directly at base (adaptctl.go, control.go and others), so no new dependency edge is created. No symbol conflicts with the existing campaign files. The local variable rename campaign to camp in ctlCreateCampaign avoids shadowing the new package import.
  • Tests. Every test removed from proxy/campaign_test.go reappears in campaign/arms_test.go with renames only. Two tests are new (TestCellOutcomeAndTenantCell, TestHonorsHeadTTL1hFailsClosed); both add coverage. The proxy keeps the HTTP-route, bounds, rollback and K-ping tests. tenant.CampaignCell is all scalar fields, so the new got != want comparison is valid.
  • Commit and PR body. DCO sign-off present, Assisted-By: attribution per repo convention. The PR body names the mirror-constant removal and claims no behavior change; my constant-by-constant check confirms the claim. Data dependence is unchanged, and no docs/data-dependence row is affected.

- Document that Eval and BuildSpec need facts when segBy is set.
- Drop the dead `if ss := ...; true` wrapper in Rows.
- Drop the idle loop in the Apply test: Apply takes no idle.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
Move the mapping of a suggest arm to a live keep-alive strategy, the cell
resolution, the overlap and duplicate checks, the weekday and hour tiling and
the grouping of cells into strategies into the `campaign` library package.

- The mirror constants of config.Default* are gone. The library reads
  config.DefaultKeepAliveIdle, DefaultKeepAliveMaxPings,
  DefaultKeepAliveMinPrefix and DefaultHeadTTLMinTokens. The values do not change.
- `campaign.HonorsHeadTTL1h` replaces two copies of the "every model honors
  the 1h tier" rule: the proxy's and cmd/cg-cache-campaign's.
- The proxy keeps the HTTP routes, the views and validateGroupStrategy.

No behaviour change.

Refs #1309
Closes #1302

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
- DefaultWeekdays is a function that returns a copy; a test pins it.
- Explain the 50,000-token head-TTL gate and why the deprecated config
  constant is the right value there.
- Fix stale comments that named the old proxy functions.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid
amiddavid force-pushed the feat/mv-1302-campaign-arms branch from bc42e0f to f27cf87 Compare November 24, 2026 09:30
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Round-1 notes, fixed in f27cf87 (macOS, Go 1.27.4; build, vet, gofmt clean; go test -race ./campaign, go test ./proxy -run 'Campaign|Adapt|Auto|Predict|Shadow' pass):

  1. DefaultWeekdays: fixed. The slice is unexported. DefaultWeekdays() returns a copy, and WeekdaysFromNames returns that copy. New test TestWeekdaysFallbackIsACopy. With the copy removed, it fails.
  2. 1h head-TTL value: fixed. A named constant headTTLMinTokens carries the old explanation: 50,000 tokens is the 200,000-byte gate (tokens x 4). It says why the deprecated config.DefaultHeadTTLMinTokens is right here: the stored strategy field is still in tokens.
  3. Stale comments: fixed in kvcache/registry.go, tenant/keepalivestrategy.go, tenant/campaign.go, proxy/campaign_test.go (4 places) and the mangled sentence in proxy/campaign.go. Comments only; no code change in proxy/, tenant/ or kvcache/.

@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 f27cf87f9092 approve

Verdict: approve

Findings

None. The fix commit f27cf87 addresses the round-1 notes correctly. I found no new defect in it.

Earlier findings, status

Mine (round 1, all non-blocking):

  1. DefaultWeekdays exported mutable slice — fixed. defaultWeekdays is now unexported (campaign/arms.go:278). DefaultWeekdays() returns slices.Clone(defaultWeekdays) (arms.go:286). WeekdaysFromNames returns that copy in the fallback case (arms.go:314), so a caller's edit cannot reach the next call. TestWeekdaysFallbackIsACopy pins both paths: it mutates the result of WeekdaysFromNames(nil) and of DefaultWeekdays() and checks the next call is unchanged.
  2. Deprecated config.DefaultHeadTTLMinTokens used with no note — fixed. A named constant headTTLMinTokens (arms.go:41) carries the explanation: the stored strategy field is token-shaped, the gate reads tokens x 4 bytes, so 50,000 tokens is the 200,000-byte gate, and the deprecated constant is the right value here. Both 1h arms now use the named constant. Value unchanged: config.DefaultHeadTTLMinTokens = 200000/4 = 50000.
  3. Stale comments — fixed. All five places I named, plus the two tenant files and the mangled sentence reviewer 2 named. I grepped the new head for campaignDefaultMaxPings, resolveCampaignCell, coalesceCampaignCells, campaign.go's tileHours and arm-mapping table: no hit outside .review-in-* files. The replacement texts are accurate (campaign.ArmFor, campaign.TileHours (campaign/arms.go), campaign.ResolveCell, campaign.Coalesce).
  4. docs/design.md package map has no campaign/ row — not addressed. No reply and no change. I keep it non-blocking: the row was missing since the first stacked PR (a0c73c5), and this PR only grows the package. It can land with the series' last PR.

Reviewer 2's (round 1):

  • Stale comments in tenant/keepalivestrategy.go:236, tenant/campaign.go:73, kvcache/registry.go:340 — agree with reviewer 2, and fixed in f27cf87. I verified each replacement myself.
  • The token-field explanation gone from the 1h arms — agree, fixed by the same headTTLMinTokens constant as my item 2.
  • Mangled sentence in proxy/campaign.go — fixed; it now reads "honors the 1h tier (campaign.HonorsHeadTTL1h)".
  • The bounds test passing the default floor for every arm — not addressed by the author. Reviewer 2 themselves marked it pre-existing and covered (TestCampaignEnforcesTheKPingArmsBudget passes a.MinPrefixTokens, and each floor is pinned elsewhere). I checked both tests at the new head; I agree it needs no change in this PR.

Non-blocking

  • None new. Item 4 above stays open as non-blocking.

What I checked

  • Last review: round 1, bc42e0f, 2026-11-24T09:17:36Z.
  • New commits read: 3.
    • beb1292d "address round-1 notes on the replay move" — the new base, entered the range through the rebase. Read in full: doc lines on Eval/BuildSpec facts, a dead if ss := ...; true wrapper dropped in Rows, a redundant idle loop dropped in a test. Base-branch changes, not part of this PR's diff; no issue found.
    • ba18d136 "move the arm-to-strategy mapping out of the proxy" — the reviewed move commit rebased. I diffed it against the round-1 head bc42e0f0: the only differences are the three files beb1292d touches. The move content is unchanged from what I verified in round 1.
    • f27cf87f "address round-1 notes on the arm mapping move" — read the full diff and the code around each hunk.
  • 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:
    • Reviewer 2's round-1 review (posted 22 s after mine, so unread in round 1): read in full; checked each of their notes against the fix commit (statuses above).
    • The author's comment (2026-11-24T09:30:38Z) listing the fixes: checked every claim against f27cf87. All three claims hold.
  • Fix-commit detail checks: slices import added and used; no caller anywhere still treats DefaultWeekdays as a variable (grep at the new head); the fallback in WeekdaysFromNames returns a fresh copy per call, so the old shared-slice identity is gone with no caller depending on it; headTTLMinTokens is used in both keepalive-1h arms and equals the old 50,000.
  • Re-verified the round-1 conclusions still hold at the new head: the PR diff beb1292d..f27cf87f is the move I already verified plus f27cf87's fixes; nothing else changed.
  • Live tests were not approved, so I did not build or run anything; all verification is by reading the code.

@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 f27cf87f9092 approve

Verdict: approve

Findings

None. The new commits fix the round-1 notes correctly. I found no new defect.

Round-1 items

Mine:

  1. Stale comments (tenant/keepalivestrategy.go:236, tenant/campaign.go:73, kvcache/registry.go:340): fixed. All three now name campaign.TileHours, campaign.ArmFor and config.DefaultKeepAliveMaxPings.
  2. Lost explanation of the token-named HeadTTLMinTokens: fixed. campaign/arms.go:41-45 has the named constant headTTLMinTokens with the old explanation: 50,000 tokens is the 200,000-byte gate, tokens x 4 bytes, and why the deprecated config constant is the right one here. Value unchanged.
  3. Mangled comment in proxy/campaign.go: fixed. Now reads "honors the 1h tier (campaign.HonorsHeadTTL1h)".
  4. Bounds test passes the default floor for every arm: not fixed, no reply. I keep it out of findings: it is pre-existing test weakness, and TestCampaignEnforcesTheKPingArmsBudget plus the floor-pinning tests cover the gap.

Reviewer 1's:

  • DefaultWeekdays exported mutable slice: fixed. The variable is now unexported. DefaultWeekdays() returns slices.Clone(defaultWeekdays), and WeekdaysFromNames returns that copy. TestWeekdaysFallbackIsACopy pins both: an edit to one result does not reach the next call. The only caller of WeekdaysFromNames outside the package is proxy/campaign.go:307, which only reads the slice, so the copy is safe. The variable was born in this PR stack, so turning it into a function breaks no released caller.
  • Deprecated-constant note: fixed, same as my item 2.
  • Stale names in proxy/campaign_test.go: 4 of 5 fixed. One remains, see Non-blocking.
  • docs/design.md has no campaign/ row: not fixed, no reply. Reviewer 1 dated it to the first stacked PR (a0c73c5), not this one. Still non-blocking.

Non-blocking

  • proxy/campaign_test.go:426 — one stale name left. The comment says "(see headTTL1hHonoredModels)". That identifier no longer exists; the set is unexported in campaign/arms.go behind campaign.HeadTTL1hHonored. Reviewer 1 listed five places; the fix commit covered four. Comment only, no code effect.
  • campaign/arms.go:295 — the doc says "this returns DefaultWeekdays". It now returns the function's copy. The sentence still reads correctly; no change needed.

What I checked

  • Last review: round 1, bc42e0f, 2026-11-24T09:17:58Z
  • New commits read: 3:
    • beb1292d — address round-1 notes on the replay move. This is the PR's new base, from the stacked sibling PR. Doc comments on Eval/BuildSpec (facts nil only when segBy is empty), removal of the dead if ss := ...; true wrapper in Rows, and a simplified Apply test. I read the whole diff: the wrapper removal keeps the same sort.Search logic and the test keeps the same assertion. No behavior change.
    • ba18d136 — the reviewed arm-mapping move, rebased onto beb1292d. I diffed a0c73c59..bc42e0f0 against beb1292d..ba18d136: the patches are byte-identical. The rebase changed nothing I reviewed in round 1.
    • f27cf87f — the round-1 fixes. Read in full, checked line by line as described above.
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt; the inline file is empty).
  • New items since my last review, and what I did about each:
    • The author's comment at 2026-11-24T09:30:38Z, claiming items fixed in f27cf87. I verified each claim against the code; all hold except the one leftover comment above.
    • The rebase (base moved a0c73c5 → beb1292, head bc42e0f → ba18d13). Verified patch identity, so my round-1 verification still stands.
    • The two new commits, reviewed as above.
  • Repo-wide grep for every old identifier (campaignArmFor, resolveCampaignCell, tileHours, coalesceCampaignCells, campaignDefault*, headTTL1hHonoredModels, and the rest): one hit remains, the comment at proxy/campaign_test.go:426.
  • DefaultWeekdays usages: all in campaign/arms.go and campaign/arms_test.go; no other package referenced the round-1 variable, so the var-to-function change breaks nothing.
  • headTTLMinTokens = config.DefaultHeadTTLMinTokens: value check repeated, 200000 / 4 = 50000, equal to the old mirror.
  • Live tests were not approved, so I did not build or run anything. The author's comment reports go test -race ./campaign and the proxy campaign tests passing on macOS, Go 1.27.4; I could not independently confirm, but nothing in the diff risks them.

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

Copy link
Copy Markdown
Collaborator Author

Output of scripts/release/approval-still-valid.sh 1333 f27cf87f:

approved: f27cf87f (base beb1292d2c5d) patch-id 38d5b9b6726d
head:     b13939303bca (base beb1292d2c5d) patch-id 1dbd79803a2b
--- git range-diff
1:  ba18d136 = 1:  ba18d136 refactor(campaign): move the arm-to-strategy mapping out of the proxy
2:  f27cf87f = 2:  f27cf87f refactor(campaign): address round-1 notes on the arm mapping move
-:  -------- > 3:  b1393930 docs(campaign): fix two stale comments
COMMENTS ONLY: f27cf87f..b13939303bca changes only comment lines in .go and .sh files. The approval of f27cf87f still counts. Say so on the PR.

@amiddavid
amiddavid changed the base branch from feat/mv-1302-campaign-replay to main November 24, 2026 10:46
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Output of scripts/release/approval-still-valid.sh 1333 b13939303bca:

approved: b13939303bca (base 30a80767bd31) patch-id fe5ec04481ce
head:     b13939303bca (base 30a80767bd31) patch-id fe5ec04481ce
--- git range-diff
1:  a0c73c59 = 1:  a0c73c59 refactor(campaign): move the campaign replay and scoring math out of the proxy
2:  beb1292d = 2:  beb1292d refactor(campaign): address round-1 notes on the replay move
3:  ba18d136 = 3:  ba18d136 refactor(campaign): move the arm-to-strategy mapping out of the proxy
4:  f27cf87f = 4:  f27cf87f refactor(campaign): address round-1 notes on the arm mapping move
5:  b1393930 = 5:  b1393930 docs(campaign): fix two stale comments
SAME CHANGE: only the base moved. The approval of b13939303bca still counts. Say so on the PR.

@amiddavid

Copy link
Copy Markdown
Collaborator Author

Output of scripts/release/approval-still-valid.sh 1333 b13939303bca at the new head ace351a (the first comment above ran before GitHub updated the PR ref, so it shows the old head; ignore it):

approved: b13939303bca (base 30a80767bd31) patch-id fe5ec04481ce
head:     ace351a62f3d (base 28383ae23c79) patch-id 1dbd79803a2b
--- git range-diff
1:  a0c73c59 = 1:  a0c73c59 refactor(campaign): move the campaign replay and scoring math out of the proxy
2:  beb1292d = 2:  beb1292d refactor(campaign): address round-1 notes on the replay move
3:  ba18d136 = 3:  ba18d136 refactor(campaign): move the arm-to-strategy mapping out of the proxy
4:  f27cf87f = 4:  f27cf87f refactor(campaign): address round-1 notes on the arm mapping move
5:  b1393930 = 5:  b1393930 docs(campaign): fix two stale comments
CHANGED: the head has new code or a conflict resolution. Each reviewer re-checks the delta.

Why CHANGED: the old patch contained the #1332 commits too. #1332 is now in main as a squash, so the patch against the new base is smaller. All 5 commits in the range-diff are equal. The head is a plain merge of origin/main with no conflict: git show --remerge-diff ace351a6 is empty. Net change vs main is only the 8 files of #1333.

@amiddavid

Copy link
Copy Markdown
Collaborator Author

Approval check by hand: the approvals of b13939303bca still hold at ace351a6.

approval-still-valid.sh prints CHANGED only because #1332 is now one squash commit in main. The merge of main was clean, with no hand resolution (git show --remerge-diff is empty).

This PR's own diff did not change:

diff <(git diff beb1292d b13939303bca) <(git diff origin/main...ace351a62f3d)   # no output

beb1292d is the #1332 head this PR was approved on top of. ace351a6 is this PR's head after the merge, compared with main, which now holds #1332.

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