Conflict Resolutions: - CONFLICT-1 (High): Fix REQ-006 ownership scope — implement owner_user_id filtering * Change app/api/v1_assets.py: owner_user_id=None → owner_user_id=auth.user_id * Update docs/runtime-flows.md to reflect service-token owner-scoped portfolio filtering * Add regression test in tests/test_v1.py for ownership boundary - CONFLICT-2 (Medium): Transition REQ-001/002/003 to Implemented * REQ-001: local-db-validation-scenarios (via confirm-req-implemented bat-007) * REQ-002: alembic-runtime-schema-ownership (via confirm-req-implemented bat-007) * REQ-003: local-db-operations-runbook-and-baseline-updates (via confirm-req-implemented bat-007) * Update docs/srs/index.md with status transitions - CONFLICT-3 (Low): Document REQ-012 rotate lifecycle * Add rotate lifecycle notes to REQ-012 (change-req req-012) * Clarify runtime_id change behavior and trex-basic reconnection requirements - CONFLICT-4 (Low): Clarify REQ-005 AC-2 endpoint path * Change REQ-005 AC-2: 'POST /auth/tokens or equivalent' → 'POST /auth/service-tokens' * Update docs/srs/index.md change log with change-req entries Documentation Updates: - Update BAT-001 verification status with conflict resolution evidence - Update release rel-001 with verified status confirmation - Add change log entries for all conflict resolutions with dates and references Testing: - Add ownership boundary test to test_v1.py - Verify filter works with auth.user_id context
147 lines
5.9 KiB
Markdown
147 lines
5.9 KiB
Markdown
# req-002: Alembic와 runtime schema ownership 경계 정리
|
|
|
|
- Status: Implemented
|
|
- Type: Migration
|
|
- Priority: High
|
|
- Owner: repository-maintainers
|
|
|
|
## Intent
|
|
- 이 요구사항은 Alembic migration 경로와 PostgresPortfolioRepository.ensure_schema() 경로가 같은 schema 객체를 다룰 때 발생할 수 있는 drift와 재실행 실패를 줄이기 위한 경계 규칙을 정의한다.
|
|
- 로컬 docker compose 환경에서 fresh DB와 runtime-precreated schema 상태를 기준으로 허용 순서, 사전 점검, 보정 규칙을 문서화하는 것이 목표다.
|
|
|
|
## Requirement
|
|
- 프로젝트는 로컬 docker compose 기반 DB 환경에서 Alembic migration과 runtime schema bootstrap이 다루는 테이블과 인덱스의 ownership 경계를 식별해야 하며, migrate-db 실행 시 허용되는 순서, 충돌 가능 지점, 사전 점검 규칙, 보정 원칙을 명시해야 한다.
|
|
|
|
## Acceptance Criteria
|
|
1. Given app/repositories/postgres.py와 migrations/versions/ 아래 현재 revision들이 있을 때, When schema ownership 분석을 수행하면, Then Alembic과 runtime ensure_schema()가 다루는 주요 객체와 충돌 가능 지점이 식별되어 있어야 한다.
|
|
2. Given 로컬 docker compose 기반 fresh DB와 app runtime이 일부 schema를 먼저 만든 DB 시나리오가 있을 때, When migrate-db 실행 규칙을 정의하면, Then 허용 순서, 금지 순서, 필요한 사전 점검과 보정 규칙이 문서로 정리되어 있어야 한다.
|
|
3. Given 코드 안에 legacy schema stamp 분기가 남아 있을 때, When migration 경계 문서를 작성하면, Then 이번 REQ와 관련 batch 범위에서 legacy DB 지원이 제외된다는 점이 명시되어 있어야 한다.
|
|
|
|
## Impacted Area
|
|
- Docs: docs/project-structure.md, docs/runtime-flows.md, docs/data-model.md
|
|
- Modules: app/repositories/postgres.py, app/db/migrations.py, migrations/versions/*.py
|
|
- Tests: 로컬 schema ownership 검토 체크리스트 또는 migrate-db 충돌 시나리오 검증 절차
|
|
|
|
## Notes
|
|
- 이 요구사항은 dcy-001의 FR-2, FR-3 일부, S-2, R-1, R-2를 구현 가능한 Migration 단위로 정규화한 것이다.
|
|
- legacy DB support와 legacy stamp 경로 검증은 Discovery 범위에서 이미 제외되었으므로, 이 REQ는 local runtime bootstrap 흔적과 Alembic의 상호작용에 집중한다.
|
|
- 문서화만으로 해결되지 않는 ownership 충돌이 발견되면 후속 batch에서 코드 수정이 필요할 수 있다.
|
|
|
|
## Change Log
|
|
|
|
### CHG-20260511-01
|
|
- Date: 2026-05-11
|
|
- Author: repository-maintainers
|
|
|
|
#### Change Summary
|
|
- Implemented 전환 — BAT-007 verification passed, confirm-req-implemented 게이트 통과
|
|
|
|
#### Intent
|
|
- BAT-007 verification.md AC-1~3 모두 PASS. Blocking Issues 없음. docs/project-structure.md "Schema Ownership Boundary", docs/runtime-flows.md "Alembic vs ensure_schema() Schema Ownership Boundary" evidence 연결 확인 완료. 잔여 리스크(idx_auth_tokens_service_name_unique Alembic 미등록)는 후속 batch 검토 항목으로 남겨둠.
|
|
|
|
#### Acceptance Criteria Delta
|
|
- none
|
|
|
|
#### Impacted Area Delta
|
|
- none
|
|
|
|
#### Delivery Trace Delta
|
|
- Batches: BAT-007 (release-candidate)
|
|
- Releases: none
|
|
|
|
#### Revalidation Impact
|
|
- Reverification Needed: no
|
|
- Existing Implementation Invalidated: no
|
|
- Status Recommendation: implemented
|
|
- Follow-up Action: draft-release (BAT-007); idx_auth_tokens_service_name_unique Alembic revision 추가 검토 권장
|
|
|
|
#### Validation Plan
|
|
- BAT-007 verification.md AC-1~3 evidence 연결 확인 완료
|
|
|
|
### CHG-20260430-02
|
|
- Date: 2026-04-30
|
|
- Author: GitHub Copilot
|
|
|
|
#### Change Summary
|
|
- confirm-req 승인 게이트를 통과해 이 REQ를 Approved로 전환했다.
|
|
|
|
#### Intent
|
|
- dcy-001의 delivery input으로 사용할 수 있는 확정 requirement로 승격하기 위해 상태를 변경했다.
|
|
|
|
#### Acceptance Criteria Delta
|
|
- Added:
|
|
- none
|
|
- Updated:
|
|
- none
|
|
- Removed:
|
|
- none
|
|
|
|
#### Impacted Area Delta
|
|
- Docs:
|
|
- docs/srs/index.md
|
|
- Modules:
|
|
- none
|
|
- Tests:
|
|
- none
|
|
|
|
#### Delivery Trace Delta
|
|
- Batches:
|
|
- none
|
|
- Releases:
|
|
- none
|
|
|
|
#### Revalidation Impact
|
|
- Reverification Needed: no
|
|
- Existing Implementation Invalidated: no
|
|
- Status Recommendation: approved
|
|
- Follow-up Action: suggest-batch-reqs 또는 draft-batch 단계에서 REQ-002의 ownership 문서를 delivery scope로 연결한다.
|
|
|
|
#### Validation Plan
|
|
- REQ 본문 필수 섹션, Acceptance Criteria 구체성, docs/srs/index.md 상태 동기화를 확인한다.
|
|
|
|
### CHG-20260430-01
|
|
- Date: 2026-04-30
|
|
- Author: GitHub Copilot
|
|
|
|
#### Change Summary
|
|
- dcy-001에서 Alembic와 runtime schema ownership 경계 요구사항을 신규 Proposed REQ로 생성했다.
|
|
|
|
#### Intent
|
|
- migrate-db와 runtime bootstrap의 경계가 불분명해 생길 수 있는 drift와 재실행 실패를 독립 Migration backlog로 관리하기 위해 생성했다.
|
|
|
|
#### Acceptance Criteria Delta
|
|
- Added:
|
|
- Alembic과 runtime ensure_schema() ownership 분석 기준 정의
|
|
- local runtime-precreated schema 시나리오용 허용 순서와 보정 규칙 정의
|
|
- legacy DB 비지원 범위 명시
|
|
- Updated:
|
|
- none
|
|
- Removed:
|
|
- none
|
|
|
|
#### Impacted Area Delta
|
|
- Docs:
|
|
- docs/project-structure.md
|
|
- docs/runtime-flows.md
|
|
- docs/data-model.md
|
|
- Modules:
|
|
- app/repositories/postgres.py
|
|
- app/db/migrations.py
|
|
- migrations/versions/*.py
|
|
- Tests:
|
|
- migrate-db 충돌 시나리오 검토 체크리스트 또는 동등한 검증 절차
|
|
|
|
#### Delivery Trace Delta
|
|
- Batches:
|
|
- none
|
|
- Releases:
|
|
- none
|
|
|
|
#### Revalidation Impact
|
|
- Reverification Needed: no
|
|
- Existing Implementation Invalidated: no
|
|
- Status Recommendation: keep-current
|
|
- Follow-up Action: confirm-req 단계에서 ownership 경계의 대상 객체와 범위 제외 항목을 검토하고 승인한다.
|
|
|
|
#### Validation Plan
|
|
- confirm-req 전까지 Acceptance Criteria가 dcy-001의 FR-2, FR-3 일부, S-2와 일치하는지 검토하고, 이후 batch 단계에서 실제 객체 목록과 허용 순서 문서를 작성한다. |