Skip to content

feat(reviewer): extract shared noema-core package (ADR-0014) - #536

Draft
seonghobae wants to merge 72 commits into
mainfrom
feat/noema-core-shared-agent-wiring
Draft

feat(reviewer): extract shared noema-core package (ADR-0014)#536
seonghobae wants to merge 72 commits into
mainfrom
feat/noema-core-shared-agent-wiring

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Scope

Introduce the minimal provider-neutral noema-core Shared Kernel. It accepts an already-resolved PydanticAI Model; contextual-orchestrator remains the provider/model discovery, credential, routing, retry and failover owner. ADR-0014 remains Proposed and external adoption requires an immutable Noema release, not this mutable PR head.

Current exact authority — 2026-09-06 KST

Protected Noema is main@e26d771470a4ece873c367b40b3cd6cb03ac7de3. Ordinary two-parent/non-force restack 8415e3c5e5eb1ed0b276f2d1154f96691d1d4e69 preserves the complete noema-core/reviewer/package delta and adopts merged #527 OIDC trust without taking provider authority into Noema.

Fresh exact-head reviewer-ci 34026788459, required Security Scan 34026788482, ci 34026788510, and patch-validator-image 34026788486 are queued. Predecessor GREEN does not transfer. Keep Draft until terminal current gates and current review state are clear.

Adds ADR-0012 recording the architecture decision for unifying Noema
into one shared runtime: three candidates were evaluated
(shared-package, shared-service, contract-only), and shared-package won
on evidence — the only real, current, same-language duplicate is the
pydantic-ai Agent-construction wiring independently built in this
repository's reviewer/agent.py and naruon's noema_agent.py, not the
broader claims the shared-service/contract-only candidates rested on.

Implements the ADR's first concrete PR: extracts the
AsyncOpenAI -> OpenAIChatModel -> OpenAIProvider -> Agent(...) wiring
from reviewer/noema_reviewer into a new packages/noema-core subpackage,
plus a shared NOEMA_PERSONA identity fragment. reviewer/ is the sole
consumer (self-consumption only); no behavior change — the existing
478-test, 100% coverage/docstring reviewer suite passes unmodified, and
noema-core carries its own equivalent 100%/100% suite. Not yet
published to an index; both CI (central-review.yml) and local pytest
reach it via PYTHONPATH, the same mechanism already used for
noema_reviewer itself.

naruon's adoption, the identity/verdict-schema contract grafted from
the contract-only candidate, and publishing noema-core to an index are
scoped as explicit next steps in the ADR, not bundled into this PR.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

PydanticAI Agent 구성 배선을 provider-neutral noema-core 패키지로 분리했습니다. reviewer는 해석된 모델을 공유 build_agent에 주입합니다. 빌드, editable 설치, import 경계 및 CI 검증 경로를 갱신했습니다.

Changes

공유 noema-core 패키지

Layer / File(s) Summary
패키지 계약과 구성 배선
packages/noema-core/...
build_agentNOEMA_PERSONA를 공개하고 provider-specific 모델 구성을 제거했습니다. 모델 입력 검증, 패키지 설정, 테스트, coverage 및 docstring 검사를 추가했습니다.

reviewer 연결과 지연 로딩

Layer / File(s) Summary
reviewer Agent 연결
reviewer/noema_reviewer/agent.py, reviewer/noema_reviewer/config.py
reviewer가 공유 Agent 구성과 페르소나를 사용합니다. OpenAI 호환 transport 구성은 reviewer에 유지합니다.
지연 import와 경계 검증
reviewer/noema_reviewer/__init__.py, reviewer/tests/..., reviewer/README.md
Agent 공개 심볼을 지연 로드합니다. evidence-only 모듈의 독립 import와 패키지 수준 export를 검증합니다.

패키징과 CI 검증

Layer / File(s) Summary
monorepo 빌드 매핑
reviewer/pyproject.toml, reviewer/build_backend.py, reviewer/MANIFEST.in
커스텀 빌드 백엔드가 canonical noema-core 소스를 private staging에 복사합니다. wheel, sdist 및 editable 설치용 setuptools 후크를 제공합니다.
설치 및 품질 검증
.github/workflows/..., reviewer/requirements-ci.in, reviewer/tests/..., test/noema-core-packaging-contract.test.ts, .gitignore
CI가 source 및 설치 환경의 import, 해시, 공개 심볼, 100% coverage 및 docstring 게이트를 검증합니다. 격리 editable 설치와 staging 동시성 및 정리 동작도 검증합니다.

