What Changed#
Check settlement settings before reading the shell snapshot or preparing candidates. Disabled timer and merge sweeps perform no snapshot or pull-request lookup work.
The final decision still reads fresh settings so disabling settlement during a lookup prevents a stale decision. Re-enabling the setting resumes settlement.
Why#
Automatic settlement looks up candidate pull requests even when both settings are disabled, spawning Git and provider processes on each scheduled sweep.
Fixes #9714.
Testing#
ThreadSettlementReactor.test.ts passes, 12/12, covering disabled timer and merge sweeps and re-enabling settlement.
- Server typecheck, targeted lint, and formatting pass.
Checklist#
Model: GPT-6 Astra
Harness: T3 code
Note
Skip settlement work in ThreadSettlementReactor.sweep when both triggers disabled#
- The
sweep method now reads server settings before loading the shell snapshot and returns immediately when merge-based settlement is disabled and the day-based interval is unset
- Test harness
makeThreadSettlementHarness records settings-service reads so tests can observe and assert on settings access
- Adds a test verifying that startup, activation, timer, and merge sweeps perform no snapshot, pull-request, invalidation, or command work while both automatic-settlement settings are disabled, then resume after one is enabled
- Behavioral Change: a disabled sweep now exits before the snapshot load, so existing tests that expected snapshot or lookup work during disabled sweeps have updated count expectations in ThreadSettlementReactor.test.ts
Macroscope summarized 68a4096.
Approvability#
Verdict: Approved at
68a4096Macroscope's review found this PR approvable — This is a focused server bug fix that avoids snapshot, Git, and pull-request lookups when both existing settlement options are disabled, while preserving enabled behavior. Regression tests cover startup, timer, merge, and re-enabling scenarios, and product defaults remain unchanged.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).