Skip to content

feat(method): refuse corpus-background wording as unique content - #151

Merged
seonghobae merged 7 commits into
mainfrom
agent/corpus-background
Aug 24, 2026
Merged

feat(method): refuse corpus-background wording as unique content#151
seonghobae merged 7 commits into
mainfrom
agent/corpus-background

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Corpus-level background language stays explicit method structure (ADR 0004/0012). It is not unique latent content and is not erased by a stopword list. Recovery is the computed share of recovered kinds that match known truth versus collapsing every token to unique content.

Complementary to #147 section, #148 style, #149 copied-text, #150 modality, #145 stopword, #63 TF-IDF/BM25 inferential-weight refusal, and #75 method_effects. This crate owns corpus-background-versus-unique-content identity.

Local gates:

  • cargo test -p corpus_background --all-targets GREEN after RED (package did not exist)
  • clippy -D warnings PASS
  • workspace contract PASS
  • docstring contract PASS
  • lines 90/90; nightly-2026-08-01 branches 6/6

Does not allocate migration 0008. Does not recreate those in-flight method-source crates.

Keep this PR draft. Preferred merge remains #47 only when exact-head required Checks pass and a qualifying independent APPROVE exists. Do not empty-commit #47.

Corpus-level background language stays explicit method structure
(ADR 0004 and 0012). It is not unique latent content and is not
erased by a stopword list. Recovery is the computed share of
background kinds that match known truth versus collapsing every
token to unique content.
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 38 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: babf7e1d-d7c4-406d-bf0f-ecaba74dcb3a

📥 Commits

Reviewing files that changed from the base of the PR and between 1d13186 and 6a6ce94.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • ARCHITECTURE.md
  • CHANGELOG.md
  • Cargo.toml
  • README.md
  • crates/corpus_background/Cargo.toml
  • crates/corpus_background/src/error.rs
  • crates/corpus_background/src/kind.rs
  • crates/corpus_background/src/lib.rs
  • crates/corpus_background/tests/corpus_background_contract.rs
  • crates/corpus_background/tests/crate_contract.rs
  • docs/TRACEABILITY.md
  • docs/adr/0004-shared-multilingual-latent-space.md
  • docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md
  • docs/adr/README.md
  • docs/research/corpus-background-identity.md
  • docs/research/standards-and-literature.md
  • docs/validation/temporal-event-foundation.md
  • scripts/check_workspace_contract.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

# Conflicts:
#	CHANGELOG.md
#	docs/validation/temporal-event-foundation.md
@seonghobae
seonghobae marked this pull request as ready for review August 20, 2026 17:53
@seonghobae

Copy link
Copy Markdown
Contributor Author

Current head 32b9ff5 merges protected main and retains the corpus-background identity contract plus current provider/orchestration traceability. Focused proof passed: cargo fmt --all -- --check, cargo test -p corpus_background --offline (6 tests), workspace contracts, documentation validation, Rust docstring contract, and git diff --check. The exact-head Checks are rerunning; merge remains gated by one qualifying independent approval.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Current-head validation update (c7d5ed2): fixed the quality contract to derive the Rust crate count from scripts/check_workspace_contract.py instead of hard-coding 10. Local evidence: 89 quality tests passed; coverage 100% (991/991 statements, 442/442 branches); workspace, docstring, documentation, and diff checks passed. Please review and rerun Checks against this exact head; merge remains subject to the repository's two independent approvals and protected rules.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Current-head review fix (a35d329): removed the duplicate active-PR Purpose-bound provider payloads row; the ledger now has one implemented-main row and the new corpus_background row. Local quality validation passed: 89 tests, 100% statement/branch coverage (991/991, 442/442), workspace/docstring/documentation contracts, and diff check. Please re-review this exact head.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Review the exact current PR head a35d329 against base main with the protected independent agents. Re-check current source, tests, coverage, documentation, and security; do not modify or merge. @opencode-agent @cwl-noema-review

@seonghobae

Copy link
Copy Markdown
Contributor Author

