feat(analysis): bind TDT/CHRONOS composition to an analysis-run profile - #364
feat(analysis): bind TDT/CHRONOS composition to an analysis-run profile#364seonghobae wants to merge 2 commits into
Conversation
Operators can request the existing event_core workflow as tdt_chronos_workflow_v1. Mentions unavailable at the request cutoff are excluded; the digest-bound tepp.tdt_chronos_workflow.v1 artifact records detection versus prediction layers and refuses instance/transition promotion. Not a new extractor, not persistence, and not implemented-main.
|
Warning Review limit reachedNext included review available in 42 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 (9)
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 |
| config: input.config, | ||
| segmentation: input.segmentation, | ||
| mentions, | ||
| links, | ||
| first_story_labels, | ||
| track_assignments, | ||
| schema_slot_assignments: input.schema_slot_assignments, | ||
| occurrence_forecasts: input.occurrence_forecasts, |
There was a problem hiding this comment.
| let links: Vec<_> = input | ||
| .links | ||
| .into_iter() | ||
| .filter(|link| eligible_ids.contains(&link.left()) && eligible_ids.contains(&link.right())) | ||
| .collect(); |
| run_id: accepted.run_id.clone(), | ||
| snapshot_id: snapshot_id.to_owned(), | ||
| knowledge_cutoff: knowledge_cutoff.to_rfc3339(), | ||
| workflow_version: composition.config_version(), |
There was a problem hiding this comment.
| pub fn to_json(&self) -> Result<String, AnalysisEngineError> { | ||
| self.validate()?; | ||
| let payload = | ||
| serde_json::to_string(self).map_err(|_| AnalysisEngineError::SerializationFailure)?; | ||
| Ok(payload) | ||
| } |
| let _ = refuse_composition_as_instance(&composition); | ||
| let _ = refuse_composition_as_transition(&composition); |
| if input.first_story_labels.len() != input.mentions.len() | ||
| || input.track_assignments.len() != input.mentions.len() | ||
| { | ||
| return Err(AnalysisEngineError::Event(EventError::InvalidWirePayload)); | ||
| } | ||
| let mut mentions = Vec::new(); | ||
| let mut first_story_labels = Vec::new(); | ||
| let mut track_assignments = Vec::new(); | ||
| let mut excluded_after_cutoff_count = 0_u64; | ||
| for ((mention, first_story), track) in input | ||
| .mentions | ||
| .into_iter() | ||
| .zip(input.first_story_labels) | ||
| .zip(input.track_assignments) | ||
| { | ||
| if mention.clocks().available_time().instant() <= knowledge_cutoff.instant() { | ||
| mentions.push(mention); | ||
| first_story_labels.push(first_story); | ||
| track_assignments.push(track); |
There was a problem hiding this comment.
| let admitted = admit_mentions_at_cutoff(input, knowledge_cutoff)?; | ||
| let composition = compose_event_intelligence( |
There was a problem hiding this comment.
| let summary = AnalysisResultSummary::new( | ||
| "tdt_chronos_workflow", | ||
| artifact.mention_count, | ||
| statistic_count, | ||
| EVENT_INTELLIGENCE_INFERENCE_STATUS, | ||
| ) | ||
| .expect("bounded event-intelligence summary constants are valid"); |
There was a problem hiding this comment.
🔴 Oversized runs panic during completion
Over one billion evidence items or combined outputs makes AnalysisResultSummary::new fail. expect then crashes the executor instead of rejecting the run.
| let summary = AnalysisResultSummary::new( | |
| "tdt_chronos_workflow", | |
| artifact.mention_count, | |
| statistic_count, | |
| EVENT_INTELLIGENCE_INFERENCE_STATUS, | |
| ) | |
| .expect("bounded event-intelligence summary constants are valid"); | |
| let summary = AnalysisResultSummary::new( | |
| "tdt_chronos_workflow", | |
| artifact.mention_count, | |
| statistic_count, | |
| EVENT_INTELLIGENCE_INFERENCE_STATUS, | |
| )?; |
Was this helpful? React with 👍 or 👎 to provide feedback.
| let links: Vec<_> = input | ||
| .links | ||
| .into_iter() | ||
| .filter(|link| eligible_ids.contains(&link.left()) & eligible_ids.contains(&link.right())) |
| ) | ||
| .expect("validated composition produces a valid bounded artifact"); |
| #[test] | ||
| fn execution_refuses_invalid_completion_time() { | ||
| let fixture = KnownTruthFixture::build(); | ||
| let request = request(); | ||
| let accepted = accepted(&request); | ||
| assert_eq!( | ||
| execute_event_intelligence_run( | ||
| &request, | ||
| &accepted, | ||
| "snapshot-event-intelligence", | ||
| cutoff(), | ||
| fixture.input(), | ||
| "invalid", | ||
| ), | ||
| Err(AnalysisEngineError::Api( | ||
| tepp_api::ApiError::InvalidWirePayload | ||
| )) | ||
| ); |
Summary
GAP-007 remaining operator-visible slice: bind the already-merged
event_coreTDT/CHRONOS composition (compose_event_intelligence, #269 on protected main) to ananalysis_engineanalysis-run output profile so operators can request the composed workflow.tdt_chronos_workflow_v1/ schematepp.tdt_chronos_workflow.v1(ADR 0030; 0026–0029 remain on other live PRs).available_timeagainst the requestknowledge_cutoff; drops links that cite an excluded mention; keeps first-story/track streams aligned.tdt_detection; CHRONOS hypotheses staychronos_prediction. Inference status iscomposed_workflow_not_instance_or_transition.refuse_composition_as_instanceandrefuse_composition_as_transition. Does not invent an extractor, persist rows, or promote an instance/transition.This is not implemented-main. Exact-head Checks on this head only. Predecessor-head evidence does not transfer.
Does not duplicate:
Test plan
cargo test -p analysis_enginecargo clippy -p analysis_engine --all-targets -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc -p analysis_engine --no-depsMerge bar
Ruleset 18156473: two independent approvals + exact-head Checks. Do not self-approve. Do not
--adminmerge.