Skip to content
Merged
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 ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ boundaries above remain the target modular MSA architecture.
| `tepp_simulation` | known-truth temporal/event data generation |
| `validation_core` | RMSE, bias, coverage, graph, and Monte Carlo metrics |
| `tepp_api` | versioned DTO, schema, and export contracts |
| `psychometric_fit` | CPU `f64` ESEM loading recovery and event-time DSEM lag gates |
| `subevent_containment` | subevent event-time intervals must stay inside the parent |
| `prediction_contradiction` | Allen promotion gate: `before`/`after` stay contradictory; `meets`/`met_by` stay unsupported; coverage is required before unmatched predicted mass may be authorized for promotion |
| `provider_receipt` | provider-disclosure field-code receipts; source text and identity are not disclosable |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang

### Added

- `psychometric_fit` CPU `f64` ESEM/DSEM fit: exploratory OLS recovers known cross-loadings from admitted log-ratio or logistic-normal coordinates with computed RMSE below a zero-loading collapse; reverse or zero event-time lagged paths fail closed; a good global fit cannot reclassify formative or network constructs as reflective (ADR 0005). No new migration number (`#45` still owns `0007`).
- `subevent_containment` parent-window gate: a half-open subevent interval that starts before or ends after its parent cannot attach; recovered containment flags match known truth at a higher computed rate than accepting every child (ADR 0003).
- `prediction_contradiction` promotion gate: `temporal_core` Allen classification refuses `before`/`after` as contradiction and `meets`/`met_by` as unsupported adjacency; `refuse_promotion` and `require_observed_coverage` refuse partial overlap that leaves unmatched predicted mass; `refuse_contradiction_or_adjacency` is the weaker contradiction/adjacency filter only; evidence available after the knowledge cutoff is ineligible. Label agreement is not RMSE recovery (ADR 0002, ADR 0016). Canonical docs name the crate, not a pull-request number, as the landable authority; `scripts/validate_documentation.py` fail-closes on `landable coverage gate is PR #N` and inverted or paraphrased forms (`PR #N is the landable coverage gate`, `the landable gate is PR #N`, `coverage-authority landing PR #N`, `merge PR #N as the coverage-authority`) including drafts #93, #94, #97, #101, #102, #104, #108, #109, #111, and #112. The hourly queue lock also fail-closes when those drafts are omitted from Keep-unmerged sentences, when a Keep-unmerged sentence is negated, or when the naruon live-HTTP *subject* is not PR #107 with #87 and #105 kept unmerged.
- `provider_receipt` disclosure audit: a receipt records purpose and field codes sent to a model provider; source text, source identity, and blanket PII masking fail closed; recovered field codes match known truth at a higher computed rate than a collapsed set (ADR 0009).
Expand Down
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"crates/tepp_simulation",
"crates/validation_core",
"crates/tepp_api",
"crates/psychometric_fit",
"crates/subevent_containment",
"crates/prediction_contradiction",
"crates/provider_receipt",
Expand All @@ -35,6 +36,7 @@ default-members = [
"crates/tepp_simulation",
"crates/validation_core",
"crates/tepp_api",
"crates/psychometric_fit",
"crates/subevent_containment",
"crates/prediction_contradiction",
"crates/provider_receipt",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ crates/corpus_split
crates/tepp_simulation
crates/validation_core
crates/tepp_api
crates/psychometric_fit
crates/subevent_containment
crates/prediction_contradiction
crates/provider_receipt
Expand Down
17 changes: 17 additions & 0 deletions crates/psychometric_fit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "psychometric_fit"
description = "CPU f64 ESEM loading recovery and event-time DSEM lag gates."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
publish = false

[lints]
workspace = true
80 changes: 80 additions & 0 deletions crates/psychometric_fit/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
//! Fail-closed ESEM/DSEM fit errors.

use std::fmt;

/// A fail-closed psychometric-fit error.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum PsychometricFitError {
/// Raw simplex proportions were offered as Euclidean fit inputs.
RawProportionForbidden,
/// Empty, rank-unsupported, unequal-length, or non-finite numeric input.
InvalidNumericInput,
/// A predictor matrix has a singular Gram matrix.
SingularDesign,
/// A lagged path would move backward or stay put in event time.
ReverseEventTimePath,
/// A good global fit was used to reinterpret a formative or network
/// construct as reflective.
FormativeReinterpretationForbidden,
/// The construct class is unresolved, so reflective interpretation is
/// unavailable.
UnresolvedConstruct,
}

impl fmt::Display for PsychometricFitError {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
let message = match self {
Self::RawProportionForbidden => {
"raw topic proportions are forbidden psychometric fit inputs"
}
Self::InvalidNumericInput => "invalid psychometric fit numeric input",
Self::SingularDesign => "singular psychometric fit design matrix",
Self::ReverseEventTimePath => "DSEM lagged paths cannot move backward in event time",
Self::FormativeReinterpretationForbidden => {
"formative or network constructs cannot be reinterpreted as reflective"
}
Self::UnresolvedConstruct => "construct class is unresolved",
};
formatter.write_str(message)
}
}

impl std::error::Error for PsychometricFitError {}

#[cfg(test)]
mod tests {
use super::PsychometricFitError;

#[test]
fn error_messages_are_stable() {
for (error, message) in [
(
PsychometricFitError::RawProportionForbidden,
"raw topic proportions are forbidden psychometric fit inputs",
),
(
PsychometricFitError::InvalidNumericInput,
"invalid psychometric fit numeric input",
),
(
PsychometricFitError::SingularDesign,
"singular psychometric fit design matrix",
),
(
PsychometricFitError::ReverseEventTimePath,
"DSEM lagged paths cannot move backward in event time",
),
(
PsychometricFitError::FormativeReinterpretationForbidden,
"formative or network constructs cannot be reinterpreted as reflective",
),
(
PsychometricFitError::UnresolvedConstruct,
"construct class is unresolved",
),
] {
assert_eq!(error.to_string(), message);
}
}
}
Loading
Loading