Current-head review refresh for a35d329:

  • Corpus-background wording is refused as unique report content, reducing background leakage into method or measurement claims.
  • git diff --check, documentation validation, workspace contract, docstring contract, and cargo fmt --all -- --check passed locally.
  • Current hosted checks are pass=14, pending=1, fail=0; merge remains withheld until the pending exact-head required check completes and qualifying approvals exist.
  • No new actionable source defect was found at this exact head; no approval is being self-issued.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Rebased current head f87c812 onto origin/main. The changelog conflict retains both feature and current-main entries; inherited documentation trailing whitespace was removed. Local merge-tree, git diff --cached --check, and cargo fmt --all -- --check pass. Exact-head hosted checks and required independent approvals remain required before protected merge.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review

Review-only request for exact current head f87c812. Re-review corpus-background identity and current validation ledger, the Rust identity contract, APA 7 research scope, documentation maturity, and protected-merge requirements. Do not merge or enable auto-merge.

@seonghobae
seonghobae enabled auto-merge (squash) August 24, 2026 00:55
@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head queue disposition

Exact head f87c812415280681c4243117fbd1302b204e4f68 is green across required Checks with no failed or queued gate. The bounded corpus-background identity crate and documentation remain mechanically mergeable, but REVIEW_REQUIRED has no qualifying independent approval. WAIT_AND_REMEDIATE; no bypass.

# Conflicts:
#	ARCHITECTURE.md
#	CHANGELOG.md
#	Cargo.lock
#	Cargo.toml
#	README.md
#	docs/TRACEABILITY.md
#	docs/adr/0004-shared-multilingual-latent-space.md
#	docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md
#	docs/adr/README.md
#	docs/research/standards-and-literature.md
#	docs/validation/temporal-event-foundation.md
#	scripts/check_workspace_contract.py
#	tests/quality/test_check_docstrings.py
@seonghobae
seonghobae merged commit d9aff39 into main Aug 24, 2026
19 of 22 checks passed

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

Open in Devin Review

Comment on lines +35 to +41
Chemudugunta, C., Smyth, P., & Steyvers, M. (2007). Modeling general and specific aspects of documents with a probabilistic topic model. In B. Schölkopf, J. Platt, & T. Hoffman (Eds.), *Advances in Neural Information Processing Systems 19* (pp. 241–248). MIT Press.

Bianchi, F., Terragni, S., Hovy, D., Nozza, D., & Fersini, E. (2021). Cross-lingual contextualized topic models with zero-shot learning. In *Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics* (pp. 1676–1683). Association for Computational Linguistics. https://doi.org/10.18653/v1/2021.eacl-main.143

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. Non-lexical modality is modeled as explicit structure, not unique latent content and not a stopword deletion (Bateman, 2008).
TEPP retains a logistic-normal CPU reference while allowing adapter backends that satisfy shared-latent, posterior, temporal, relational, and measurement-invariance contracts. Corpus-background wording is modeled as explicit structure, not unique latent content and not a stopword deletion (Chemudugunta et al., 2007).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Literature register drops the modality citation

This PR overwrites the Bateman (2008) reference and modality paragraph in standards-and-literature.md and :41 with corpus-background material, even though modality_source is already merged on main. The section holds one method-source slot that every stacked PR replaces, so modality loses its central register entry each time. Its own doctoring file docs/research/modality-source-identity.md:25-28 still cites Bateman, so the claim stays documented under docs/research/.

Open in Devin Review

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

Comment on lines +79 to +93
pub fn identity_recovery_rate(
truth: &[CorpusBackgroundKind],
decided: &[CorpusBackgroundKind],
) -> Result<f64, CorpusBackgroundError> {
if truth.is_empty() || truth.len() != decided.len() {
return Err(CorpusBackgroundError::InvalidCorpusBackgroundPayload);
}
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)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: identity_recovery_rate fail-closed logic and casts are correct

kind.rs guards against empty and length-mismatched slices before computing the match fraction, and matches is bounded by truth.len(), so the f64::from(matches) / truth.len() as f64 division cannot divide by zero and is not affected by the cast_precision_loss allow beyond acceptable precision for realistic corpus sizes. No bug here.

Open in Devin Review

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant