Skip to content

feat(instrument): list durable startable releases - #303

Closed
seonghobae wants to merge 27 commits into
mainfrom
automation/instrument-startable-catalog-main-20260821
Closed

seonghobae wants to merge 27 commits into
mainfrom
automation/instrument-startable-catalog-main-20260821

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Adds a current-main PostgreSQL catalog query for persisted instrument releases that can start new sessions. The query returns only current Published rows in deterministic instrument/locale/release order and revalidates each row through the existing load_published_instrument_release boundary. Real PostgreSQL tests cover ordering, persisted suspension, empty catalogs, and corrupt stored evidence.

This reconciles the durable catalog-query portion of older draft #213 onto current main. HTTP catalog transport remains separate; #165 is not superseded by this persistence-only slice.

Test-first history starts at 12f893ed20245b6e92ebd32948c2afc6d7e84a65. Exact-head CI and independent review remain required before merge.


Open in Devin Review

Summary by CodeRabbit

  • 새 기능
    • PostgreSQL에서 시작 가능한 게시 릴리스 목록을 조회할 수 있습니다.
    • 계기판, 로케일, 릴리스 순서에 따라 안정적으로 결과를 제공합니다.
    • 조회 중 다른 세션의 상태 변경을 기다리지 않고 목록을 확인할 수 있습니다.
  • 버그 수정
    • 게시 취소된 릴리스가 목록에 포함되지 않습니다.
    • 손상되거나 유효하지 않은 저장 데이터와 데이터베이스 오류를 감지하면 부분 결과 없이 실패하고 트랜잭션을 롤백합니다.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 6 minutes.

View limit details

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5dd30a4-5ace-4672-a1c7-855f1d3ddf82

📥 Commits

Reviewing files that changed from the base of the PR and between b6f116a and bfffa94.

📒 Files selected for processing (4)
  • src/lib.rs
  • src/postgres_instrument_catalog.rs
  • tests/postgres_instrument_startable_catalog.rs
  • tests/postgres_instrument_startable_catalog_pagination.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f8f211c-7216-47d3-a331-77e92bf72a69

📥 Commits

Reviewing files that changed from the base of the PR and between 2b5c1e6 and b6f116a.

📒 Files selected for processing (5)
  • docs/TRACEABILITY.md
  • src/postgres_instrument_catalog.rs
  • src/postgres_instrument_release.rs
  • tests/postgres_instrument_startable_catalog.rs
  • tests/reference_numeric_literal_contract.rs

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


📝 Walkthrough

Walkthrough

게시된 instrument release를 PostgreSQL에서 비잠금 방식으로 조회하는 공개 catalog 함수를 추가했다. 저장된 증거를 snapshot으로 재구성하고, 상태 변경·손상 데이터·누락 테이블을 통합 테스트로 검증했다. 참조 식별자 검증 계약도 추가했다.

Changes

PostgreSQL instrument catalog

Layer / File(s) Summary
게시 release 비잠금 조회 및 snapshot 재구성
src/lib.rs, src/postgres_instrument_catalog.rs, src/postgres_instrument_release.rs, docs/TRACEABILITY.md
공개 catalog 모듈과 list_startable_instrument_releases 함수를 추가했다. 함수는 모든 persisted evidence를 한 번의 비잠금 쿼리로 조회하고 PublishedInstrumentReleaseSnapshot으로 재구성한다. 최종 세션 시작 시 정확한 release를 다시 로드하고 잠그는 권한 경계를 문서화했다.
Catalog 통합 동작 및 오류 검증
tests/postgres_instrument_startable_catalog.rs
PostgreSQL advisory lock 기반 테스트 격리를 추가했다. 게시 release의 정렬, 중지 상태 제외, 빈 결과, 동시 중지, 손상된 증거, 누락된 release 테이블 및 트랜잭션 롤백을 검증한다.

Reference numeric literal contract

Layer / File(s) Summary
숫자형 참조 검증 계약
tests/reference_numeric_literal_contract.rs
ASCII 및 지원되는 유니코드 숫자형 리터럴 참조를 거부하는 동작을 검증한다. 숫자와 구두점이 섞인 불투명 참조는 참가자와 테넌트 참조에서 원문 그대로 허용되는지 검증한다.

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

Merge Risk: 🔵 Low · up to b6f11

The PR adds a durable catalog query for startable releases and revalidates returned records. It is generally mergeable, but the query may hold locks until the caller's transaction ends and could temporarily delay lifecycle updates, so transaction scope should remain an explicit owner follow-up.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant list_startable_instrument_releases
  participant PostgreSQL
  participant SnapshotBuilder
  Caller->>list_startable_instrument_releases: 시작 가능 release 목록 요청
  list_startable_instrument_releases->>PostgreSQL: published release evidence 비잠금 조회
  PostgreSQL-->>list_startable_instrument_releases: 정렬된 release 행 반환
  list_startable_instrument_releases->>SnapshotBuilder: 각 행 snapshot 변환 및 검증
  SnapshotBuilder-->>list_startable_instrument_releases: snapshot 또는 오류 반환
  list_startable_instrument_releases-->>Caller: 전체 목록 또는 오류 반환
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 5 files. (1 skipped: 1 unsupported.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 PostgreSQL에서 시작 가능한 영속 계기판 릴리스를 조회하는 주요 변경 사항을 간결하고 명확하게 설명합니다.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch automation/instrument-startable-catalog-main-20260821

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[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head repair at d871470: hosted Rust format check rejected only rustfmt drift in the new PostgreSQL startable-catalog contract test. Applied cargo fmt without changing production behavior. Local cargo fmt --check, git diff --check, and cargo test --workspace --no-run --tests passed. Hosted checks are rerunning on this exact head.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

seonghobae and others added 3 commits August 26, 2026 07:17
Protected main now enforces exact opaque item-reference spelling through
schema constraints, so duplicated item references cannot be persisted.
Update the corrupt-published-evidence regression to prove fail-closed at
the deepest layer (constraint rejection) while both valid releases remain
startable, and resolve TRACEABILITY/CHANGELOG conflicts against merged
lanes.

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

Open in Devin Review

Comment on lines +166 to +172
let next_cursor = if has_more {
releases
.last()
.map(StartableInstrumentReleaseCursor::from_snapshot)
} else {
None
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Cursor from manifest is safe because identity is validated against stored columns

The continuation cursor uses the last snapshot's manifest fields while the SQL keyset predicate uses raw stored columns. into_published_snapshot (postgres_instrument_release.rs) rejects any row whose manifest core identity diverges from stored instrument_ref, locale, and release_ref, so the two are guaranteed equal and pagination cannot skip or duplicate rows.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Superseded by #422, which replays this exact five-file durable catalog slice onto protected main@09534ef52c9307ce0dc559e9d908ebd715c641a1 as one clean commit while preserving the intervening longitudinal module exposure. Historical checks/reviews on this head do not transfer. Do not merge both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant