Skip to content

feat(addie): add non-admitting matched NI diagnostic - #7306

Merged
bokelley merged 17 commits into
mainfrom
conductor/addie-matched-ni-exact
Sep 6, 2026
Merged

bokelley merged 17 commits into
mainfrom
conductor/addie-matched-ni-exact

Conversation

@bokelley

@bokelley bokelley commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a standalone, research-only Lloyd–Moldovan (2008) restricted-score E+M exact-unconditional matched-pair noninferiority diagnostic. It uses normalized BigInt rationals, rational probability polynomials, square-free Sturm derivative-root isolation with rational interval enclosures, and continuous null-boundary maximization. The published n=25, x=2, t=2, m=.10 fixture is enclosed and rounds to .0085.

Primary source: Lloyd CJ, Moldovan MV. A more powerful exact test of noninferiority from binary matched-pairs data. Statistics in Medicine. 2008;27(18):3540-3549. doi:10.1002/sim.3229.

Exact safety and isolation scope

  • This is diagnostic-only and never admits or promotes a production decision. Results carry hard-coded false admission, have no root-level decision/reject field, and confidence inversion/adaptive resizing remain typed non-implementations.
  • The public wrapper snapshots and rehydrates canonical data, runs two isolated complete recomputations, requires exact agreement, enforces a two-worker live-handle bound, terminates on terminal paths, and conservatively falls back on worker creation failure, saturation, malformed/unequal replies, timeout, or resource limits.
  • The exact engine applies its joint support predicate, deterministic root/work caps, continuous endpoint/stationary-point maximization, and conservative lower/upper size envelopes. Zero margin uses exact conditional McNemar only. compareScorePrecisely resolves the reviewed score comparison.
  • Array map and iterator methods are never invoked by the engine core; poisoned versions therefore do not execute through the core’s array construction, population, or iteration paths.
  • Before core work, workers inspect this explicitly audited set of mutable methods used by the loaded NI modules: RegExp.prototype.test, String.prototype.startsWith/indexOf/slice/endsWith, Map.prototype.get/set/has, and WeakSet.prototype.add/has. A detected replacement returns the existing conservative worker failure response before the core starts. This is a finite named-method check, not a general arbitrary-intrinsic isolation claim.
  • TypeScript source under node --import tsx has one explicit exclusion: poisoning mutable built-ins before dynamically importing engine.ts is outside the engine isolation contract. tsx's external resolver runs before engine evaluation and can hang first; the engine worker timer cannot cover it. This is not presented as engine isolation. The emitted-JavaScript pre-evaluation and TypeScript post-loader/pre-core guarantees above remain covered.

Deliberate non-admission and constrained domain

Admission remains blocked by missing independent-reference match, continuous type-I certificate review, no confirmatory sample-size validation for supported N, and unvalidated adaptive re-estimation. The checked-in fixture is provenance only, not an independent-reference claim. The support predicate is non-Cartesian: inference uses S²·b <= 1,500,000; exhaustive size additionally requires n <= 8 and S³·b <= 1,500,000, with S=(n+1)(n+2)/2 and b margin bit length. Unsupported requests return conservative diagnostic evidence.

Validation

  • Focused deterministic regressions distinguish: (1) the explicitly unsupported pre-evaluation TypeScript/tsx loader condition, bounded by a 1.5-second child timeout; (2) post-loader/pre-core TypeScript worker behavior; and (3) emitted-JavaScript pre-evaluation behavior.
  • The source post-loader and emitted pre-evaluation matrices exercise poisoned Array map/iterator methods and assert normal completion without calling those helpers. For each explicitly audited RegExp/String/Map/WeakSet method, they assert bounded { ok: false } settlement and no core-start/core-complete telemetry across inference and size tasks.
  • npx vitest run --config server/vitest.config.ts server/tests/unit/addie/matched-pair-ni/exact-inference.test.ts -t 'does not claim TypeScript source pre-evaluation'
  • npx vitest run --config server/vitest.config.ts server/tests/unit/addie/matched-pair-ni/exact-inference.test.ts -t 'keeps post-loader/pre-core TypeScript'
  • npx vitest run --config server/vitest.config.ts server/tests/unit/addie/matched-pair-ni/exact-inference.test.ts -t 'does not export worker-only expensive cores'

Review request

Please perform a fresh independent exact Sol review. Do not approve or merge: this remains research-only and non-admitting.

@bokelley
bokelley force-pushed the conductor/addie-matched-ni-exact branch from c684dbc to c88dd12 Compare September 5, 2026 23:22
@bokelley
bokelley force-pushed the conductor/addie-matched-ni-exact branch from 20fb27a to 48ab9f6 Compare September 6, 2026 00:28
@bokelley
bokelley marked this pull request as ready for review September 6, 2026 03:45

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve.

New, research-only Lloyd-Moldovan matched-pair NI diagnostic module added under server/src/addie/eval/matched-pair-ni/** (8 files, all additions). Non-admitting, unwired, no protocol surface touched — so no changeset is owed, and schema↔docs / oneOf / artifact-immutability gates do not apply.

Reviewed the load-bearing files: engine.ts (two-worker concurrency gate + worker timeout backstop), algebraic.ts (Sturm root isolation, signed-interval division), and exact-inference.test.ts — all correct and fail-closed. The only operational note (worker errors swallowed without alerting) is acceptable given the diagnostic-only, non-admitting, unwired nature and does not rise to medium.

Decision-table walk: no critical/high/medium findings (rows 1, 4, 5, 6, 8 do not fire). gated_paths is false (row 2 n/a). high_risk is true but every reason is (added) — new scaffolding, which the risk-reading rules treat as inherently low risk; no (deleted) or (modified) entries (rows 3, 5 n/a). No no-auto-approve team match (row 7 n/a). Falls through to row 9 → approve.

@bokelley
bokelley merged commit bd1e104 into main Sep 6, 2026
30 checks passed
@bokelley
bokelley deleted the conductor/addie-matched-ni-exact branch September 6, 2026 04:13
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