feat(api): admit LineageWeave as a modular analysis-run consumer - #155
Conversation
PR #87 accepted analysis-run bodies with knowledge_cutoff "k" and hung when a client sent a partial request. The named live listener now installs a read/write deadline, requires a loopback Host, refuses Transfer-Encoding and NIM/proxy headers, parses RFC 3339 cutoffs, keys idempotency by tenant plus key, and proves export over TCP. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
The live TEPP listener currently accepts only tepp-consumer: naruon and keys idempotency without the consumer identity. These regressions require a credential-free LineageWeave exchange, a published consumer code, accepted 202 handling, cross-consumer idempotency isolation, and fail-closed unknown consumers.
|
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루프백 HTTP ingress를 공통화했습니다. Naruon과 LineageWeave의 분석 실행, temporal-context 및 project-history 계약을 추가했습니다. 소비자별 replay, cutoff 검증, 결정적 projection 및 wire-size 제한을 적용했습니다. Coverage CI와 Changes소비자 범위 ingress와 계약
브랜치 커버리지 검증
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant LineageWeave
participant AnalysisRunLiveService
participant live_http
participant project_history_projection
LineageWeave->>AnalysisRunLiveService: /v1/project-history POST 요청 전송
AnalysisRunLiveService->>live_http: HTTP 프레이밍과 공통 헤더 검증 요청
live_http-->>AnalysisRunLiveService: 검증된 UTF-8 본문 반환
AnalysisRunLiveService->>project_history_projection: 검증된 ProjectHistoryRequest 전달
project_history_projection-->>AnalysisRunLiveService: 결정적 ProjectHistoryProjection 반환
AnalysisRunLiveService-->>LineageWeave: 200 응답과 projection JSON 반환
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Publish a credential-free LineageWeave analysis-run exchange and a consumer-neutral loopback ingress. Accepted-run idempotency is isolated by consumer, tenant, and caller key; unpublished consumers and hostile headers fail closed. The acknowledgement remains asynchronous and does not claim a completed psychometric result.
The one-shot workflow removes test-only imports from production code, runs the pinned Rust formatter, verifies formatting, commits the repair, and removes itself.
# Conflicts: # CHANGELOG.md # Cargo.lock # crates/tepp_api/Cargo.toml # crates/tepp_api/src/lib.rs # docs/API_CONTRACT.md # docs/adr/README.md # docs/validation/temporal-event-foundation.md
Exact-head Strix dispositionThe exact-head |
Exact-head review disposition
|
Scorecard Pinned-Dependencies flags rust:1.97.1-bookworm as unpinned. Pin the multi-arch index digest verified against Docker Hub (sha256:0e2bcaef...e42e4a97) so the build stage matches the pinned runtime stage policy.
Exact-head restack and verification note
|
# Conflicts: # CHANGELOG.md # docs/adr/0002-six-clock-temporal-semantics.md
| if let Some((stored_request, stored_projection)) = | ||
| self.accepted_project_histories.get(&replay_key) | ||
| { | ||
| if stored_request == &request { | ||
| return Ok(json_response(200, "OK", stored_projection.to_json()?)); | ||
| } | ||
| return Err(ApiError::InvalidWirePayload); | ||
| } |
There was a problem hiding this comment.
📝 Info: Project-history replay uses exact struct equality
accept_project_history compares stored vs new with stored_request == &request (full PartialEq, including event order), while accept_analysis_run uses requests_are_idempotent_matches. A retry that reorders the events array under the same idempotency key is treated as a conflict (400) rather than an idempotent replay. Possibly intentional, but stricter than the analysis-run path.
Was this helpful? React with 👍 or 👎 to provide feedback.
# Conflicts: # CHANGELOG.md # docs/adr/0002-six-clock-temporal-semantics.md # docs/adr/0003-relational-event-multiple-membership.md
| | versioned service/API contracts and exports | PRD; API contract; ADR 0011/0013 | `tepp_api` analysis-run/export/JSON-LD/GraphML contracts on protected main (PR #21); merged PR #158 supplies the LineageWeave cutoff-safe temporal-context DTO and PR #155 carries its current loopback consumer boundary; production TLS remaining | partial | | ||
| | immutable split/run/reproducibility manifests | ADR 0013; ERD | `tepp_api` reproducibility manifest and corpus-split leakage-audit wire (`CorpusSplitManifest` v1) on the active stack; `persistence_postgres` append-only SQL insert/lookup for `reproducibility_manifest`, `corpus_split_manifest`, `model_run`, and `model_artifact` (migration `0003`); full physical ERD constraints remaining | partial | |
There was a problem hiding this comment.
🔍 Duplicate rows added to traceability matrix
Two capabilities now appear twice in the matrix: 'versioned service/API contracts and exports' and 'immutable split/run/reproducibility manifests'. The new rows duplicate existing ones, a likely restack artifact that no documentation validator catches.
Was this helpful? React with 👍 or 👎 to provide feedback.
| International Organization for Standardization. (2019). *Date and time—Representations for information interchange—Part 1: Basic rules* (ISO Standard No. 8601-1:2019). https://www.iso.org/standard/70907.html | ||
| `temporal_core` owns the thirteen elementary relations and composition; | ||
| `prediction_contradiction` uses `before`/`after` as contradiction, | ||
| `meets`/`met_by` as unsupported adjacency, and | ||
| `during`/`starts`/`finishes`/`equals` as the only coverage relations that can | ||
| authorize promotion. |
There was a problem hiding this comment.
📝 Info: Prose and duplicate citation spliced into references
The insertion places implementation prose between APA reference entries and re-adds an Allen (1983) citation that already exists earlier in the file, reading like a merge artifact rather than a clean reference addition.
Was this helpful? React with 👍 or 👎 to provide feedback.
# Conflicts: # CHANGELOG.md # docs/adr/0002-six-clock-temporal-semantics.md # docs/adr/0003-relational-event-multiple-membership.md # docs/research/standards-and-literature.md
# Conflicts: # CHANGELOG.md # docs/adr/0002-six-clock-temporal-semantics.md # docs/adr/0003-relational-event-multiple-membership.md # docs/research/standards-and-literature.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md # docs/adr/0003-relational-event-multiple-membership.md # docs/research/standards-and-literature.md
# Conflicts: # CHANGELOG.md # docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md
# Conflicts: # CHANGELOG.md # docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md
# Conflicts: # CHANGELOG.md # docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md
# Conflicts: # CHANGELOG.md # docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md
…e-consumer-contract # Conflicts: # CHANGELOG.md # docs/adr/0003-relational-event-multiple-membership.md # docs/adr/0012-temporal-relational-shared-latent-topic-measurement.md # tests/quality/test_check_docstrings.py
Stack
mainatc45be17a9dbce95ef81cee230e9d128abc7160ac.main; this PR extends that live loopback boundary rather than targeting the retired feature branch.Root cause
The #107 listener accepted only
tepp-consumer: naruon. A structurally valid LineageWeaveAnalysisRunRequesttherefore failed closed with HTTP 400. The listener also keyed idempotency by tenant plus caller key only, allowing two modular consumers to collide when they reused a legitimate tenant/key pair.Fix
LINEAGEWEAVE_CONSUMER_CODEandNARUON_CONSUMER_CODE;lineageweave_analysis_run_exchangebuilder;AnalysisRunLiveServicefor the shared/v1/analysis-runsboundary;TDD evidence
The first commit added a failing contract test because the LineageWeave symbols and consumer admission were absent. The GREEN implementation verifies:
AnalysisRunAccepted;Claim boundary
Current exact state
main@c45be17a9dbce95ef81cee230e9d128abc7160ac17f06e814e943ebd9bf592549e2d218a4efed112mainchanges no product intent and prevents this PR from landing only on the already-merged feat(api): serve naruon POSTs on loopback with a live deadline #107 feature branch.Merge gate
Summary by CodeRabbit
새 기능
보안 및 안정성 개선
문서 및 품질