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
6 changes: 1 addition & 5 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,10 @@ boundaries above remain the target modular MSA architecture.
| `persistence_postgres` | PostgreSQL repositories and migrations |
| `corpus_split` | cutoff-safe, relation-aware partitioning |
| `tepp_simulation` | known-truth temporal/event data generation |
| `validation_core` | RMSE, bias, coverage, graph, and Monte Carlo metrics |
| `validation_core` | RMSE, bias, coverage, graph, Monte Carlo, and exact-head claim-promotion metrics |
| `tepp_api` | versioned DTO, schema, terminal-result, and export contracts |
| `analysis_engine` | bounded cutoff-safe temporal evidence readiness execution and digest-bound terminal artifacts |
| `location_membership` | location is not entity identity and not a language channel |
| `validation_core` | RMSE, bias, coverage, graph, Monte Carlo, and exact-head claim-promotion metrics |
| `tepp_api` | versioned DTO, schema, and export contracts |
| `episode_membership` | event-time episode membership containment gate |
| `location_membership` | location is not entity identity and not a language channel |
| `prompt_source` | prompt boilerplate is not unique latent content and not stopword deletion |
| `corpus_background` | corpus-background wording is not unique latent content and not stopword deletion |
| `modality_source` | non-lexical modality is not unique latent content and not stopword deletion |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang

## [Unreleased]

