Skip to content

feat(people): add assignment category correction provenance - #165

Draft
seonghobae wants to merge 75 commits into
feat/explicit-assignment-categoryfrom
feat/assignment-category-correction-provenance
Draft

feat(people): add assignment category correction provenance#165
seonghobae wants to merge 75 commits into
feat/explicit-assignment-categoryfrom
feat/assignment-category-correction-provenance

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Current exact stack

Refs #164. Correction/provenance child remains exact head b61491efe2cfa915cfdfbb9c0f7db49756614ee9 on parent/base #163@5d4133b29f19a8db92bda0e03ba3ae1470aae594, open · Draft · mechanically mergeable relative to that parent. Its valid correction delta and ancestry are preserved; no force/rebase or premature restack was performed.

The feature closes the recorded-open predecessor Assignment, creates a replacement preserving tenant/Employment/Person/Position/allocation/effective truth, and records normalized predecessor→replacement supersession provenance. legacy_unspecified remains outside this explicit-category correction path.

Prerequisite truth

Process #63#64#65#141 through ordinary protected integration. Then non-force adopt resulting protected truth into #163 and integrate #163 normally. Only after that may #165 non-force restack/adopt the integrated parent/protected truth and reacquire exact-head product/PostgreSQL/security/review evidence. docs/product-technical-gap-baseline.md remains single-writer-owned by #100.

No mutable-owner source copy, administrator bypass, self-approval, gate weakening, force-push, destructive rebase, no-op retrigger, or predecessor-evidence transfer.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 6d019283-3379-40ec-8ad4-ed17154058ab

📥 Commits

Reviewing files that changed from the base of the PR and between 14417af and 0817104.

📒 Files selected for processing (6)
  • docs/traceability/assignment-category-correction-provenance.md
  • services/people-api/src/orgmetra_people_api/assignment_correction_mutations.py
  • services/people-api/src/orgmetra_people_api/postgres_assignment_corrections.py
  • services/people-api/tests/test_assignment_correction_adapter_runtime_integrity.py
  • services/people-api/tests/test_assignment_correction_openapi_structure.py
  • services/people-api/tests/test_assignment_correction_result_runtime_integrity.py

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


📝 Walkthrough

Walkthrough

명시적 Assignment 카테고리 교정 기능을 추가했다. 도메인 연산은 predecessor를 종료하고 새 identity의 replacement와 supersession 사실을 생성한다. HTTP, 권한, PostgreSQL 영속성, 멱등성, RLS, append-only 및 CI 검증을 추가했다.

Changes

Assignment 카테고리 교정

