fix(core): 정체성 자료에 대상 개인이 없으면 거부 - #27
Merged
Merged
Conversation
페르소나 schema를 파생할 때 profileFor가 "정체성 자료를 주지 않음"과 "자료는 줬는데 대상 개인이 없음"을 모두 null로 접었다. 그래서 다른 개인의 프로필만 든 자료나 빈 목록을 넘기면 lockedFor가 전 축을 잠금 해제로 판정하고, digest까지 자료 미제공 경우와 같아져 하류에서 두 상황을 구분할 수 없었다. 제공된 자료는 참여자 전원에 대한 주장이므로 대상이 빠진 것은 정책 부재가 아니라 자료 결함이다. LIFE 경로는 이미 같은 조건을 거부한다 (world/views.ts, world/growth.ts, world/autonomy-rules.ts). persona-schema만 예외였다. 이제 같은 방식으로 거부한다. identity가 null인 기존 입력의 허용 범위는 그대로 두고 반환 타입의 null도 유지한다. 018 작성 계약의 불완전 입력 표에서 자료 미제공은 허용이다. 회귀는 누락을 잠금 해제의 정상 결과로 기대하던 단언을 교체하고, 빈 목록과 타 에이전트 자료 두 형태의 거부, 그리고 부재·manual 전체 잠금·선택 잠금 세 경우의 digest가 서로 다른지를 검사한다. 쌍 두 개만 비교하면 manual이 부재와 같아지는 변형을 놓치므로 세 값을 한 번에 비교한다. Refs: JUN-28
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
thisisjun786
changed the base branch from
codex/jun-28-persona-contract
to
dev
September 13, 2026 19:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
personaSchemaFromLifeDefinition이 페르소나 schema를 파생할 때,profileFor가 "정체성 자료를 주지 않음"과 "자료는 줬는데 대상 개인이 없음"을 모두null로 접었다. 그래서 다른 개인의 프로필만 든 자료나 빈 목록을 넘기면lockedFor가 전 축을 잠금 해제로 판정했고, digest까지 자료 미제공 경우와 같아져 하류에서 두 상황을 구분할 수 없었다.제공된 자료는 참여자 전원에 대한 주장이므로 대상이 빠진 것은 정책 부재가 아니라 자료 결함이다. LIFE 경로는 이미 같은 조건을 거부한다. 뒤의 두 경우가 이제
Missing persona identity policy로 실패하고, 첫 번째는 그대로 허용된다.world/views.ts:252Missing LIFE identity policyworld/views.ts:416Missing current persona identityworld/growth.ts:34Missing growth identity policyworld/autonomy-rules.ts:208Missing authored growth identityidentity가null인 입력의 허용 범위는 그대로 두고 반환 타입의| null도 유지한다. 자료 미제공이 허용이라는 것은 018 작성 계약의 불완전 입력 표가 정한 내용이고, 이 PR은 그 표의 두 번째 경우만 바꾼다.이 PR의 base는 그 계약을 담은 #26이다. #26을 먼저 병합한 뒤 이 PR을 병합한다.
Refs: JUN-28
Verification
실패 회귀를 먼저 만들고 통과시켰다.
bun test전체bun run typecheckbun run lint기존 단언 중 누락을 잠금 해제의 정상 결과로 기대하던 부분을 교체했다. 새 테스트는 빈 목록과 타 에이전트 자료 두 형태의 거부를 확인하고, 부재·
manual전체 잠금·선택 잠금 세 경우의 digest가 서로 다른지 검사한다. 쌍을 두 개만 비교하면manual이 부재와 같아지는 변형을 놓치므로 세 값을 한 번에 비교한다. 이 변형은 리뷰 단계에서 실제로 만들어 검출을 확인했다.Risks and remaining work
personaSchemaFromLifeDefinition에는 아직 제품 호출자가 없다. 저장소 전체에서 호출자는 배럴 재export와 테스트뿐이다. 따라서 이 수정은 운영 중인 페르소나 잠금을 보호한다는 뜻이 아니고, 앞으로 이 함수를 제품에 연결할 때 잘못된 자료가 조용히 통과하지 않게 하는 생성 시점의 거부다.우회 경로도 남는다. 이 함수를 거치지 않고
PersonaSchema객체를 직접 만들어parsePersonaSchema에 넣으면 이 검사를 지나간다. 그 파서는 자체 정합성만 보고 외부 정체성 자료와 대조하지 않는다. 저장·복원 경로의 강제는 JUN-35 범위다.digest 앞 8자는 해당 테스트 픽스처에 한정된 값이라 다른 예시의 기대값으로 쓸 수 없다.