Skip to content
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9701b3d
feat(topic): logistic-normal ALR coordinates with true-parameter RMSE
seonghobae Aug 13, 2026
130bc71
test(topic): expose unstable ALR overflow path
seonghobae Aug 14, 2026
e76a0de
test(topic): reject inverse underflow to a zero simplex part
seonghobae Aug 14, 2026
30ae9e0
fix(topic): script stable ALR and preserve shared ledgers
seonghobae Aug 14, 2026
bce4ac6
chore(ci): verify PR 48 stable log-ratio repair
seonghobae Aug 14, 2026
c95ebe1
fix(topic): stabilize extreme log-ratio coordinates
github-actions[bot] Aug 14, 2026
5106f4b
docs(topic): specify stable inverse reference coordinate
seonghobae Aug 14, 2026
0269df0
test(topic): detect hidden simplex mass with compensated summation
seonghobae Aug 14, 2026
d70f5c7
fix(topic): validate simplex mass with compensated summation
seonghobae Aug 14, 2026
0c3d88d
test(topic): keep compensated-sum fixture clippy-clean
seonghobae Aug 14, 2026
0d7c65f
style(topic): apply pinned rustfmt output
seonghobae Aug 14, 2026
f3540fa
test(quality): include topic measurement in docstring inventory
seonghobae Aug 14, 2026
ab29247
test(topic): cover non-finite compensated simplex mass
cursoragent Aug 17, 2026
4ae9b5d
feat(topic): add sequential Egozcue ILR coordinates
cursoragent Aug 17, 2026
a52dd55
test(topic): hit non-finite ILR centered-log reconstruction
cursoragent Aug 17, 2026
30c1d1f
test(topic): recover three-part sequential ILR in unit tests
cursoragent Aug 18, 2026
2f08cdd
docs(adr): align 0010 and 0013 maturity with merged main
cursoragent Aug 18, 2026
6fe6a78
chore(docs): remove trailing whitespace from ADR maturity lines
seonghobae Aug 19, 2026
d1f3dc3
fix(coverage): ignore Rust multiline string fragments
seonghobae Aug 19, 2026
4b54dc8
test(topic): assert direct Aitchison distance recovery
seonghobae Aug 20, 2026
543982c
fix(coverage): parse Rust strings and comments statefully
seonghobae Aug 20, 2026
621cae0
docs: record stateful coverage parser repair
seonghobae Aug 20, 2026
8e88b33
docs(topic): define ILR pairwise distance
seonghobae Aug 20, 2026
f352e15
docs: trace logratio claims to sources
seonghobae Aug 20, 2026
ff41714
fix(quality): parse Rust literal state in coverage gate
seonghobae Aug 20, 2026
45224e5
docs: record Rust literal coverage hardening
seonghobae Aug 20, 2026
7769df7
Merge current main into topic coordinate contract
seonghobae Aug 21, 2026
7340399
docs(adr): align maturity index with source decisions
seonghobae Aug 21, 2026
26a9fde
feat(topic): recover pairwise Aitchison distance from ILR
seonghobae Aug 23, 2026
578961a
style(topic): rustfmt ILR recovery contract
seonghobae Aug 23, 2026
1dd3953
fix(topic): satisfy clippy similar-names on ILR contract
seonghobae Aug 23, 2026
b7214a8
fix(coverage): track nested Rust block-comment depth
seonghobae Aug 23, 2026
16899f3
fix(coverage): count code after multiline strings
seonghobae Aug 23, 2026
e337391
fix(coverage): scan code after block comments
seonghobae Aug 23, 2026
b3dc7da
feat(topic): publish bounded TRSL topic lineage artifacts (#191)
seonghobae Aug 23, 2026
6110d36
fix: fail closed on log-ratio division underflow
seonghobae Aug 23, 2026
2e595d8
merge: reconcile topic log-ratio coordinates with protected main
seonghobae Aug 25, 2026
96e556f
test(quality): cover blank-predecessor commas and escaped char literals
cursoragent Aug 25, 2026
c879a89
docs(research): restore Graham Neubig initial in Liu 2023
cursoragent Aug 25, 2026
6510405
Merge remote-tracking branch 'origin/main' into rebase/48
seonghobae Aug 25, 2026
2084c84
docs(adr): remap analysis-run execution to ADR 0022
cursoragent Aug 25, 2026
04f05ea
Merge remote-tracking branch 'origin/main' into rebase/48
seonghobae Aug 25, 2026
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
9 changes: 8 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ flowchart LR

Every boundary must be independently usable and expose versioned contracts for integration with organization repositories, `naruon`, and `contextual-orchestrator`.

The `analysis_engine` vertical slice is intentionally separate from `tepp_api`:
the API owns wire contracts while the engine owns deterministic execution. It
does not replace the future topic or psychometric estimators and does not read
another service's application tables.

## Implemented foundation topology

Task 1 materializes the first storage-independent workspace boundaries. The
Expand All @@ -61,7 +66,7 @@ boundaries above remain the target modular MSA architecture.
| `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 |
| `tepp_api` | versioned DTO, schema, and export contracts |
| `tepp_api` | versioned DTO, schema, terminal-result, and export contracts |
| `location_membership` | location is not entity identity and not a language channel |
Comment on lines +69 to +71

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Duplicate rows in ARCHITECTURE foundation-crate table

The added rows for validation_core and tepp_api duplicate the existing rows immediately below them, each now listed twice with conflicting descriptions. location_membership is also re-added though it already appears in the file.

Suggested change
| `validation_core` | RMSE, bias, coverage, graph, and Monte Carlo metrics |
| `tepp_api` | versioned DTO, schema, terminal-result, and export contracts |
| `location_membership` | location is not entity identity and not a language channel |
| `topic_measurement` | logistic-normal ALR and sequential Egozcue ILR topic coordinates |
| `analysis_engine` | bounded cutoff-safe temporal evidence readiness execution and digest-bound terminal artifacts |
Open in Devin Review

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

| `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 |
Expand Down Expand Up @@ -100,6 +105,8 @@ boundaries above remain the target modular MSA architecture.
| `model_selection` | statistical/Pareto candidate-`K` gates; LLM votes are not numerical authority |
| `checkpoint_authority` | a model checkpoint is not the CPU `f64` estimator |
| `membership_target` | language, episode, template, department, and opportunity-pool targets cannot collapse into entity or project |
| `topic_measurement` | logistic-normal ALR and sequential Egozcue ILR topic coordinates |
| `analysis_engine` | bounded cutoff-safe temporal evidence readiness execution and digest-bound terminal artifacts |


Foundation crates expose only tested contracts. Empty façades are not public
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang

### Added

- `topic_measurement` bounded deterministic CPU `f64` TRSL-TM reference estimator: canonical CSR/CSC inputs, cutoff-safe documents, standardized event time, weighted multiple memberships, prevalence covariates, explicit predecessor/successor regularization, multi-seed generalized EM, diagonal Laplace uncertainty, and fitted topic-lineage counts with known-truth RMSE plus exact line/branch coverage (ADR 0012; no persistence or accelerated-backend claim).
- `topic_measurement` logistic-normal additive log-ratio and sequential Egozcue isometric log-ratio coordinates: fail-closed simplex validation, max-shifted stable ALR/ILR inverses with true-parameter RMSE, pairwise CLR Aitchison distance recovered by ILR Euclidean isometry for valid composition pairs, and refusal of TF-IDF/BM25/keyword scores as inferential topic coordinates (ADR 0012 first production slice; no new migration).
- Coverage contract now excludes Rust multiline string continuation records emitted by LLVM LCOV, keeping the 100% authored-line gate focused on executable production lines.
- Coverage source classification now scans Rust normal/raw/byte strings, comments, and character literals with escape-aware state, preserving executable string method calls and ignoring quoted comments.
- Registered the analysis-engine gap-closure doctoring in the canonical documentation map so its product and scientific traceability record is discoverable.
- Authored Rust coverage classification now ignores standalone structural closing parentheses, preventing formatting-only LCOV rows from appearing as uncovered production behavior.
- `analysis_engine` vertical slice (ADR 0021): bounded Rust execution from an accepted analysis run to either a cutoff-safe readiness result or a validated `tepp.trsl_topic_lineage.v1` artifact from the ADR-0012 estimator. Topic artifacts preserve fitted predecessor/successor edges, connectable-post and lineage counts, request/snapshot/cutoff bindings, SHA-256 identity, and fail-closed non-convergence/tamper behavior with exact line/branch coverage. This remains active-PR evidence and does not claim causal or psychometric authority.
- Coverage classification preserves the final expression line of multiline Rust `match` guards while respecting preceding-arm boundaries, keeping the 100% authored-line gate conservative.
- `tepp_api` fail-closed analysis-result boundaries: status constructors reject
terminal envelopes that cannot fit the default 64 KiB status limit, and
standalone terminal results reject knowledge cutoffs in the future.
- `tepp_api` request-bound terminal analysis results and typed analysis-run status/read responses: accepted/running states cannot carry measurement evidence, terminal results bind exact request and receipt identities, and succeeded/failed payloads remain digest-bound or content-redacted.
- `persistence_postgres` entity/project target SQL now rejects empty, oversized, or hostile type/status labels before insert; interpolated codes are restricted to lowercase ASCII `snake_case` characters so membership foreign keys remain referentially safe (ADR 0003 / ADR 0013).
- `persistence_postgres` live SQLx transport retains one pool-backed PostgreSQL connection per session so tenant binding and the following statement share a session, and closes the connection and owned runtime safely from another Tokio runtime (ADR 0013).
- The authored-line coverage gate now filters LLVM-only literal and expression continuation records while retaining branch coverage for their executable decisions; Rust function signatures and structural branch lines are no longer counted as uncovered statements.
Expand Down Expand Up @@ -90,13 +102,12 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang
- `event_core` now requires and retains `EventEvidenceLayer::PromotedTransition` when constructing an `EventInstance`; every other layer is rejected at the promotion boundary, and TDT story classification uses a caller-owned hash set for expected constant-time membership checks.
- `event_core` ADR 0016 evidence-status gates: TDT detections and CHRONOS predictions cannot admit a forward state transition; first-story detection scores miss/false-alarm rates against a known story stream (Allan 2002 task).
- `membership_target` identity gate: language, episode, template, department, and opportunity-pool memberships cannot collapse into the entity/project pair stored by migration `0006`; comparison-contract tests record recovered target kinds against an entity-collapse baseline (ADR 0003).

- `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.
- `persistence_postgres` backup/restore integrity: restored snapshots stay unusable until tenant, canonical `SHA-256`, knowledge-cutoff eligibility, temporal window order, and append-only triggers revalidate; SQL probes raise `restore integrity failed` (ADR 0013).
- `persistence_postgres` concurrent document-write stress: atomic revise `DO` block that requires exactly one open `system_to` close, SQLSTATE mapping onto `ConcurrentWriteConflict` / `DuplicateDocumentRecord`, and live multi-session insert/revise/append-only proofs. No new migration number.
- `tepp_api` naruon HTTP interchange: versioned `https` POST contracts for analysis-run create and modular export authorization that refuse table-access URLs, review/Copilot credential headers, reserved standard-header redefinition, principal-only export idempotency keys, and lexical inference claims (ADR 0011).
- `tepp_api` naruon HTTP interchange: versioned `https` POST contracts for analysis-run create and modular export authorization that refuse table-access URLs, provider-specific API-key/secret and review/Copilot credential headers, malformed extra HTTP fields, reserved standard-header redefinition, principal-only export idempotency keys, and lexical inference claims (ADR 0011).
- `persistence_postgres` audit-event SQL contracts: append-only insert that refuses empty, oversized, or hostile `action_code` values before SQL is rendered.
- `network_analysis` compositional cluster gates: raw topic proportions cannot be treated as Euclidean coordinates; recovered clusters are scored with label-invariant pair precision and recall against known truth.
- `persistence_postgres` event-instance SQL contracts: bitemporal insert and as-known-at lookup that refuse inverted valid/system windows and hostile type/lifecycle labels before SQL is rendered.
Expand Down Expand Up @@ -162,6 +173,9 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang

### Changed

- ALR and ILR inverse normalization now fails closed when division would turn
a representable subnormal weight into a zero simplex part; runtime images
are pinned to the reviewed multi-platform Rust and Debian OCI digests.
- The docstring discovery test compares crate-root names to `EXPECTED_CRATES` instead of a hardcoded count of 10, so `semantic_core` is required and an unapproved extra crate fails closed.
- The LineageWeave temporal-context read exchange no longer emits a fabricated
`idempotency-key`; that header remains reserved for retryable write/export
Expand Down Expand Up @@ -189,6 +203,9 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang
#202–#204, and #164 `ff2e645b1785` as the predecessor register head. Duplicate
PR #179 remains closed. Stacked-merged heads and queued Checks are not
implemented-main.
- Rust LCOV quality gating now ignores visibility-qualified function signatures
and structural match-arm labels that LLVM reports as zero-hit non-executable
lines.
- Clarified ADR 0001 so it owns Rust-first numerical/reference-backend authority while ADR 0011 owns cross-service MSA/service authority.
- Clarified ADR 0006 so it owns GPU/VRAM and model-credential boundaries; ADR 0010 now owns LLM orchestration policy and ADR 0015 owns autonomous repository-write/review/merge authority.
- Expanded ADR 0002–0005 and 0009–0011 with explicit implementation maturity, alternatives, failure/recovery, compatibility/migration, verification, and rollback/supersession boundaries where they were previously implicit.
Expand Down
28 changes: 28 additions & 0 deletions Cargo.lock

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

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
"crates/tepp_simulation",
"crates/validation_core",
"crates/tepp_api",

"crates/location_membership",
"crates/prompt_source",
"crates/corpus_background",
Expand Down Expand Up @@ -50,7 +51,8 @@ members = [
"crates/model_selection",
"crates/checkpoint_authority",
"crates/membership_target",

"crates/topic_measurement",
"crates/analysis_engine",
]
default-members = [
"crates/evidence_core",
Expand All @@ -64,6 +66,7 @@ default-members = [
"crates/tepp_simulation",
"crates/validation_core",
"crates/tepp_api",

"crates/location_membership",
"crates/prompt_source",
"crates/corpus_background",
Expand Down Expand Up @@ -102,7 +105,8 @@ default-members = [
"crates/model_selection",
"crates/checkpoint_authority",
"crates/membership_target",

"crates/topic_measurement",
"crates/analysis_engine",
]

[workspace.package]
Expand Down
3 changes: 3 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ TEPP's approved PRD v0.4 and implementation plan are the primary product baselin
| Stopword-deletion doctoring | [`docs/research/stopword-deletion.md`](docs/research/stopword-deletion.md) |
| Provider-payload minimization doctoring | [`docs/research/provider-payload-minimization.md`](docs/research/provider-payload-minimization.md) |
| Adaptive orchestration router doctoring | [`docs/research/adaptive-orchestration-router.md`](docs/research/adaptive-orchestration-router.md) |
| Topic log-ratio coordinate doctoring | [`docs/research/topic-logratio-coordinates.md`](docs/research/topic-logratio-coordinates.md) |
| Hourly NIM OpenCode doctoring | [`docs/doctoring/hourly-nim-opencode-development.md`](docs/doctoring/hourly-nim-opencode-development.md) |
| Analysis engine v1 doctoring | [`docs/doctoring/analysis-engine-v1.md`](docs/doctoring/analysis-engine-v1.md) |
| Analysis engine gap-closure doctoring | [`docs/doctoring/analysis-engine-gap-closure.md`](docs/doctoring/analysis-engine-gap-closure.md) |
| Corpus-split leakage-audit wire doctoring | [`docs/research/corpus-split-manifest-wire.md`](docs/research/corpus-split-manifest-wire.md) |
| Unicode canonical-identity doctoring | [`docs/research/unicode-canonical-identity.md`](docs/research/unicode-canonical-identity.md) |
| Change history | [`CHANGELOG.md`](CHANGELOG.md) |
Expand Down
116 changes: 49 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,84 +6,62 @@ implemented in Rust.

## Current implementation state

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 eleven 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 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 eleven 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 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 behavior includes immutable
evidence records, topic measurement, and cutoff-safe analysis execution.

```text
crates/evidence_core
crates/semantic_core
crates/temporal_core
crates/event_core
crates/relation_graph
crates/membership_core
crates/persistence_postgres
crates/corpus_split
crates/tepp_simulation
crates/validation_core
crates/tepp_api
crates/prompt_source
crates/corpus_background
crates/modality_source
crates/analysis_engine
crates/assertion_clock
crates/available_clock
crates/checkpoint_authority
crates/citation_edge
Comment on lines +25 to +50

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Unbalanced code fence in README breaks docs check

The edit leaves README.md with 5 triple-backtick fences, an odd count. validate_markdown flags any file whose fence count is odd and raises, so the documentation check fails. A new ```text crate-list block was inserted without a matching closing fence, tangling with the existing crate-list block.

Prompt for agents
README.md now contains an odd number of ``` code fences (5), which validate_markdown rejects as an unbalanced fence. The inserted ```text block near the top (listing crates/analysis_engine ...) was added mid-file without a matching closing fence and overlaps the pre-existing crate-list block, producing garbled duplicate content. Reconcile the top-of-file 'Current implementation state' section: keep a single well-formed ```text crate list with matching open/close fences, remove the duplicated/half-merged lines, and verify README.md has an even number of ``` fences.
Open in Devin Review

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

crates/copied_text
crates/style_source
crates/stopword_deletion
crates/copy_identity
crates/provider_receipt
crates/intake_authorization
crates/summarizes_edge
crates/outcome_order
crates/retrospective_edge
crates/payload_bound
crates/inferred_status
crates/support_edge
crates/system_clock
crates/event_clock
crates/assertion_clock
crates/corpus_background
crates/corpus_split
crates/cutoff_clock
crates/available_clock
crates/derived_sensitivity
crates/document_clocks
crates/revision_order
crates/encrypted_mapping
crates/citation_edge
crates/psychometric_fit
crates/subevent_containment
crates/event_clock
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/prediction_contradiction
crates/prompt_source
crates/provider_receipt
crates/operational_log
crates/psychometric_fit
crates/relation_graph
crates/retrospective_edge
crates/revision_order
crates/semantic_core
crates/service_tls
crates/derived_sensitivity
crates/longitudinal_core
crates/stopword_deletion
crates/style_source
crates/subevent_containment
crates/summarizes_edge
crates/support_edge
crates/system_clock
crates/temporal_core
crates/tepp_api
crates/tepp_simulation
crates/topic_lineage
crates/network_analysis
crates/interpretation_gateway
crates/model_selection
crates/checkpoint_authority
crates/membership_target

crates/topic_measurement
crates/validation_core
```

## Local verification
Expand Down Expand Up @@ -118,3 +96,7 @@ this skeleton-only slice; it must never conceal uncovered production behavior.

No release, production-readiness, GPU, database, or statistical-recovery claim is
made by this foundation slice.

The active stacked analysis-engine slice adds a bounded executable readiness path
from an accepted run to a digest-bound terminal artifact. It is not yet
implemented-main and does not replace scientific estimator contracts.
Loading
Loading