Skip to content

feat(analysis): bind independent TDT link-criterion fitting to an analysis-run profile - #423

Draft
seonghobae wants to merge 2 commits into
mainfrom
feat/lineage-criterion-analysis-run-gap-004
Draft

feat(analysis): bind independent TDT link-criterion fitting to an analysis-run profile#423
seonghobae wants to merge 2 commits into
mainfrom
feat/lineage-criterion-analysis-run-gap-004

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

GAP-004 leftover / ADR 0063. Bind existing analysis_engine::fit_lineage_criterion_posteriors to a cutoff-safe lineage_criterion_v1 analysis-run profile (tepp.lineage_criterion.v1).

  • Invokes the independent TDT link-criterion Jeffreys fitter already on protected main. Does not reimplement criterion fitting.
  • Artifact carries pair count, draw count, and inference status independent_tdt_criterion_not_date_from_record_order.
  • Event-time draws remain producer evidence. Date inference from record order and CHRONOS promotion are refused.
  • Raw posteriors and pair identities stay with the scientific fitter.
  • Invalid observations, fitter refusal, and snapshot/profile/cutoff mismatch fail closed, including reuse of case_deletion_refit_v1, composed_fitted_lineage_v1, fitted_candidate_k_v1, pareto_candidate_k_v1, trsl_topic_lineage_v1, and method_effects_v1.

Not corpus-background refusals (#422 / ADR 0062). Not non-lexical modality (#421 / ADR 0061). Not project-history CLI (#420). Not prompt-boilerplate (#419 / ADR 0060). Not house-voice (#418 / ADR 0059). Not template-copy (#416 / ADR 0058). Not method-effects (#415 / ADR 0057). Not case-deletion (#413 / ADR 0056). Not a Bayesian sampler. Not GPU. Not topic birth/split/merge. Not implemented-main.

Distinct from live slices

Does not duplicate #422/#421/#420/#419/#418/#417/#416/#415/#414/#413/#412/#411/#410/#409/#408/#407/#406/#405/#404/#398/#376/#374/#372/#389/#364/#356/#358/#359, Leiden (#351), 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

…lysis-run profile

GAP-004 leftover / ADR 0062. Bind existing fit_lineage_criterion_posteriors
to cutoff-safe lineage_criterion_v1. Event-time draws remain producer
evidence; date inference from record order is refused.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 57 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: Team

Run ID: 0addae4d-d4d5-468c-a0ea-24d639ab79da

📥 Commits

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

📒 Files selected for processing (8)
  • CHANGELOG.md
  • crates/analysis_engine/src/lib.rs
  • crates/analysis_engine/src/lineage_criterion_artifact.rs
  • crates/analysis_engine/tests/lineage_criterion_execution_contract.rs
  • docs/TRACEABILITY.md
  • docs/adr/0063-lineage-criterion-analysis-run.md
  • docs/adr/README.md
  • docs/doctoring/lineage-criterion-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.

ADR 0062 is already taken by live TEPP #422 corpus-background refusals.

@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.

Author COMMENT on exact head 1628f1f. This is not APPROVE. Independent = non-author, non-bot APPROVE. Two independent current-head APPROVEs required before merge. ADR 0063 after #422 took 0062. Do not self-approve.

@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 4 potential issues.

Devin Review

Comment on lines +29 to +30
observations: &'a [LineageCriterionObservation],
draw_count: usize,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Historical cutoff never filters evidence

LineageCriterionInput carries no availability timestamps, so evidence released after the requested cutoff still produces a successful artifact.

Prompt for agents
The lineage-criterion analysis-run input in crates/analysis_engine/src/lineage_criterion_artifact.rs cannot prove historical eligibility because LineageCriterionObservation and LineageCriterionInput contain no availability time. Extend the input contract with availability provenance, validate every observation against the requested KnowledgeCutoff before fitting, and add a test where an otherwise valid observation is unavailable until after the cutoff. Preserve the distinction between event-time draws and evidence availability.
Devin Review

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

Comment on lines +177 to +188
let fits = fit_lineage_criterion_posteriors(input.observations(), input.draw_count()).map_err(
|error| match error {
LineageCriterionFitError::EmptyInput
| LineageCriterionFitError::InvalidPairIdentity
| LineageCriterionFitError::TemporalDrawMismatch => {
AnalysisEngineError::InvalidEvidence
}
LineageCriterionFitError::Criterion(_) => {
AnalysisEngineError::LineageCriterionFitFailure
}
},
)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Malformed event times pass validation

execute_lineage_criterion_run validates only temporal draw counts. Arbitrary strings still produce a successful result that claims valid event-time evidence.

Prompt for agents
Validate every predecessor_event_time_draws and successor_event_time_draws value as an EventTime before fitting in the lineage-criterion execution path. Return InvalidEvidence for malformed timestamps and add integration tests covering malformed predecessor and successor draws. If LineageCriterionObservation is intended to guarantee validity earlier, replace raw strings with typed EventTime values instead.
Devin Review

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

Comment on lines +169 to +170
if request.knowledge_cutoff != knowledge_cutoff.to_rfc3339()
|| request.model_contract_version != LINEAGE_CRITERION_MODEL_CONTRACT_VERSION

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Equivalent cutoffs require identical spelling

Valid RFC 3339 offsets fail request.knowledge_cutoff comparison unless they exactly match canonical UTC text. Confirm this profile requires textual, not instant, equality.

Devin Review

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

Comment on lines +177 to +188
let fits = fit_lineage_criterion_posteriors(input.observations(), input.draw_count()).map_err(
|error| match error {
LineageCriterionFitError::EmptyInput
| LineageCriterionFitError::InvalidPairIdentity
| LineageCriterionFitError::TemporalDrawMismatch => {
AnalysisEngineError::InvalidEvidence
}
LineageCriterionFitError::Criterion(_) => {
AnalysisEngineError::LineageCriterionFitFailure
}
},
)?;

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 input enables resource exhaustion

execute_lineage_criterion_run accepts unlimited pairs and draws, then materializes every posterior. Oversized untrusted inputs can exhaust memory or monopolize CPU.

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