Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang

## [Unreleased]

- **Independent TDT link-criterion analysis-run profile**: cutoff-safe `lineage_criterion_v1` binds `fit_lineage_criterion_posteriors` and refuses date inference from record order (`analysis_engine`). Not a Bayesian sampler and not implemented-main.
- Removed the repository-local hourly PR-maintenance caller now covered by the central required scheduler, retired stale workflow registrations, narrowed documentation triggers, keyed PR concurrency by fixed workflow name, repository, and pull-request number without cancelling non-PR runs, and combined line/branch coverage on one sequential runner while preserving both 100% gates and diagnostics.

- `event_core` adds bounded Allen interval-consistency classification, atomic path-consistency closure, contradiction/resource refusals, and an explicit dependency-error fallback without claiming unrestricted global satisfiability.
Expand Down
2 changes: 1 addition & 1 deletion crates/analysis_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ categories.workspace = true
publish = false

[dependencies]
corpus_split = { path = "../corpus_split", version = "0.2.0" }
event_core = { path = "../event_core", version = "0.2.0" }
serde = { workspace = true }
serde_json = { workspace = true }
Expand All @@ -24,7 +25,6 @@ topic_measurement = { path = "../topic_measurement", version = "0.2.0" }
uuid.workspace = true

[dev-dependencies]
corpus_split = { path = "../corpus_split", version = "0.2.0" }
membership_core = { path = "../membership_core", version = "0.2.0" }
relation_graph = { path = "../relation_graph", version = "0.2.0" }

Expand Down
33 changes: 29 additions & 4 deletions crates/analysis_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
//! through [`tepp_api`]. It deliberately does not claim latent-variable or topic
//! estimation authority; those estimators remain separate scientific crates.
//! estimation authority; it invokes estimators through their scientific crate
//! contracts and preserves their artifact meaning.
//! contracts and preserves their artifact meaning. Independent TDT
//! link-criterion fitting is invoked through
//! [`fit_lineage_criterion_posteriors`] and does not infer a date from
//! record order.

mod case_deletion_refit;
mod lineage_criterion;
mod lineage_criterion_artifact;
mod topic_context_posterior;
mod topic_lineage_artifact;

Expand Down Expand Up @@ -46,6 +50,13 @@ pub use lineage_criterion::{
LineageCriterionFit, LineageCriterionFitError, LineageCriterionObservation,
fit_lineage_criterion_posteriors,
};
/// Independent TDT link-criterion artifact and execution contracts from this engine.
pub use lineage_criterion_artifact::{
LINEAGE_CRITERION_ARTIFACT_BYTE_LIMIT, LINEAGE_CRITERION_ARTIFACT_SCHEMA_VERSION,
LINEAGE_CRITERION_MODEL_CONTRACT_VERSION, LINEAGE_CRITERION_OUTPUT_PROFILE,
LineageCriterionArtifact, LineageCriterionExecution, LineageCriterionInput,
execute_lineage_criterion_run,
};
/// Bounded posterior topic-context producer contract and record types.
pub use topic_context_posterior::{
TOPIC_CONTEXT_POSTERIOR_BYTE_LIMIT, TOPIC_CONTEXT_POSTERIOR_SCHEMA_VERSION,
Expand Down Expand Up @@ -248,6 +259,10 @@ pub enum AnalysisEngineError {
TopicMeasurement(TopicMeasurementError),
/// A topic-lineage artifact violated its bounded schema or count invariants.
InvalidTopicLineageArtifact,
/// A lineage-criterion artifact violated its bounded schema or counts.
InvalidLineageCriterionArtifact,
/// The independent TDT link-criterion fitter refused the observations.
LineageCriterionFitFailure,
}

impl fmt::Display for AnalysisEngineError {
Expand All @@ -262,6 +277,8 @@ impl fmt::Display for AnalysisEngineError {
Self::LimitExceeded => "analysis corpus exceeded its execution bound",
Self::TopicMeasurement(error) => return error.fmt(formatter),
Self::InvalidTopicLineageArtifact => "invalid topic lineage artifact",
Self::InvalidLineageCriterionArtifact => "invalid lineage-criterion artifact",
Self::LineageCriterionFitFailure => "lineage-criterion fitter refused the observations",
};
formatter.write_str(message)
}
Expand Down Expand Up @@ -384,7 +401,7 @@ fn add_membership_count(sum: u64, membership_count: u32) -> Result<u64, Analysis
}

/// Require the accepted receipt to carry the request's idempotency identity.
fn require_receipt_identity(
pub(crate) fn require_receipt_identity(
request: &AnalysisRunRequest,
accepted: &AnalysisRunAccepted,
) -> Result<(), AnalysisEngineError> {
Expand All @@ -394,15 +411,15 @@ fn require_receipt_identity(
Ok(())
}

fn format_digest(digest: impl AsRef<[u8]>) -> String {
pub(crate) fn format_digest(digest: impl AsRef<[u8]>) -> String {
let mut output = String::with_capacity(digest.as_ref().len() * 2);
for byte in digest.as_ref() {
let _ = write!(output, "{byte:02x}");
}
output
}

fn valid_identifier(value: &str) -> bool {
pub(crate) fn valid_identifier(value: &str) -> bool {
!value.trim().is_empty()
&& value.len() <= MAX_ANALYSIS_IDENTIFIER_BYTES
&& !value.chars().any(char::is_control)
Expand Down Expand Up @@ -681,6 +698,14 @@ mod tests {
AnalysisEngineError::InvalidTopicLineageArtifact,
"invalid topic lineage artifact",
),
(
AnalysisEngineError::InvalidLineageCriterionArtifact,
"invalid lineage-criterion artifact",
),
(
AnalysisEngineError::LineageCriterionFitFailure,
"lineage-criterion fitter refused the observations",
),
];
for (error, message) in messages {
assert_eq!(error.to_string(), message);
Expand Down
Loading
Loading