Skip to content

fix(core): 정체성 자료에 대상 개인이 없으면 거부 - #27

Merged
thisisjun786 merged 5 commits into
devfrom
codex/jun-28-identity-lock
Sep 13, 2026
Merged

thisisjun786 merged 5 commits into
devfrom
codex/jun-28-identity-lock

Conversation

@thisisjun786

@thisisjun786 thisisjun786 commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Change

personaSchemaFromLifeDefinition이 페르소나 schema를 파생할 때, profileFor가 "정체성 자료를 주지 않음"과 "자료는 줬는데 대상 개인이 없음"을 모두 null로 접었다. 그래서 다른 개인의 프로필만 든 자료나 빈 목록을 넘기면 lockedFor가 전 축을 잠금 해제로 판정했고, digest까지 자료 미제공 경우와 같아져 하류에서 두 상황을 구분할 수 없었다.

// 이 브랜치 이전, definition.participants = ["lina"]
identity: null                              -> sourceIdentity null, 전 축 해제, digest b7ade1a1
identity: { profiles: [] }                  -> sourceIdentity null, 전 축 해제, digest b7ade1a1
identity: { profiles: [mira(manual)] }      -> sourceIdentity null, 전 축 해제, digest b7ade1a1

제공된 자료는 참여자 전원에 대한 주장이므로 대상이 빠진 것은 정책 부재가 아니라 자료 결함이다. LIFE 경로는 이미 같은 조건을 거부한다. 뒤의 두 경우가 이제 Missing persona identity policy로 실패하고, 첫 번째는 그대로 허용된다.

기존 거부 지점 메시지
world/views.ts:252 Missing LIFE identity policy
world/views.ts:416 Missing current persona identity
world/growth.ts:34 Missing growth identity policy
world/autonomy-rules.ts:208 Missing authored growth identity

identitynull인 입력의 허용 범위는 그대로 두고 반환 타입의 | null도 유지한다. 자료 미제공이 허용이라는 것은 018 작성 계약의 불완전 입력 표가 정한 내용이고, 이 PR은 그 표의 두 번째 경우만 바꾼다.

이 PR의 base는 그 계약을 담은 #26이다. #26을 먼저 병합한 뒤 이 PR을 병합한다.

Refs: JUN-28

Verification

실패 회귀를 먼저 만들고 통과시켰다.

단계 결과
테스트만 수정한 상태 37 pass, 1 fail. 실패는 새 거부 테스트 하나이고 사유는 "Received function did not throw"
소스 수정 후 38 pass, 0 fail
인접 회귀 5개 파일 포함 6개 파일 72 pass, 0 fail
bun test 전체 4557 pass, 47 skip, 0 fail (558 files)
bun run typecheck exit 0
bun run lint exit 0

기존 단언 중 누락을 잠금 해제의 정상 결과로 기대하던 부분을 교체했다. 새 테스트는 빈 목록과 타 에이전트 자료 두 형태의 거부를 확인하고, 부재·manual 전체 잠금·선택 잠금 세 경우의 digest가 서로 다른지 검사한다. 쌍을 두 개만 비교하면 manual이 부재와 같아지는 변형을 놓치므로 세 값을 한 번에 비교한다. 이 변형은 리뷰 단계에서 실제로 만들어 검출을 확인했다.

Risks and remaining work

personaSchemaFromLifeDefinition에는 아직 제품 호출자가 없다. 저장소 전체에서 호출자는 배럴 재export와 테스트뿐이다. 따라서 이 수정은 운영 중인 페르소나 잠금을 보호한다는 뜻이 아니고, 앞으로 이 함수를 제품에 연결할 때 잘못된 자료가 조용히 통과하지 않게 하는 생성 시점의 거부다.

우회 경로도 남는다. 이 함수를 거치지 않고 PersonaSchema 객체를 직접 만들어 parsePersonaSchema에 넣으면 이 검사를 지나간다. 그 파서는 자체 정합성만 보고 외부 정체성 자료와 대조하지 않는다. 저장·복원 경로의 강제는 JUN-35 범위다.

digest 앞 8자는 해당 테스트 픽스처에 한정된 값이라 다른 예시의 기대값으로 쓸 수 없다.


Devin Review

페르소나 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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-13T18:55:12.396004Z e7114b2 New commits
🔒 Security Review Completed 2026-09-13T17:32:08.126621Z a492d0f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@thisisjun786
thisisjun786 changed the base branch from codex/jun-28-persona-contract to dev September 13, 2026 19:10
@thisisjun786
thisisjun786 merged commit 1a10e71 into dev Sep 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant