Skip to content

docs(plan): JC simulation-based inference with OGAR DisMech counterfactual gates - #1614

Merged
AdaWorldAPI merged 8 commits into
mainfrom
docs/jc-sbi-dismech-counterfactual-v1
Oct 19, 2026
Merged

AdaWorldAPI merged 8 commits into
mainfrom
docs/jc-sbi-dismech-counterfactual-v1

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Why

Follow up #1613 (proposed R/JC API), #1612 (Soufflé/cold lowering), #1611 (model-comparison meta-uncertainty), and CerebroCortex-RS #1 with a concrete, gated SBI statistical-methods plan.

Decisions

  • JC owns likelihood-free ABC/inference mathematics, SBC, posterior-predictive checks, model-comparison uncertainty and conditional EIG. ndarray::simd owns reusable numerical kernels only after an insufficiency/performance gate. The docs(plan): design R statistical API and formula lowering over JC #1613 R surfaces remain optional cold adapters, not R in the hot path.
  • Real owner inventory: ogar-dismech is AdaWorldAPI/OGAR/crates/ogar-dismech (19 causal predicates + 7 LOCAL search verbs), not a simulation engine. Historical dismech_counterfactual.rs was renamed to current lance-graph-planner/src/chain_counterfactual.rs; its edge-cut replay is not do-calculus or a general SCM.
  • Preserve dismech-rs as an independent oracle; keep SimulationOnly distinct from independent empirical and intervention-backed support. No invented mediator identities in unknown-topology or ungrounded-source fixtures.
  • No second Datalog/runtime/SoA authority, hot JSON/strings, new opcode or CE64 field; explicitly refuse the banned D-RA-4 d′ foreign-gather path.

Added

  • .claude/plans/jc-sbi-counterfactual-integration-v1.md: source inventory, mathematical ownership, typed method boundary, ABC/SMC/SBC/EIG ladder, DisMech causal validity gates, D-JCSBI-0..9 delivery phases and stop conditions.
  • docs/research/jc-sbi-counterfactual-falsifiers-v1.md: 32 preregistered semantic, numerical, identity, bias, counterfactual and EIG fixtures, with mutational controls.

First executable follow-up

D-JCSBI-0/1/2: inventoried typed request/refusal + independently verified small exact posterior fixture and ABC reference; no simulator orchestration or substrate changes. Subsequently test ACT-R parameter recovery and existing DisMech cut-replay sensitivity. EIG only after predictive calibration and model adequacy controls.

Documentation only. No Rust code, tests, benchmarks, model calibration or ABI additions claimed. No merge/implementation authorization implied.

Added follow-up: dynamic perturbation protocol + mechanical Sudoku + a little ACT-R

After source inspection of crates/perturbation-sim, OGAR ogar-dismech, lance-graph-planner/dismech_candidates, and CerebroCortex-RS #1, the plan now also covers:

  • An optional typed experiment protocol (model revision, parameter bundle, legal design, witness, RNG stream, computational budget, typed result). perturbation_sim::simulate_outage remains the standalone grid-physics oracle; DisMech remains a separate semantic oracle, not a power-grid simulator.
  • Mechanical Sudoku from OGAR: CANDIDATES/FOLD_XREF/NAKED_SINGLE/HIDDEN_SINGLE/ELIMINATE/FORK/RESIDUE_BAND as reusable conditional-search semantics, with executable-owner and coordinate/foreign-gather proof gates. OGAR declares seven vocabulary operations; it does not yet prove a complete runtime exists. Search traces are not evidence.
  • A deliberately small ACT-R-inspired eligible-production / conflict-selection / witnessed-transition policy: activation, procedural utility, budget, and optional calibrated JC-EIG remain distinct from NAL F/C, posterior mass, and authority.
  • 16 additional preregistered falsifiers (SB-33..48) for dynamic grid invariants, covariance invalidation, Sudoku search, ACT-R tie-breaks, simulated-vs-empirical evidence and target leakage. 48 total proposed, not executed.

The first executable cross-domain vertical slice compares three grid model families under two permitted perturbations; it also includes DisMech known-vs-unknown mediator restraint and ACT-R retrieval cue perturbation analogues. Match compute budgets and independent empirical receipts. No new runtime authority, schema, opcode or production API is implemented in this docs PR.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16a29efe-f781-4823-8446-a992ebfad320
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 19, 2026 02:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T02:16:15.673707Z 58b9788 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Add Carrot credits or activate Agent usage billing to use Autofix

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58b9788cc9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


### M4: Bayesian optimal experimental design (BOED/EIG), last

EIG is expected posterior information gain under the model and design distribution, not entropy, candidate-mask narrowing or EWA disagreement. Use a well-defined estimator (nested Monte Carlo or a vetted likelihood/ratio method) and an independent small discrete-oracle fixture. Separate aleatoric uncertainty, posterior/parameter uncertainty, estimator Monte Carlo error and model-misspecification warning. Only allow objectives after sufficient calibration; when misspecified or unidentifiable, abstain. Include experiment cost and authorized design constraints. Planner proposes next observation; it cannot bypass authority gates or create empirical evidence before executing the experiment.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Permit EIG to resolve current-design nonidentifiability

When parameters are nonidentifiable under the observations collected so far but an allowed candidate experiment distinguishes them, abstaining before evaluating EIG prevents BOED from doing exactly the identification work intended by D-JCSBI-7. Distinguish current-design nonidentifiability from nonidentifiability under every permitted design; only the latter warrants a blanket abstention.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Addressed in b978d25: BOED now explicitly distinguishes current-design nonidentifiability from nonidentifiability under every admissible future design. A permitted discriminative experiment may be selected via EIG when the current observations cannot identify the model; only absence of any distinguishing admissible design warrants an identification-specific abstention. Simulator calibration/misspecification is a separate validity gate. Added SB-24b (recoverable ambiguity) and SB-24c (unresolvable under all allowed designs) alongside the analytic SB-24a reference.

| ID | Experiment | Required assertion / falsifier |
| --- | --- | --- |
| SB-01 | Beta-Binomial small exact posterior | Analytic posterior mass and credible intervals match independently computed reference, incl. tails |
| SB-02 | Zero prior support / underflow-prone importance weights | Refuse, never return a valid all-zero mass or silently normalize NaNs |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Separate numerical underflow from zero prior support

When finite log-weights merely underflow after exponentiation, refusing discards a mathematically valid posterior and leaves the plan's promised stable log normalization untested. Split this fixture so genuinely zero posterior support must refuse, while an underflow-prone but finite case must normalize with a stable log-domain method and match the reference.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Addressed in b978d25 and 413cb78: SB-02a requires typed refusal for genuinely zero support (all log weights = -∞), whereas SB-02b requires finite extreme-negative log weights to survive stable log-sum-exp normalization with shift invariance and high-precision oracle parity. The plan's M0 gate and D-JCSBI-2 acceptance criteria now make the same distinction.

@AdaWorldAPI
AdaWorldAPI merged commit 1b26d9c into main Oct 19, 2026
4 checks passed
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