Repository navigation
feat(config): add auto-purchase switch stamp columns (migration 000115) - #840
Conversation
Add nullable global_config.auto_purchase_changed_by/at/via, read them in getGlobalConfigFrom and write them in the whole-config upsert so the RI-exchange read-modify-write path keeps them. The fields are json:"-" so PUT /api/config cannot forge them. Nothing sets the stamps yet. Refs #631 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 8 billable files and costs up to $2.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 20 minutes for your next included review. View limit details
Comment |
Gate verdict: APPROVE at bca07ecI am an independent gate reviewer (Opus) and did not write this PR. I reviewed the full diff with skepticism because it touches the auto-purchase switch path. Checks against the PR's claims
Local evidence (from a
CI: Mutation testing (5 mutants, run once)
No blocking findings. |
Refs #631 (R1a of the kill-switch grant work; R1b adds the gates and sets the stamps).
What
global_config.auto_purchase_changed_by,_at,_via(ADD COLUMN IF NOT EXISTS, no backfill, down drops them).getGlobalConfigFromreads them andsaveGlobalConfigWithwrites them back ($26-$28), so the RI-exchange whole-config read-modify-write keeps the stamps.GlobalConfigfields arejson:"-": PUT /api/config unmarshals the body onto this struct, so a tagged field could be forged by a client.Nothing sets the stamps yet (R1b). Behaviour is unchanged: switch stays OFF, caps NULL.
Tests
auto_purchase_enabledfalse with NULL stamps, and anUpdateGlobalConfigAtomicRI-style write preserves seeded stamps. Env-gated byAUTO_PURCHASE_STAMPS_TEST_DATABASE_URL(db namer1a_*), same pattern as the RI exchange reservation test.go vet -tags integration) but was not run here.Notes
000112migration colliding with main's000112_plan_step_cap_auto_purchase_switch; flagged for that PR.🤖 Generated with Claude Code