Skip to content

@DependencyGraph(.shared) graph api를 구현한다 - #42

Merged
opficdev merged 8 commits into
developfrom
feat/#40
Sep 6, 2026
Merged

opficdev merged 8 commits into
developfrom
feat/#40

Conversation

@opficdev

@opficdev opficdev commented Sep 6, 2026

Copy link
Copy Markdown
Owner

🔗 연관된 이슈

🎯 작업 목적

@DependencyGraph(.shared)의 정적 graph 수명, Swift 6 동시성 경계, source graph 조립과 테스트 경계의 공개 계약 확정

📝 작업 내용

📌 요약

  • DependencyGraphLifetime와 @DependencyGraph(.shared) 추가
  • Graph.shared 정적 조립, source graph 조합, override 분리 경로 구현
  • checked Sendable class·actor·@MainActor graph의 동시성 계약과 compiler diagnostic 추가
  • graph .shared와 provider .shared·.lazy 수명 구분 문서화
  • 리뷰 보완으로 중첩 shared 타입 충돌 진단과 package 접근 수준 검증 추가

🔍 상세

  • 비격리 final class의 .shared는 선언에 직접 작성한 checked Sendable 준수에서만 허용
  • @unchecked Sendable, nonisolated(unsafe), runtime registry, reset API, 전역 provider 저장소 미추가
  • actor graph의 shared는 비동기 접근 없이 읽고, 생성 프로퍼티의 actor 격리와 Sendable 검사는 기존 정책 유지
  • @MainActor graph의 사용자가 지정한 격리 유지, 자동 @MainActor 부여 미수행
  • source가 있는 Graph.shared는 정규화한 순서로 각 SourceGraph.shared를 한 번 읽은 뒤 조합 graph를 한 번 생성
  • Graph.shared는 원본 Factory만 사용하고, 테스트·Preview는 Graph() 또는 Graph.override(...).build(...)로 독립 graph 생성
  • 간접 정적 초기화 순환은 전수 분석하거나 runtime 해소하지 않는 범위 유지
  • shared 중첩 타입·typealias와 생성 정적 멤버의 충돌을 .shared 원본 위치에서 진단

🔄 변경 흐름

flowchart LR
    production["운영 Graph.shared"] --> assembly["원본 graph 조립"]
    source["SourceGraph.shared"] --> assembly
    assembly --> staticGraph["프로세스 정적 graph"]

    test["테스트 Preview"] --> instance["Graph() 또는 Graph.override(...).build(...)"]
    instance --> graphStorage["graph 인스턴스별 provider 저장소"]
Loading

✅ 검증

  • swift build
  • swift build -Xswiftc -strict-concurrency=complete
  • swift test
  • 변경 Swift 파일 SwiftLint 0건
  • git diff --check
  • 앱과 Simulator 미실행

@opficdev opficdev self-assigned this Sep 6, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 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-06T08:32:08.746351Z f567efe 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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f567efecc9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CradleMacros/SharedGraphDeclaration.swift
Comment thread Sources/CradleMacros/SharedGraphDeclaration.swift Outdated
@opficdev
opficdev merged commit e23d548 into develop Sep 6, 2026
5 checks passed
@opficdev
opficdev deleted the feat/#40 branch September 6, 2026 09:04
@opficdev
opficdev restored the feat/#40 branch September 6, 2026 11:18
@opficdev
opficdev deleted the feat/#40 branch September 6, 2026 11:18
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.

@DependencyGraph(.shared) graph api를 구현한다

1 participant