fix(people): protect governed mutation runtime types - #64
Conversation
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughPeople 변이와 채용 수락 경계가 서브클래스를 거부하도록 변경되었습니다. UUID, 문자열, Decimal, 명령, 결과, 권한 결정, 시간값, PostgreSQL 행 형태에 정확한 타입 검사를 적용했습니다. 런타임 무결성 회귀 테스트와 변경 기록을 갱신했습니다. ChangesPeople 런타임 무결성
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to This change hardens People mutation and hire-acceptance inputs against executable subtype values while preserving supported built-in values and persistence behavior. No concrete current-head merge-blocking risk remains. 🚥 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 |
|
Exact-head repair/evidence update for the current branch state:
Fresh exact-current-head hosted evidence is terminal GREEN: People API Quality Live protected base remains |
|
Current exact-head follow-up after fresh review: A new review correctly identified that the three direct
Fresh exact-current-head hosted evidence is terminal GREEN:
Live protected base remains |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/Orgmetra"
head="e4d538c3e5c0707b650e4eeefb7d91dc4611fe9e"
base="eb9757f8649aaad026a9865508d9aad50c1a7a4f"
prior="62a6b7ac2908dce2ea760c13123f8685a6f0eb5c"
generic="services/people-api/src/orgmetra_people_api/mutations.py"
hire="services/people-api/src/orgmetra_people_api/hire.py"
postgres="services/people-api/src/orgmetra_people_api/postgres_mutations.py"
echo '== Exact head, ancestry, and PR state =='
printf 'checked_out='; git rev-parse HEAD
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
git cat-file -e "${prior}^{commit}"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true'
git merge-base --is-ancestor "$prior" "$head" && echo 'prior_is_ancestor=true'
gh pr view 64 --repo "$repo" \
--json number,state,isDraft,headRefOid,baseRefName,baseRefOid,mergeable,url
echo '== Issue `#231` =='
gh issue view 231 --repo "$repo" --json number,title,state,body,url
echo '== Successor sequence and changed paths =='
git log --reverse --format='commit %H%nparents %P%nsubject %s%n' "${prior}..${head}"
git diff --check "$base" "$head"
git diff --name-status "$prior" "$head"
git diff --stat "$prior" "$head"
echo '== Production paths changed after prior head =='
git diff --name-status "$prior" "$head" -- services/people-api/src
echo '== Per-commit scope after prior head =='
for commit in $(git rev-list --reverse "${prior}..${head}"); do
printf '\n-- %s --\n' "$commit"
git show --check --format='parents %P%nsubject %s%n' --name-status --no-renames "$commit"
done
echo '== Source maps =='
ast-grep outline "$generic" --items all
ast-grep outline "$hire" --items all
ast-grep outline "$postgres" --items all --match 'PostgresPeopleMutationPort'
echo '== Focused successor diff =='
git diff --unified=120 "$prior" "$head" -- \
"$generic" "$hire" "$postgres" services/people-api/tests
echo '== Application authorization, snapshots, and port-call ordering =='
rg -n -C 18 --glob '*.py' \
'(def\s+(create_employment_record|create_position_record|create_assignment_record|accept_confirmed_hire)\b|replace\s*\(|dataclasses\.replace|authorize|authorization|expected_(employment|position|assignment|person|conversion|candidate_worker).*record_id|mutation_port\.|port\.(create_|accept_)|result\.[A-Za-z_]+|command\.[A-Za-z_]+)' \
"$generic" "$hire" services/people-api/tests
echo '== Direct PostgreSQL command-detachment ordering =='
rg -n -C 16 \
'(def\s+(create_employment|create_position|create_assignment)\b|replace\s*\(|_require_authorization\s*\(|connection_factory\s*\(|command\.[A-Za-z_]+)' \
"$postgres"
echo '== Candidate `#231` regression modules =='
fd -t f . services/people-api/tests | rg -i \
'(authorization|purpose|detach|post.*construction|result.*(identity|target|snapshot)|mutation.*integrity|hire.*integrity)' \
| while IFS= read -r file; do
echo "== ${file} =="
cat -n "$file"
done
echo '== Search for result comparisons that read command fields after port calls =='
rg -n -C 8 --glob '*.py' \
'result\.(employment_record_id|position_record_id|assignment_record_id|person_record_id|candidate_worker_conversion_record_id)\s*!=\s*command\.' \
services/people-api/src/orgmetra_people_api
echo '== Exact-head hosted checks and reviews =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'
gh pr view 64 --repo "$repo" --json reviews \
--jq '.reviews[] | [.author.login, .state, .commit.oid] | `@tsv`'Length of output: 9359 #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/Orgmetra"
head="e4d538c3e5c0707b650e4eeefb7d91dc4611fe9e"
prior="62a6b7ac2908dce2ea760c13123f8685a6f0eb5c"
test_first="f7415084d801bc06be316b022f41f53763197882"
generic="services/people-api/src/orgmetra_people_api/mutations.py"
hire="services/people-api/src/orgmetra_people_api/hire.py"
postgres="services/people-api/src/orgmetra_people_api/postgres_mutations.py"
snapshot_test="services/people-api/tests/test_people_mutation_authorization_command_snapshot.py"
echo '== Per-commit scopes and whitespace =='
for commit in "$test_first" "$head"; do
printf '\n-- %s --\n' "$commit"
git show --check --format='parents %P%nsubject %s%n' --no-patch "$commit"
git diff-tree --no-commit-id --name-status -r "$commit"
done
echo '== `#231` test-first diff and production repair diff =='
git diff --unified=120 "${test_first}^" "$test_first" -- "$snapshot_test"
git diff --unified=120 "${head}^" "$head" -- "$generic"
echo '== Final application mutation services =='
ast-grep outline "$generic" --items all
sed -n '1,500p' "$generic"
echo '== `#231` regression module =='
cat -n "$snapshot_test"
echo '== Authorization-to-port ordering and expected-result snapshots =='
rg -n -C 20 --glob '*.py' \
'(def\s+create_(employment|position|assignment)_record\b|command\s*=\s*replace\s*\(command\)|expected_(employment|position|assignment)_record_id|authorize|authorization|mutation_port\.|result\.(employment|position|assignment)_record_id)' \
"$generic" "$snapshot_test"
echo '== `#229` hire result-target snapshot remains intact =='
rg -n -C 20 \
'(def\s+accept_confirmed_hire\b|expected_(person|employment|candidate_worker_conversion)_record_id|HireAcceptanceResult\.__post_init__|result\.(person|employment|candidate_worker_conversion)_record_id)' \
"$hire"
echo '== `#230` PostgreSQL detachment remains intact =='
rg -n -C 18 \
'(def\s+(create_employment|create_position|create_assignment)\b|command\s*=\s*replace\s*\(command\)|_require_authorization\s*\(|connection_factory\s*\(|command\.[A-Za-z_]+)' \
"$postgres"
echo '== Changed production scope after the `#229` head =='
git diff --check "$prior" "$head"
git diff --name-status "$prior" "$head" -- services/people-api/src
git diff --stat "$prior" "$head" -- services/people-api/src
echo '== Current-head checks and reviews =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'
gh pr view 64 --repo "$repo" --json reviews \
--jq '.reviews[] | [.author.login, .state, .commit.oid] | `@tsv`'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
repo="ContextualWisdomLab/Orgmetra"
head="9771be6d65bef77408cd5ad1ae316f0a8d8fb5e3"
base="eb9757f8649aaad026a9865508d9aad50c1a7a4f"
test_first="f7415084d801bc06be316b022f41f53763197882"
prior="e4d538c3e5c0707b650e4eeefb7d91dc4611fe9e"
generic="services/people-api/src/orgmetra_people_api/mutations.py"
hire="services/people-api/src/orgmetra_people_api/hire.py"
postgres="services/people-api/src/orgmetra_people_api/postgres_mutations.py"
echo '== Exact revision and PR metadata =='
printf 'checked_out='; git rev-parse HEAD
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
git cat-file -e "${test_first}^{commit}"
git cat-file -e "${prior}^{commit}"
gh pr view 64 --repo "$repo" \
--json number,state,isDraft,headRefOid,baseRefName,baseRefOid,mergeable,url
echo '== Issue `#231` =='
gh issue view 231 --repo "$repo" --json number,title,state,body,url
echo '== Requested chain ancestry and commit scope =='
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true'
git merge-base --is-ancestor "$test_first" "$head" && echo 'test_first_is_ancestor=true'
git merge-base --is-ancestor "$prior" "$head" && echo 'prior_is_ancestor=true'
git log --reverse --format='commit %H%nparents %P%nsubject %s%n' "${test_first}^..${head}"
for commit in $(git rev-list --reverse "${test_first}^..${head}"); do
printf '\n-- %s --\n' "$commit"
git show --check --format='subject %s' --no-patch "$commit"
git diff-tree --no-commit-id --name-status -r "$commit"
done
echo '== Delta and production scope =='
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"
git diff --stat "$base" "$head"
echo '== Production paths changed after prior `#231` repair head =='
git diff --name-status "$prior" "$head" -- services/people-api/src
echo '== Production diff after prior `#231` repair head =='
git diff --unified=100 "$prior" "$head" -- services/people-api/src
echo '== Source maps =='
ast-grep outline "$generic" --items all
ast-grep outline "$hire" --items all
ast-grep outline "$postgres" --items all --match 'PostgresPeopleMutationPort'
echo '== Complete focused implementation and regression delta =='
git diff --unified=140 "${test_first}^" "$head" -- \
"$generic" "$hire" "$postgres" services/people-api/tests
echo '== Detachment, authorization, port call, and result-binding contexts =='
rg -n -C 20 --glob '*.py' \
'(def\s+(create_employment_record|create_position_record|create_assignment_record|accept_confirmed_hire|create_employment|create_position|create_assignment)\b|command\s*=\s*replace\s*\(command\)|dataclasses\.replace|authorize|authorization|expected_(employment|position|assignment|person|candidate_worker_conversion)_record_id|mutation_port\.|port\.(create_|accept_)|result\.(employment|position|assignment|person|candidate_worker_conversion)_record_id|_require_authorization\s*\(|connection_factory\s*\()' \
"$generic" "$hire" "$postgres" services/people-api/tests
echo '== Candidate `#231` and retained-boundary tests =='
fd -t f . services/people-api/tests | rg -i \
'(authorization.*(snapshot|command|detach)|hire.*(authorization|snapshot|integrity)|mutation.*(result|snapshot|post.*construction|integrity)|postgres.*mutation.*(post.*construction|integrity))' \
| while IFS= read -r file; do
echo "== ${file} =="
sed -n '1,340p' "$file"
done
echo '== Result comparisons that read command identities after port calls =='
rg -n -C 10 --glob '*.py' \
'result\.(employment_record_id|position_record_id|assignment_record_id|person_record_id|candidate_worker_conversion_record_id)\s*!=\s*command\.' \
services/people-api/src/orgmetra_people_api
echo '== Exact-head checks and reviews =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | [.name, .status, .conclusion, .details_url] | `@tsv`'
gh pr view 64 --repo "$repo" --json reviews \
--jq '.reviews[] | [.author.login, .state, .commit.oid] | `@tsv`'Length of output: 105186 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/Orgmetra"
head="9771be6d65bef77408cd5ad1ae316f0a8d8fb5e3"
base="eb9757f8649aaad026a9865508d9aad50c1a7a4f"
commits=(
"f7415084d801bc06be316b022f41f53763197882"
"e4d538c3e5c0707b650e4eeefb7d91dc4611fe9e"
"5a6354a9"
"9771be6d65bef77408cd5ad1ae316f0a8d8fb5e3"
)
generic="services/people-api/src/orgmetra_people_api/mutations.py"
hire="services/people-api/src/orgmetra_people_api/hire.py"
postgres="services/people-api/src/orgmetra_people_api/postgres_mutations.py"
echo '== Exact head and PR =='
printf 'checked_out='; git rev-parse HEAD
gh pr view 64 --repo "$repo" --json headRefOid,baseRefOid,state,isDraft,mergeable \
--jq '{headRefOid,baseRefOid,state,isDraft,mergeable}'
echo '== Requested chain =='
for ref in "${commits[@]}"; do
commit="$(git rev-parse "${ref}^{commit}")"
printf '\ncommit=%s\n' "$commit"
git show --no-patch --format='parents %P%nsubject %s'
git diff-tree --no-commit-id --name-status -r "$commit"
git diff --check "${commit}^" "$commit"
done
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true'
echo '== Source delta after `#231` test-first =='
git diff --stat "${commits[0]}^" "$head" -- "$generic" "$hire" "$postgres" services/people-api/tests
git diff --name-status "${commits[0]}^" "$head" -- services/people-api/src
echo '== Application mutation service methods =='
rg -n -A90 -B5 \
'^(def (create_employment_record|create_position_record|create_assignment_record)\b)' \
"$generic"
echo '== Confirmed-hire application method =='
rg -n -A120 -B5 '^def accept_confirmed_hire\b' "$hire"
echo '== Direct PostgreSQL mutation entry methods =='
rg -n -A75 -B5 '^\s+def (create_employment|create_position|create_assignment)\b' "$postgres"
echo '== `#231` focused test files and test definitions =='
fd -t f . services/people-api/tests | rg -i '(authorization.*(snapshot|command)|hire.*authorization.*snapshot)' \
| while IFS= read -r file; do
echo "== ${file} =="
rg -n -A75 -B8 '^(def test_|class _)' "$file"
done
echo '== Post-port result identity reads =='
rg -n -C 8 \
'expected_(employment|position|assignment|person|candidate_worker_conversion)_record_id|result\.(employment_record_id|position_record_id|assignment_record_id|person_record_id|candidate_worker_conversion_record_id)' \
"$generic" "$hire"
echo '== Exact-head checks =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | "\(.name)\t\(.status)\t\(.conclusion // "null")"'
echo '== Exact-head reviews =='
gh pr view 64 --repo "$repo" --json reviews \
--jq '.reviews[] | "\(.author.login)\t\(.state)\t\(.commit.oid)"'Length of output: 50699
I found no defect in the inspected The four application services use the same safe order:
This order applies to:
The The The The code changes after the
The requested commit-parent sequence was not independently verified because the collection command omitted the commit argument when it printed parents. The changed-file scopes for all four specified commits were collected. Exact-head hosted checks are queued or skipped, so their final status is inconclusive. I did not use predecessor review or check evidence. You are interacting with an AI system. |
|
@coderabbitai review Please review exact head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/Orgmetra"
head="8d3877650865f71c4d9708b06eb55f43a7cb7661"
base="eb9757f8649aaad026a9865508d9aad50c1a7a4f"
prior="9771be6d65bef77408cd5ad1ae316f0a8d8fb5e3"
echo '== Exact revision, ancestry, and pull request metadata =='
printf 'checked_out='; git rev-parse HEAD
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true'
gh pr view 64 --repo "$repo" \
--json number,state,isDraft,headRefOid,baseRefName,baseRefOid,mergeable,url
echo '== Issue `#232` =='
gh issue view 232 --repo "$repo" --json number,title,state,body,url
echo '== Successor sequence and changed paths =='
git log --reverse --format='commit %H%nparents %P%nsubject %s%n' "${prior}..${head}"
for commit in $(git rev-list --reverse "${prior}..${head}"); do
printf '\n-- %s --\n' "$commit"
git show --check --format='subject %s' --no-patch "$commit"
git diff-tree --no-commit-id --name-status -r "$commit"
done
git diff --check "$base" "$head"
echo '== Production changes after prior head =='
git diff --name-status "$prior" "$head" -- services/people-api/src
git diff --stat "$prior" "$head"
echo '== Locate Assignment HTTP parser and candidate tests =='
fd -t f . services/people-api | rg -i '(http|api|route|handler|assignment|allocation|runtime.*integrity)'
rg -n -C 16 --glob '*.py' \
'(allocation.{0,30}(ratio|Ratio)|(ratio|Ratio).{0,30}allocation|Decimal\s*\(|fullmatch\s*\(|match\s*\(|isinstance\s*\([^)]*,\s*str\)|type\s*\([^)]*\)\s+is(?:\s+not)?\s+str)' \
services/people-api/src services/people-api/tests
echo '== Structure of HTTP source candidates =='
fd -t f -e py . services/people-api/src | rg -i '(http|api|route|handler|assignment)' \
| while IFS= read -r file; do
echo "== ${file} =="
ast-grep outline "$file" --items all
done
echo '== Complete focused delta after prior head =='
git diff --unified=140 "$prior" "$head" -- \
services/people-api/src services/people-api/tests
echo '== Candidate `#232` regression modules =='
fd -t f -e py . services/people-api/tests | rg -i '(assignment|allocation|http|parser|runtime.*integrity)' \
| while IFS= read -r file; do
echo "== ${file} =="
cat -n "$file"
done
echo '== Exact-head check runs and reviews =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | "\(.name)\t\(.status)\t\(.conclusion // "null")\t\(.details_url)"'
gh pr view 64 --repo "$repo" --json reviews \
--jq '.reviews[] | "\(.author.login)\t\(.state)\t\(.commit.oid)"'Length of output: 125640 🏁 Script executed: #!/bin/bash
set -euo pipefail
head="8d3877650865f71c4d9708b06eb55f43a7cb7661"
prior="9771be6d65bef77408cd5ad1ae316f0a8d8fb5e3"
source="services/people-api/src/orgmetra_people_api/mutations.py"
http_source="services/people-api/src/orgmetra_people_api/mutation_http.py"
test_file="services/people-api/tests/test_people_mutation_allocation_text_runtime_integrity.py"
echo '== Exact successor commits and changed paths =='
git log --reverse --format='commit %H%nparents %P%nsubject %s%n' "${prior}..${head}"
for commit in $(git rev-list --reverse "${prior}..${head}"); do
printf '\n-- %s --\n' "$commit"
git diff-tree --no-commit-id --name-status -r "$commit"
git diff --check "${commit}^" "$commit"
done
echo '== Focused changes after the prior head =='
git diff --unified=160 "$prior" "$head" -- "$source" "$http_source" "$test_file"
echo '== Final parser declaration and all direct call sites =='
ast-grep outline "$source" --items all --match 'parse_allocation_ratio'
rg -n -C 24 \
'def\s+parse_allocation_ratio\b|parse_allocation_ratio\s*\(|fullmatch\s*\(|Decimal\s*\(' \
"$source" "$http_source" "$test_file"
echo '== Exact parser source range =='
parser_line=$(rg -n '^def parse_allocation_ratio\b' "$source" | cut -d: -f1)
sed -n "$((parser_line - 10)),$((parser_line + 70))p" "$source"
echo '== Exact regression module =='
cat -n "$test_file"
echo '== Existing parser acceptance and rejection contracts =='
rg -n -C 8 --glob 'test_*.py' \
'(parse_allocation_ratio|allocation_ratio.*(0\.|1\.|four|decimal)|four-decimal|allocation ratio)' \
services/people-api/tests
echo '== Production paths changed after prior head =='
git diff --name-status "$prior" "$head" -- services/people-api/srcLength of output: 72336
I found no defect in the reviewed
The test-first and repair sequence is valid:
The regression uses a valid-looking Existing parser contracts still accept exact built-in The production delta after the prior head is limited to The exact-head hosted checks are queued or skipped. I did not use predecessor review or check evidence for this head. 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
repo="ContextualWisdomLab/Orgmetra"
head="8f986853a6f234c317e29080c4982bab34f3dc51"
base="eb9757f8649aaad026a9865508d9aad50c1a7a4f"
prior="8d3877650865f71c4d9708b06eb55f43a7cb7661"
echo '== Exact revision and PR state =='
printf 'checked_out='; git rev-parse HEAD
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
git cat-file -e "${prior}^{commit}"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true'
git merge-base --is-ancestor "$prior" "$head" && echo 'prior_is_ancestor=true'
gh pr view 64 --repo "$repo" \
--json number,state,isDraft,headRefOid,baseRefName,baseRefOid,mergeable,url
echo '== Issue `#233` =='
gh issue view 233 --repo "$repo" --json number,title,state,body,url
echo '== Successor commits and paths =='
git log --reverse --format='commit %H%nparents %P%nsubject %s%n' "${prior}..${head}"
for commit in $(git rev-list --reverse "${prior}..${head}"); do
printf '\n-- %s --\n' "$commit"
git show --check --format='subject %s' --no-patch "$commit"
git diff-tree --no-commit-id --name-status -r "$commit"
done
echo '== Total and successor diff checks =='
git diff --check "$base" "$head"
git diff --check "$prior" "$head"
git diff --name-status "$prior" "$head"
git diff --stat "$prior" "$head"
echo '== Production paths changed after prior head =='
git diff --name-status "$prior" "$head" -- services/people-api/src
echo '== Locate allocation parser, OpenAPI contract, manifests, and tests =='
fd -t f . | rg -i '(mutation.*http|mutation.*openapi|openapi|swagger|assignment|allocation|manifest|contract)'
rg -n -C 12 --glob '*.{py,json,yaml,yml}' \
'(parse_allocation_ratio|allocation_ratio|exclusiveMinimum|minimum|0\.0000|0\.0001|Assignment)' \
services/people-api CHANGELOG.md manifest.json 2>/dev/null || true
echo '== Source outlines =='
ast-grep outline services/people-api/src/orgmetra_people_api/mutations.py --items all
for file in $(fd -t f -e py -e json -e yaml -e yml . services/people-api | rg -i '(openapi|mutation_http|contract)'); do
echo "== ${file} =="
ast-grep outline "$file" --items all || true
done
echo '== Focused diff after prior head =='
git diff --unified=160 "$prior" "$head" -- \
services/people-api/src \
services/people-api/tests \
CHANGELOG.md \
manifest.json \
'*.yaml' '*.yml' '*.json'
echo '== Manifest evidence at exact head =='
if [ -f manifest.json ]; then
cat manifest.json
echo '== Referenced manifest entries =='
jq -r '.. | objects | select(has("path") and (.path == "CHANGELOG.md" or (.path | test("openapi|people"; "i"))) )' manifest.json || true
fi
echo '== Recomputed CHANGELOG evidence =='
sha256sum CHANGELOG.md
wc -c -l CHANGELOG.md
echo '== Find and inspect da4b628 lineage =='
git rev-parse 'da4b628^{commit}' 2>/dev/null || true
git merge-base --is-ancestor da4b628 "$head" 2>/dev/null && echo 'da4b628_is_ancestor=true' || true
git log --reverse --format='commit %H%nparents %P%nsubject %s%n' "${prior}..${head}"
git log --all --oneline --decorate --max-count=80 --grep='manifest\|`#233`\|allocation' -i
git show --check --format='commit %H%nparents %P%nsubject %s%n' da4b628 2>/dev/null || true
git diff --unified=120 da4b628^ da4b628 -- manifest.json CHANGELOG.md 2>/dev/null || true
echo '== Exact-head check runs and reviews =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | "\(.name)\t\(.status)\t\(.conclusion // "null")\t\(.details_url)"'
gh pr view 64 --repo "$repo" --json reviews \
--jq '.reviews[] | "\(.author.login)\t\(.state)\t\(.commit.oid)"'Length of output: 119892 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/Orgmetra"
head="8f986853a6f234c317e29080c4982bab34f3dc51"
prior="8d3877650865f71c4d9708b06eb55f43a7cb7661"
mistake="da4b628fe344372ec22421cfa010e15105ad2c50"
outbox_path="database/migrations/0005_outbox_delivery_finalization.sql"
echo '== Exact PR metadata =='
git rev-parse HEAD
gh pr view 64 --repo "$repo" --json headRefOid,baseRefOid,state,isDraft,mergeable
echo '== Focused final `#233` files =='
cat -n services/people-api/src/orgmetra_people_api/mutations.py | sed -n '455,480p'
rg -n -A22 -B6 '^ allocation_ratio:' schemas/openapi.yaml
cat -n services/people-api/tests/test_people_mutation_allocation_text_runtime_integrity.py
rg -n -C 8 --glob '*.{py,mjs}' \
'(allocation_ratio|0\\\.0000|0\\\.0001|CreateAssignmentRecordCommand)' \
services/people-api/tests tests
echo '== All OpenAPI allocation-ratio declarations =='
rg -n -A5 -B3 'allocation_ratio:' schemas/openapi.yaml
echo '== All application allocation parser call sites =='
rg -n -C 5 'parse_allocation_ratio\s*\(' services/people-api/src services/people-api/tests
echo '== `#233` and manifest successor diffs =='
git diff --unified=100 "$prior" "$head" -- \
services/people-api/src/orgmetra_people_api/mutations.py \
services/people-api/tests/test_people_mutation_allocation_text_runtime_integrity.py \
schemas/openapi.yaml \
manifest.json
echo '== Mistake then correction only =='
git diff --unified=60 "${mistake}^" "$mistake" -- manifest.json
git diff --unified=60 "${head}^" "$head" -- manifest.json
echo '== Corrected outbox manifest evidence =='
actual_sha="$(sha256sum "$outbox_path" | awk '{print $1}')"
actual_bytes="$(wc -c < "$outbox_path" | tr -d ' ')"
actual_lines="$(wc -l < "$outbox_path" | tr -d ' ')"
manifest_entry="$(jq -c --arg path "$outbox_path" '.files[] | select(.path == $path)' manifest.json)"
printf 'actual_sha=%s\nactual_bytes=%s\nactual_lines=%s\nmanifest_entry=%s\n' \
"$actual_sha" "$actual_bytes" "$actual_lines" "$manifest_entry"
jq -e --arg path "$outbox_path" --arg sha "$actual_sha" \
--argjson bytes "$actual_bytes" --argjson lines "$actual_lines" \
'.files[] | select(.path == $path) | .sha256 == $sha and .bytes == $bytes and .lines == $lines' \
manifest.json >/dev/null && echo 'outbox_manifest_matches=true'
echo '== OpenAPI manifest evidence =='
actual_openapi_sha="$(sha256sum schemas/openapi.yaml | awk '{print $1}')"
actual_openapi_bytes="$(wc -c < schemas/openapi.yaml | tr -d ' ')"
actual_openapi_lines="$(wc -l < schemas/openapi.yaml | tr -d ' ')"
openapi_entry="$(jq -c '.files[] | select(.path == "schemas/openapi.yaml")' manifest.json)"
printf 'actual_sha=%s\nactual_bytes=%s\nactual_lines=%s\nmanifest_entry=%s\n' \
"$actual_openapi_sha" "$actual_openapi_bytes" "$actual_openapi_lines" "$openapi_entry"
jq -e --arg sha "$actual_openapi_sha" --argjson bytes "$actual_openapi_bytes" --argjson lines "$actual_openapi_lines" \
'.files[] | select(.path == "schemas/openapi.yaml") | .sha256 == $sha and .bytes == $bytes and .lines == $lines' \
manifest.json >/dev/null && echo 'openapi_manifest_matches=true'
echo '== Repository manifest validator references =='
rg -n -C 6 '(manifest\.json|sha256|wc -c|line.*count|validate_repository)' \
tests/validate_repository.py scripts tests/foundation-contract.test.mjsLength of output: 101649
I found no defect in the reviewed
The OpenAPI The published-contract regression rejects The
The ordinary successor Its byte count (
The PR is open, draft, and mergeable. The exact-head hosted checks are queued or skipped. I did not use predecessor reviews or checks as evidence for this head. You are interacting with an AI system. |
| class _ExecutableUUID(UUID): | ||
| """Expose UUID rendering attempted before an exact runtime-type gate.""" | ||
|
|
||
| def __getattribute__(self, name: str) -> object: |
| class _ExecutableBatch(list[object]): | ||
| """Fail if a fetched row collection is consumed before exact-type validation.""" | ||
|
|
||
| def __bool__(self) -> bool: |
| """Reject pre-gate length inspection.""" | ||
| raise AssertionError("row collection length executed before exact-type validation") | ||
|
|
||
| def __getitem__(self, key: object) -> object: |
| """Reject pre-gate row length inspection.""" | ||
| raise AssertionError("row length executed before exact-type validation") | ||
|
|
||
| def __getitem__(self, key: object) -> object: |
| class _ExecutableUUID(UUID): | ||
| """Expose any UUID attribute inspection performed before an exact-type gate.""" | ||
|
|
||
| def __getattribute__(self, name: str) -> object: |
|
|
||
| calls = 0 | ||
|
|
||
| def __bool__(self) -> bool: |
| type(self).calls += 1 | ||
| raise AssertionError("outer durable row collection executed __len__") | ||
|
|
||
| def __getitem__(self, index: object) -> object: |
| class _ExecutableUUID(UUID): | ||
| """Expose UUID attribute inspection performed before an exact-type gate.""" | ||
|
|
||
| def __getattribute__(self, name: str) -> object: |
| instance.calls = 0 | ||
| return instance | ||
|
|
||
| def __hash__(self) -> int: |
| instance.calls = 0 | ||
| return instance | ||
|
|
||
| def __gt__(self, other: object) -> bool: |
|
@coderabbitai review Please review exact head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/Orgmetra"
head="a61617f0cdd6f1a2e29b512b2a3c66872af5ccc4"
base="eb9757f8649aaad026a9865508d9aad50c1a7a4f"
prior="8f986853a6f234c317e29080c4982bab34f3dc51"
echo '== Exact revision, PR state, and ancestry =='
printf 'checked_out='; git rev-parse HEAD
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true'
git merge-base --is-ancestor "$prior" "$head" && echo 'prior_is_ancestor=true'
gh pr view 64 --repo "$repo" \
--json number,state,isDraft,headRefOid,baseRefName,baseRefOid,mergeable,url
echo '== Issue `#246` =='
gh issue view 246 --repo "$repo" --json number,title,state,body,url
echo '== Successor commits and changed paths =='
git log --reverse --format='commit %H%nparents %P%nsubject %s%n' "${prior}..${head}"
for commit in $(git rev-list --reverse "${prior}..${head}"); do
printf '\n-- %s --\n' "$commit"
git show --check --format='subject %s' --no-patch "$commit"
git diff-tree --no-commit-id --name-status -r "$commit"
done
echo '== Delta and source scope =='
git diff --check "$base" "$head"
git diff --name-status "$prior" "$head"
git diff --stat "$prior" "$head"
git diff --name-status "$prior" "$head" -- services/people-api/src
echo '== Source maps =='
ast-grep outline services/people-api/src/orgmetra_people_api/mutations.py --items all
ast-grep outline services/people-api/src/orgmetra_people_api/postgres_mutations.py --items all --match 'PostgresPeopleMutationPort'
ast-grep outline services/people-api/src/orgmetra_people_api/hire.py --items all
ast-grep outline services/people-api/src/orgmetra_people_api/postgres_hire.py --items all
echo '== Replay evidence producers, consumers, digest checks, and identity binding =='
rg -n -C 18 --glob '*.py' \
'(replay_command_digest|replay.*digest|_replayed_record_id|stored_digest|idempotency.*digest|mutation_command_digest|def\s+(create_employment_record|create_position_record|create_assignment_record|accept_confirmed_hire|create_employment|create_position|create_assignment)\b|expected_(employment|position|assignment|person|candidate_worker_conversion)_record_id|MutationResult\.__post_init__|HireAcceptanceResult\.__post_init__)' \
services/people-api/src/orgmetra_people_api \
services/people-api/tests
echo '== Focused source and test delta =='
git diff --unified=140 "$prior" "$head" -- \
services/people-api/src/orgmetra_people_api/mutations.py \
services/people-api/src/orgmetra_people_api/postgres_mutations.py \
services/people-api/src/orgmetra_people_api/hire.py \
services/people-api/src/orgmetra_people_api/postgres_hire.py \
services/people-api/tests
echo '== Candidate Issue `#246` regression files =='
fd -t f -e py . services/people-api/tests | rg -i \
'(replay|idempotency|result.*identity|mutation.*(integrity|digest|snapshot)|hire.*integrity)' \
| while IFS= read -r file; do
echo "== ${file} =="
ast-grep outline "$file" --items all
done
echo '== Exact-head check runs and reviews =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
--jq '.check_runs[] | "\(.name)\t\(.status)\t\(.conclusion // "null")\t\(.details_url)"'
gh pr view 64 --repo "$repo" --json reviews \
--jq '.reviews[] | "\(.author.login)\t\(.state)\t\(.commit.oid)"'Length of output: 164780 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/Orgmetra"
head="a61617f0cdd6f1a2e29b512b2a3c66872af5ccc4"
prior="8f986853a6f234c317e29080c4982bab34f3dc51"
generic="services/people-api/src/orgmetra_people_api/mutations.py"
postgres="services/people-api/src/orgmetra_people_api/postgres_mutations.py"
hire="services/people-api/src/orgmetra_people_api/hire.py"
postgres_hire="services/people-api/src/orgmetra_people_api/postgres_hire.py"
focused_test="services/people-api/tests/test_people_mutation_idempotent_replay_result.py"
postgres_test="services/people-api/tests/test_postgres_people_mutations.py"
echo '== Issue `#246` full metadata =='
gh issue view 246 --repo "$repo" --json number,title,state,body,comments,url
echo '== Exact successor parents and complete scopes =='
for commit in $(git rev-list --reverse "${prior}..${head}"); do
echo "-- $commit --"
git show --no-patch --format='parents %P%nsubject %s' "$commit"
git diff-tree --no-commit-id --name-status -r "$commit"
done
echo '== Generic result evidence contracts and all consumers =='
rg -n -A45 -B10 \
'def _validate_replay_command_digest\b|class (EmploymentMutationResult|PositionMutationResult|AssignmentMutationResult)\b|def _require_result_identity_or_replay\b|^def create_(employment|position|assignment)_record\b' \
"$generic"
rg -n -C 8 'replay_command_digest|_require_result_identity_or_replay\s*\(' \
services/people-api/src services/people-api/tests
echo '== Direct PostgreSQL idempotency producer and all generic result returns =='
rg -n -A65 -B12 '^def _replayed_record_id\b|^def _record_idempotency\b' "$postgres"
rg -n -C 8 \
'replayed\s*=|if replayed is not None|return (EmploymentMutationResult|PositionMutationResult|AssignmentMutationResult)' \
"$postgres"
echo '== Focused Issue `#246` regression module =='
cat -n "$focused_test"
echo '== Direct PostgreSQL generic replay regression and normal-create assertions =='
rg -n -A90 -B15 \
'def test_same_key_replays_without_second_hris_or_audit_facts\b|def test_same_key_different_command_fails_closed\b|def test_different_key_is_a_new_command\b' \
"$postgres_test"
echo '== Confirmed-hire code and tests, plus successor delta =='
rg -n -A150 -B10 '^def accept_confirmed_hire\b' "$hire"
rg -n -C 10 'return HireAcceptanceResult|HireAcceptanceResult\(' "$postgres_hire"
git diff --quiet "$prior" "$head" -- "$hire" "$postgres_hire" \
&& echo 'hire_source_delta_after_prior=none'
echo '== Focused test type-checking and test discovery configuration =='
fd -t f -a 'pyproject.toml' 'pytest.ini' 'tox.ini' 'mypy.ini' .
rg -n -C 8 '(mypy|pyright|pytest|coverage|strict)' \
pyproject.toml pytest.ini tox.ini mypy.ini 2>/dev/null || true
echo '== Whitespace and final exact-head state =='
git diff --check "$prior" "$head"
printf 'checked_out='; git rev-parse HEAD
gh pr view 64 --repo "$repo" --json headRefOid,baseRefOid,state,isDraft,mergeableLength of output: 73769
I found no defect in the reviewed The repair preserves both required result paths:
The replay evidence has an exact built-in
Each generic The focused regression covers all three generic mutation services with a foreign first-committed identity and matching evidence. It also covers mismatched evidence and invalid replay-evidence type. The existing PostgreSQL replay test verifies that same-key retries return the first committed Employment, Position, and Assignment IDs without new business, audit, or idempotency writes. It also retains the same-key/different-command failure case. Confirmed-hire code has no delta from the predecessor head. It still requires the returned Person, Employment, and conversion IDs to match the exact detached command IDs. The
The exact-head workflows are queued or skipped. I did not treat predecessor workflow evidence as current-head GREEN. You are interacting with an AI system. |
Scope
Canonical Orgmetra People mutation runtime/contract-integrity lane. HR mutation truth stays in Orgmetra; this PR does not copy mutable shared-kernel, authorization, feature-lane, workflow-owner, or Assignment source.
Protected base remains
develop@eb9757f8649aaad026a9865508d9aad50c1a7a4f. Current exact head isa61617f0cdd6f1a2e29b512b2a3c66872af5ccc4; the PR is open · Draft · mechanically mergeable. Predecessor checks/reviews do not authorize this head.Retained repair chain
#215–#225 retain hire/generic PostgreSQL trust-boundary hardening. #226–#228 retain application/direct-Port post-construction command/result revalidation. #229 binds unexplained exact revalidated Employment/Position/Assignment results to pre-port target UUID snapshots and keeps confirmed-hire exact materialization identities command-bound. #230 detaches generic commands at direct PostgreSQL adapter entry. #231 detaches generic and confirmed-hire application commands before purpose-bound authorization/port callbacks. #232 requires exact built-in allocation-ratio HTTP text. #233 aligns parser/OpenAPI Assignment allocation with the authoritative strictly-positive
(0, 1.0000]domain.#233 strictly-positive Assignment allocation contract
Test-only
abd5dc506d363897d0396dc9e75b1e389b47c71festablished parser/schema RED for0.0000;7a95aa95a6a9cf4497b301ffee0748555d98776erepaired the parser andf659b652fbe307134792370ac273514f0b1830a0repaired the published OpenAPI.8f986853a6f234c317e29080c4982bab34f3dc51completed the intended manifest reseal after an unrelated manifest-copy mistake was repaired by ordinary successor. #233 remains open until normal protected integration or a verified successor fully carries the delta.#246 real hosted RED and idempotent-replay repair
Foundation run
33947715482, Repository quality job101256719960, on exact predecessor8f986853a6f234c317e29080c4982bab34f3dc51actually executed. Candidate-evidence, HRIS-kernel, Keyverse, migration, Naruon, offer, requisition, selection and job-analysis suites passed with their owned 100% coverage. People API reached 232 passed / 1 failed and 99.48% total coverage. The failing contract wasPostgresPeopleMutationTests.test_same_key_replays_without_second_hris_or_audit_facts:create_employment_record(...)raisedPeopleMutationIntegrityError("employment result identity does not match command")before later replay branches could execute.This is a production-contract conflict, not a stale fixture.
docs/API_CONTRACT.mdanddocs/TEST_STRATEGY.mdalready require an identical tenant/route/idempotency-key retry to return the first committed created-record identity. Employment/Position/Assignment generated IDs are intentionally excluded frommutation_command_digest(...), so a retry may allocate fresh record/audit/outbox UUIDs and still be the same semantic command. #229's unconditional generic result-ID equality made that documented replay impossible. Confirmed-hire is intentionally different: its contract requires the same materialization identities and keeps exact-result binding.Test-first
d7440d40e46f59a2596167bbca54af2a79e901a4adds focused contracts for a first-committed foreign identity backed by matching semantic replay evidence, mismatched replay evidence rejection, and exact replay-digest scalar validation. Productioncc1cc53f34908178495ff657930c3950ce5931f9adds optionalreplay_command_digestto generic mutation results and accepts a foreign result identity only when the application independently recomputes the same digest from its detached command and exact authorization decision. Ordinary unexplained foreign results continue to fail with the #229 identity error; a mismatched digest fails with replay-evidence integrity error.Current successor
a61617f0cdd6f1a2e29b512b2a3c66872af5ccc4changes_replayed_record_id(...)to return the first committed UUID plus the exact stored digest only after the stored digest has already matched the current semantic digest.PostgresPeopleMutationPortpropagates that receipt on replay for Employment/Position/Assignment. Normal creates return no replay receipt and therefore still require current command identity. No SQL/schema/migration/idempotency-key/digest definition, audit/outbox semantics, or confirmed-hire behavior changed.Compare
8f986853... → a61617f...is strictly ahead by three ordinary commits and contains onlymutations.py,postgres_mutations.py, and the new focused replay-result test. No force-push or destructive rebase was used.Exact-head evidence
CodeRabbit completed an exact-head review of
a61617f0cdd6f1a2e29b512b2a3c66872af5ccc4against protecteddevelop@eb9757f8649aaad026a9865508d9aad50c1a7a4fand found no defect in the reviewed #246 changes. It confirmed matching replay evidence preserves first-committed generic identity, mismatched evidence and unexplained foreign identity fail closed, PostgreSQL emits replay evidence only after stored/current digest equality, confirmed-hire has no delta and retains exact identity binding, the three-commit lineage is linear, andgit diff --checkis clean. This is independent static review evidence, not a ruleset-qualifying approval or hosted GREEN.Current workflows on exact
a61617f...are Foundation CI33964015934, SAST Semgrep33964015913, Security Scan33964015937, and CodeQL PR33964015914. Foundation Repository quality job101300767068remains queued before checkout withsteps=[],ubuntu-24.04, and no assigned runner at the latest read. No current-head hosted GREEN, PostgreSQL completion, repository-owned 100% statement/branch coverage, terminal security completion, or qualifying approval is claimed. Formal submitted reviews remain non-authorizing; predecessor COMMENTED reviews and resolved threads do not transfer after these pushes.Owner dependencies
72070cb4b8d636825ce5b1a326df4c296596ed7e. Its exact Foundation CI33936088421is terminal success after the predecessor real RED (218 tests passed, 99.43% coverage) was repaired by three defensive-branch tests. Remaining required gate/review evidence still controls normal integration; fix(people): protect governed mutation runtime types #64 does not copy fix(core): protect canonical evidence runtime types #63 source.1caf8f760e81f1cb6954fdf1d0d13a46dbb6c0b1and overlaps fix(people): protect governed mutation runtime types #64 on four People production files. After fix(people): protect governed mutation runtime types #64 becomes protected truth, fix(authz): protect purpose-bound runtime integrity #65 must non-force adopt it while preserving fix(people): bind mutation results to the exact commanded HR identity #229–fix(people): reject zero assignment allocation at the published HTTP contract #233, people: reconcile result-identity hardening with idempotent replay identity #246 and its authorization-decision validation.schemas/openapi.yamland People/authorization files from an old, now non-mergeable owner base. It remains Draft rather than closed. After fix(people): protect governed mutation runtime types #64/fix(authz): protect purpose-bound runtime integrity #65 protected owner integration, feat(hris): bind Employment to employing legal organization #141 must non-force adopt protected owner truth and preserve its legal-employer delta.docs/product-technical-gap-baseline.mdremains single-writer-owned by docs: maintain durable product-technical gap baseline #100; volatile leaf SHAs and run IDs stay in PR/Issue metadata.Causal order remains #63 normal protected integration as gates allow → #64 normal integration → #65 non-force protected adoption/reconciliation and integration → #141 non-force protected adoption/reconciliation of its valid feature → Assignment descendants. The independent #235 Workforce Validation lane may continue from protected develop while these owner gates run. No self-approval, administrator bypass, gate weakening, force-push, destructive rebase, no-op retrigger, mutable-owner dependency, or predecessor-evidence transfer.