Skip to content

feat(analysis): bind simulation method-effect labels to an analysis-run profile - #415

Draft
seonghobae wants to merge 7 commits into
mainfrom
feat/method-effects-analysis-run-gap-004
Draft

feat(analysis): bind simulation method-effect labels to an analysis-run profile#415
seonghobae wants to merge 7 commits into
mainfrom
feat/method-effects-analysis-run-gap-004

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Consolidation status

fold_child for the surviving Validation / Analysis Run landing vehicle #416. method_effects_v1 is an analysis-run profile over existing tepp_simulation truth labels, not a new bounded context or independent protected-main landing authority.

Current exact child head: b20ed27f065ddec9c6f05cfe531ece546c3f4d2e; protected base: main@a243f18da4a4ca8a8d068c39922537f1f8ed6ad0. Current #416 head: 03f8de2ed0a0fb842d2022d411814e440df7cfb4. Fresh comparison is diverged with protected main as merge base: this child has 7 unique commits and is 81 #416 commits behind. Keep Draft and preserve all unique source/test/ADR/doctoring delta until an ordinary non-force conflict-resolving fold verifies inheritance.

Scientific / temporal contract

The profile invokes existing tepp_simulation::generate method-effect labels (original, revision, translation, template_copy) and reports a digest-bound cutoff-admitted census. It does not implement an estimator-side method model, GPU/MCMC execution, topic birth/split/merge, or scientific acceptance.

The earlier implementation compared request.knowledge_cutoff to the executor cutoff as RFC 3339 text and reused the domain inference label as terminal provider validation status. Those are distinct contract defects: legal textual representations of the same instant must not change historical admission, and AnalysisResultSummary.validation_status is provider-authored execution state rather than a domain inference claim.

Repair lineage:

  • RED 861d6a720f89068691e82932873f093c90c1511b adds a realistic equivalent-instant cutoff contract (2026-08-01T01:00:00+01:00 vs 2026-08-01T00:00:00Z) and requires terminal validation_status == "validated" while the artifact retains simulation_method_effect_labels_not_estimator_model as its inference boundary.
  • Repair 6d7db6d89ac76f7cde69dd1b5c877ef8cbc362f6 parses the request cutoff and compares KnowledgeCutoff::instant() values; snapshot/model/profile gates remain fail closed. The terminal provider status is separated from artifact inference status.
  • cd76c7262d1e7e3743890003950f299d29b1d0f3 changes ADR 0057 from premature branch-local Accepted authority to Proposed and records the typed-instant/provider-status decision.
  • b20ed27f065ddec9c6f05cfe531ece546c3f4d2e proves the maximal valid artifact shape (256-byte bounded identifiers, fixed digests/schema/claim strings, maximal valid u64 counts) remains below METHOD_EFFECTS_ARTIFACT_BYTE_LIMIT and round-trips through the inbound parser. The 256 KiB check remains an untrusted-input admission boundary; no unreachable output-side size branch was added.

Previously repaired findings remain preserved: lowercase SHA-256 validation for config/content digests, admitted-population rather than full-corpus content digest, duplicate production/dev dependency removal, and conservative pre-allocation generated-row admission.

Review and authority state

All current inline threads are resolved after verification; thread resolution is not approval. Submitted reviews are COMMENTED only, so there is no qualifying current-head APPROVE. Live ruleset 18156473 requires one qualifying current-head approval, dismisses stale reviews after pushes, requires review-thread resolution, and enforces the central required workflows. The old body requirement for two approvals was stale and is removed here.

ADR 0057 body is now Proposed, but the shared docs/adr/README.md row still says Accepted. That index mismatch is real and must survive as a repair finding into the #416/docs consolidation; do not replace the large shared index wholesale merely to change one row.

Exact-head evidence

Fresh workflows admitted for b20ed27f... are Rust Foundation CI 34786927610, Documentation Quality 34786927603, Security Scan 34786927657, SAST Semgrep 34786927717, and CodeQL PR 34786927590. They are currently queued. No predecessor check, coverage receipt, or review transfers to this head; this PR does not claim GREEN, 100% coverage, Ready, or merge authorization.

Fold gate