Layer / File(s) Summary
도메인 교정 계약
packages/hris-kernel/src/orgmetra_hris_kernel/assignment_correction.py, packages/hris-kernel/src/orgmetra_hris_kernel/__init__.py, packages/hris-kernel/tests/test_assignment_category_correction.py
명시적 카테고리와 operational UUID를 검증한다. predecessor interval을 종료하고 replacement 및 supersession 사실을 생성한다.
명령 및 HTTP 경계
services/people-api/src/orgmetra_people_api/assignment_correction_mutations.py, services/people-api/src/orgmetra_people_api/assignment_correction_http.py, services/people-api/assignment-correction.openapi.yaml, services/people-api/src/orgmetra_people_api/__init__.py, services/people-api/tests/*, services/people-api/README.md
purpose-bound command와 digest를 추가한다. category 필드만 correct_record로 승인한다. POST route, 인증, tenant 및 actor binding, 입력 검증, 오류 응답과 OpenAPI 계약을 구현하고 검증한다.
PostgreSQL 영속성과 계보
services/people-api/src/orgmetra_people_api/postgres_assignment_corrections.py, database/migrations/0018_assignment_category_supersession.sql, database/migrations/0019_assignment_correction_idempotency_route.sql, services/people-api/tests/test_postgres_assignment_corrections.py
잠금과 portfolio 재검증 후 단일 트랜잭션으로 predecessor 종료, replacement 및 supersession 삽입, audit outbox와 idempotency evidence 저장을 수행한다. replay 시 기존 결과를 반환하고 의미가 변경되면 거부한다.
데이터베이스 통합 검증
tests/test_assignment_category_correction_postgres.sh, tests/test_assignment_correction_idempotency_postgres.sh
supersession linkage, tenant RLS, append-only, UUID 및 시간 제약, business truth 보존, predecessor 유일성, idempotency route 제약을 PostgreSQL에서 검증한다.
추적성과 품질 자동화
docs/traceability/assignment-category-correction-provenance.md, .github/workflows/assignment-correction-quality.yml
교정 경계와 구현 증거를 문서화한다. kernel, People API, PostgreSQL persistence 및 idempotency 테스트를 고정 commit과 PostgreSQL 16.14 환경에서 실행한다.

Estimated code review effort: 5 (Critical) | ~120 minutes

Merge Risk: ⚪ Minimal · up to 08171

This change adds provenance-backed Assignment category corrections, replacing an open predecessor with a linked corrected record while preserving its core assignment attributes. No concrete current merge-readiness risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant AssignmentCorrectionAsgiApp
  participant correct_assignment_record_category
  participant PostgresAssignmentCorrectionMutationPort
  participant PostgreSQL
  Client->>AssignmentCorrectionAsgiApp: POST category correction
  AssignmentCorrectionAsgiApp->>correct_assignment_record_category: 인증된 command 전달
  correct_assignment_record_category->>PostgresAssignmentCorrectionMutationPort: category correction 실행
  PostgresAssignmentCorrectionMutationPort->>PostgreSQL: replay 확인 및 predecessor 잠금
  PostgresAssignmentCorrectionMutationPort->>PostgreSQL: predecessor 종료와 replacement/supersession 저장
  PostgreSQL-->>PostgresAssignmentCorrectionMutationPort: transaction commit
  PostgresAssignmentCorrectionMutationPort-->>AssignmentCorrectionAsgiApp: replacement 및 supersession ID
  AssignmentCorrectionAsgiApp-->>Client: 201 response
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 95.15% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 103 functions across 16 files. (1 skipped: …
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 제목은 Assignment category correction provenance 기능 추가라는 주요 변경 사항을 정확하게 요약합니다. 간결하고 관련성이 높습니다.
✨ 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 feat/assignment-category-correction-provenance

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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 80be07bb5d2cc7de46fd95aef4864eab21039d03, especially the correction-specific recorded-time trust boundary: regression b01d387f…, fixed-offset detachment 8a8a2afd…, exact-head workflow inclusion 6aa7b915…, coverability cleanup ffca8855…, and offsetless/timedelta-subtype edge coverage 80be07bb…. Treat predecessor review results as stale for this head.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="80be07bb5d2cc7de46fd95aef4864eab21039d03"
commits=(
  "b01d387f"
  "8a8a2afd"
  "6aa7b915"
  "ffca8855"
  "80be07bb"
)

echo "== Exact HEAD =="
git rev-parse HEAD
git status --short
git show --no-patch --format='head=%H%nparents=%P%nsubject=%s' "$head"
test "$(git rev-parse HEAD)" = "$head"

echo "== Cited commits and ancestry =="
for prefix in "${commits[@]}"; do
  commit="$(git rev-parse "${prefix}^{commit}")"
  git show --no-patch --format='commit=%H%nparents=%P%nsubject=%s' "$commit"
  if git merge-base --is-ancestor "$commit" "$head"; then
    echo "ancestor_of_head=yes"
  else
    echo "ancestor_of_head=no"
  fi
  echo "== Files changed by $commit =="
  git diff-tree --no-commit-id --name-status -r "$commit"
done

echo "== Cited focused diffs =="
for prefix in "${commits[@]}"; do
  commit="$(git rev-parse "${prefix}^{commit}")"
  echo "-- $commit"
  git diff --unified=100 "${commit}^" "$commit" -- \
    packages/hris-kernel/src/orgmetra_hris_kernel/assignment_correction.py \
    packages/hris-kernel/tests \
    services/people-api/tests \
    .github/workflows/assignment-correction-quality.yml \
    docs/traceability/assignment-category-correction-provenance.md
done

echo "== Candidate files =="
fd -a -t f . \
  packages/hris-kernel/src \
  packages/hris-kernel/tests \
  services/people-api/tests \
  .github/workflows \
  docs/traceability \
  2>/dev/null \
  | while IFS= read -r file; do
      if rg -q 'recorded_at|timedelta|utcoffset|timezone|AssignmentSupersessionFact|assignment.category.correction|assignment_correction' "$file"; then
        echo "-- $file"
      fi
    done

echo "== Candidate outlines =="
for file in \
  packages/hris-kernel/src/orgmetra_hris_kernel/assignment_correction.py \
  packages/hris-kernel/tests/test_assignment_category_correction.py
do
  if [ -f "$file" ]; then
    echo "-- $file"
    ast-grep outline "$file" --items all || true
  fi
done

echo "== Recorded-time validation and test assertions =="
rg -n -C 12 \
  'recorded_at|timedelta|utcoffset|timezone|tzinfo|type\(.*datetime|type\(.*timedelta|AssignmentSupersessionFact|correct_assignment_category' \
  packages/hris-kernel/src \
  packages/hris-kernel/tests \
  services/people-api/tests \
  docs/traceability \
  2>/dev/null || true

echo "== Focused source and tests =="
sed -n '1,280p' packages/hris-kernel/src/orgmetra_hris_kernel/assignment_correction.py
sed -n '1,420p' packages/hris-kernel/tests/test_assignment_category_correction.py

echo "== Workflow inclusion and coverage configuration =="
if [ -f .github/workflows/assignment-correction-quality.yml ]; then
  cat -n .github/workflows/assignment-correction-quality.yml
fi
rg -n -C 5 \
  'coverage|--branch|--fail-under|hris-kernel|test_assignment_category_correction|unittest discover|pytest' \
  .github packages/hris-kernel 2>/dev/null || true

Length of output: 203405


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="80be07bb5d2cc7de46fd95aef4864eab21039d03"
log="/tmp/coderabbit-shell-logs/shell-output-aX5yR9"
test_file="packages/hris-kernel/tests/test_assignment_category_correction_recorded_time_integrity.py"
source_file="packages/hris-kernel/src/orgmetra_hris_kernel/assignment_correction.py"
workflow=".github/workflows/assignment-correction-quality.yml"

echo "== Exact-head and cited-commit results from first inspection =="
rg -n -A5 -B2 \
  '== Exact HEAD ==|^head=|^commit=|ancestor_of_head=|^80be07bb5d2cc7de46fd95aef4864eab21039d03$' \
  "$log" || true

echo "== Dedicated recorded-time integrity test =="
cat -n "$test_file"

echo "== Final edge-coverage commit diff =="
git diff --unified=140 "${head}^" "$head" -- "$source_file" "$test_file" "$workflow"

echo "== Regression and fixed-offset detachment diffs =="
for prefix in b01d387f 8a8a2afd ffca8855; do
  commit="$(git rev-parse "${prefix}^{commit}")"
  echo "-- $commit"
  git diff --unified=140 "${commit}^" "$commit" -- "$source_file" "$test_file"
done

echo "== Exact-head workflow inclusion diff =="
commit="$(git rev-parse '6aa7b915^{commit}')"
git diff --unified=140 "${commit}^" "$commit" -- "$workflow"

echo "== Recorded-time flow and non-domain exception paths =="
rg -n -C 10 \
  '_require_recorded_at|close_recorded_interval|RecordedInterval\(start=recorded_at\)|AssignmentSupersessionFact\(|timezone\(offset\)|except Exception' \
  "$source_file" "$test_file"

echo "== Test configuration =="
sed -n '19,45p' packages/hris-kernel/pyproject.toml

Length of output: 60149


@seonghobae I reviewed exact head 80be07bb5d2cc7de46fd95aef4864eab21039d03.

I found no actionable issue in the requested scope.

The checked-out commit matches the requested head. The regression b01d387f…, fixed-offset detachment 8a8a2afd…, workflow inclusion 6aa7b915…, coverability cleanup ffca8855…, and final edge coverage are ancestors of this head.

_require_recorded_at accepts only an exact datetime with tzinfo. It resolves the offset under exception handling. It then requires an exact timedelta. The function creates datetime.timezone(offset) and replaces the caller-owned tzinfo.

correct_assignment_category normalizes recorded_at before it closes the predecessor or creates the replacement and supersession facts. AssignmentSupersessionFact.__post_init__ also normalizes its direct recorded_at input. The caller timezone implementation therefore cannot persist in returned correction evidence.

test_assignment_category_correction_recorded_time_integrity.py verifies:

  • Fixed-offset caller timezone detachment on all three returned timestamps.
  • Direct AssignmentSupersessionFact construction detachment.
  • CorrectionError normalization when utcoffset() raises.
  • Rejection of an offsetless timezone provider.
  • Rejection of a caller-defined timedelta subtype.

The assignment-correction workflow checks out the exact PR head and verifies the checkout SHA. It runs both correction-domain test modules, including the recorded-time integrity regression. The HRIS kernel test configuration enables branch coverage and requires 100% coverage.

I did not execute repository tests or hosted workflows in this static-inspection sandbox.


🧠 Learnings used
Learnt from: seonghobae
Repo: ContextualWisdomLab/Orgmetra

Timestamp: 2026-09-03T00:10:19.811Z
Learning: In `services/people-api/tests/test_postgres_assignment_corrections.py`, the PostgreSQL Assignment category-correction lock-order contract must identify the predecessor locator separately from `_LOCK_ASSIGNMENT_PORTFOLIO_SQL`. It must require deterministic `ORDER BY assignment.assignment_record_id`, assert `Employment < Position < portfolio < clock < writes`, and assert `cursor.fetchall_rows == []` so the test detects removal of portfolio revalidation.

Learnt from: seonghobae
Repo: ContextualWisdomLab/Orgmetra PR: 165
File: services/people-api/src/orgmetra_people_api/postgres_assignment_corrections.py:392-392
Timestamp: 2026-09-03T00:10:10.323Z
Learning: In `services/people-api/src/orgmetra_people_api/postgres_assignment_corrections.py`, Assignment category correction transactions must use the deadlock-safe lock order: perform an unlocked predecessor locator read, then lock Employment, then Position, then lock the related Assignment portfolio with `assignment_record_id` ordering. Revalidate the predecessor from the locked portfolio, and read the database clock only after all authoritative row locks are acquired. This removes the deadlock cycle between corrections for different Employments that share one Position; do not mask this condition only with SQLSTATE `40P01` retries.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Current exact head advanced by formatting-only successor to 55279794d163d135178b6445baa9d613d5aea7ac. Please bind any new review to this SHA; predecessor review/check evidence does not transfer.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="55279794d163d135178b6445baa9d613d5aea7ac"

echo "== Exact checked-out head =="
git rev-parse HEAD
git status --short
git show --no-patch --format='head=%H%nparents=%P%nsubject=%s' "$head"
test "$(git rev-parse HEAD)" = "$head"

parent="$(git rev-parse "${head}^")"
printf 'parent=%s\n' "$parent"

echo "== Successor delta =="
git diff --name-status "$parent..$head"
git diff --check "$parent..$head"
git diff --stat "$parent..$head"
git diff --unified=100 "$parent..$head"

echo "== Assignment-correction files in the exact tree =="
fd -a -t f . \
  packages/hris-kernel/src \
  packages/hris-kernel/tests \
  services/people-api/src \
  services/people-api/tests \
  .github/workflows \
  docs/traceability \
  2>/dev/null \
  | while IFS= read -r file; do
      if rg -q 'AssignmentCorrection|assignment_correction|assignment.category.correction|category-corrections|AssignmentSupersessionFact' "$file"; then
        echo "-- $file"
      fi
    done

echo "== Outline changed Python files, if any =="
git diff --name-only "$parent..$head" -- '*.py' \
  | while IFS= read -r file; do
      [ -f "$file" ] || continue
      echo "-- $file"
      ast-grep outline "$file" --items all || true
    done

echo "== Coverage and exact-head workflow references =="
rg -n -C 5 \
  'coverage|--branch|--fail-under|github\.sha|test_assignment_category_correction|services/people-api/tests' \
  .github/workflows packages/hris-kernel services/people-api 2>/dev/null || true

Length of output: 111648


@seonghobae I reviewed exact head 55279794d163d135178b6445baa9d613d5aea7ac.

I found no actionable issue in the successor delta.

The checked-out commit matches the requested SHA. Its direct parent is 80be07bb5d2cc7de46fd95aef4864eab21039d03.

The successor changes only packages/hris-kernel/tests/test_assignment_category_correction_recorded_time_integrity.py. The changes format imports and assertion arguments. The changes also simplify test docstrings. They do not change test inputs, assertions, parameterization, or runtime behavior.

The test still covers fixed-offset timezone detachment, direct AssignmentSupersessionFact construction, timezone-provider failure, offsetless timezone providers, and timedelta subtype rejection.

The assignment-correction workflow checks out the exact PR head and verifies the SHA. It includes this recorded-time test module. The HRIS kernel configuration requires 100% statement and branch coverage.

I did not execute repository tests in this sandbox.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head b61491efe2cfa915cfdfbb9c0f7db49756614ee9. This head preserves the recorded-time trust-boundary repair and non-force adopts current parent #163@5d4133b29f19a8db92bda0e03ba3ae1470aae594 / protected develop@ef1b143368cb6249c9520ca8cae10ebe844a5aa1. Treat all predecessor review/check evidence as stale for integration authority.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="b61491efe2cfa915cfdfbb9c0f7db49756614ee9"
parent_163="5d4133b29f19a8db92bda0e03ba3ae1470aae594"
develop="ef1b143368cb6249c9520ca8cae10ebe844a5aa1"
source_file="packages/hris-kernel/src/orgmetra_hris_kernel/assignment_correction.py"
test_file="packages/hris-kernel/tests/test_assignment_category_correction_recorded_time_integrity.py"
workflow=".github/workflows/assignment-correction-quality.yml"
traceability="docs/traceability/assignment-category-correction-provenance.md"

echo "== Exact head and working tree =="
git rev-parse HEAD
git status --short
git show --no-patch --format='head=%H%nparents=%P%nsubject=%s' "$head"
test "$(git rev-parse HEAD)" = "$head"

echo "== Referenced integration commits =="
for commit in "$parent_163" "$develop"; do
  git show --no-patch --format='commit=%H%nparents=%P%nsubject=%s' "$commit"
  if git merge-base --is-ancestor "$commit" "$head"; then
    echo "ancestor_of_head=yes"
  else
    echo "ancestor_of_head=no"
  fi
done

echo "== Head parent topology =="
git rev-list --parents -n 1 "$head"
for parent in $(git show -s --format=%P "$head"); do
  git show --no-patch --format='parent=%H%nsubject=%s' "$parent"
  if git merge-base --is-ancestor "$parent_163" "$parent"; then
    echo "parent_retains_163=yes"
  fi
  if git merge-base --is-ancestor "$develop" "$parent"; then
    echo "parent_retains_develop=yes"
  fi
done

echo "== Changes from each direct parent to exact head =="
for parent in $(git show -s --format=%P "$head"); do
  echo "-- parent $parent"
  git diff --name-status "$parent..$head"
done

echo "== Recorded-time implementation and test map =="
for file in "$source_file" "$test_file"; do
  echo "-- $file"
  ast-grep outline "$file" --items all || true
done

rg -n -C 12 \
  '_require_recorded_at|utcoffset|timedelta|timezone\(offset\)|recorded_at|AssignmentSupersessionFact|correct_assignment_category' \
  "$source_file" "$test_file" "$traceability"

echo "== Focused current source and regression test =="
sed -n '1,300p' "$source_file"
cat -n "$test_file"

echo "== Exact-head workflow inclusion and coverage configuration =="
cat -n "$workflow"
rg -n -C 5 \
  'github\.sha|test_assignment_category_correction|recorded_time_integrity|coverage|--branch|--fail-under' \
  "$workflow" packages/hris-kernel 2>/dev/null || true

echo "== Diff hygiene =="
git diff --check "${head}^..${head}"

Length of output: 125747


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="b61491efe2cfa915cfdfbb9c0f7db49756614ee9"
child_parent="55279794d163d135178b6445baa9d613d5aea7ac"

echo "== Direct merge delta =="
git diff --check "$child_parent..$head"
git diff --unified=160 "$child_parent..$head" -- \
  .github/workflows/foundation-ci.yml \
  .github/workflows/recovery-rehearsal-quality.yml

echo "== Current workflow structure =="
for file in \
  .github/workflows/foundation-ci.yml \
  .github/workflows/recovery-rehearsal-quality.yml
do
  echo "-- $file"
  rg -n -C 8 \
    '^(name:|on:|  pull_request:|    paths:|      - |jobs:|  [A-Za-z0-9_-]+:|    if:|        run:|        env:)|ARCHITECTURE|ERD|UML|SECURITY|THREAT_MODEL|OPERABILITY|TEST_STRATEGY|manifest|inventory|path' \
    "$file"
done

echo "== Parent provenance for workflow changes =="
for file in \
  .github/workflows/foundation-ci.yml \
  .github/workflows/recovery-rehearsal-quality.yml
do
  echo "-- $file"
  git diff --unified=100 "$child_parent..$head" -- "$file"
  git log -1 --format='head-touch=%H %s' "$head" -- "$file"
done

Length of output: 27329


@seonghobae I reviewed exact head b61491efe2cfa915cfdfbb9c0f7db49756614ee9.

I found no actionable issue in the requested scope.

The checked-out commit matches the requested SHA. Its direct parents are:

  • 55279794d163d135178b6445baa9d613d5aea7ac
  • #163@5d4133b29f19a8db92bda0e03ba3ae1470aae594

develop@ef1b143368cb6249c9520ca8cae10ebe844a5aa1 is an ancestor of the #163 parent. The merge retains both parent histories. Git topology cannot independently prove the remote update method. The topology does show that the merge does not discard either history.

The correction-specific recorded-time boundary remains intact in packages/hris-kernel/src/orgmetra_hris_kernel/assignment_correction.py. _require_recorded_at requires an exact timezone-aware datetime, resolves an exact timedelta offset, and replaces caller-owned tzinfo with datetime.timezone(offset). correct_assignment_category performs this normalization before it closes the predecessor and constructs the replacement and supersession facts.

packages/hris-kernel/tests/test_assignment_category_correction_recorded_time_integrity.py still verifies fixed-offset detachment, direct supersession construction, timezone-provider failure, offsetless timezone values, and caller-defined timedelta subtypes.

.github/workflows/assignment-correction-quality.yml checks out the exact candidate SHA, verifies the checkout SHA, and runs the recorded-time regression module. The HRIS kernel configuration requires 100% statement and branch coverage.

The merge delta removes documentation paths-ignore filters from the Foundation CI and recovery rehearsal workflows. This restores contract checks for documentation-only changes. I found no adverse interaction with the Assignment correction workflow.

I did not execute repository tests or hosted workflows in this static-inspection sandbox.


✏️ Learnings added
Learnt from: seonghobae
URL: https://github.com/ContextualWisdomLab/Orgmetra/pull/165

Timestamp: 2026-09-03T05:46:58.498Z
Learning: For ContextualWisdomLab/Orgmetra PR `#165`, predecessor review and check results are not integration authority after a new current-head merge or restack. Review evidence must be bound to the exact current head and must verify retained parent and protected-branch ancestry.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: seonghobae
Repo: ContextualWisdomLab/Orgmetra

Timestamp: 2026-09-03T00:10:19.811Z
Learning: In `services/people-api/tests/test_postgres_assignment_corrections.py`, the PostgreSQL Assignment category-correction lock-order contract must identify the predecessor locator separately from `_LOCK_ASSIGNMENT_PORTFOLIO_SQL`. It must require deterministic `ORDER BY assignment.assignment_record_id`, assert `Employment < Position < portfolio < clock < writes`, and assert `cursor.fetchall_rows == []` so the test detects removal of portfolio revalidation.

Learnt from: seonghobae
Repo: ContextualWisdomLab/Orgmetra PR: 165
File: services/people-api/src/orgmetra_people_api/postgres_assignment_corrections.py:392-392
Timestamp: 2026-09-03T00:10:10.323Z
Learning: In `services/people-api/src/orgmetra_people_api/postgres_assignment_corrections.py`, Assignment category correction transactions must use the deadlock-safe lock order: perform an unlocked predecessor locator read, then lock Employment, then Position, then lock the related Assignment portfolio with `assignment_record_id` ordering. Revalidate the predecessor from the locked portfolio, and read the database clock only after all authoritative row locks are acquired. This removes the deadlock cycle between corrections for different Employments that share one Position; do not mask this condition only with SQLSTATE `40P01` retries.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

Owner-path freshness update: canonical #65 is now exact head 5e1eb4a5146ca1fb29e93a66f7475c469c14a9ed on protected base develop@ef1b143368cb6249c9520ca8cae10ebe844a5aa1. The latest material repair closes the principal comparison inconsistency left by tuple-backed storage: strict principal-only __eq__ no longer conflicts with inherited tuple.__ne__; both People and Job Analysis now implement strict __ne__. This is mutable owner work. #165 remains Draft and must wait for ordinary #65/#163 protected integration, then non-force adopt protected truth and reacquire exact-head gates; do not copy the owner source or transfer predecessor evidence.

Copy link
Copy Markdown
Contributor Author

Owner-path successor update: canonical #65 is now b468accb8a1db0f268b0c44f65e8f4bbb16e95e0. New RED 92f7eb41… closes returned-UUID aliasing left after tuple-backed principal storage: People/Job Analysis now store the validated tenant UUID integer and return a fresh UUID value per access (64deb92f… / b468accb…). This is mutable owner work and predecessor #65 review/check evidence does not transfer. #165 remains Draft; wait for ordinary #65 then #163 protected integration, non-force adopt protected truth, and reacquire exact-head gates.

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