- Repaired post-consolidation merge fallout that left protected `main` red: restored the lost `return True` in the `check_coverage.py` match-guard branch, removed the shadowed duplicate `load_union_branch_totals` and `_is_multiline_match_guard` definitions plus duplicate workspace-crate entries (`episode_membership`, `analysis_engine`) from the contract tuple and Cargo member arrays, split two union-fused four-tuples back into `(variant, message)` pairs in the `event_core` error table, repaired the fused `identity_recovery_rate` body in `episode_membership::window`, deduplicated the checked-arithmetic eligible-count block in `analysis_engine`, fixed four-argument `unit()` test call sites, rebalanced the README crate-list fence around all 54 unique crates, and deduplicated the `location_membership`/`validation_core`/`tepp_api` architecture-table rows. Also documents private `PLAUSIBLE_IMAGE_MEDIA_TYPES` so `cargo doc -D warnings` passes.
- Branch coverage JSON now unique-folds `files[].branches` True/False counts across instantiations. Nightly totals on #49 head `1e3e2eb` reported `event_time.rs` 505/506 while every unique site had both arms taken (253 sites × 2 instantiations). Summary-only reports without branch arrays still fail closed on totals. The 100% contract is unique production arms, matching the LCOV authored-line gate. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation.
- `psychometric_core` maps overflowing `expm1(a Δt)` / `expm1(2 a Δt)` in `recover_discrete_constant_predictor_effect` and `recover_discrete_process_noise` through the log-space rewrite without a redundant `if !argument.is_finite()` after overflow. Local crate llvm-cov on #49 head `559e7b399473ee90ba3234677dd9ef7f05f7fd2e` was 509/510: the same LLVM `exp`/`expm1` finite-argument proof as L768/L5040. Existing rewrite (`a = 800` / `a = 400`) and overflow (`a = 1e308`) tests remain the contract. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation.
- `psychometric_core` maps overflowing `e^{a Δt}` / `e^{a(t−u)}` through the log-space rewrite without redundant `if !argument.is_finite()` after `exp` overflow on lagged covariance, T0 TI/TD carry, and impulse carry. Nightly branch coverage on #49 head `7e669babcc54408dd8407bbac56be0f304fa99e5` was 1713/1714: LLVM counted `event_time.rs` L5040 True and treated the finite-argument overflow False as uncovered after proving `exp` of a finite argument is finite, which binary64 overflow falsifies. `fit_scalar_log_rate` now also skips a zero earlier residual and a negative lag while still recovering from a valid pair. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation.
Expand Down
21 changes: 21 additions & 0 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ members = [
"crates/checkpoint_authority",
"crates/episode_membership",
"crates/compute_backend",
"crates/episode_membership",
"crates/membership_target",
"crates/analysis_engine",
"crates/topic_measurement",
"crates/analysis_engine",
"crates/psychometric_core",
]
default-members = [
Expand Down Expand Up @@ -111,11 +109,9 @@ default-members = [
"crates/checkpoint_authority",
"crates/episode_membership",
"crates/compute_backend",
"crates/episode_membership",
"crates/membership_target",
"crates/analysis_engine",
"crates/topic_measurement",
"crates/analysis_engine",
"crates/psychometric_core",
]

Expand Down
92 changes: 7 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ API exchange, compute planning, or evidence-grounded interpretation. Numerical
and psychometric authority remains on the CPU `f64` reference path; streamed
accelerator plans must preserve the full observation set and fail closed to the
reference path when resources or validation are insufficient.
The repository currently implements 53 independently documented crates rather
than a full commercial release. The implemented crates include topic measurement
and the analysis engine; they do not claim a complete commercial estimator,
The repository currently implements 54 independently documented crates rather
than a full commercial release. The implemented crates include topic
measurement, the analysis engine, and psychometric input/recovery gates; they
do not claim a complete commercial estimator,
Comment on lines +28 to +31

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 README states two different crate counts

The updated text says the repository implements 54 crates, while README.md still says the workspace contains 50. The enumerated fence lists 54, so the older count is stale and the two statements contradict each other.

Prompt for agents
README.md contains two conflicting crate counts. Line 21 says "The current workspace contains 50 independently documented Rust crates" while line 28 (updated in this PR) says "The repository currently implements 54 independently documented crates". The alphabetical crate-list fence enumerates 54 crates, matching the deduplicated Cargo.toml and check_workspace_contract.py EXPECTED_CRATES. Update the stale "50" on line 21 to "54" so the document is internally consistent.
Open in Devin Review

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

operator workspace, or supported release.

- `topic_measurement`: the first production topic-measurement crate. It
Expand All @@ -40,47 +41,16 @@ operator workspace, or supported release.
estimator contract; persists the run with the six TEPP clocks; and emits a
typed terminal result. The crate does not claim buyer-visible product
completeness.
- `psychometric_core`: validated statistical-recovery APIs on already-mapped
coordinates. It does not implement a full ESEM/DSEM estimator.

```text
crates/analysis_engine
These are production contracts, not a claim that the complete commercial
estimator, operator workspace, or supported release already exists. Read the
[product and technical gap baseline](docs/product-technical-gap-baseline.md)
before treating a crate as a shipped product capability.
This branch keeps the Rust workspace quality foundation and the bounded
foundation crates. Domain crates expose only tested contracts: immutable
evidence, six-clock temporal values, event mentions/instances, relations,
membership, persistence, splits, simulation, validation, API DTOs, and the
predicted-versus-observed promotion gate.
This branch establishes the Rust workspace, quality-gate foundation, and the
longitudinal within/between decomposition capability. The workspace bounded crates
compile independently. `longitudinal_core` exposes within/between decomposition
and component RMSE APIs; the remaining crates expose no placeholder production
APIs, and domain behavior for them begins in Task 2 with immutable evidence
identifiers and source records.
This branch establishes the Task 1 Rust workspace and quality-gate foundation.
The workspace bounded crates compile independently but intentionally expose no
The workspace bounded crates compile independently; Task 1 includes the
The twelve bounded crates compile independently but intentionally expose no
The eleven bounded crates compile independently; Task 1 includes the
implemented `encrypted_mapping` crate with AES-256-GCM sealing and
purpose-bound opening, while the remaining domain behavior begins in Task 2
with immutable evidence identifiers and source records.
The workspace bounded crates compile independently. `derived_sensitivity` inherits
source Restricted/Internal classes onto topic, factor, and relation artifacts
and fails closed on unknown kinds; derivation and blanket PII masking are not
declassification. Other crates still begin domain behavior in Task 2 with
immutable evidence identifiers and source records.
The workspace bounded crates compile independently but intentionally expose no

The eleven bounded crates compile independently but intentionally expose no
placeholder production APIs. Domain behavior begins in Task 2 with immutable
evidence identifiers and source records.
This branch establishes the Rust workspace and quality-gate foundation. The
bounded crates compile independently. Domain crates expose only validated
production APIs; placeholder surfaces are prohibited.

```text
crates/analysis_engine
crates/assertion_clock
crates/available_clock
crates/checkpoint_authority
Expand All @@ -96,46 +66,6 @@ crates/document_clocks
crates/encrypted_mapping
crates/episode_membership
crates/event_clock
crates/evidence_core
crates/semantic_core
crates/temporal_core
crates/event_core
crates/evidence_core
crates/inferred_status
crates/intake_authorization
crates/interpretation_gateway
crates/location_membership
crates/longitudinal_core
crates/membership_core
crates/membership_target
crates/modality_source
crates/model_selection
crates/network_analysis
crates/operational_log
crates/outcome_order
crates/payload_bound
crates/persistence_postgres
crates/corpus_split
crates/tepp_simulation
crates/validation_core
crates/tepp_api
crates/analysis_engine
crates/episode_membership
crates/location_membership
crates/prediction_contradiction
crates/prompt_source
crates/provider_receipt
crates/corpus_background
crates/modality_source
crates/copied_text
crates/copy_identity
crates/corpus_background
crates/corpus_split
crates/cutoff_clock
crates/derived_sensitivity
crates/document_clocks
crates/encrypted_mapping
crates/event_clock
crates/event_core
crates/evidence_core
crates/inferred_status
Expand All @@ -161,7 +91,6 @@ crates/relation_graph
crates/retrospective_edge
crates/revision_order
crates/semantic_core
crates/operational_log
crates/service_tls
crates/stopword_deletion
crates/style_source
Expand All @@ -175,13 +104,6 @@ crates/tepp_simulation
crates/topic_lineage
crates/topic_measurement
crates/validation_core
crates/network_analysis
crates/interpretation_gateway
crates/model_selection
crates/checkpoint_authority
crates/compute_backend
crates/episode_membership
crates/membership_target

```

Expand Down
11 changes: 4 additions & 7 deletions crates/analysis_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,6 @@ pub fn execute_analysis_run(
sum.checked_add(u64::from(unit.membership_count))
.ok_or(AnalysisEngineError::ArithmeticOverflow)
})?;
// The corpus bound makes this conversion and sum strictly smaller than
// `u64::MAX`: 100,000 * u32::MAX is below the 64-bit range.
let eligible_evidence_count = eligible.len() as u64;
let eligible_membership_count = eligible
.iter()
.fold(0_u64, |sum, unit| sum + u64::from(unit.membership_count));
let (earliest, latest) = eligible.iter().fold(
(eligible[0].event_time, eligible[0].event_time),
|(earliest, latest), unit| (earliest.min(unit.event_time), latest.max(unit.event_time)),
Expand Down Expand Up @@ -387,7 +381,6 @@ mod tests {
use super::{
ANALYSIS_ARTIFACT_SCHEMA_VERSION, ANALYSIS_STATISTIC_COUNT, AnalysisCorpus,
AnalysisEngineError, AnalysisEvidenceUnit, MAX_ANALYSIS_IDENTIFIER_BYTES,
MAX_EVIDENCE_UNITS, execute_analysis_run,
MAX_EVIDENCE_UNITS, TopicMeasurementError, execute_analysis_run,
};
use temporal_core::{AvailableTime, EventTime};
Expand Down Expand Up @@ -539,6 +532,7 @@ mod tests {
vec![unit(
"evidence-1",
"2026-07-01T00:00:00Z",
"2026-07-01T00:00:00Z",
1,
)],
)
Expand All @@ -554,6 +548,7 @@ mod tests {
vec![unit(
"evidence-1",
"2026-07-01T00:00:00Z",
"2026-07-01T00:00:00Z",
1,
)],
)
Expand Down Expand Up @@ -594,6 +589,7 @@ mod tests {
let evidence = unit(
"evidence-accessor",
"2026-07-01T00:00:00Z",
"2026-07-01T00:00:00Z",
4,
);
assert_eq!(evidence.evidence_id(), "evidence-accessor");
Expand Down Expand Up @@ -668,6 +664,7 @@ mod tests {
vec![unit(
"evidence-1",
"2026-07-01T00:00:00Z",
"2026-07-01T00:00:00Z",
1,
)],
)
Expand Down
6 changes: 0 additions & 6 deletions crates/episode_membership/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ pub fn identity_recovery_rate(
if truth.is_empty() || truth.len() != decided.len() {
return Err(EpisodeMembershipError::InvalidEpisodePayload);
}
let matches = truth
.iter()
.zip(decided)
.filter(|(truth_flag, decided_flag)| truth_flag == decided_flag)
.count();
Ok(matches as f64 / truth.len() as f64)
let matches = count_matching_decisions(truth.iter().copied().zip(decided.iter().copied()));
Ok(recovery_rate_from_tally(matches, truth.len()))
}
Expand Down
4 changes: 4 additions & 0 deletions crates/event_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,16 @@ mod tests {
(
EventError::UnknownEventLinkLabel,
"unknown event link label",
),
(
EventError::FirstStoryIsNotEventInstance,
"first-story detection is not an event instance",
),
(
EventError::UnknownFirstStoryLabel,
"unknown first-story label",
),
(
EventError::EventTrackIsNotEventInstance,
"event track is not an event instance",
),
Expand Down
5 changes: 4 additions & 1 deletion crates/evidence_core/src/image_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const BASE64_MARK: &str = ";base64,";

/// Image media types accepted as plausible by [`embedded_image_units`].
///
/// Kept private by design; the accepted set is surfaced only through the
/// parse contract of [`embedded_image_units`].
///
/// The set is deliberately conservative and tracks widely registered or
/// de facto standard image subtypes; anything else fails closed instead of
/// yielding a bogus embedded-image unit.
Expand Down Expand Up @@ -51,7 +54,7 @@ impl<'document> EmbeddedImageUnit<'document> {
/// Locate `data:image/<type>;base64,...` units and retain their original spans.
///
/// Only plausible image media types are accepted: a candidate URI whose
/// declared media type is not in [`PLAUSIBLE_IMAGE_MEDIA_TYPES`] fails the
/// declared media type is not in the plausible-image set fails the
/// whole parse so malformed bodies cannot produce bogus units.
///
/// # Errors
Expand Down
3 changes: 3 additions & 0 deletions crates/persistence_postgres/src/entity_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ mod tests {
"author;role".into(),
"author\\".into(),
"author\nrole".into(),
// Uppercase bytes pass the alphanumeric gate yet fail the lowercase
// gate, so this exercises the final clause of the validation chain.
"AUTHOR".into(),
"a".repeat(129),
] {
assert_eq!(
Expand Down
3 changes: 3 additions & 0 deletions crates/persistence_postgres/src/project_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ mod tests {
"active;closed".into(),
"active\\".into(),
"active\nclosed".into(),
// Uppercase bytes pass the alphanumeric gate yet fail the lowercase
// gate, so this exercises the final clause of the validation chain.
"ACTIVE".into(),
"s".repeat(129),
] {
assert_eq!(
Expand Down
Loading
Loading