feat(api): publish completed analysis-run result contract - #157
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
Changes분석 실행 계약
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🟠 High · up to The PR still has unresolved correctness and security issues: invalid terminal results may be accepted, non-terminal receipts may be bound to measurement data, and provider credentials or unsafe headers may cross the interchange boundary; the coverage checker can also misclassify executable code. Merge should be blocked until these issues are fixed. Sequence Diagram(s)sequenceDiagram
participant Client
participant AnalysisRunRequest
participant AnalysisRunAccepted
participant AnalysisRunStatus
participant AnalysisRunTerminalResult
Client->>AnalysisRunRequest: 분석 실행 요청 제출
AnalysisRunRequest->>AnalysisRunAccepted: 승인 영수증 생성
AnalysisRunAccepted->>AnalysisRunStatus: accepted 또는 running 상태 제공
AnalysisRunTerminalResult->>AnalysisRunStatus: succeeded 또는 failed 결과 제공
AnalysisRunStatus-->>Client: 바인딩된 상태와 결과 반환
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
|
@opencode-agent review exact current head 30918e5. Require same-head contract tests, coverage evidence, and protected checks before approval; no bypass. |
|
Current HEAD 30918e5 was rechecked. The reviewed serialization byte-limit and terminal-binding findings are already satisfied in the current implementation ( |
|
@opencode-agent review exact current HEAD 30918e5. Verify the completed-result status contract, receipt/result separation, size bounds, exact bindings, and temporal clock semantics. The pre-cutoff completion case is intentional; report only findings tied to this SHA. Do not use COPILOT_GITHUB_TOKEN or bypass protected checks. |
|
OpenCode review: inspect exact current HEAD 30918e5. Re-check completed analysis-result contract semantics, temporal/cutoff boundaries, deterministic serialization, evidence provenance, and fail-closed validation. Report actionable findings only; do not approve. Do not use COPILOT_GITHUB_TOKEN or bypass protected checks. |
|
@opencode-agent review exact current HEAD 30918e5. Re-evaluate completed-analysis-result contract bindings, time semantics, size limits, deterministic serialization, and fail-closed validation on this exact SHA. Approve only from exact-head evidence. Do not use COPILOT_GITHUB_TOKEN or bypass protected checks. |
|
@opencode-agent review exact current HEAD 30918e5. Re-check the completed analysis-run result contract, issue #156 acceptance criteria, result provenance/cutoff semantics, and current required checks. Approve only from exact-head evidence. Do not use COPILOT_GITHUB_TOKEN or bypass protected checks. |
|
Required Checks are green or completing on exact HEAD 30918e5. Please provide the qualifying independent review on this exact HEAD; stale REQUEST_CHANGES from older commits must not be treated as current evidence. |
|
Current exact head has all required repository, scientific, security, supply-chain, and coverage Checks successful. Please perform the qualifying independent review against this exact head, including completed-run result semantics, idempotency, unknown-field rejection, and deterministic artifact authority. Do not reuse predecessor-head evidence, use COPILOT_GITHUB_TOKEN, or bypass the ruleset. |
|
Current exact head 30918e5 has all required repository, scientific, security, supply-chain, and coverage Checks successful. Please perform the qualifying independent review against this exact head, including completed-run result semantics, idempotency, unknown-field rejection, and deterministic artifact authority. Do not reuse predecessor-head evidence, use COPILOT_GITHUB_TOKEN, or bypass the ruleset. |
|
Exact-head review update: fixed two boundary defects on 020c353. AnalysisRunAccepted JSON ingress/egress now uses the default 64 KiB limit with a caller-supplied parser limit, and the shared wire identity validator rejects ASCII/Unicode control characters. Added regression coverage. Verified exact head with cargo fmt --check, pinned Rust 1.97.1 cargo test -p tepp_api (25 unit, 11 analysis-result, 1 crate, 1 example, 9 HTTP, 4 resource, 13 router, 3 security, 7 provider, 2 provider-time, 5 audit, 1 denial; all pass), docstring contract, documentation validator, and git diff --check. Please review only 020c353; stale approvals are not valid. |
|
Implemented the current-head review fix at
Please re-run the current-head Checks and review this exact commit. |
|
Exact-head revalidation for f1c94f7: remote changes superseded the prior 020c353 evidence, so the full tepp_api suite was rerun. Pinned Rust 1.97.1 passes 25 unit, 11 analysis-result, 1 crate, 1 example, 9 HTTP, 4 resource, 13 router, 3 security, 7 provider, 2 provider-time, 5 audit, and 1 denial tests. Cargo fmt --check, Rust docstring contract, documentation validator, and git diff --check also pass. Terminal result bindings, accepted payload limits, control-character rejection, unknown-field refusal, and request/receipt identity checks are current-head verified. Please review only f1c94f7; prior HEAD evidence is superseded. |
|
Validation update at exact HEAD
No self-approval or bypass was used; the PR remains |
|
Verified against current head 0cb9ff6. The valid CodeRabbit findings are already present: default byte limits are enforced on both JSON serializers, binding contracts validate before comparison, and non-terminal idempotency keys are checked. The proposed completed_at >= knowledge_cutoff rule is intentionally not applied: knowledge_cutoff is the evidence-availability boundary, while completed_at is a distinct system clock; a run completing before the cutoff is valid and is covered by the existing contract test. Adding that ordering would introduce an unsupported temporal invariant. The coverage failure was fixed at its root: require_nonempty already rejects control characters, so the duplicate control-character predicate in compose_https_target was unreachable. The focused workspace branch gate now reports 1044/1044. |
* docs: add live product technical gap baseline * docs: refresh live delivery baseline * docs: record psychometric draft state * docs: refresh temporal and image delivery queue * docs: record Unicode identity PR in gap baseline * docs: refresh buyer gap baseline for psychometric PR * docs: refresh baseline for branch coverage repair * docs: refresh baseline with current PR heads * docs: record validation claim promotion head * docs: refresh live PR baseline * docs: bind baseline to refresh head * docs: refresh gap baseline current heads * docs: refresh live pull request evidence * docs: expand TEPP completion gaps and issue roadmap * docs: add product and technical gap baseline * docs: normalize buyer gap maturity * docs: remove duplicate gap baseline index entry * docs(gap): refresh live queue snapshot * docs(gap): split executable product capabilities * docs(gap): align queue snapshot timestamp * docs(gap): normalize maturity and authority fields * docs: refresh live pull request gap evidence * docs: record hot partition readiness gap * docs: refresh live product gap snapshot * docs: route Strix gap evidence to canonical owner * docs: link exact Strix failure records * docs: bound Strix evidence to public records * docs(gaps): refresh live PR snapshot * docs(gaps): bind snapshot to refreshed head * docs: refresh live buyer-gap baseline * docs: refresh live PR head register * docs: require dated exact-head gap baseline Refresh the live 2026-08-23 GitHub inventory, add a structure validator that rejects queued-Checks-as-shipped claims, and cover it with quality tests. PR #164 remains the single gap-baseline authority. * docs: drop closed duplicate #179 from live register Refresh the exact-head inventory to 93 open PRs after closing the duplicate gap-baseline snapshot. PR #164 remains the single authority. * docs: bind gap heads to the live 95-PR register Refresh the exact-head inventory to 2026-08-23T13:31:34Z and set each buyer-gap current head SHA to that snapshot, including #164, #48, #50, #63, and #157. Queued Checks remain not implemented-main. * fix(docs): honor negated queued-Checks wording in the gap validator The promotion guard treated any same-line 'queued Checks'...'implemented-main' window as a shipped claim, so correct negation failed and a wrapped affirmative claim could evade. Require an un-negated match, including across a line break. * docs: refresh 96-PR exact-head gap register Bind the live 2026-08-23T13:57:34Z inventory, including #49 extra-lag underflow coverage and hourly #180/#164 repairs. Buyer-gap current heads match that snapshot. Queued Checks are not implemented-main. * docs: replace Buyer language in the live gap register TEPP is not a purchase catalog. The gap baseline, validator, and CHANGELOG now name operator-visible gaps and operator-gap closure evidence. * docs: refresh 96-PR exact-head gap register after #49 90b08bb Bind GAP current-head SHA prefixes to the 2026-08-23T14:08:41Z live inventory, including #49 extra-process lag underflow and #164 8b78797. Queued Checks remain not implemented-main. * docs: refresh 98-PR exact-head operator-gap register Snapshot 2026-08-23T14:52:16Z. GAP-015 records this register's prior exact head 33bf824. TEPP remains an operator-gap register, not a purchase catalog. * docs: refresh 97-PR exact-head gap register after stacked #191 Drop closed stacked #191, bind GAP current-head SHAs to the 2026-08-23T15:07:33Z REST inventory, and keep queued Checks off implemented-main. * docs: refresh 97-PR exact-head gap register after #49 1e3e2eb Bind GAP current-head SHAs to the 2026-08-23T15:57:48Z REST inventory, including #49 exp/expm1 overflow rewrites. Queued Checks remain off implemented-main. * docs: refresh 99-PR exact-head gap register after stacked #193/#194 Bind GAP current-head SHAs to the 2026-08-23T16:52:27Z REST inventory. #49 nightly 1701/1702 on 1e3e2eb is logged, not treated as implemented-main. Queued Checks remain off protected-main. * docs: refresh 101-PR exact-head gap register after #49 dd6cf43 Bind GAP current-head SHAs to the 2026-08-23T17:59:26Z REST inventory, including unique-fold coverage on #49 and stacked drafts #195/#196. Queued Checks remain off implemented-main. * fix(docs): require promotion-denial wording for queued-Checks guard An unrelated `not` in `queued Checks are not required; this PR is implemented-main` was treated as negation. Only never/do not/does not/ cannot/must not plus promote/treat/make/mean licenses the span. * docs: refresh 103-PR exact-head gap register after stacked #197/#198 Bind GAP current-head SHAs to the 2026-08-23T18:48:36Z REST inventory. #49 unique-fold nightly is green on dd6cf43 and is not implemented-main. Queued Checks remain off protected-main. * docs: refresh 105-PR exact-head gap register after stacked #199/#200 Bind GAP current-head SHAs to the 2026-08-23T19:48:22Z REST inventory. #49 unique-fold nightly remains green on dd6cf43 and is not implemented-main. Queued Checks remain off protected-main. * docs: refresh 106-PR exact-head gap register after #201 span units Bind GAP-005 to #201 5344729 as a first span-unit slice only, not concept alignment and not implemented-main. Queued Checks remain off protected-main. * docs: refresh 109-PR exact-head gap register after #201 6afd650 Bind GAP-005 to the RFC 5646-once citation head and include stacked drafts #202–#204. Queued Checks remain off implemented-main. * fix(docs): deny queued-Checks promotion by governed negation Replace the fixed-window denial regex with sentence-scoped negation governance: a claim passes only when a negation cue directly governs a promotion verb inside the same sentence and no adversative conjunction separates that pair from the maturity assertion. Honest wordings whose negation precedes the phrase are accepted, while unrelated negated clauses joined by 'but' can no longer license an implemented-main claim. * docs: refresh 117-PR exact-head gap register after #205-#212 Eight new draft PRs opened in the Driver-recovery psychometric series since the last snapshot. Protected-main SHA and non-draft count (70) are unchanged -- no new mergeable work landed, this is a pure register refresh. * docs: refresh live product gap evidence * docs(changelog): align gap-baseline snapshot entry with committed register The Changed entry still described the predecessor 2026-08-23T21:46:37Z snapshot (109 open / 39 drafts) while the committed baseline document records the refreshed 2026-08-24T05:41:54Z snapshot (118 open / 48 drafts). Align the changelog narrative with the register the validator enforces so the exact-head evidence stays internally consistent. --------- Co-authored-by: seonghobae <seonghobae@users.noreply.github.com> Co-authored-by: opencode-agent <agent@contextualwisdomlab.dev>
Union workspace members and contract crate lists (analysis_engine + membership_target); coverage classifier keeps main's structural-comma and multiline-string helpers alongside the multiline match-guard recognizer; ADR 0003/0012 stacked maturity paragraphs consolidated into single dated statements; README contradictory foundation paragraphs replaced by one accurate paragraph covering the current crate set plus the analysis_engine slice.
# Conflicts: # ARCHITECTURE.md # Cargo.toml # README.md # docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md
| | `validation_core` | RMSE, bias, coverage, graph, and Monte Carlo metrics | | ||
| | `tepp_api` | versioned DTO, schema, terminal-result, and export contracts | | ||
| | `analysis_engine` | bounded cutoff-safe temporal evidence readiness execution and digest-bound terminal artifacts | | ||
| | `location_membership` | location is not entity identity and not a language channel | |
There was a problem hiding this comment.
🟡 Duplicate, conflicting crate rows in topology table
The added rows for validation_core, tepp_api, and location_membership duplicate rows that already exist in the same table further down. validation_core and tepp_api now appear twice with different descriptions, so the table states two conflicting responsibilities for each.
Was this helpful? React with 👍 or 👎 to provide feedback.
# Conflicts: # ARCHITECTURE.md # Cargo.lock # Cargo.toml # README.md # crates/analysis_engine/Cargo.toml # crates/analysis_engine/src/lib.rs # crates/analysis_engine/tests/end_to_end_contract.rs # docs/API_CONTRACT.md # docs/TRACEABILITY.md # docs/adr/0011-standalone-modular-msa-boundary.md # docs/adr/README.md # docs/connectors/naruon-artifact-consumer.md # docs/doctoring/analysis-engine-v1.md # scripts/check_coverage.py # scripts/check_workspace_contract.py # tests/quality/test_check_coverage.py
# Conflicts: # docs/TRACEABILITY.md
# Conflicts: # README.md
| // The corpus bound makes this conversion strictly smaller than | ||
| // `u64::MAX`; the fold still fails closed through checked arithmetic so a | ||
| // future bound change cannot wrap membership totals silently. | ||
| let eligible_evidence_count = eligible.len() as u64; | ||
| let eligible_membership_count = eligible.iter().try_fold(0_u64, |sum, unit| { | ||
| sum.checked_add(u64::from(unit.membership_count)) | ||
| .ok_or(AnalysisEngineError::ArithmeticOverflow) | ||
| })?; | ||
| // The corpus bound makes this conversion and sum strictly smaller than | ||
| // `u64::MAX`: 100,000 * u32::MAX is below the 64-bit range. | ||
| let eligible_evidence_count = eligible.len() as u64; |
There was a problem hiding this comment.
🔴 Overflow-checked membership total silently discarded
The eligible membership total is first summed with checked arithmetic that fails closed on overflow, then immediately re-summed with an unchecked + fold that shadows and discards the checked value. The overflow guard never applies, so raising the evidence-unit bound can wrap the total silently.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
| if text.endswith("=> {") and " if " not in text: | ||
| if ( | ||
| text.startswith("if ") | ||
| or text.startswith("if(") | ||
| or " if(" in text | ||
| ): | ||
| if text.startswith("if ") or text.startswith("if("): | ||
| return True | ||
| return _is_multiline_match_guard(lines, line_number) |
There was a problem hiding this comment.
🔍 Coverage gate script fails to import
The if (...) header at lines 301-305 has no indented body before the following if at line 306, an IndentationError that prevents check_coverage.py from importing at all. _is_multiline_match_guard is also defined twice (line 327 and line 504) with differing logic; the later one wins and the earlier is dead.
Was this helpful? React with 👍 or 👎 to provide feedback.
| use super::{ | ||
| ANALYSIS_ARTIFACT_SCHEMA_VERSION, ANALYSIS_STATISTIC_COUNT, AnalysisCorpus, | ||
| AnalysisEngineError, AnalysisEvidenceUnit, MAX_ANALYSIS_IDENTIFIER_BYTES, | ||
| MAX_EVIDENCE_UNITS, execute_analysis_run, | ||
| MAX_EVIDENCE_UNITS, TopicMeasurementError, execute_analysis_run, | ||
| }; |
There was a problem hiding this comment.
🔍 Test module has duplicate imports and truncated calls
The test module imports MAX_EVIDENCE_UNITS and execute_analysis_run twice (lines 390-391), and several unit(...) calls lost their available argument, leaving 3 arguments against the 4-argument unit signature. Both are merge artifacts that stop the crate tests from building.
Was this helpful? React with 👍 or 👎 to provide feedback.
| "crates/analysis_engine", | ||
| "crates/topic_measurement", | ||
| "crates/analysis_engine", | ||
| "crates/psychometric_core", |
There was a problem hiding this comment.
🔍 analysis_engine listed twice in workspace members
members and default-members each list crates/analysis_engine twice (lines 57/59 and 116/118). EXPECTED_CRATES received the same duplicate so the contract check still passes, but the duplicate entry is unintended and mirrors pre-existing duplicates like episode_membership.
Was this helpful? React with 👍 or 👎 to provide feedback.
…main (#246) Refresh the canonical register against c482cce (#239, merged 2026-08-25T09:23:20Z): workspace version 0.2.0 across every manifest, 57 unique crates, queue drained to seven open PRs with full exact-head SHAs (four non-draft: release cut #235, register refresh #236, lineage anchor #237, final branch-gap coverage #241; three drafts), and nine open issues with #156/#168/#175 closed. GAP rows advance on verified merge evidence: GAP-001/GAP-017 close through #157, GAP-004 records the CPU TRSL-TM reference estimator as implemented-main, GAP-005 notes the #168 closure, GAP-006 records the psychometric stack drain through vehicles #231/#232, GAP-009 advances to estimator core plus #239 repairs (exact Fisher-z p-values, BH admission, bootstrap intervals, fail-closed guard ordering, negative-edge exclusion) with repeated Leiden consensus remaining, and GAP-012 closes with issue #175. A new Post-#239 state note separates the landed repairs from the still- prohibited supported-release claim. Stale duplicate GAP-016/GAP-017 rows are removed. CHANGELOG [Unreleased]: add this refresh entry, drop three bullets that verbatim-duplicated earlier entries after the consolidation merges, and drop the network_analysis repair bullet superseded by the v0.2.0 Fixed entry. Supersedes #236, whose base cf0e0ad predates #239. Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>
Fixes #156
Buyer and ecosystem gap
AnalysisRunAcceptedis a durable submission receipt, not a measurement result. LineageWeave needs a provider-authoritative terminal DTO and a typed status/read contract so an accepted asynchronous run cannot be treated as scientific completion.Contract added
AnalysisRunTerminalResult;AnalysisRunAcceptedis unchanged;AnalysisRunStatusv1 returns typedaccepted,running,succeeded, orfailedstates;Consumer boundary
LineageWeave persists accepted receipts as transport evidence, keeps its local run
Running, reads the typed status contract, and persists the terminal DTO only after complete binding validation. Global Ask must label itmeasurement_evidence; it is never a SearXNG-verified real-world fact.Scope boundary
This PR adds the typed interchange contract and binding validation only. It does not add a database, estimator, or deployed HTTP service; the future HTTP layer can expose the same versioned status/read DTO.
Merge gate
Keep Draft until exact-head Rust tests, clippy, rustdoc, line/branch coverage, repository contract, documentation validation, security checks, and independent review succeed. Do not merge solely because the DTO unit tests pass.
Summary by CodeRabbit
새 기능
버그 수정
문서
테스트