feat(persistence): persist idempotent analysis runs - #287
Conversation
Store canonical tenant-bound requests and append-only lifecycle events with database-enforced transitions and artifact provenance. Refs: #166 Signed-off-by: Seongho Bae <me@seonghobae.me>
|
Warning Review limit reachedNext included review available in 36 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (18)
📝 WalkthroughWalkthrough분석 실행 요청과 상태 이벤트를 PostgreSQL에 영속화하는 기능을 추가했습니다. 정규 요청 JSON과 SHA-256 digest를 저장하고, 테넌트별 멱등 삽입과 append-only 상태 전이를 적용합니다. Rust SQL 생성 API, 마이그레이션, 계약 테스트, 실제 PostgreSQL 테스트와 관련 문서를 추가했습니다. Changes분석 실행 영속화
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🟡 Moderate · up to This PR adds durable tenant-scoped analysis-run records and stable retries, but the current head still risks failed exact retries, production traffic blocking during migration, and weakened tenant isolation if callers do not bind tenant context correctly. Merge should wait until these issues are fixed or explicitly accepted; the remaining documentation mismatches are non-blocking. Sequence Diagram(s)sequenceDiagram
participant Caller as 호출자
participant RustAPI as insert_analysis_run_request_sql
participant PostgreSQL
Caller->>RustAPI: AnalysisRunRequestRecord 전달
RustAPI->>RustAPI: 정규 JSON과 SHA-256 digest 검증
RustAPI-->>Caller: INSERT SQL 반환
Caller->>PostgreSQL: 멱등 요청 및 accepted 이벤트 삽입
PostgreSQL-->>Caller: 저장된 실행 ID와 digest 검증 결과
Caller->>RustAPI: 상태 이벤트 전달
RustAPI-->>Caller: 상태 이벤트 INSERT SQL 반환
Caller->>PostgreSQL: append-only 상태 이벤트 삽입
PostgreSQL-->>Caller: 상태 전이 및 테넌트 제약 결과
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 54.55% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 6 files. (9 skipped: 9 unsupported.) ✨ 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 |
Exercise digest-only request tampering and cross-tenant lifecycle events so both trust-boundary short-circuit arms remain covered. Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
…s-worker feat(persistence): add durable worker transport
Summary
analysis_run_requestand append-onlyanalysis_run_state_eventpersistenceExact current head
17830159dbcb486fe05739c8153c9e495c91d076main@b03cc378228d5e568fc34970fcb23dc2b452f535Verification
cargo test -q --workspacecargo clippy -q --workspace --all-targets -- -D warningscargo test -q -p persistence_postgresRefs #166
Do not self-approve. Do not --admin merge. Independent human approvals required. Checks are not blockers — keep shipping after two independent approvals on exact head.