설계 결정과 변경 기록

Layer / File(s) Summary
공유 패키지 범위와 후속 단계
docs/adr/..., docs/adr/README.md, CHANGELOG.md
추출 대상과 소비자별 책임, 임시 monorepo 패키징 방식, CI 조건 및 후속 공개·버전 의존성 전환을 기록했습니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: 🟡 Moderate · up to 73917

This PR moves provider-neutral agent construction into a shared package and embeds it in reviewer artifacts. It is not merge-ready while the required exact-head validation checks remain queued or pending; bounded follow-up also remains for staged-package provenance and provider-client cleanup, while the editable-install assertion needs minor hardening.

Sequence Diagram(s)

sequenceDiagram
  participant Reviewer as reviewer
  participant Config as resolve_model
  participant Core as noema_core
  participant Backend as reviewer build_backend
  participant CI as reviewer-ci

  Reviewer->>Config: OpenAI 호환 Model 구성
  Config-->>Reviewer: 해석된 Model 반환
  Reviewer->>Core: build_agent(Model, system_prompt)
  Core-->>Reviewer: PydanticAI Agent 반환
  Backend->>Core: canonical noema-core 소스 staging
  Backend-->>CI: noema_core 포함 wheel 및 sdist 생성
  CI->>CI: 설치 import, 해시, coverage 및 docstring 검증
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 92.86% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 42 functions across 13 files. (1 skipped: 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 PR의 핵심 변경인 reviewer용 공유 noema-core 패키지 추출을 명확하고 간결하게 설명합니다. 다만 제목의 ADR-0014는 변경된 문서의 ADR-0012와 일치하지 않습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/noema-core-shared-agent-wiring

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

Triage note: this branch was 63 commits behind main when I started reviewing, but by the time I went to merge it had already been brought up to date with main (merge commit 2dacd1a, pushed a few minutes prior) — no action needed from me here. Required checks are currently queued on the new head; that appears to be the org-wide Actions runner capacity condition referenced elsewhere (.github#712) rather than anything specific to this PR.


Generated by Claude Code

@seonghobae
seonghobae marked this pull request as draft September 3, 2026 00:16
Comment thread reviewer/build_backend.py Fixed
Reconstruct the branch non-destructively on current protected main, preserve the shared-core/reviewer packaging delta, and resolve the ADR identity collision by moving the decision to ADR-0014. Keep provider routing and credentials outside noema-core; external consumption still requires immutable publication.
@seonghobae seonghobae changed the title docs(adr): unify Noema on a shared noema-core package (ADR-0012) feat(reviewer): extract shared noema-core package (ADR-0014) Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Fresh protected-base repair supersedes the stale authority block above. Protected main is e1ac9d50f6c646f04be8c137c8acdc7200182fcd. Ordinary two-parent non-force merge 5531a5327d822028c4be59e290b4d101b34d49db preserves the full noema-core provider-neutral package delta and inherits the protected stateless GitHub installation-token regression. Current exact-head workflows: ci 33871891928, reviewer-ci 33871891847, required Security Scan 33871891860, patch-validator-image 33871891868; all queued/non-passing. Predecessor/local evidence does not transfer; keep Draft.

Copy link
Copy Markdown
Contributor Author

2026-09-06 KST post-#546 repair finding: protected reviewer source is now main@85b17014b8d46eacc95e096ca114568c321d0263. This shared-core lane overlaps the integrated reviewer repair in central-review.yml, reviewer-ci.yml, CHANGELOG.md, reviewer/README.md, and reviewer test surfaces while also owning packages/noema-core and shared-core import/package boundaries. That overlap requires an ordinary semantic three-way restack; wholesale replacement would silently discard either protected CodeGraph/reviewer evidence or valid shared-core work. Keep Draft, preserve owner boundaries, regenerate exact-head gates after the semantic merge, and do not force-push or transfer pre-#546 reviewer authority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request priority: medium Normal-priority or P2 work status: needs-review type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant