Skip to content

fix(core)!: switch chshSybilCalibrated default to the autocorrelation-corrected margin (Caveat-A) - #10027

Merged
AceHack merged 1 commit into
mainfrom
fix/antisybil-switch-default-to-autocorr-corrected-margin-20260804
Aug 4, 2026
Merged

fix(core)!: switch chshSybilCalibrated default to the autocorrelation-corrected margin (Caveat-A)#10027
AceHack merged 1 commit into
mainfrom
fix/antisybil-switch-default-to-autocorr-corrected-margin-20260804

Conversation

@AceHack

@AceHack AceHack commented Aug 4, 2026

Copy link
Copy Markdown
Member

The shipped default anti-sybil oracle now convicts at 2 + chshMarginAutocorr (the pairs own HAC effective-sample margin) instead of the i.i.d. 2 + chshMargin. Closes the Caveat-A over-conviction bug in the default path — real streams autocorrelate, so the i.i.d. margin was too tight and falsely collapsed honest-but-bursty identities into one source.

Authorization + verify-before-trust gate

Authorized by Aaron 2026-08-04 ("switch the default, ship it") after the gate cleared:

Scope

The margin swap only (parameter-free, fully proven). The stationarity gate stays in the opt-in chshSybilAutocorrCalibrated (needs a tol choice). chshMargin (i.i.d.) unchanged and still exported (algebraic bound + caveat pointer). No external callers to repoint. DecorrelationMeter still uses the i.i.d. chshMargin deliberately — separate, scope-limited instrument, a distinct decision.

Framing (Soraya)

"Provably more conservative than i.i.d.", NOT "fully sound" — dependence beyond the HAC bandwidth can still evade.

Tests

30 AntiSybil + 67 Sybil/DecorrelationMeter green (strong S=4 convictions still convict — low-autocorrelation pairs get corrected ≈ i.i.d.). Core 0-warning.

🤖 Generated with Claude Code

…-corrected margin (Caveat-A)

