feat(analysis): compose fitted candidate-K selection with topic lineage - #412
feat(analysis): compose fitted candidate-K selection with topic lineage#412seonghobae wants to merge 2 commits into
Conversation
GAP-004/#166/#167 leftover / ADR 0055. Bind existing select_fitted_candidate_k then execute_topic_lineage_run at selected K as cutoff-safe composed_fitted_lineage_v1. LLM votes cannot define the numerical optimum. Not a Schwarz-only bind, not Pareto, not a Bayesian sampler, and not implemented-main.
seonghobae
left a comment
There was a problem hiding this comment.
Operator COMMENT on exact head e2b3c3b.
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 fitted candidate-K composed with topic lineage as composed_fitted_lineage_v1 (ADR 0055). Distinct from Schwarz-only (#404 / ADR 0049), Pareto (#409 / ADR 0053), joint Laplace (#408 / ADR 0052), topic activity (#407 / ADR 0051), interpreter/verifier (#405 / ADR 0050), and export retrieval (#411 / ADR 0054). LLM votes cannot define the numerical optimum. Not a Bayesian sampler. Not implemented-main.
Do not self-approve. Do not merge without two independent approvals. Predecessor Checks do not transfer.
|
Warning Review limit reachedNext included review available in 46 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
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. Comment |
| pub fn execute_composed_fitted_lineage_run( | ||
| request: &AnalysisRunRequest, | ||
| accepted: &AnalysisRunAccepted, | ||
| snapshot_id: &str, | ||
| knowledge_cutoff: KnowledgeCutoff, | ||
| composition: &ComposedFittedLineageInput<'_>, | ||
| completed_at: impl Into<String>, | ||
| ) -> Result<ComposedFittedLineageExecution, AnalysisEngineError> { | ||
| request.to_json()?; | ||
| accepted.to_json()?; | ||
| require_receipt_identity(request, accepted)?; | ||
| if request.snapshot_id != snapshot_id { | ||
| return Err(AnalysisEngineError::SnapshotMismatch); | ||
| } | ||
| if request.knowledge_cutoff != knowledge_cutoff.to_rfc3339() | ||
| || request.model_contract_version != COMPOSED_FITTED_LINEAGE_MODEL_CONTRACT_VERSION | ||
| || request.output_profile != COMPOSED_FITTED_LINEAGE_OUTPUT_PROFILE | ||
| || !valid_identifier(composition.method_name()) | ||
| { | ||
| return Err(AnalysisEngineError::InvalidEvidence); | ||
| } |
| pub struct ComposedFittedLineageExecution { | ||
| /// Digest-bound composed selection-plus-lineage artifact. | ||
| pub artifact: ComposedFittedLineageArtifact, | ||
| /// Terminal result carrying the composed artifact identity, digest, and schema. | ||
| pub terminal_result: AnalysisRunTerminalResult, |
| }; | ||
| let digest = artifact.sha256()?; | ||
| #[rustfmt::skip] | ||
| let summary = AnalysisResultSummary::new("composed_fitted_lineage", artifact.evidence_count, 4, COMPOSED_FITTED_LINEAGE_INFERENCE_STATUS)?; |
There was a problem hiding this comment.
| if candidates.is_empty() { | ||
| return Err(ModelSelectionError::NoSuccessfulFit); | ||
| } | ||
| select_candidate_k(&candidates) | ||
| let selected_k = select_candidate_k(&candidates)?; | ||
| fitted | ||
| .into_iter() | ||
| .find(|(candidate_k, _)| *candidate_k == selected_k) | ||
| .ok_or(ModelSelectionError::NoSuccessfulFit) |
There was a problem hiding this comment.
📝 Info: Failed fits remain isolated
select_fitted_candidate_model preserves the existing candidate-failure policy. LLM votes cannot supply the returned model because lookup uses only successful fits.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
GAP-004/#166/#167 leftover / ADR 0055. Bind existing
model_selection::select_fitted_candidate_kthenexecute_topic_lineage_runat the selectedKto a cutoff-safecomposed_fitted_lineage_v1analysis-run profile (tepp.composed_fitted_lineage.v1).f64topic-lineage executor already on protected main. Does not reimplement scoring or lineage edges.K, candidate/evidence counts, lineage topic/edge counts, the inner lineage digest, and inference statusfitted_k_composed_lineage_not_bayesian_sampler.fitted_candidate_k_v1,pareto_candidate_k_v1,trsl_topic_lineage_v1, andjoint_posterior_draws_v1.Not standalone fitted candidate-
K(#404 / ADR 0049). Not interpreter/verifier (#405 / ADR 0050). Not topic activity (#407 / ADR 0051). Not joint Gauss-Newton Laplace draws (#408 / ADR 0052). Not Pareto candidate-K(#409 / ADR 0053). Not export retrieval (#411 / ADR 0054). Not a Bayesian sampler. Not GPU. Not topic birth/split/merge. Not implemented-main.Distinct from live slices
Does not duplicate #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_enginecargo clippy -p analysis_engine --all-targets -- -D warningspython3 scripts/validate_documentation.pyMerge 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.