feat(people): add assignment category correction provenance - #165
feat(people): add assignment category correction provenance#165seonghobae wants to merge 75 commits into
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough명시적 Assignment 카테고리 교정 기능을 추가했다. 도메인 연산은 predecessor를 종료하고 새 identity의 replacement와 supersession 사실을 생성한다. HTTP, 권한, PostgreSQL 영속성, 멱등성, RLS, append-only 및 CI 검증을 추가했다. ChangesAssignment 카테고리 교정
Estimated code review effort: 5 (Critical) | ~120 minutes Merge Risk: ⚪ Minimal · up to 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
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review Please review exact current head |
|
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 || trueLength 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.tomlLength of output: 60149
I found no actionable issue in the requested scope. The checked-out commit matches the requested head. The regression
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 usedYou are interacting with an AI system. |
|
@coderabbitai review Current exact head advanced by formatting-only successor to |
|
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 || trueLength of output: 111648
I found no actionable issue in the successor delta. The checked-out commit matches the requested SHA. Its direct parent is The successor changes only The test still covers fixed-offset timezone detachment, direct 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. |
|
@coderabbitai review Please review exact current head |
|
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"
doneLength of output: 27329
I found no actionable issue in the requested scope. The checked-out commit matches the requested SHA. Its direct parents are:
The correction-specific recorded-time boundary remains intact in
The merge delta removes documentation I did not execute repository tests or hosted workflows in this static-inspection sandbox. ✏️ Learnings added
🧠 Learnings usedYou are interacting with an AI system. |
|
Owner-path freshness update: canonical #65 is now exact head |
|
Owner-path successor update: canonical #65 is now |
Current exact stack
Refs #164. Correction/provenance child remains exact head
b61491efe2cfa915cfdfbb9c0f7db49756614ee9on 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_unspecifiedremains outside this explicit-category correction path.Prerequisite truth
72070cb4b8d636825ce5b1a326df4c296596ed7e: exact Foundation CI is terminal success after the predecessor real 218-test/99.43%-coverage RED and minimal three-branch test repair; remaining security/review gates still control integration.8f986853a6f234c317e29080c4982bab34f3dc51: fix(people): bind mutation results to the exact commanded HR identity #229–fix(people): require exact allocation-ratio text before Decimal parsing #232 preserve command/result/runtime-integrity boundaries; fix(people): reject zero assignment allocation at the published HTTP contract #233 now aligns Assignment allocation(0, 1.0000]across parser, published OpenAPI, regression tests, and deterministic manifest evidence. Source repair is complete on the mutable head, but exact hosted/security/review evidence remains non-terminal.1caf8f760e81f1cb6954fdf1d0d13a46dbb6c0b1: after fix(people): protect governed mutation runtime types #64 normal integration it must non-force adopt protected fix(people): protect governed mutation runtime types #64 and preserve fix(people): bind mutation results to the exact commanded HR identity #229–fix(people): reject zero assignment allocation at the published HTTP contract #233 together withvalidate_authorization_decision(...)durable-consumer validation.8d12ee7cd05549a69c6debf5e0de0c5fc8668f33: now Draft/non-mergeable on an old base and overlapping fix(people): protect governed mutation runtime types #64/fix(authz): protect purpose-bound runtime integrity #65; it follows fix(authz): protect purpose-bound runtime integrity #65 and must non-force adopt protected owner truth while preserving its legal-employer feature.develop; preserve it until all owner prerequisites integrate.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.mdremains 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.