diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index ffe514db..f8c11f8a 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 | +| `section_source` | report section boilerplate is not unique latent content and not stopword deletion | 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..beded8a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang ### Added +- `section_source` method gate: report section boilerplate is not unique latent content and is not stopword deletion; recovered section kinds match known truth at a higher computed rate than collapsing every token to unique content (ADR 0004/0012). - `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..53863e35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -995,6 +995,10 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "section_source" +version = "0.1.0" + [[package]] name = "serde" version = "1.0.229" diff --git a/Cargo.toml b/Cargo.toml index 92565940..a0bdbb45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ members = [ "crates/tepp_simulation", "crates/validation_core", "crates/tepp_api", + "crates/section_source", ] default-members = [ "crates/evidence_core", @@ -23,6 +24,7 @@ default-members = [ "crates/tepp_simulation", "crates/validation_core", "crates/tepp_api", + "crates/section_source", ] [workspace.package] diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 3f094947..72bf40f1 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -35,6 +35,7 @@ TEPP's approved PRD v0.4 and implementation plan are the primary product baselin | Actions fleet research doctoring | [`docs/research/actions-workflow-fleet.md`](docs/research/actions-workflow-fleet.md) | | Retention/deletion/legal-hold doctoring | [`docs/research/retention-deletion-legal-hold.md`](docs/research/retention-deletion-legal-hold.md) | | Provider-payload minimization doctoring | [`docs/research/provider-payload-minimization.md`](docs/research/provider-payload-minimization.md) | +| Section-source method-effect doctoring | [`docs/research/section-source.md`](docs/research/section-source.md) | | Adaptive orchestration router doctoring | [`docs/research/adaptive-orchestration-router.md`](docs/research/adaptive-orchestration-router.md) | | Hourly NIM OpenCode doctoring | [`docs/doctoring/hourly-nim-opencode-development.md`](docs/doctoring/hourly-nim-opencode-development.md) | | Change history | [`CHANGELOG.md`](CHANGELOG.md) | diff --git a/README.md b/README.md index ae74015d..baf22ac9 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ crates/corpus_split crates/tepp_simulation crates/validation_core crates/tepp_api +crates/section_source ``` ## Local verification diff --git a/crates/section_source/Cargo.toml b/crates/section_source/Cargo.toml new file mode 100644 index 00000000..c4c21540 --- /dev/null +++ b/crates/section_source/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "section_source" +description = "Report section boilerplate is not unique latent content and not stopword deletion." +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/section_source/src/error.rs b/crates/section_source/src/error.rs new file mode 100644 index 00000000..831b8605 --- /dev/null +++ b/crates/section_source/src/error.rs @@ -0,0 +1,53 @@ +//! Fail-closed section-source errors. + +use std::fmt; + +/// A fail-closed section-source error. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[non_exhaustive] +pub enum SectionSourceError { + /// Section boilerplate was treated as unique latent content. + SectionIsNotUniqueContent, + /// Section boilerplate was treated as stopword deletion. + SectionIsNotStopwordDeletion, + /// A recovery slice was empty or length-mismatched. + InvalidSectionPayload, +} + +impl fmt::Display for SectionSourceError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + let message = match self { + Self::SectionIsNotUniqueContent => "section boilerplate is not unique latent content", + Self::SectionIsNotStopwordDeletion => "section boilerplate is not stopword deletion", + Self::InvalidSectionPayload => "invalid section-source payload", + }; + formatter.write_str(message) + } +} + +impl std::error::Error for SectionSourceError {} + +#[cfg(test)] +mod tests { + use super::SectionSourceError; + + #[test] + fn error_messages_are_stable() { + for (error, message) in [ + ( + SectionSourceError::SectionIsNotUniqueContent, + "section boilerplate is not unique latent content", + ), + ( + SectionSourceError::SectionIsNotStopwordDeletion, + "section boilerplate is not stopword deletion", + ), + ( + SectionSourceError::InvalidSectionPayload, + "invalid section-source payload", + ), + ] { + assert_eq!(error.to_string(), message); + } + } +} diff --git a/crates/section_source/src/kind.rs b/crates/section_source/src/kind.rs new file mode 100644 index 00000000..660502c9 --- /dev/null +++ b/crates/section_source/src/kind.rs @@ -0,0 +1,132 @@ +//! Section boilerplate versus unique latent content. + +use crate::SectionSourceError; + +/// Closed vocabulary of section-related token treatments. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum SectionKind { + /// Repeated report section heading or boilerplate. + SectionBoilerplate, + /// Unique document content that is not section structure. + UniqueContent, +} + +impl SectionKind { + /// Return the stable wire kind name. + #[must_use] + pub const fn wire_name(self) -> &'static str { + match self { + Self::SectionBoilerplate => "section_boilerplate", + Self::UniqueContent => "unique_content", + } + } + + /// Parse a stable wire kind name. + /// + /// # Errors + /// + /// Returns [`SectionSourceError::InvalidSectionPayload`] for unrecognized + /// names. + pub fn from_wire_name(name: &str) -> Result { + match name { + "section_boilerplate" => Ok(Self::SectionBoilerplate), + "unique_content" => Ok(Self::UniqueContent), + _ => Err(SectionSourceError::InvalidSectionPayload), + } + } +} + +/// Refuse to treat section boilerplate as unique latent content. +/// +/// # Errors +/// +/// Returns [`SectionSourceError::SectionIsNotUniqueContent`] when `kind` is +/// [`SectionKind::SectionBoilerplate`]. +pub fn refuse_section_as_unique_content(kind: SectionKind) -> Result<(), SectionSourceError> { + match kind { + SectionKind::SectionBoilerplate => Err(SectionSourceError::SectionIsNotUniqueContent), + SectionKind::UniqueContent => Ok(()), + } +} + +/// Refuse to treat section boilerplate as stopword deletion. +/// +/// # Errors +/// +/// Returns [`SectionSourceError::SectionIsNotStopwordDeletion`] when `kind` is +/// [`SectionKind::SectionBoilerplate`]. +pub fn refuse_section_as_stopword_deletion(kind: SectionKind) -> Result<(), SectionSourceError> { + match kind { + SectionKind::SectionBoilerplate => Err(SectionSourceError::SectionIsNotStopwordDeletion), + SectionKind::UniqueContent => Ok(()), + } +} + +/// Fraction of recovered section kinds that match known truth. +/// +/// # Errors +/// +/// Returns [`SectionSourceError::InvalidSectionPayload`] when either slice is +/// empty or the lengths differ. +pub fn identity_recovery_rate( + truth: &[SectionKind], + decided: &[SectionKind], +) -> Result { + if truth.is_empty() || truth.len() != decided.len() { + return Err(SectionSourceError::InvalidSectionPayload); + } + 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::{ + SectionKind, identity_recovery_rate, refuse_section_as_stopword_deletion, + refuse_section_as_unique_content, + }; + use crate::SectionSourceError; + + #[test] + fn local_branches_cover_kinds_payloads_and_wire_names() { + assert_eq!( + refuse_section_as_unique_content(SectionKind::SectionBoilerplate), + Err(SectionSourceError::SectionIsNotUniqueContent) + ); + assert_eq!( + refuse_section_as_stopword_deletion(SectionKind::SectionBoilerplate), + Err(SectionSourceError::SectionIsNotStopwordDeletion) + ); + refuse_section_as_unique_content(SectionKind::UniqueContent).expect("unique"); + refuse_section_as_stopword_deletion(SectionKind::UniqueContent).expect("unique"); + for kind in [SectionKind::SectionBoilerplate, SectionKind::UniqueContent] { + assert_eq!( + SectionKind::from_wire_name(kind.wire_name()).expect("round-trip"), + kind + ); + } + assert_eq!( + SectionKind::from_wire_name("template_source"), + Err(SectionSourceError::InvalidSectionPayload) + ); + let matched = identity_recovery_rate( + &[SectionKind::SectionBoilerplate], + &[SectionKind::SectionBoilerplate], + ) + .expect("rate"); + assert!((matched - 1.0).abs() < f64::EPSILON); + assert_eq!( + identity_recovery_rate(&[], &[]), + Err(SectionSourceError::InvalidSectionPayload) + ); + assert_eq!( + identity_recovery_rate(&[SectionKind::SectionBoilerplate], &[]), + Err(SectionSourceError::InvalidSectionPayload) + ); + } +} diff --git a/crates/section_source/src/lib.rs b/crates/section_source/src/lib.rs new file mode 100644 index 00000000..6979cc91 --- /dev/null +++ b/crates/section_source/src/lib.rs @@ -0,0 +1,22 @@ +#![forbid(unsafe_code)] +#![deny(missing_docs)] +#![allow(clippy::cast_precision_loss)] +//! Report section boilerplate is not unique latent content. +//! +//! Repeated section headings stay explicit method/background structure. They +//! are not unique document meaning and are not erased by a stopword list +//! (ADR 0004/0012). + +mod error; +mod kind; + +/// Fail-closed section-source errors. +pub use error::SectionSourceError; +/// Closed vocabulary of section-related token treatments. +pub use kind::SectionKind; +/// Fraction of recovered section kinds that match known truth. +pub use kind::identity_recovery_rate; +/// Refuse to treat section boilerplate as stopword deletion. +pub use kind::refuse_section_as_stopword_deletion; +/// Refuse to treat section boilerplate as unique latent content. +pub use kind::refuse_section_as_unique_content; diff --git a/crates/section_source/tests/crate_contract.rs b/crates/section_source/tests/crate_contract.rs new file mode 100644 index 00000000..67dcd9a8 --- /dev/null +++ b/crates/section_source/tests/crate_contract.rs @@ -0,0 +1,7 @@ +//! Integration contract for the `section_source` package identity. + +#[test] +fn package_identity_is_stable() { + let observed = std::hint::black_box(env!("CARGO_PKG_NAME")); + assert_eq!(observed, "section_source"); +} diff --git a/crates/section_source/tests/section_source_contract.rs b/crates/section_source/tests/section_source_contract.rs new file mode 100644 index 00000000..0a8ee8ab --- /dev/null +++ b/crates/section_source/tests/section_source_contract.rs @@ -0,0 +1,67 @@ +//! Report section boilerplate is not unique content and not stopword deletion. + +use section_source::{ + SectionKind, SectionSourceError, identity_recovery_rate, refuse_section_as_stopword_deletion, + refuse_section_as_unique_content, +}; + +#[test] +fn a_section_cannot_become_unique_content_or_stopword_deletion() { + assert_eq!( + refuse_section_as_unique_content(SectionKind::SectionBoilerplate), + Err(SectionSourceError::SectionIsNotUniqueContent) + ); + assert_eq!( + refuse_section_as_stopword_deletion(SectionKind::SectionBoilerplate), + Err(SectionSourceError::SectionIsNotStopwordDeletion) + ); + refuse_section_as_unique_content(SectionKind::UniqueContent).expect("unique"); + refuse_section_as_stopword_deletion(SectionKind::UniqueContent).expect("unique"); +} + +#[test] +fn recovered_kinds_match_known_truth_better_than_a_unique_collapse() { + let truth = [ + SectionKind::SectionBoilerplate, + SectionKind::UniqueContent, + SectionKind::SectionBoilerplate, + ]; + let recovered = truth; + let collapsed = [ + SectionKind::UniqueContent, + SectionKind::UniqueContent, + SectionKind::UniqueContent, + ]; + 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(SectionSourceError::InvalidSectionPayload) + ); + assert_eq!( + identity_recovery_rate(&[SectionKind::SectionBoilerplate], &[]), + Err(SectionSourceError::InvalidSectionPayload) + ); + assert_eq!( + identity_recovery_rate( + &[SectionKind::SectionBoilerplate, SectionKind::UniqueContent], + &[SectionKind::SectionBoilerplate] + ), + Err(SectionSourceError::InvalidSectionPayload) + ); +} diff --git a/docs/TRACEABILITY.md b/docs/TRACEABILITY.md index a3e674cf..b58fa5d0 100644 --- a/docs/TRACEABILITY.md +++ b/docs/TRACEABILITY.md @@ -25,7 +25,7 @@ The full APA 7th standards/literature register remains `docs/research/standards- | TRSL-TM temporal/relational topic posterior and backend compatibility | ADR 0012; ADR 0004 | future `topic_measurement` | accepted-target | | global P0 topic identity with activity/dormancy/reactivation | ADR 0012 | future topic lineage/activity state | accepted-target | | no default stopword deletion / no TF-IDF-BM25 inferential weighting | ADR 0004/0012; PRD/TRD | future semantic/method-source model | accepted-target | -| report template/section/copied/style/modality method effects | ADR 0004/0012; PRD/TRD | simulation truth factors implemented; estimator-side method model remains future | partial | +| report template/section/copied/style/modality method effects | ADR 0004/0012; PRD/TRD | `section_source` section-boilerplate gate on the active PR; remaining template/copied/style/modality estimator-side model remains future | partial | | candidate K statistical/Pareto gates + blinded LLM review | ADR 0012; research | future `model_selection` | accepted-target | | compositional topic correlation / stable clustering | ADR 0005/0012; research | future `network_analysis` | accepted-target | | posterior ESEM / longitudinal invariance / DSEM | ADR 0005 | future `psychometric_core` | accepted-target | diff --git a/docs/adr/0004-shared-multilingual-latent-space.md b/docs/adr/0004-shared-multilingual-latent-space.md index c8da25b5..b20daaf0 100644 --- a/docs/adr/0004-shared-multilingual-latent-space.md +++ b/docs/adr/0004-shared-multilingual-latent-space.md @@ -1,7 +1,7 @@ # ADR 0004 — Shared multilingual latent semantic space **Decision status:** Accepted -**Implementation maturity:** accepted-target +**Implementation maturity:** partial — section-boilerplate method source is `section_source` on the active PR; shared-space estimators, language profiles, stopword-deletion and TF-IDF/BM25 inferential-weight refusal remain accepted-target **Date:** 2026-08-05 **Supersedes:** None. ADR 0012 governs the complete topic-estimator/backend/global-topic contract built on this multilingual measurement decision. 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/0012-temporal-relational-shared-latent-topic-measurement.md b/docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md index c3d5085f..c5508a66 100644 --- a/docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md +++ b/docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md @@ -1,7 +1,7 @@ # ADR 0012 — Temporal Relational Shared-Latent Topic Measurement **Decision status:** Accepted -**Implementation maturity:** accepted-target +**Implementation maturity:** partial — section-boilerplate method source is `section_source` on the active PR; topic estimator, global topic identity, remaining method-effect model, and TF-IDF/BM25 inferential-weight refusal remain accepted-target **Date:** 2026-08-12 **Supersedes:** None; refines ADR 0004 and ADR 0005 without replacing their multilingual and psychometric authorities. diff --git a/docs/adr/README.md b/docs/adr/README.md index 258eb7f3..b68befc5 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -9,7 +9,7 @@ Read [`ADR_POLICY.md`](ADR_POLICY.md) first. **Decision status and implementatio | [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. | -| [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. | +| [0004](0004-shared-multilingual-latent-space.md) | One shared multilingual latent space with explicit invariance status | Accepted | partial | Section-boilerplate method source is `section_source` on the active PR; 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. | | [0007](0007-rust-workspace-quality-gates.md) | Explicit Rust workspace, pinned toolchains, and exact quality gates | Accepted | implemented-main | ADR 0014 governs scientific/product claim promotion beyond repository-quality tooling. | @@ -17,7 +17,7 @@ Read [`ADR_POLICY.md`](ADR_POLICY.md) first. **Decision status and implementatio | [0009](0009-purpose-bound-pii-governance.md) | Purpose-bound PII governance without blanket masking | Accepted | partial | Persistence retention/deletion/legal-hold (`0007`) and provider-payload minimization implemented-main; deployment evidence remains accepted-target. | | [0010](0010-adaptive-llm-orchestration.md) | Adaptive LLM orchestration and test-time compute | Accepted | partial | `tepp_api` router/ablation/orchestrator binding on the active PR; live NIM execution and production ablation evidence remain accepted-target. | | [0011](0011-standalone-modular-msa-boundary.md) | Standalone operation and modular CWL MSA boundary | Accepted | partial | Owns cross-service persistence/credential/API authority; no direct cross-service application-table coupling. | -| [0012](0012-temporal-relational-shared-latent-topic-measurement.md) | Temporal Relational Shared-Latent Topic Measurement (TRSL-TM) | Accepted | accepted-target | Owns topic backend compatibility, global topic identity, method effects, K/model-selection prerequisites, and compositional topic coordinates. | +| [0012](0012-temporal-relational-shared-latent-topic-measurement.md) | Temporal Relational Shared-Latent Topic Measurement (TRSL-TM) | Accepted | partial | Section-boilerplate method source is `section_source` on the active PR; topic backend, global topic identity, remaining method effects, K/model-selection, and compositional coordinates remain accepted-target. | | [0013](0013-bitemporal-persistence-reproducibility-and-split-authority.md) | Bitemporal persistence, reproducibility manifests, and relation-aware split authority | Accepted | partial | Owns PostgreSQL adapter semantics, immutable run/split manifests, leakage-safe partitions, and recovery identity; optional `live-sqlx` `PgPool`, live PG CI, tenant RLS, and `0006` membership implemented-main; `0007` retention/deletion/legal-hold on the active PR; remaining physical ERD/backup accepted-target. | | [0014](0014-scientific-claim-promotion-and-release-evidence.md) | Scientific claim promotion and release evidence authority | Accepted | partial | Separates design, implementation, scientific/product claim, and release authority; repository SBOM/provenance generator implemented, full release bundle remaining. | | [0015](0015-autonomous-development-review-and-merge-authority.md) | Autonomous development, review, and merge authority separation | Accepted | active-PR | Separates model proposal, deterministic verification, publication, independent review, and merge/release authority. | 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/section-source.md b/docs/research/section-source.md new file mode 100644 index 00000000..24bf4115 --- /dev/null +++ b/docs/research/section-source.md @@ -0,0 +1,35 @@ +# Report section boilerplate is not unique content (doctoring) + +## Scope + +`section_source` keeps report section headings and other section +boilerplate from being treated as unique latent content or erased by a +stopword list. Recovery is the computed share of recovered section +kinds that match known truth. + +This slice does not persist tokens, allocate migration `0008`, apply +TF-IDF/BM25 inferential weights, or replace `method_effects` or +`stopword_deletion`. + +## Authority + +### Normative TEPP contract + +- `docs/adr/0004-shared-multilingual-latent-space.md` — + repeated template/section/copied wording is modeled as + method/background structure. +- `docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md` — + section effects are explicit method/background structure, not + stopword deletion. + +### Supporting literature + +Chemudugunta, Smyth, and Steyvers (2007) separate general document +wording from specific content. Section headings are general structure +and must not be collapsed into unique latent meaning. + +Chemudugunta, C., Smyth, P., & Steyvers, M. (2007). Modeling general +and specific aspects of documents with a probabilistic topic model. In +B. Schölkopf, J. C. Platt, & T. Hoffman (Eds.), *Advances in neural +information processing systems 19* (pp. 241–248). MIT Press. +https://papers.nips.cc/paper/3048-modeling-general-and-specific-aspects-of-documents-with-a-probabilistic-topic-model diff --git a/docs/research/standards-and-literature.md b/docs/research/standards-and-literature.md index 28e62d5c..0ac7ae32 100644 --- a/docs/research/standards-and-literature.md +++ b/docs/research/standards-and-literature.md @@ -32,7 +32,9 @@ Bianchi, F., Terragni, S., Hovy, D., Nozza, D., & Fersini, E. (2021). Cross-ling Nguyen, T. P., Minh, N. V., Nguyen, T., Van, L. N., Nguyen, D. A., Sang, D. V., & Le, T. (2025). XTRA: Cross-lingual topic modeling with topic and representation alignments. In *Findings of the Association for Computational Linguistics: EMNLP 2025*. Association for Computational Linguistics. -TEPP retains a logistic-normal CPU reference while allowing adapter backends that satisfy shared-latent, posterior, temporal, relational, and measurement-invariance contracts. +Chemudugunta, C., Smyth, P., & Steyvers, M. (2007). Modeling general and specific aspects of documents with a probabilistic topic model. In B. Schölkopf, J. C. Platt, & T. Hoffman (Eds.), *Advances in neural information processing systems 19* (pp. 241–248). MIT Press. https://papers.nips.cc/paper/3048-modeling-general-and-specific-aspects-of-documents-with-a-probabilistic-topic-model + +TEPP retains a logistic-normal CPU reference while allowing adapter backends that satisfy shared-latent, posterior, temporal, relational, and measurement-invariance contracts. Report section headings and other general/boilerplate wording stay explicit method/background structure; `section_source` refuses to treat them as unique latent content or as stopword deletion (Chemudugunta, Smyth, & Steyvers, 2007). ## Topic-model evaluation and LLM judges diff --git a/docs/validation/temporal-event-foundation.md b/docs/validation/temporal-event-foundation.md index aae1a06e..a06c4201 100644 --- a/docs/validation/temporal-event-foundation.md +++ b/docs/validation/temporal-event-foundation.md @@ -23,7 +23,8 @@ This report tracks exact-head scientific and engineering evidence required befor | Truth corpora / manifests | `tepp_simulation` | implemented-main | — | deterministic generator tests | Task 10 / PR #18 | | Recovery metrics | `validation_core` | implemented-main | — | RMSE/bias/coverage/MC gates | Task 11 / PR #19 | | Versioned API/export contracts | `tepp_api` | implemented-main | naruon HTTP interchange | unknown-field/version/limit + naruon HTTPS interchange tests | Task 12 / PR #21; live HTTP service remaining | -| Purpose-bound provider payloads | `tepp_api` | implemented-main | provider-payload minimization | expired/not-yet-valid/inverted/cross-tenant/impossible-calendar grant, mapping refusal, audited elevated re-id replay | ADR 0009; `docs/research/provider-payload-minimization.md` | +| Section boilerplate method source | `section_source` | accepted-target | active PR | refuse section-as-unique/stopword + recovery vs unique collapse | ADR 0004/0012 | +| Purpose-bound provider payloads | `tepp_api` | active-PR | provider-payload minimization | expired/not-yet-valid/inverted/cross-tenant/impossible-calendar grant, mapping refusal, audited elevated re-id replay | ADR 0009; `docs/research/provider-payload-minimization.md` | | Adaptive orchestration router | `tepp_api` | accepted-target | active PR | mode selection, document-control denial, ablation, credential-free bind | ADR 0010; `docs/research/adaptive-orchestration-router.md` | | CWL modular connectors | `docs/connectors/*` | implemented-main | — | contract docs + examples | PR #22; live HTTP ports remaining | | Release SBOM/provenance generator | `scripts/release_evidence.py` | partial | — | generate+validate in CI | Task 13 partial / PR #28 | diff --git a/scripts/check_workspace_contract.py b/scripts/check_workspace_contract.py index c7b1ecf5..278cd25e 100644 --- a/scripts/check_workspace_contract.py +++ b/scripts/check_workspace_contract.py @@ -23,6 +23,7 @@ "tepp_simulation", "validation_core", "tepp_api", + "section_source", ) REQUIRED_CI_SNIPPETS: tuple[str, ...] = ( diff --git a/tests/quality/test_check_docstrings.py b/tests/quality/test_check_docstrings.py index 2c11f7a5..56d553d2 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 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(contract.EXPECTED_CRATES)) self.assertTrue(set(crate_roots).issubset(sources)) self.assertGreaterEqual(len(sources), len(crate_roots)) self.assertEqual(docstrings.validate_repository(REPOSITORY_ROOT), [])