Skip to content

feat(people): add purpose-bound Employment history read - #149

Draft
seonghobae wants to merge 64 commits into
fix/people-read-auth-backend-failurefrom
feat/people-employment-history-read
Draft

seonghobae wants to merge 64 commits into
fix/people-read-auth-backend-failurefrom
feat/people-employment-history-read

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Buyer-visible HRIS gap

Adds purpose-bound bitemporal Employment history to the governed Person read surface. This slice reads canonical Orgmetra Employment identity/version truth only; it does not mutate Employment, infer employment decisions, query another service's application tables, or become a parallel governed-People-read owner.

Canonical owner stack

PR #55 remains the direct single writer for governed People reads. Current direct parent: #55 5907537d38dc0e9e4d0a5539805089002b7ee1aa; protected truth below it remains develop@eb9757f8649aaad026a9865508d9aad50c1a7a4f.

Current exact head 69b5e8796245ef82bcc05a316bc0aa8b4f171b8d ordinary-forward adopts #341's confirmed-hire dependency binding. Only canonical parent-owned hire_http.py and the focused dependency-binding regression were adopted; #149's Employment-history feature delta remains intact. Earlier #333–#337 request/header/read hardening remains inherited through the same canonical lineage. Independent authorization-owner prerequisite remains #65/#175. ADR 0149 remains Proposed.

Checked-versus-used repository binding, tuple/cardinality validation, authorization-schema validation, immutable scalar row identity, raw-scalar-before-UUID-reconstruction, deterministic ordering, and authorization-before-retrieval regressions remain intact. Shared People transport/authentication/read-model authority is inherited from #55 rather than reimplemented here.

This PR intentionally targets #55 while Foundation PR acceptance targets protected develop; parent checks/reviews do not transfer. After #55 and #65 reach protected develop, #149 must ordinary-forward onto protected owner truth, retarget to develop, and reacquire exact-head Foundation/Security/SAST/CodeQL/model review plus qualifying independent approval.

Keep Draft. No force-push, destructive rebase, self/model approval, routine bypass, mutable-owner source copy, synthetic status, no-op retrigger, predecessor-evidence transfer, gate weakening, or simple Close is authorized.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e3813c39-adcd-4168-a4eb-87d6c25833a8

📥 Commits

Reviewing files that changed from the base of the PR and between 4fd210e and f95bac8.

📒 Files selected for processing (4)
  • docs/adr/0149-employee-profile-employment-history-read.md
  • docs/traceability/employee-profile-employment-history-read.md
  • services/people-api/src/orgmetra_people_api/employment_history.py
  • services/people-api/tests/test_employment_history_review_regressions.py

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


📝 Walkthrough

Walkthrough

Employment 이력 읽기 경계를 추가했습니다. 요청을 사전 인가하고, 정적으로 고정한 persistence 함수를 호출하며, 결과 행과 UUID·시간·필드 스키마를 검증한 뒤 허용 필드만 반환합니다. 관련 문서와 회귀 테스트도 추가했습니다.

Changes

Employment 이력 읽기

Layer / File(s) Summary
계약 및 추적성
docs/adr/0149-employee-profile-employment-history-read.md, docs/doctoring/employee-profile-employment-history-references.md, docs/traceability/employee-profile-employment-history-read.md
인가 전 구체 persistence capability를 고정하고, 인가 후 동일 함수를 호출하는 계약을 문서화했습니다. 정확한 행 형상과 빈 결과에서도 수행되는 필드 스키마 검증을 기록했습니다.
읽기 경계 및 데이터 모델
services/people-api/src/orgmetra_people_api/employment_history.py, services/people-api/src/orgmetra_people_api/__init__.py
EmploymentHistoryRecord, EmploymentHistoryReadPort, 인가된 출력 모델과 read_employment_history를 추가했습니다. UUID 원시 스칼라, UTC 시각, 행 형상, tenant/person 범위, 기록 시각 가시성, 중복 버전 및 유효일 겹침을 검증합니다. 새 공개 항목을 패키지 네임스페이스와 __all__에 연결했습니다.
회귀 및 별칭 무결성 검증
services/people-api/tests/test_employment_history_alias_integrity.py, services/people-api/tests/test_employment_history_read.py, services/people-api/tests/test_employment_history_uuid_alias_integrity.py, services/people-api/tests/test_employment_history_review_regressions.py
인가 전 저장소 접근 차단, capability 교체 방지, 빈 결과의 필드 스키마 거부, 정확한 행 길이 검증, fail-closed 무결성 검사, UUID 별칭 분리 및 구조적 불변성을 검증했습니다.

Priority: ➖ Normal

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant read_employment_history
  participant authorize_resource_fields
  participant EmploymentHistoryReadPort
  participant AuthorizedEmploymentHistoryView
  Caller->>read_employment_history: 요청 필드와 known_at 전달
  read_employment_history->>read_employment_history: 구체 persistence 함수 정적 바인딩
  read_employment_history->>authorize_resource_fields: tenant, Person, purpose, 작업, 필드 인가
  read_employment_history->>EmploymentHistoryReadPort: 바인딩된 함수로 이력 조회
  EmploymentHistoryReadPort-->>read_employment_history: EmploymentHistoryRecord 튜플 반환
  read_employment_history->>AuthorizedEmploymentHistoryView: 행과 필드 검증 후 출력 구성
  AuthorizedEmploymentHistoryView-->>Caller: 인가된 Employment 이력 반환
Loading

Merge Risk: ⚪ Minimal · up to f95ba

The new Employment-history read boundary includes validation and regression coverage for its stated security and integrity contracts. No concrete merge-blocking issue remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.93% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 61 functions across 6 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 목적 바운드 Employment history 조회 API를 추가하는 PR의 핵심 변경을 정확하고 간결하게 설명합니다.
Full details: Docstring Coverage

Explanation

Docstring coverage is 63.93% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 61 functions across 6 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/people-employment-history-read

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant