Skip to content

feat: normalize candidate application lifecycle - #66

Draft
seonghobae wants to merge 57 commits into
developfrom
feat/normalized-candidate-application
Draft

feat: normalize candidate application lifecycle#66
seonghobae wants to merge 57 commits into
developfrom
feat/normalized-candidate-application

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Buyer-visible gap

Orgmetra currently conflates candidate identity with opening-specific recruiting lifecycle through a candidate-level application status. This lane adds tenant-qualified durable application identity, bitemporal Job/optional-Position scope versions, and bitemporal application-stage history while keeping employer terminal outcomes in governed decision boundaries.

Current domain contract

candidate_application_record is the immutable durable anchor; candidate_application_record_version carries bitemporal Job/optional-Position scope; candidate_application_stage_record carries non-terminal recruiting stages. Same-tenant Candidate/Job/Position integrity and Position→Job scope are enforced. Raw stages exclude generic closed, bare withdrawn, and hired so governed terminal-decision/withdrawal evidence cannot be bypassed. Forced RLS is exercised with NOBYPASSRLS regressions. No dedicated-writer dependency repository or cross-service application-table SQL is introduced.

Repair lineage

A CodeRabbit finding correctly identified that docs/ERD.md used the too-strong candidate_application_record ||--|{ candidate_application_record_version cardinality although the authoritative schema permits a durable application anchor with zero scope versions. Regression 10335192ec910c1daa23ce88fd475f18cba81253 pinned the optional ||--o{ edge; 29691f265d100361e2d5a70024e02672384c2da9 repaired the ERD; f27136f5febea21fb9b3cc7f22d4b564484a52be resealed the exact changed workflow/ERD artifacts. Those valid deltas remain preserved.

Live authority

  • exact head: 04c60a6d485c1af32973959c37c9133ae928f59b
  • PR recorded base snapshot: develop@9e3e4847510e1e612b48474ba42b177b8ed824df
  • current protected truth: develop@eb9757f8649aaad026a9865508d9aad50c1a7a4f
  • live state: open · Draft · mergeable=false

The older body text that called this PR non-draft/mergeable is superseded. Its prior exact-source hosted snapshot included broad technical success but terminal OpenCode/Strix failures. Protected develop has also advanced materially, so neither that old check rollup nor mechanical mergeability can authorize integration now.

Stack discipline

PR #67 is a dependency-first child and remains on this parent's old branch snapshot. Process #66 first: non-force adopt the then-current protected develop, preserve the normalized-application delta, reconcile migrations/ERD/provenance with protected truth, reseal exact changed artifacts, and rerun every applicable exact-current-head local/central gate. Only after normal protected integration should #67 adopt protected truth and reacquire its own withdrawal evidence. The separate unresolved ADR-manifest provenance dependency owned by #51 must likewise be revalidated from protected truth rather than copied from a mutable branch.

Do not force-push, destructively rebase, self-approve, use routine administrator bypass, weaken a gate, transfer parent/predecessor evidence, or mutate a dedicated-writer dependency.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

후보자 지원을 불변 앵커, bitemporal 범위 버전, 단계 이력으로 분리했다. 테넌트 격리와 변경·삭제·TRUNCATE 보호를 적용했다. PostgreSQL 계약 테스트와 CI 저장소 검증을 갱신했다.

Changes

후보자 지원 핵심

Layer / File(s) Summary
지원서 앵커 및 범위 버전 모델
database/migrations/0014_candidate_application_core.sql, docs/DATA_MODEL.md, docs/ERD.md, docs/adr/0026-normalized-candidate-application.md
불변 candidate_application_recordcandidate_application_record_version을 분리했다. 범위 무결성, bitemporal 중복 방지, 단계 연결, RLS, 변경 및 TRUNCATE 보호를 추가했다.
지원서 계약 및 보안 회귀 테스트
tests/test_candidate_application_postgres.sh, tests/test_candidate_application_decision_boundary_postgres.sh, tests/test_candidate_application_rls_postgres.sh
지원서 정정, 앵커 보존, 단계 계보, 참조 무결성, 중복 기간, RLS 및 TRUNCATE 차단을 검증한다.
품질 워크플로 및 저장소 검증 연결
.github/workflows/candidate-application-quality.yml, scripts/foundation-contract-core.mjs, tests/foundation-contract.test.mjs, tests/validate_repository.py, manifest.json
PostgreSQL 16.14에서 계약 테스트를 실행한다. 필수 아티팩트, 데이터베이스 객체, 마이그레이션 fixture, 매니페스트, 정확한 checkout 및 작업 트리 상태를 검증한다.
설계 근거 및 추적성 문서
docs/doctoring/candidate-application-references.md, docs/traceability/candidate-application-core.md, docs/adr/README.md, CHANGELOG.md
정규화 모델의 표준 근거, 설계 결정, 구현 추적성, ADR 인덱스 및 변경 로그를 갱신했다.

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

Merge Risk: 🔵 Low · up to 83918

The PR normalizes candidate application identity and lifecycle history. Current checks are green, but adding a uniqueness constraint to existing position data during deployment may briefly block reads and writes, so merge is low risk with owner awareness of the acceptable migration lock duration; the remaining documentation and test-maintenance issues are non-blocking.

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant GitHubActions
  participant PostgreSQL
  participant ContractTests
  PullRequest->>GitHubActions: trigger workflow
  GitHubActions->>PostgreSQL: start PostgreSQL 16.14
  GitHubActions->>ContractTests: run ordered PostgreSQL contracts
  ContractTests->>PostgreSQL: apply migration and validate protections
  PostgreSQL-->>ContractTests: return contract results
  ContractTests-->>GitHubActions: report tests and worktree status
Loading

Suggested reviewers: cursoragent

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 6 files. (9 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 제목은 후보자 지원 라이프사이클 정규화라는 이 PR의 주요 변경 사항을 정확하고 간결하게 설명합니다.
Full details: Docstring Coverage

Explanation

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

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/normalized-candidate-application

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.

@seonghobae
seonghobae marked this pull request as ready for review August 25, 2026 23:29
devin-ai-integration[bot]

This comment was marked as resolved.

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.

devin-ai-integration[bot]

This comment was marked as resolved.

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

Devin Review

Comment thread tests/foundation-contract.test.mjs
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