Skip to content

feat(analysis): bind non-lexical modality refusals to an analysis-run profile - #421

Draft
seonghobae wants to merge 1 commit into
mainfrom
feat/modality-source-analysis-run-gap-004
Draft

feat(analysis): bind non-lexical modality refusals to an analysis-run profile#421
seonghobae wants to merge 1 commit into
mainfrom
feat/modality-source-analysis-run-gap-004

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

GAP-004 leftover / ADR 0061. Bind existing modality_source::refuse_modality_as_unique_content and refuse_modality_as_stopword_deletion to a cutoff-safe modality_source_v1 analysis-run profile (tepp.modality_source.v1).

Not GPU. Not MCMC. Not topic birth/split/merge. Not implemented-main.

Distinct from live slices

Does not duplicate #420 (project-history CLI), #419 (prompt-source), #418 (style-source), #417 (export-retrieval CLI), #416 (copy-identity), #415 (method-effects), #414 (temporal-context CLI), #413 (case-deletion), #412 (composed fitted-K+lineage), #411 (export GET), #410 (export-authorize CLI), #409 (Pareto candidate-K), #408 (joint posterior Laplace), #407 (topic activity), #351 (Leiden), or Driver p.16 std-family micro-PRs.

Verification

  • cargo test -p analysis_engine
  • cargo clippy -p analysis_engine --all-targets -- -D warnings
  • python3 scripts/validate_documentation.py

Merge gate

Two independent current-head APPROVEs required. Author/bot COMMENTED is not independent APPROVE. Exact-head Checks on this SHA only. Predecessor Checks do not transfer. Do not self-approve. Do not merge without two independent approvals.


Devin Review

… profile

GAP-004 leftover / ADR 0061. Bind existing modality_source refusals
(refuse_modality_as_unique_content, refuse_modality_as_stopword_deletion)
to cutoff-safe modality_source_v1. identity_recovery_rate stays
library-side. Distinct from prompt-source (#419), style-source (#418),
copy-identity (#416), and method-effects (#415). Not GPU, not MCMC, and
not topic birth/split/merge.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 5 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: Team

Run ID: 73e7086d-9674-4821-8eab-8e9103193a01

📥 Commits

Reviewing files that changed from the base of the PR and between 1bc02f5 and 517cd8b.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • CHANGELOG.md
  • DOCUMENTATION.md
  • crates/analysis_engine/Cargo.toml
  • crates/analysis_engine/src/lib.rs
  • crates/analysis_engine/src/modality_source_artifact.rs
  • crates/analysis_engine/tests/modality_source_execution_contract.rs
  • docs/TRACEABILITY.md
  • docs/adr/0061-modality-source-analysis-run.md
  • docs/adr/README.md
  • docs/doctoring/modality-source-analysis-run.md

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.

@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 4 potential issues.

Devin Review

Comment on lines +29 to +32
pub struct ModalitySourceDocument {
document_id: String,
kind: ModalityKind,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Future evidence enters historical censuses

ModalitySourceDocument records no availability timestamp, so callers can include post-cutoff documents. The resulting historical census silently includes future evidence.

Prompt for agents
Add availability provenance to ModalitySourceDocument and enforce it in execute_modality_source_run against the supplied KnowledgeCutoff. Either exclude post-cutoff documents consistently with execute_analysis_run or fail closed, according to the profile contract. Add equality-at-cutoff and post-cutoff integration tests, and update the artifact/ADR wording if the admitted document count changes.
Devin Review

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

return Err(AnalysisEngineError::InvalidEvidence);
}

let mut seen = std::collections::BTreeSet::new();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Unbounded censuses can exhaust memory

execute_modality_source_run accepts any document count and builds an identity set for every entry. Large runs can exhaust memory instead of returning LimitExceeded.

Suggested change
let mut seen = std::collections::BTreeSet::new();
if documents.len() > crate::MAX_EVIDENCE_UNITS {
return Err(AnalysisEngineError::LimitExceeded);
}
let mut seen = std::collections::BTreeSet::new();
Devin Review

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

uuid.workspace = true

[dev-dependencies]
modality_source = { path = "../modality_source", version = "0.2.0" }

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 dependency declaration

modality_source is listed identically under normal and development dependencies. Tests inherit normal dependencies, making the second declaration redundant.

Devin Review

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

if request.snapshot_id != snapshot_id {
return Err(AnalysisEngineError::SnapshotMismatch);
}
if request.knowledge_cutoff != knowledge_cutoff.to_rfc3339()

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: Exact cutoff binding stays consistent

Equivalent RFC 3339 spellings are rejected because the profile requires canonical construction identity. The existing topic-lineage executor applies the same exact comparison.

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