Before successor-based Close, verify on the surviving #416/successor head that the method-effect source, admitted-population digest, generation budget, exact temporal-instant binding, provider/domain status separation, maximal-wire proof, tests, ADR 0057 Proposed semantics, doctoring and TRACEABILITY all survived the ordinary conflict-resolving fold. Then reacquire exact-head line/branch coverage, required security/CodeQL/docs workflows, resolved threads and the qualifying independent approval on the unchanged survivor.

No self-approval, force push, destructive rebase, skip/xfail, coverage-denominator change, scanner suppression, no-op rerun, mutable dependency consumption, or predecessor evidence transfer is authorized.

…un profile

GAP-004 leftover / ADR 0057. Bind existing tepp_simulation::generate and
refuse_unavailable_document to cutoff-safe method_effects_v1. Census of
original/revision/translation/template_copy labels, not an estimator-side
method model, not GPU, not MCMC, and not topic birth/split/merge.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

analysis_enginemethod_effects_v1 실행 프로필을 추가했습니다. 실행기는 cutoff와 snapshot을 검증하고, 사용 가능한 문서를 집계한 SHA-256 artifact와 terminal result를 생성합니다. 통합 테스트와 ADR, 추적성 문서도 추가했습니다.

Changes

메서드 효과 분석 실행 프로필

Layer / File(s) Summary
실행 계약과 공개 API
crates/analysis_engine/Cargo.toml, crates/analysis_engine/src/lib.rs
tepp_simulation 의존성, method-effects 모듈, 공개 실행 API와 InvalidMethodEffectsArtifact 오류를 추가했습니다.
Artifact 생성과 실행 검증
crates/analysis_engine/src/method_effects_artifact.rs
요청과 접수 identity, snapshot, cutoff, model contract, output profile을 검증합니다. 사용 가능한 문서를 집계하고 method_effects_v1 artifact와 terminal result를 생성합니다. JSON 왕복, SHA-256 digest, 크기와 불변식을 검증합니다.
계약 테스트와 추적성 문서
crates/analysis_engine/tests/method_effects_execution_contract.rs, docs/adr/*, docs/TRACEABILITY.md, docs/doctoring/*, DOCUMENTATION.md, CHANGELOG.md
정상 실행과 빈 corpus, 단일 원본, snapshot·cutoff·profile 불일치의 fail-closed 동작을 검증합니다. ADR, 추적성, 문서 맵과 변경 기록을 갱신합니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant AnalysisRunRequest
  participant execute_method_effects_run
  participant tepp_simulation
  participant MethodEffectsArtifact
  participant AnalysisRunTerminalResult
  AnalysisRunRequest->>execute_method_effects_run: 요청 및 접수 identity 전달
  execute_method_effects_run->>tepp_simulation: cutoff-safe simulation manifest 생성
  tepp_simulation-->>execute_method_effects_run: 사용 가능한 문서와 method effects 반환
  execute_method_effects_run->>MethodEffectsArtifact: 문서 집계와 digest 생성
  MethodEffectsArtifact-->>execute_method_effects_run: 검증된 artifact 반환
  execute_method_effects_run->>AnalysisRunTerminalResult: 성공 상태와 artifact digest 연결
Loading

Merge Risk: 🔵 Low · up to 39d99

This change adds a versioned method-effects analysis artifact and execution result. Invalid digest metadata can pass validation, and tenant authorization is not visibly bound to the accepted run if the execution boundary is reachable by an untrusted caller. The PR is mergeable with explicit owner awareness and follow-up on digest validation and authorization binding.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 3 files. (7 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 제목은 시뮬레이션 method-effect 라벨을 analysis-run 프로파일에 연결하는 PR의 주요 변경 사항을 정확하고 간결하게 설명합니다.
Full details: Docstring Coverage

Explanation

Docstring coverage is 52.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 3 files. (7 skipped: 7 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/method-effects-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[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

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

Devin Review

Comment thread crates/analysis_engine/src/method_effects_artifact.rs Outdated
Comment thread crates/analysis_engine/src/method_effects_artifact.rs
Comment thread crates/analysis_engine/src/method_effects_artifact.rs
Comment thread crates/tepp_simulation/src/truth_manifest.rs
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 84406c59); the only conflict was the CHANGELOG.md append, both entries kept. ADR 0057 already carries an admitted maturity value (active-PR).

Local evidence on the pushed head (toolchain 1.98.0): cargo test over the touched crates (analysis_engine, tepp_simulation) 60 passed / 0 failed, clippy -D warnings clean on the same crates, 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