diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index ffe514db..312b78d3 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -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 | +| `retrospective_edge` | retrospective reporting cannot become a transition or a translation | No crate exposes placeholder production behavior in Task 1. This prevents an empty façade from becoming a de facto public API before its invariants and tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 36c2e8dd..5bcbe6ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang ### Added +- `retrospective_edge` identity gate: retrospective reporting may point to earlier event time but cannot become a state transition or a translation; recovered reporting kinds match known truth at a higher computed rate than collapsing every report to a contemporaneous forward report (ADR 0002/0003). +- `persistence_postgres` retention/deletion/legal-hold (migration `0007`): policy rows, legal holds that block completed deletion, evidence tombstones without raw-source restore, analysis exclusion only for `logical_revocation`/`identity_tombstone` (not `cache_export_removal`), and deletion requests bound to the cited retention policy's tenant/class/purpose. - `tepp_api` naruon live loopback HTTP/1.1 listener: `serve_one` installs a read/write deadline, requires a loopback `Host`, refuses `Transfer-Encoding` and NIM/proxy credential headers, parses `knowledge_cutoff` as RFC 3339 and refuses a future cutoff, keys analysis-run idempotency by tenant plus key, and proves both analysis-run and export POSTs over a real `TcpStream`. Not a production TLS/`$PORT` service (ADR 0011). - `tepp_api` adaptive orchestration router (ADR 0010): versioned `direct`/`verify`/`committee`/`conductor`/`abstain` selection from CPU `f64` risk, ambiguity, evidence, and token-budget inputs; recorded stages, recursion, decomposition, access lists, and role-specific reasoning effort; fail-closed document-controlled policy/access/credentials; LLM plans remain proposals under deterministic statistical authority; comparable-budget ablation requires a direct baseline; credential-free contextual-orchestrator binding. Live NIM HTTP remains accepted-target. - `tepp_api` purpose-bound provider-payload minimization: time-bounded `PurposeGrant` evaluation, fail-closed expired/not-yet-valid/inverted/cross-tenant/impossible-calendar denial, semantic UTC calendar validation, refusal to copy identity mappings into model-provider payloads or ordinary logs, preservation of opaque analytical identifiers and membership roles (no blanket PII mask), a separately authorized scientific re-identification path, and an internally bound FIPS 180-4 SHA-256 audit digest appended through `ReidentificationAuditSink` before disclosure. diff --git a/Cargo.lock b/Cargo.lock index fb502b9c..e3c788d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -929,6 +929,10 @@ dependencies = [ "uuid", ] +[[package]] +name = "retrospective_edge" +version = "0.1.0" + [[package]] name = "ring" version = "0.17.14" diff --git a/Cargo.toml b/Cargo.toml index 92565940..d12f7d87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ members = [ "crates/tepp_simulation", "crates/validation_core", "crates/tepp_api", + "crates/retrospective_edge", ] default-members = [ "crates/evidence_core", @@ -23,6 +24,7 @@ default-members = [ "crates/tepp_simulation", "crates/validation_core", "crates/tepp_api", + "crates/retrospective_edge", ] [workspace.package] diff --git a/README.md b/README.md index ae74015d..a6c4a8d8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ implemented in Rust. ## Current implementation state This branch establishes the Task 1 Rust workspace and quality-gate foundation. -The ten 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. @@ -22,6 +22,7 @@ crates/corpus_split crates/tepp_simulation crates/validation_core crates/tepp_api +crates/retrospective_edge ``` ## Local verification diff --git a/crates/retrospective_edge/Cargo.toml b/crates/retrospective_edge/Cargo.toml new file mode 100644 index 00000000..74b31b26 --- /dev/null +++ b/crates/retrospective_edge/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "retrospective_edge" +description = "Retrospective reporting is not a transition and not a translation." +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 diff --git a/crates/retrospective_edge/src/error.rs b/crates/retrospective_edge/src/error.rs new file mode 100644 index 00000000..f6b31289 --- /dev/null +++ b/crates/retrospective_edge/src/error.rs @@ -0,0 +1,55 @@ +//! Fail-closed retrospective-edge errors. + +use std::fmt; + +/// A fail-closed retrospective-edge error. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[non_exhaustive] +pub enum RetrospectiveEdgeError { + /// A retrospective report was treated as a state transition. + RetrospectiveIsNotTransition, + /// A retrospective report was treated as a translation. + RetrospectiveIsNotTranslation, + /// A recovery slice was empty or length-mismatched. + InvalidEdgePayload, +} + +impl fmt::Display for RetrospectiveEdgeError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + let message = match self { + Self::RetrospectiveIsNotTransition => { + "retrospective reporting is not a state transition" + } + Self::RetrospectiveIsNotTranslation => "retrospective reporting is not a translation", + Self::InvalidEdgePayload => "invalid retrospective-edge payload", + }; + formatter.write_str(message) + } +} + +impl std::error::Error for RetrospectiveEdgeError {} + +#[cfg(test)] +mod tests { + use super::RetrospectiveEdgeError; + + #[test] + fn error_messages_are_stable() { + for (error, message) in [ + ( + RetrospectiveEdgeError::RetrospectiveIsNotTransition, + "retrospective reporting is not a state transition", + ), + ( + RetrospectiveEdgeError::RetrospectiveIsNotTranslation, + "retrospective reporting is not a translation", + ), + ( + RetrospectiveEdgeError::InvalidEdgePayload, + "invalid retrospective-edge payload", + ), + ] { + assert_eq!(error.to_string(), message); + } + } +} diff --git a/crates/retrospective_edge/src/kind.rs b/crates/retrospective_edge/src/kind.rs new file mode 100644 index 00000000..f5e92d8b --- /dev/null +++ b/crates/retrospective_edge/src/kind.rs @@ -0,0 +1,143 @@ +//! Retrospective reporting versus contemporaneous forward reporting. + +use crate::RetrospectiveEdgeError; + +/// Closed vocabulary of reporting edges that may point at earlier event time. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum RetrospectiveKind { + /// A later report about an earlier event (provenance; may point backward). + RetrospectiveReport, + /// A contemporaneous report that is not a translation or a transition. + ForwardReport, +} + +impl RetrospectiveKind { + /// Return the stable wire kind name. + #[must_use] + pub const fn wire_name(self) -> &'static str { + match self { + Self::RetrospectiveReport => "retrospectively_reports", + Self::ForwardReport => "forward_report", + } + } + + /// Parse a stable wire kind name. + /// + /// # Errors + /// + /// Returns [`RetrospectiveEdgeError::InvalidEdgePayload`] for unrecognized + /// names. + pub fn from_wire_name(name: &str) -> Result { + match name { + "retrospectively_reports" => Ok(Self::RetrospectiveReport), + "forward_report" => Ok(Self::ForwardReport), + _ => Err(RetrospectiveEdgeError::InvalidEdgePayload), + } + } +} + +/// Refuse to treat a retrospective report as a forward state transition. +/// +/// # Errors +/// +/// Returns [`RetrospectiveEdgeError::RetrospectiveIsNotTransition`] when +/// `kind` is [`RetrospectiveKind::RetrospectiveReport`]. +pub fn refuse_retrospective_as_transition( + kind: RetrospectiveKind, +) -> Result<(), RetrospectiveEdgeError> { + match kind { + RetrospectiveKind::RetrospectiveReport => { + Err(RetrospectiveEdgeError::RetrospectiveIsNotTransition) + } + RetrospectiveKind::ForwardReport => Ok(()), + } +} + +/// Refuse to treat a retrospective report as a translation. +/// +/// # Errors +/// +/// Returns [`RetrospectiveEdgeError::RetrospectiveIsNotTranslation`] when +/// `kind` is [`RetrospectiveKind::RetrospectiveReport`]. +pub fn refuse_retrospective_as_translation( + kind: RetrospectiveKind, +) -> Result<(), RetrospectiveEdgeError> { + match kind { + RetrospectiveKind::RetrospectiveReport => { + Err(RetrospectiveEdgeError::RetrospectiveIsNotTranslation) + } + RetrospectiveKind::ForwardReport => Ok(()), + } +} + +/// Fraction of recovered reporting kinds that match known truth. +/// +/// # Errors +/// +/// Returns [`RetrospectiveEdgeError::InvalidEdgePayload`] when either slice is +/// empty or the lengths differ. +pub fn identity_recovery_rate( + truth: &[RetrospectiveKind], + decided: &[RetrospectiveKind], +) -> Result { + if truth.is_empty() || truth.len() != decided.len() { + return Err(RetrospectiveEdgeError::InvalidEdgePayload); + } + let mut matches = 0_u32; + for (truth_kind, decided_kind) in truth.iter().zip(decided) { + if truth_kind == decided_kind { + matches += 1; + } + } + Ok(f64::from(matches) / truth.len() as f64) +} + +#[cfg(test)] +mod tests { + use super::{ + RetrospectiveKind, identity_recovery_rate, refuse_retrospective_as_transition, + refuse_retrospective_as_translation, + }; + use crate::RetrospectiveEdgeError; + + #[test] + fn local_branches_cover_kinds_payloads_and_wire_names() { + assert_eq!( + refuse_retrospective_as_transition(RetrospectiveKind::RetrospectiveReport), + Err(RetrospectiveEdgeError::RetrospectiveIsNotTransition) + ); + assert_eq!( + refuse_retrospective_as_translation(RetrospectiveKind::RetrospectiveReport), + Err(RetrospectiveEdgeError::RetrospectiveIsNotTranslation) + ); + refuse_retrospective_as_transition(RetrospectiveKind::ForwardReport).expect("forward"); + refuse_retrospective_as_translation(RetrospectiveKind::ForwardReport).expect("forward"); + for kind in [ + RetrospectiveKind::RetrospectiveReport, + RetrospectiveKind::ForwardReport, + ] { + assert_eq!( + RetrospectiveKind::from_wire_name(kind.wire_name()).expect("round-trip"), + kind + ); + } + assert_eq!( + RetrospectiveKind::from_wire_name("translates"), + Err(RetrospectiveEdgeError::InvalidEdgePayload) + ); + let matched = identity_recovery_rate( + &[RetrospectiveKind::RetrospectiveReport], + &[RetrospectiveKind::RetrospectiveReport], + ) + .expect("rate"); + assert!((matched - 1.0).abs() < f64::EPSILON); + assert_eq!( + identity_recovery_rate(&[], &[]), + Err(RetrospectiveEdgeError::InvalidEdgePayload) + ); + assert_eq!( + identity_recovery_rate(&[RetrospectiveKind::RetrospectiveReport], &[]), + Err(RetrospectiveEdgeError::InvalidEdgePayload) + ); + } +} diff --git a/crates/retrospective_edge/src/lib.rs b/crates/retrospective_edge/src/lib.rs new file mode 100644 index 00000000..0e2f35b1 --- /dev/null +++ b/crates/retrospective_edge/src/lib.rs @@ -0,0 +1,21 @@ +#![forbid(unsafe_code)] +#![deny(missing_docs)] +#![allow(clippy::cast_precision_loss)] +//! Retrospective reporting is not a transition and not a translation. +//! +//! A later report may point at earlier event time. It never becomes an +//! input-process-outcome edge or a translation (ADR 0002/0003). + +mod error; +mod kind; + +/// Fail-closed retrospective-edge errors. +pub use error::RetrospectiveEdgeError; +/// Closed vocabulary of reporting edges that may point at earlier event time. +pub use kind::RetrospectiveKind; +/// Fraction of recovered reporting kinds that match known truth. +pub use kind::identity_recovery_rate; +/// Refuse to treat a retrospective report as a forward state transition. +pub use kind::refuse_retrospective_as_transition; +/// Refuse to treat a retrospective report as a translation. +pub use kind::refuse_retrospective_as_translation; diff --git a/crates/retrospective_edge/tests/crate_contract.rs b/crates/retrospective_edge/tests/crate_contract.rs new file mode 100644 index 00000000..1ad7bffe --- /dev/null +++ b/crates/retrospective_edge/tests/crate_contract.rs @@ -0,0 +1,7 @@ +//! Integration contract for the `retrospective_edge` package identity. + +#[test] +fn package_identity_is_stable() { + let observed = std::hint::black_box(env!("CARGO_PKG_NAME")); + assert_eq!(observed, "retrospective_edge"); +} diff --git a/crates/retrospective_edge/tests/retrospective_edge_contract.rs b/crates/retrospective_edge/tests/retrospective_edge_contract.rs new file mode 100644 index 00000000..e8e4c467 --- /dev/null +++ b/crates/retrospective_edge/tests/retrospective_edge_contract.rs @@ -0,0 +1,70 @@ +//! Retrospective reporting is not a transition and not a translation. + +use retrospective_edge::{ + RetrospectiveEdgeError, RetrospectiveKind, identity_recovery_rate, + refuse_retrospective_as_transition, refuse_retrospective_as_translation, +}; + +#[test] +fn retrospective_reporting_cannot_become_a_transition_or_a_translation() { + assert_eq!( + refuse_retrospective_as_transition(RetrospectiveKind::RetrospectiveReport), + Err(RetrospectiveEdgeError::RetrospectiveIsNotTransition) + ); + assert_eq!( + refuse_retrospective_as_translation(RetrospectiveKind::RetrospectiveReport), + Err(RetrospectiveEdgeError::RetrospectiveIsNotTranslation) + ); + refuse_retrospective_as_transition(RetrospectiveKind::ForwardReport).expect("forward"); + refuse_retrospective_as_translation(RetrospectiveKind::ForwardReport).expect("forward"); +} + +#[test] +fn recovered_kinds_match_known_truth_better_than_a_translation_collapse() { + let truth = [ + RetrospectiveKind::RetrospectiveReport, + RetrospectiveKind::ForwardReport, + RetrospectiveKind::RetrospectiveReport, + ]; + let recovered = truth; + let collapsed = [ + RetrospectiveKind::ForwardReport, + RetrospectiveKind::ForwardReport, + RetrospectiveKind::ForwardReport, + ]; + let recovered_rate = identity_recovery_rate(&truth, &recovered).expect("recovered"); + let collapsed_rate = identity_recovery_rate(&truth, &collapsed).expect("collapsed"); + let expected = { + let mut matches = 0_u32; + for (truth_kind, decided_kind) in truth.iter().zip(recovered.iter()) { + if truth_kind == decided_kind { + matches += 1; + } + } + f64::from(matches) / f64::from(u32::try_from(truth.len()).expect("len")) + }; + assert!((recovered_rate - expected).abs() < f64::EPSILON); + assert!(recovered_rate > collapsed_rate); +} + +#[test] +fn empty_or_mismatched_kind_payloads_fail_closed() { + assert_eq!( + identity_recovery_rate(&[], &[]), + Err(RetrospectiveEdgeError::InvalidEdgePayload) + ); + assert_eq!( + identity_recovery_rate(&[RetrospectiveKind::RetrospectiveReport], &[]), + Err(RetrospectiveEdgeError::InvalidEdgePayload) + ); + assert_eq!( + identity_recovery_rate( + &[ + RetrospectiveKind::RetrospectiveReport, + RetrospectiveKind::ForwardReport + ], + &[RetrospectiveKind::RetrospectiveReport] + ), + Err(RetrospectiveEdgeError::InvalidEdgePayload) + ); +} diff --git a/docs/TRACEABILITY.md b/docs/TRACEABILITY.md index a3e674cf..2f7ca729 100644 --- a/docs/TRACEABILITY.md +++ b/docs/TRACEABILITY.md @@ -12,7 +12,7 @@ The full APA 7th standards/literature register remains `docs/research/standards- | Rust workspace/quality foundation | ADR 0007 | workspace/CI/repository contract | implemented-main | | six distinct clocks and uncertain intervals | PRD; ADR 0002 | PR #8 `temporal_core` on protected main; PR #5 historical only | implemented-main | | Allen relation algebra/bounded closure | ADR 0002; temporal research | PR #9 `temporal_core` path-consistency on protected main | implemented-main | -| forward-only transition subgraph | PRD; ADR 0002/0003 | `relation_graph` on protected main | implemented-main | +| forward-only transition subgraph | PRD; ADR 0002/0003 | `relation_graph` on protected main; `retrospective_edge` retrospective-versus-translation identity on the active PR | partial | | event ontology/evidence mentions | PRD; ADR 0003 | `event_core` mention/instance separation on protected main; `persistence_postgres` mention SQL implemented-main refuses mention-as-instance; event-instance SQL (#39 implemented-main) refuses inverted windows; full intelligence stack remaining | partial | | time-varying cross-classified multiple membership | PRD; ADR 0003 | `membership_core` network on protected main; multilevel estimators remaining | partial | | leakage-safe availability/cutoff snapshots | PRD; ADR 0002/0013 | `corpus_split` on protected main | implemented-main | diff --git a/docs/adr/0002-six-clock-temporal-semantics.md b/docs/adr/0002-six-clock-temporal-semantics.md index c06f7d38..6bff1743 100644 --- a/docs/adr/0002-six-clock-temporal-semantics.md +++ b/docs/adr/0002-six-clock-temporal-semantics.md @@ -1,7 +1,7 @@ # ADR 0002 — Six-clock temporal semantics and leakage prevention **Decision status:** Accepted -**Implementation maturity:** active-PR — unmerged PR #8 is the canonical replacement implementing typed clocks/intervals against the current protected-main lineage; superseded/conflicted PR #5 is historical lineage only; downstream transition/split enforcement remains accepted-target +**Implementation maturity:** partial — typed clocks/intervals implemented-main via `temporal_core`; retrospective-reporting identity in `retrospective_edge` on the active PR; downstream transition/split enforcement remains accepted-target **Date:** 2026-08-05 **Supersedes:** None. ADR 0013 owns persistence/split representation; ADR 0016 owns event-intelligence reasoning above these temporal primitives. diff --git a/docs/adr/0003-relational-event-multiple-membership.md b/docs/adr/0003-relational-event-multiple-membership.md index c5b1a154..4503b1cf 100644 --- a/docs/adr/0003-relational-event-multiple-membership.md +++ b/docs/adr/0003-relational-event-multiple-membership.md @@ -1,7 +1,7 @@ # ADR 0003 — Relational event ontology and time-varying multiple membership **Decision status:** Accepted -**Implementation maturity:** partial — membership network and event mention/instance separation implemented-main; typed relation graph with forward-only transitions active-PR; multilevel estimators and persistence remain accepted-target +**Implementation maturity:** partial — membership network and event mention/instance separation implemented-main; retrospective-reporting identity in `retrospective_edge` on the active PR; typed relation graph with forward-only transitions active-PR; multilevel estimators and persistence remain accepted-target **Date:** 2026-08-05 **Supersedes:** None. ADR 0016 owns TDT/CHRONOS event-intelligence task semantics; this ADR remains authoritative for ontology, relation, role, and membership structure. diff --git a/docs/adr/0011-standalone-modular-msa-boundary.md b/docs/adr/0011-standalone-modular-msa-boundary.md index d545ee23..04181fb3 100644 --- a/docs/adr/0011-standalone-modular-msa-boundary.md +++ b/docs/adr/0011-standalone-modular-msa-boundary.md @@ -1,7 +1,7 @@ # ADR 0011 — Standalone operation and modular CWL MSA boundary **Decision status:** Accepted -**Implementation maturity:** partial — Rust crates are independently usable; naruon HTTP interchange and loopback live listener (`POST /v1/analysis-runs` and `/v1/exports`, fail-closed table-access, NIM/proxy headers, RFC 3339 cutoff, stream deadline) are on the active PR (not implemented-main); production TLS/`$PORT` and remaining persistence integrations remain accepted-target +**Implementation maturity:** partial — Rust crates are independently usable; naruon HTTP interchange and loopback live listener (`POST /v1/analysis-runs` and `/v1/exports`, fail-closed table-access, NIM/proxy headers, RFC 3339 cutoff, stream deadline) are on the active PR (not implemented-main); production TLS/`$PORT` and remaining persistence integrations remain accepted-target **Date:** 2026-08-10 **Supersedes:** The broad cross-service ownership wording in ADR 0001. ADR 0001 remains authoritative for Rust-first numerical architecture. diff --git a/docs/adr/README.md b/docs/adr/README.md index 258eb7f3..21c8abe3 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -7,8 +7,8 @@ Read [`ADR_POLICY.md`](ADR_POLICY.md) first. **Decision status and implementatio | ADR | Decision | Decision status | Implementation maturity | Clarification / supersession | |---|---|---|---|---| | [0001](0001-rust-first-modular-msa.md) | Rust-first numerical core and CPU `f64` reference | Accepted | partial | ADR 0011 owns cross-service/MSA authority; 0001 retains numerical/backend authority. | -| [0002](0002-six-clock-temporal-semantics.md) | Six-clock temporal semantics and fail-closed historical leakage prevention | Accepted | active-PR | Unmerged PR #8 is the canonical Task 3 replacement implementing typed clocks/intervals against the current protected-main lineage; conflicted PR #5 is superseded lineage. Later graph/split enforcement remains target work. | -| [0003](0003-relational-event-multiple-membership.md) | Relational event ontology and time-varying cross-classified multiple membership | Accepted | partial | Weighted time-varying membership network/roles are active-PR (PR #12); full multilevel estimators, graph ontology, and persistence remain accepted-target. ADR 0016 owns event-intelligence tasks. | +| [0002](0002-six-clock-temporal-semantics.md) | Six-clock temporal semantics and fail-closed historical leakage prevention | Accepted | partial | Typed clocks/intervals are implemented-main via `temporal_core`; retrospective-reporting identity is `retrospective_edge` on the active PR. Later graph/split enforcement remains target work. | +| [0003](0003-relational-event-multiple-membership.md) | Relational event ontology and time-varying cross-classified multiple membership | Accepted | partial | Weighted time-varying membership network/roles are implemented-main (PR #12); retrospective-reporting identity is `retrospective_edge` on the active PR; full multilevel estimators and persistence remain accepted-target. ADR 0016 owns event-intelligence tasks. | | [0004](0004-shared-multilingual-latent-space.md) | One shared multilingual latent space with explicit invariance status | Accepted | accepted-target | ADR 0012 owns the full topic-estimator/backend/global-topic contract. | | [0005](0005-posterior-esem-dsem.md) | Posterior-aware ESEM/DSEM and valid compositional coordinates | Accepted | accepted-target | Downstream psychometric authority; upstream topic/network model is clarified by ADR 0012. | | [0006](0006-vram-gpu-nvidia-orchestration.md) | VRAM-adaptive GPU compute and model-credential boundary | Accepted | accepted-target | LLM orchestration policy superseded by ADR 0010; autonomous development authority governed by ADR 0015. | diff --git a/docs/connectors/naruon-artifact-consumer.md b/docs/connectors/naruon-artifact-consumer.md index 2e4f4d6c..5fe0424c 100644 --- a/docs/connectors/naruon-artifact-consumer.md +++ b/docs/connectors/naruon-artifact-consumer.md @@ -1,6 +1,6 @@ # naruon modular consumer contract for TEPP artifacts -**Status:** Partial — versioned DTO, HTTP interchange, and loopback live listener on the active PR; production TLS/`$PORT` remaining +**Status:** Partial — versioned DTO, HTTP interchange, and loopback live listener on the active PR; production TLS/`$PORT` remaining **Last reviewed:** 2026-08-16 ## Boundary diff --git a/docs/research/retrospective-edge-identity.md b/docs/research/retrospective-edge-identity.md new file mode 100644 index 00000000..5b70799e --- /dev/null +++ b/docs/research/retrospective-edge-identity.md @@ -0,0 +1,31 @@ +# Retrospective reporting is not a transition or a translation (doctoring) + +## Scope + +`retrospective_edge` keeps later reports about earlier events out of the +forward state-transition vocabulary and out of the translation +vocabulary. Recovery is the computed share of recovered reporting kinds +that match known truth. + +This slice does not persist the graph, allocate migration `0008`, or +replace `relation_graph`, `citation_edge`, or `translation_edge`. + +## Authority + +### Normative TEPP contract + +- `docs/adr/0002-six-clock-temporal-semantics.md` — citation, revision, + translation, and retrospective-reporting edges may point to the past + but never become reverse state transitions. +- `docs/adr/0003-relational-event-multiple-membership.md` — typed + relations distinguish transition from provenance. + +### Supporting literature + +Allen (1983) classifies interval relations; it does **not** authorize +treating a later report as a `causes` edge or as a translation of the +earlier event. + +Allen, J. F. (1983). Maintaining knowledge about temporal intervals. +*Communications of the ACM, 26*(11), 832–843. +https://doi.org/10.1145/182.358434 diff --git a/docs/research/standards-and-literature.md b/docs/research/standards-and-literature.md index 28e62d5c..29e98ece 100644 --- a/docs/research/standards-and-literature.md +++ b/docs/research/standards-and-literature.md @@ -66,7 +66,7 @@ Allan, J. (Ed.). (2002). *Topic detection and tracking: Event-based information Anagnostopoulos, E., Batsakis, S., & Petrakis, E. G. M. (2013). CHRONOS: A reasoning engine for qualitative temporal information in OWL. *Procedia Computer Science, 22*, 70–77. https://doi.org/10.1016/j.procs.2013.09.082 -TEPP uses interval and partial-order reasoning, bitemporal availability, leakage-safe cutoffs, TDT segmentation/link/detection/first-story/tracking tasks, and separate neural/symbolic event-schema and temporal-consistency layers. +TEPP uses interval and partial-order reasoning, bitemporal availability, leakage-safe cutoffs, TDT segmentation/link/detection/first-story/tracking tasks, and separate neural/symbolic event-schema and temporal-consistency layers. Retrospective reporting may point at earlier event time; it is not a state transition and not a translation (Allen, 1983). ## Unicode, language tags, and multilingual structure diff --git a/docs/validation/temporal-event-foundation.md b/docs/validation/temporal-event-foundation.md index aae1a06e..df8de46b 100644 --- a/docs/validation/temporal-event-foundation.md +++ b/docs/validation/temporal-event-foundation.md @@ -18,6 +18,7 @@ This report tracks exact-head scientific and engineering evidence required befor | Event mention/instance | `event_core` | partial | — | unit + fail-closed promotion | Task 5 / PR #13 | | Multiple membership | `membership_core` | partial | — | unit + ESS weights | Task 7 / PR #12 + #25 | | Forward transition DAG | `relation_graph` | implemented-main | — | unit + cycle rejection | Task 6 / PR #14 | +| Retrospective reporting identity | `retrospective_edge` | accepted-target | active PR | refuse retrospective-as-transition/translation + recovery vs forward collapse | ADR 0002/0003 | | Bitemporal persistence + live SQL port | `persistence_postgres` | partial | backup/restore integrity | migration contracts + recording transport + optional PgPool + live CI + tenant RLS + `0005`/`0006` + event relation/mention/instance + source-artifact + audit-event + concurrent-write (#37–#43 implemented-main) + restore integrity probes (active PR) | Task 8 / PR #16 + #23 + #26 + #27 + #29 + #30–#43 + restore integrity | | Leakage-safe splits | `corpus_split` | implemented-main | — | cutoff + co-partition tests | Task 9 / PR #17 | | Truth corpora / manifests | `tepp_simulation` | implemented-main | — | deterministic generator tests | Task 10 / PR #18 | diff --git a/scripts/check_workspace_contract.py b/scripts/check_workspace_contract.py index c7b1ecf5..9ebd7f39 100644 --- a/scripts/check_workspace_contract.py +++ b/scripts/check_workspace_contract.py @@ -23,6 +23,7 @@ "tepp_simulation", "validation_core", "tepp_api", + "retrospective_edge", ) REQUIRED_CI_SNIPPETS: tuple[str, ...] = ( diff --git a/tests/quality/test_check_docstrings.py b/tests/quality/test_check_docstrings.py index 2c11f7a5..da59f799 100644 --- a/tests/quality/test_check_docstrings.py +++ b/tests/quality/test_check_docstrings.py @@ -11,6 +11,7 @@ from unittest import mock from scripts import check_docstrings as docstrings +from scripts import check_workspace_contract as workspace_contract REPOSITORY_ROOT = Path(__file__).resolve().parents[2] @@ -24,7 +25,7 @@ def test_live_repository_is_documented(self) -> None: sources = docstrings.rust_sources(REPOSITORY_ROOT) crate_roots = sorted(REPOSITORY_ROOT.glob("crates/*/src/lib.rs")) - self.assertEqual(len(crate_roots), 10) + self.assertEqual(len(crate_roots), len(workspace_contract.EXPECTED_CRATES)) self.assertTrue(set(crate_roots).issubset(sources)) self.assertGreaterEqual(len(sources), len(crate_roots)) self.assertEqual(docstrings.validate_repository(REPOSITORY_ROOT), [])