Skip to content

feat(analysis): bind exhaustive case-deletion refit to an analysis-run profile - #413

Draft
seonghobae wants to merge 1 commit into
mainfrom
feat/case-deletion-refit-analysis-run-gap-004
Draft

feat(analysis): bind exhaustive case-deletion refit to an analysis-run profile#413
seonghobae wants to merge 1 commit into
mainfrom
feat/case-deletion-refit-analysis-run-gap-004

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

GAP-004 leftover / ADR 0056. Bind existing analysis_engine::fit_exhaustive_case_deletion to a cutoff-safe case_deletion_refit_v1 analysis-run profile (tepp.case_deletion_refit.v1).

  • Invokes the exhaustive actual D \\ {i} runner already on protected main. Does not reimplement leave-one-out fitting.
  • Artifact carries document count, deletion-refit count, independent seed-domain count, the full-fit seed domain, and inference status exhaustive_actual_deletion_not_reweighting_approx.
  • Raw posteriors stay with the scientific fitter. Reweighting, a fixed posterior, and a diagonal approximation cannot substitute for an actual deleted-data fit.
  • Invalid corpora, fitter refusal, and snapshot/profile/cutoff mismatch fail closed, including reuse of composed_fitted_lineage_v1, fitted_candidate_k_v1, pareto_candidate_k_v1, and trsl_topic_lineage_v1.

Not composed fitted-K+lineage (#412 / ADR 0055). Not export retrieval (#411 / ADR 0054). Not Pareto candidate-K (#409 / ADR 0053). Not joint Laplace draws (#408 / ADR 0052). Not topic activity (#407 / ADR 0051). Not interpreter/verifier (#405 / ADR 0050). Not standalone fitted candidate-K (#404 / ADR 0049). Not a Bayesian sampler. Not GPU. Not topic birth/split/merge. Not implemented-main.

Distinct from live slices

Does not duplicate #412 (composed fitted-lineage), #411 (export retrieval), #410 (export authorize CLI), #409 (Pareto candidate-K), #408 (joint posterior Laplace draws), #407 (topic activity), #406 (wait CLI), #405 (interpreter/verifier), #404 (fitted candidate-K), #398 (membership-posterior ICC), #376 (ESEM/DSEM), #374 (Rubin), #372 (CWC), #389 (irregular event-time), #364 (TDT/CHRONOS), #356/#358/#359 (GAP-003A), #351 (Leiden), or Driver p.16 std-family micro-PRs.

Verification

  • cargo test -p analysis_engine
  • cargo clippy -p analysis_engine --all-targets -- -D warnings
  • python3 scripts/validate_documentation.py

Merge gate

Two independent current-head APPROVEs required. Author/bot COMMENTED is not independent APPROVE. Exact-head Checks on this SHA only. Predecessor Checks do not transfer. Do not self-approve. Do not merge without two independent approvals.


Devin Review

…n profile

GAP-004 leftover / ADR 0056. Bind existing fit_exhaustive_case_deletion to
cutoff-safe case_deletion_refit_v1. Actual D\{i} fits; reweighting and a
fixed posterior cannot substitute. Not a Bayesian sampler and not
implemented-main.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Operator COMMENT on exact head 1ebb626.

This is not an APPROVE. Author COMMENTED is not an independent review. Ruleset 18156473 still needs two independent current-head APPROVEs from non-author, non-bot reviewers.

Bind is exhaustive actual case-deletion as case_deletion_refit_v1 (ADR 0056). Distinct from composed fitted-lineage (#412 / ADR 0055), Pareto (#409 / ADR 0053), fitted Schwarz-only (#404 / ADR 0049), and export retrieval (#411 / ADR 0054). Reweighting cannot substitute for an actual deleted-data fit. Not a Bayesian sampler. Not implemented-main.

Do not self-approve. Do not merge without two independent approvals. Predecessor Checks do not transfer.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 5 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 569c452d-bf27-4a73-9bf2-4f7d41f8a4f4

📥 Commits

Reviewing files that changed from the base of the PR and between 1bc02f5 and 1ebb626.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • crates/analysis_engine/src/case_deletion_refit_artifact.rs
  • crates/analysis_engine/src/lib.rs
  • crates/analysis_engine/tests/case_deletion_refit_execution_contract.rs
  • docs/TRACEABILITY.md
  • docs/adr/0056-case-deletion-refit-analysis-run.md
  • docs/adr/README.md
  • docs/doctoring/case-deletion-refit-analysis-run.md

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.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 3 potential issues.

Devin Review

Comment on lines +201 to +202
let fits =
fit_exhaustive_case_deletion(input.documents(), input.seed_domain_base(), input.fitter())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Unbounded refits can exhaust workers

execute_case_deletion_refit_run launches unlimited refits and retains every deleted corpus plus posterior. Large requests grow quadratically and can exhaust or monopolize a worker.

Prompt for agents
Add an explicit case-deletion document-count limit and reject oversized inputs before calling fit_exhaustive_case_deletion in crates/analysis_engine/src/case_deletion_refit_artifact.rs. Size the limit for the runner's quadratic retained_document_ids allocation and fitter-owned posterior retention, rather than relying on the constant-size artifact limit or the unrelated AnalysisCorpus limit. Add a boundary test proving no fitter call occurs when the limit is exceeded. Consider streaming summaries if larger corpora must be supported.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +69 to +80
## Verification

The PR includes Rust unit and integration tests for successful exhaustive
counts, invalid corpora, fitter refusal, snapshot/profile/cutoff mismatch
including reuse of live sibling profiles, and artifact tampering. Run:

```text
cargo fmt --all -- --check
cargo test -p analysis_engine
cargo clippy -p analysis_engine --all-targets -- -D warnings
python3 scripts/validate_documentation.py
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Required verification evidence is incomplete

The listed verification omits formatting, full workspace tests, 100% line and branch coverage, and dependency checks required by repository policy. Current-head gates need review before merge.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +37 to +46
pub const fn new(
documents: &'a [CaseDeletionDocument<D>],
seed_domain_base: &'a str,
fitter: &'a F,
) -> Self {
Self {
documents,
seed_domain_base,
fitter,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟨 Untrusted refit inputs bypass validation

CaseDeletionRefitInput::new accepts arbitrary documents without size, provenance, snapshot, or availability checks. Untrusted inputs can reach expensive exhaustive fitting directly.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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