The shipped default anti-sybil oracle now convicts at 2 + chshMarginAutocorr (the
pair's own HAC effective-sample margin) instead of the i.i.d. 2 + chshMargin. This
closes the Caveat-A over-conviction bug in the DEFAULT path: real streams
autocorrelate, so the i.i.d. margin was too tight and falsely collapsed honest-
but-bursty identities into one source.

Authorized by Aaron 2026-08-04 ("switch the default, ship it") after the
verify-before-trust gate: Soraya VERIFIED obligations (a) n_eff ≤ n, (b)
margin_corrected ≥ margin_iid (Z3), and (c) the conviction set is a strict SUBSET
of the i.i.d. oracle's (my 40-batch machine-check). Because the corrected margin
is never smaller, the switch can ONLY REMOVE false collapses, never add a
conviction — provably safe. Her two model-scope holes (lag-2, stationarity gate)
were already fixed (#10026: HAC estimator + multi-block gate).

Scope of the switch: the MARGIN swap only (parameter-free, fully proven). The
stationarity gate stays in the opt-in chshSybilAutocorrCalibrated (it needs a tol
choice). chshMargin (i.i.d.) is unchanged and still exported (algebraic bound +
caveat pointer). No external callers to repoint (chshSybilCalibrated had none in
src/); DecorrelationMeter still uses the i.i.d. chshMargin deliberately (separate,
scope-limited instrument — a distinct decision).

Framing discipline (Soraya): "provably more conservative than i.i.d.", NOT "fully
sound" — dependence beyond the HAC bandwidth can still evade.

30 AntiSybil + 67 Sybil/DecorrelationMeter tests green (strong S=4 convictions
still convict — low-autocorrelation pairs get corrected ≈ i.i.d.). Core 0-warning.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@AceHack
AceHack merged commit 689f4e5 into main Aug 4, 2026
31 of 32 checks passed
@AceHack
AceHack deleted the fix/antisybil-switch-default-to-autocorr-corrected-margin-20260804 branch August 4, 2026 15:26
AceHack added a commit that referenced this pull request Aug 4, 2026
…margin (Caveat-A) (#10028)

DecorrelationMeter.classifyPair / fuse now bound at 2 + AntiSybil.chshMarginAutocorr
(the pair's own HAC effective-sample margin) instead of the i.i.d. chshMargin,
matching the chshSybilCalibrated default switch (#10027). An autocorrelated /
periodic probe stream no longer under-states the fluctuation, so it needs more
rounds to convict AboveClassicalBound — the correct, more-conservative behavior.
Resolves the module's own SOUNDNESS-block autocorrelation caveat (updated).

Same subset logic as the anti-sybil switch: margin_corrected ≥ margin_iid ⇒ can
only remove false AboveClassicalBound verdicts, never add. Streams are already in
hand at both call sites (no signature change). The i.i.d. chshMargin stays exported
for callers who explicitly want it.

8 DecorrelationMeter tests green with NO fixture changes (the s4 fixtures'
autocorrelation is mild enough that |S|=4 still clears the corrected bound at
n=100; the tiny-n non-conviction and identical-pair tests hold a fortiori).
Core 0-warning.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request Aug 4, 2026
…t-A margin switch (#10029)

* test(core): BP-16 second tool — FsCheck subset property for the Caveat-A margin switch

Soraya machine-verified obligations (a)/(b)/(c) with Z3 on the pointwise formulas;
BP-16 (cross-check triage) wants a SECOND independent tool for a P0 security change
(the chshSybilCalibrated default switch, #10027, was shipped on a 40-batch fixed-seed
loop — below that bar). This is the second tool: FsCheck generative properties over
real ChshRound streams, reaching the executable paths Z3 can't (union-find closure,
the infinity guard, the HAC bandwidth, the RhoMax clamp).

Five properties (100 generated cases each, green):
- (a) effectiveSampleSize <= n, equality iff rho1 <= 0.
- (a) effectiveSampleSizeHAC <= n for any stream + bandwidth.
- (b) chshMarginAutocorr >= chshMargin for every pair + delta (the load-bearing fact).
- (c) corrected chshSybilCalibrated DistinctCount >= the iid oracle's (subset) — the
  i.i.d. oracle reconstructed INLINE (chshSybilCalibrated now uses the corrected
  margin, so the old i.i.d. behavior is rebuilt to compare against).
- (c') gated chshSybilAutocorrCalibrated DistinctCount >= margin-only (gate only removes).

Z3 (arithmetic core) + FsCheck (whole-oracle) = the BP-16 pair. Retroactively brings
the shipped switch to the full verify-before-trust bar. Independent adversarial review
of the properties routed next.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test(core): harden the BP-16 FsCheck properties after adversarial review (all findings addressed)

The harsh-critic reviewed the first cut and found it green-but-weak. Every finding
fixed:

- P1 (cardinality shadow): (c)/(c') tested DistinctCount ≥, which is necessary but
  NOT sufficient for subset (two equal-count partitions can be incomparable). Now
  tests the TRUE subset: per-pair implication (corrected-convicts ⟹ iid-convicts)
  AND partition refinement (corrected SourceOf refines iid SourceOf via `refines`).
- P1 (generator never hit the adversary): random i.i.d. outcomes ⇒ i.i.d. products
  ⇒ corrected ≈ iid on every case, so the conviction-flip was never generated. Added
  genBurstStream (run-structured ⇒ autocorrelated) and genConductedPair (|S|=4 with
  bursty settings ⇒ margin_autocorr > margin_iid), so the antecedent actually fires.
  Fixed the false "shrinking throws up runs" comment.
- NEW explicit FLIP fact: a conducted |S|=4 pair, settings in runs of 12, n=96 —
  i.i.d. bound 2.999 CONVICTS (false positive), corrected bound 4.019 SPARES. The
  honest-but-bursty over-conviction the switch fixes, demonstrated concretely.
- P2 (bandwidth): stream length 0..120 (> 64) so Newey–West ⌊n^(1/3)⌋ reaches ≥ 4.
- P2 (determinism / DST): Replay="1337,7331" fixes the seed on every property.
- P2 ((a) HAC only checked ≤): added a strict-below-n fact on a bursty stream.
- Honest labels: (a)/(b) are regression guards (theorems of the code); (c)/(c')/FLIP
  are the load-bearing behavioral checks.

8 tests green (6 properties @ 500–1000 cases + FLIP + HAC-strict). iidSourceOf
confirmed a faithful reconstruction of the pre-switch oracle (critic: no baseline
divergence).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant