Skip to content

feat(analysis): bind house-voice style refusals to an analysis-run profile - #418

Draft
seonghobae wants to merge 2 commits into
mainfrom
feat/style-source-analysis-run-gap-004
Draft

feat(analysis): bind house-voice style refusals to an analysis-run profile#418
seonghobae wants to merge 2 commits into
mainfrom
feat/style-source-analysis-run-gap-004

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

GAP-004 leftover / ADR 0059. Bind existing style_source::refuse_style_as_unique_content and refuse_style_as_stopword_deletion to a cutoff-safe style_source_v1 analysis-run profile (tepp.style_source.v1).

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

Distinct from live slices

Does not duplicate #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), #406 (wait CLI), #405 (interpreter/verifier), #404 (fitted candidate-K), #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

…ofile

GAP-004 leftover / ADR 0059. Bind existing style_source refusals
(refuse_style_as_unique_content, refuse_style_as_stopword_deletion) to
cutoff-safe style_source_v1. identity_recovery_rate stays library-side.
Distinct from 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

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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 5 potential issues.

Devin Review

Comment on lines +28 to +31
pub struct StyleSourceDocument {
document_id: String,
kind: StyleKind,
}

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 documents enter historical censuses

StyleSourceDocument carries no availability time, so execute_style_source_run counts documents that became available after the requested cutoff. Historical artifacts can include future evidence.

Prompt for agents
Add typed availability provenance to StyleSourceDocument in crates/analysis_engine/src/style_source_artifact.rs. In execute_style_source_run, enforce that every counted document was available no later than the bound KnowledgeCutoff, either by excluding later documents before all counts and duplicate checks or by failing closed according to the analysis-run contract. Add integration tests containing documents on both sides of the cutoff and verify that no future-available document contributes to the artifact.
Devin Review

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

Comment on lines +28 to +31
pub struct StyleSourceDocument {
document_id: String,
kind: StyleKind,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Unrelated documents inherit snapshot identity

StyleSourceDocument carries no snapshot identity, so callers can label any document set with the request snapshot. The digest then certifies an unverified evidence binding.

Prompt for agents
Bind each StyleSourceDocument, or an immutable corpus wrapper containing the documents, to validated snapshot provenance in crates/analysis_engine/src/style_source_artifact.rs. Make execute_style_source_run derive or verify its snapshot identity from that bound input instead of trusting an independent snapshot_id argument. Reject mixed or mismatched snapshot provenance and add tests proving unrelated documents cannot be emitted under a requested snapshot.
Devin Review

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

Comment on lines +195 to +200
let mut seen = std::collections::BTreeSet::new();
let mut unique_content_count = 0_u64;
let mut style_residue_count = 0_u64;
let mut refused_as_unique_content_count = 0_u64;
let mut refused_as_stopword_deletion_count = 0_u64;
for document in documents {

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 exhaust execution resources

execute_style_source_run accepts unlimited documents and retains every identity. Oversized runs bypass the engine’s 100,000-item bound and can exhaust memory.

Prompt for agents
Enforce a document-count limit before allocating the seen set or iterating in execute_style_source_run. Reuse the analysis engine's 100,000-evidence execution bound or define and document a profile-specific bound, return LimitExceeded when it is exceeded, and add a boundary test for limit plus one.
Devin Review

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

uuid.workspace = true

[dev-dependencies]
style_source = { path = "../style_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

style_source appears in both dependency sections with identical configuration. The development entry is redundant and can drift from the production declaration.

Devin Review

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

Comment on lines +372 to +376
{
let mut value = artifact.clone();
value.refused_as_unique_content_count = 1;
value
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Second refusal invariant lacks coverage

The tampering suite exercises only one refusal count. Add a mutation for refused_as_stopword_deletion_count to substantiate the repository’s complete-coverage requirement.

Devin Review

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

Resolve the CHANGELOG.md append conflict by keeping both entries.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Restack on protected main (a243f18)

Non-force merge of origin/main (merge commit fb19c9df); the only conflict was the CHANGELOG.md append, both entries kept. ADR 0059 already carries an admitted maturity value (active-PR).

Local evidence on the pushed head (toolchain 1.98.0): cargo test -p analysis_engine 37 passed / 0 failed, cargo clippy -p analysis_engine --all-targets -D warnings clean, cargo fmt --all --check clean, documentation/workspace/docstring contracts PASS, git diff --check clean.

🤖 Generated with Claude Code

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant