Skip to content

feat(analysis): bind posterior topic-context producer to an analysis-run profile - #432

Draft
seonghobae wants to merge 15 commits into
mainfrom
feat/topic-context-posterior-analysis-run-gap-004
Draft

seonghobae wants to merge 15 commits into
mainfrom
feat/topic-context-posterior-analysis-run-gap-004

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

GAP-004 / ADR 0068 Draft fold child. Binds the existing protected-main TopicContextPosteriorArtifact producer contract to topic_context_posterior_v1 without reimplementing TRSL-TM fitting.

Current exact head is 021843391c8b450e728703e4ec721b2f4a5b3927 on protected main@a243f18da4a4ca8a8d068c39922537f1f8ed6ad0. Compared with #416 03f8de2e..., this child is diverged from the same protected-main merge base with 15 unique child commits and 81 commits on the surviving vehicle side. It remains Draft and is not an independent landing candidate.

Repair lineage

  • RED b44f8bc5c88504b6cc3b1f3631bc406aa44fd23a: equivalent RFC 3339 cutoff instants and terminal validation/inference separation.
  • causal repair 6f3eae7627825a5d04da0371c321ef9639c3ea8f, warning cleanup 1bf55d91c5274954d5062fff64b13aa1f0be769f: compare cutoffs by instant, keep persisted artifact/manifest cutoffs canonical, and report terminal validation as validated while retaining posterior_topic_coordinates_not_importance on the artifact.
  • manifest wire contract 91407b566764519ce83ca3609c1b98d30f6fdc42: bounded from_json/to_json, unknown-field refusal, canonical timestamp validation, round-trip tests.
  • support-availability RED 0042422275bd3725e7e1ca9cb92e885a0ff0e8ce: an authoritative manifest must carry independent availability for supporting evidence resources rather than deriving it from document availability.
  • causal support repair ae867a95bb1ac525b014cf78224fcde0fa862438: exact-set bind every evidence_resource_id actually used by lineage events, document relations, and memberships to support_evidence_available_at; missing, substituted, malformed, or post-cutoff support fails closed. The executor does not subtract late support from an already-fitted posterior.
  • contract follow-through 875a8224..., 8dcd00bf..., c9c3e36740a44fbb1c71df6ee68a31313d103625: manifest wire refusal, temporal fixture migration, and execution regressions for future/missing/substituted support evidence.
  • ADR/doctoring currentization 3b6de91d... / 021843391...: ADR 0068 remains Proposed and documents the exact-set support-evidence admission boundary.

The approved producer contract is enforced exactly: artifacts whose model_contract_version is not trsl-tm-v1 fail closed. AnalysisResultSummary.validation_status remains provider validation status; the artifact owns the scientific inference boundary.

Current gate

The previous late-support leakage finding is repaired and all inline review threads are resolved. There is still no qualifying current-head approval. Exact-head Rust Foundation, Documentation Quality, Security Scan, Semgrep, and CodeQL receipts for 021843391... are queued/pending; predecessor receipts do not transfer.

The child PR itself is currently mergeable against protected main, but it is deliberately retained as a fold child because it is independently diverged from #416. Use an ordinary non-force conflict-resolving fold into the surviving Analysis Run vehicle rather than landing this branch separately. Do not Close #432 until #416 or another verified successor has inherited the source, tests, ADR/doctoring, manifest wire contract, instant cutoff semantics, exact-set document/support availability, producer-contract guard, and terminal claim separation.

Shared documentation remains a separate currentization surface: docs/adr/README.md still lists ADR 0068 as Accepted, and the CHANGELOG/TRACEABILITY/product-gap authorities must be reconciled by the docs/queue-authority lane rather than treating this child comment as checked-in completion.

Verification commands

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

Exact-head Checks only; no self-approval, bypass, force update, destructive rebase, coverage suppression, or predecessor evidence transfer.

Merge gate

Live organization ruleset 18156473 requires one qualifying current-head approval, stale-review dismissal on push, all review threads resolved, and central required workflows; non-fast-forward updates are prohibited. This PR stays Draft pending fold/consolidation and exact-head evidence.

…run profile

GAP-004 leftover / ADR 0068. Bind existing TopicContextPosteriorArtifact
to cutoff-safe topic_context_posterior_v1. Posterior coordinates are not
importance; missing draws are not collapsed; lineage events stay producer-supplied.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Author COMMENT on exact head 4ab92f3. This is not APPROVE. Independent = non-author, non-bot APPROVE. Two independent current-head APPROVEs required before merge. ADR 0068. Do not self-approve.

@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.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 2 potential issues.

Devin Review

Comment thread crates/analysis_engine/src/topic_context_posterior.rs
Comment thread crates/analysis_engine/src/topic_context_posterior.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ab92f3f2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/analysis_engine/src/topic_context_posterior.rs Outdated
Comment thread crates/analysis_engine/src/topic_context_posterior.rs Outdated
Comment thread crates/analysis_engine/src/topic_context_posterior.rs
Comment thread crates/analysis_engine/src/topic_context_posterior.rs Outdated
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 274bd6fd-e6f6-4413-8b73-7a3d52e2477e

📥 Commits

Reviewing files that changed from the base of the PR and between 1bc02f5 and 3e09ff2.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • crates/analysis_engine/src/lib.rs
  • crates/analysis_engine/src/topic_context_posterior.rs
  • crates/analysis_engine/tests/topic_context_posterior_execution_contract.rs
  • docs/TRACEABILITY.md
  • docs/adr/0068-topic-context-posterior-analysis-run.md
  • docs/adr/README.md
  • docs/doctoring/topic-context-posterior-analysis-run.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

topic_context_posterior_v1 실행 프로필이 추가되었습니다. 이 프로필은 기존 TopicContextPosteriorArtifact를 snapshot manifest와 digest로 검증하고, cutoff 이후 증거와 승인되지 않은 producer contract를 거부한 뒤 terminal result를 생성합니다.

Changes

Posterior topic-context 실행 프로필

Layer / File(s) Summary
Posterior 계약과 공개 API
crates/analysis_engine/src/topic_context_posterior.rs, crates/analysis_engine/src/lib.rs
계약 버전, 출력 프로필, inference 상태 상수와 TopicContextPosteriorSnapshotManifest, TopicContextPosteriorExecution 및 실행 함수가 추가되었습니다.
Digest-bound 실행 검증
crates/analysis_engine/src/topic_context_posterior.rs
실행 함수가 요청, receipt, snapshot, cutoff, source digest, artifact digest, 문서 availability와 producer contract를 검증합니다. 검증 성공 시 artifact와 terminal result를 반환합니다.
실행 계약 검증
crates/analysis_engine/tests/topic_context_posterior_execution_contract.rs
성공 결과와 digest-bound 좌표 수를 검증합니다. identity, snapshot, profile, cutoff, digest, availability, producer contract 및 malformed input 불일치를 fail-closed 방식으로 검증합니다.
결정과 추적성 문서
docs/adr/0068-topic-context-posterior-analysis-run.md, docs/adr/README.md, docs/TRACEABILITY.md, docs/doctoring/topic-context-posterior-analysis-run.md, CHANGELOG.md
프로필의 계약, 범위, 비추론 보장, 검증 계획, rollback 조건과 implemented-main 조건이 문서화되었습니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant analysis_engine
  participant SnapshotManifest
  participant TopicContextPosteriorArtifact
  participant TerminalResult
  Operator->>analysis_engine: topic_context_posterior_v1 실행 요청
  analysis_engine->>SnapshotManifest: snapshot, cutoff, source digest, availability 검증
  analysis_engine->>TopicContextPosteriorArtifact: producer contract와 artifact digest 검증
  analysis_engine->>TerminalResult: 검증된 좌표 수와 digest-bound summary 생성
  analysis_engine-->>Operator: 성공 또는 fail-closed 오류 반환
Loading

Suggested reviewers: cursoragent

Merge Risk: 🔵 Low · up to 3e09f

This PR adds a public execution path that can produce a succeeded analysis result from caller-supplied run, manifest, and artifact data after consistency checks. If exposed beyond a trusted integration boundary, an unauthorized caller could provide internally consistent but non-authoritative inputs; the production adapter should enforce authorization and authoritative storage before relying on this path.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 3 files. (5 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 기존 posterior topic-context producer를 analysis-run profile에 연결하는 PR의 주요 변경을 정확하고 간결하게 설명합니다.
Full details: Docstring Coverage

Explanation

Docstring coverage is 46.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 3 files. (5 skipped: 5 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/topic-context-posterior-analysis-run-gap-004

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 1 new potential issue.

Devin Review

Comment thread crates/analysis_engine/src/topic_context_posterior.rs

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Operator-visible: head moved to 3e09ff2 (eligible-snapshot bind). Still zero independent current-head APPROVE. Author/bot COMMENTED is not APPROVE. Exact-head Checks on 3e09ff2 only. Predecessor 4ab92f3 evidence does not transfer. Do not self-approve.

Copy link
Copy Markdown
Contributor Author

Hour-35 exact-head review request.

Current head 3e09ff29cc89ef97a859f3ae50e1297846dd2eeb (not 4ab92f3). ADR 0068 topic_context_posterior_v1. Author COMMENT 5073678689 is not APPROVE. Exact-head Checks on 3e09ff2 only. Predecessor 4ab92f3 evidence does not transfer. Do not duplicate topic-context posterior. Do not invent a Bayesian sampler or topic birth/split/merge. Do not self-approve.

@opencode-agent review

Copy link
Copy Markdown
Contributor Author

Hour-36 re-verify: topic-context posterior head 3e09ff2. Zero independent APPROVEs. Do not duplicate. Exact-head Checks on 3e09ff2 only. Do not self-approve. @opencode-agent review.

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 98dfc629); the only conflict was the CHANGELOG.md append, both entries kept. ADR 0068 already carries an admitted maturity value (active-PR).

Local evidence on the pushed head (toolchain 1.98.0): cargo test -p analysis_engine 38 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