Skip to content

docs(adr): correct — Noema is one shared runtime per CWL-MASTER-CONTEXT, not separate contexts - #1527

Draft
seonghobae wants to merge 3 commits into
developfrom
docs/adr-noema-bounded-context-separation
Draft

docs(adr): correct — Noema is one shared runtime per CWL-MASTER-CONTEXT, not separate contexts#1527
seonghobae wants to merge 3 commits into
developfrom
docs/adr-noema-bounded-context-separation

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

2026-09-02 correction to my own earlier PR: the ADR this PR adds originally concluded naruon's Noema and .github's CI-review Noema are "intentionally separate" and should never share code. That was wrong — I only read current code in both repos and never checked docs/CWL-MASTER-CONTEXT.md in ContextualWisdomLab/.github, which explicitly defines Noema as one shared agent runtime (Pydantic-AI / Codex-Python) with three consumers: the GitHub review agent in CI, a do-anything agent inside naruon, and wardnet's AI SOC (including the quarantine sandbox, i.e. ContextualWisdomLab/quarantine-sandbox-runtime). The repo owner confirmed directly that compatibility across these was the intended design from the start.

This PR now updates ADR-0006 in place to mark it superseded-on-arrival: the original code-level investigation (what .github's and naruon's current Noema implementations actually do) is kept and remains accurate, but the "therefore keep them permanently separate" conclusion is withdrawn. The real follow-up — designing the actual shared runtime the master context describes — is tracked separately, not settled by this ADR.

See naruon#1486 for a follow-up comment correcting the same wrong framing there.

🤖 Generated with Claude Code

…iew core

The owner asked for Noema to be developed as an Agent naruon can also use,
not only a PR-review CI workflow (DDD). Reading .github's
scripts/ci/noema_review_gate.py end to end shows its only reusable core is a
single-shot diff-review verdict generator (one fixed prompt/JSON schema keyed
on changed-diff lines); everything else is GitHub PR CI glue. Naruon already
has its own, actively developed general-purpose Noema agent
(backend/services/noema_agent.py, pydantic-ai, mail/content-graph/task
tools) that does not need or use that diff-review core — see the open,
active naruon#1486 (calendar conflict-check tool) and naruon#1384
(tenant-scoped contextual-orchestrator gateway slice).

This ADR records that finding durably: the two Noemas are separate Bounded
Contexts sharing only a name, per docs/product-goal-directive.md §5's
Shared-Kernel-minimization convention, so the "share only a name" reasoning
survives beyond PR prose (which this investigation found can be lost — see
the closed, since-repurposed .github#1437/#1438).
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Important

Approval pending

CodeRabbit has no unresolved comments, but it has not reviewed the latest commit.

Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.

  • 🔍 Trigger review

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.

@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.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 1 potential issue.

Devin Review

Comment thread docs/adr/0006-noema-bounded-context-separation.md

Copy link
Copy Markdown
Contributor Author

Current Naruon architecture has one material contradiction with this ADR that must be resolved before it can become authority. The two agent bounded contexts may remain separate (.github PR-review Noema vs Naruon workspace Noema), but provider-neutral model routing is owned by contextual-orchestrator. Naruon must not establish direct tenant-provider routing as the durable production architecture merely to avoid the CI-scoped review sidecar.

Please keep the useful DDD conclusion (no shared noema_review_gate.py/prompt/verdict kernel), but revise the model-routing decision as follows:

  • .github review credentials/sidecar remain CI-only and must never receive customer workspace data;
  • Naruon uses a tenant/workspace-authorized published contextual-orchestrator contract with its own tenant-scoped credential/purpose boundary for production Noema LLM calls;
  • direct provider SDK/endpoint/credential fallback in Naruon is not a second authority and must fail closed/abstain rather than silently bypass the orchestrator;
  • feat(noema): route LLM through contextual-orchestrator #1384 (or its live successor) is therefore the relevant Naruon owner path to reconcile, not an optional architecture question this ADR can leave undecided;
  • add an executable architecture regression that fails if noema_agent/its provider adapter regains direct provider routing outside the contextual-orchestrator ACL, while keeping deterministic calendar policy and other domain tools Naruon-owned.

This does not imply sharing .github's Noema implementation or credentials. It separates agent/domain logic from the shared provider-neutral orchestration authority, which is the intended DDD boundary. Please refetch #1384/#1486 exact heads before editing because both are externally active lanes and their overlap/ADR numbering is mutable.

@seonghobae seonghobae added the documentation Improvements or additions to documentation label Sep 2, 2026 — with ChatGPT Codex Connector
…te Bounded Contexts

The original ADR-0006 concluded naruon's Noema and .github's CI-review Noema
are "intentionally separate" and should never share code, based only on
reading current code in both repos. That never checked
docs/CWL-MASTER-CONTEXT.md in ContextualWisdomLab/.github, which is explicit:
"noema — agent runtime (Pydantic-AI / Codex-Python): a GitHub Review Agent in
CI + a do-anything agent inside naruon + the lightweight quarantine sandbox"
and "noema is the shared agent runtime + quarantine sandbox (used by naruon,
the GitHub review agent, and wardnet's AI SOC)". Owner confirmed this
directly: compatibility across the two was the intended design from the
start, not a coincidence of naming.

This commit marks the ADR superseded-on-arrival, keeps the original
investigation for record (its code-level findings are accurate, only the
"therefore keep them permanently separate" conclusion was wrong), and points
at the real follow-up: design the shared Pydantic-AI Noema runtime +
quarantine-sandbox capability the master context describes, with .github's
diff-review logic and naruon's multi-tool agent logic as two callers of that
shared core.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@seonghobae seonghobae changed the title docs(adr): record Noema bounded-context separation from .github's rev… docs(adr): correct — Noema is one shared runtime per CWL-MASTER-CONTEXT, not separate contexts Sep 2, 2026

@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 found 2 new potential issues.

Devin Review

Comment thread docs/adr/0006-noema-bounded-context-separation.md
Comment thread docs/adr/0006-noema-bounded-context-separation.md

Copy link
Copy Markdown
Contributor Author

Fresh owner-contract verification after the correction found that this PR still cannot be accepted as current architecture. ContextualWisdomLab/noema protected main@6b2b3e90dc3d5bd24cd27ed11db41b9eb7106010 now defines Noema as the evidence-producing credential and maintenance control plane for governed GitHub automation, not as a shared Pydantic-AI workspace/SOC runtime. Its public README explicitly says model discovery/provider routing belongs to contextual-orchestrator, every model-backed Noema job uses the published orchestrator gateway, and direct-provider fallbacks are rejected. The dedicated quarantine runtime is likewise a separate owner boundary rather than something Naruon should silently absorb because an older .github/docs/CWL-MASTER-CONTEXT.md sentence grouped them together.

Therefore the newly added “one shared agent runtime + quarantine sandbox” correction is itself stale relative to the current protected owner repository and should not be promoted into an Accepted/Superseded Naruon ADR as canonical truth. Please refetch the live Noema PRD/TRD/ARCHITECTURE/README and the active Noema writer path before changing this branch again, then make this Naruon ADR describe only Naruon’s consumer boundary:

  • Naruon owns workspace-agent domain tools/context/authorization and must not copy .github PR-review logic;
  • contextual-orchestrator owns provider-neutral model discovery/routing; Naruon Noema calls it through a tenant/workspace-authorized published contract and never falls back directly to a provider;
  • current ContextualWisdomLab/noema is a separate credential/maintenance control-plane product unless its own protected owner contract is deliberately superseded there first;
  • quarantine remains a separately published isolation capability/owner contract;
  • historical .github master-context prose is evidence of prior intent, not authority over newer protected owner contracts.

A durable cross-repo unification decision, if still desired, belongs first in the Noema owner path and must publish a versioned contract that Naruon can consume. Until then, the safest Naruon state is to record the observed drift without inventing a shared runtime that the current owner does not ship. Please keep this PR non-authoritative/Draft or rewrite it to that consumer-boundary statement; do not transfer review/check evidence after the head moves.

…012)

ADR-0006's 2026-09-02 correction promised a follow-up shared-runtime
design without naming it yet. That design has since landed as
ContextualWisdomLab/noema's ADR-0012 (docs/adr/0012-shared-noema-core-package.md,
noema#536): a minimal noema-core package holding only the pydantic-ai
Agent-construction wiring, extracted from noema's reviewer/ first
(self-consumption only). Naruon's own adoption is that ADR's explicit
PR #2, sequenced after noema#536 merges and after this repository's
naruon#1486/#1384 merge-order conflict resolves — not done here.

Points both the correction section and the Consequences list at the
concrete ADR/PR instead of leaving "follow-up work" as an unnamed
promise.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Pushed a follow-up commit: pointed this ADR's correction section and Consequences list at the design that resolves its "follow-up work" promise — ContextualWisdomLab/noema ADR-0012 (docs/adr/0012-shared-noema-core-package.md, currently Proposed in noema#536). That PR implements the minimal shared noema-core package (Agent-construction wiring only, self-consumption only in noema/reviewer) called for by this ADR's correction. Naruon's own adoption of it is that ADR's explicit PR #2, sequenced after noema#536 merges and after this repo's own #1486/#1384 merge-order conflict resolves.

@seonghobae seonghobae added the type: docs Documentation, ADR, PRD, or technical writing label Sep 2, 2026 — with ChatGPT Codex Connector
@seonghobae seonghobae added priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks labels Sep 2, 2026 — with ChatGPT Codex Connector
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

PR governance metadata gate is not ready for 23680b13b443bb4eb7659b9a75073ecc1b67e133:

  • 3 unresolved current review thread(s) remain.
  • Required check strix is CANCELLED on the current head.

@seonghobae

seonghobae commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

[codex] Current develop head 042b0c7 and this PR head have unrelated histories, so allowing unrelated histories would mix repository histories. Successor #1557 starts from the live remote develop head and carries forward this PR valid DDD boundary, research references, active-lane traceability, and follow-up intent while replacing claims contradicted by Noema protected main. The earlier #1556 used a stale local tracking ref, had no unique delta after #1557, and was closed. This predecessor remains open; do not transfer checks or reviews, and do not close it until #1557 full-delta succession is independently verified.

@seonghobae
seonghobae marked this pull request as draft September 4, 2026 15:46
@seonghobae seonghobae removed the status: needs-review Open pull request requiring current-head review or checks label Sep 6, 2026
@seonghobae seonghobae added the status: draft Draft pull request label Sep 6, 2026 — with ChatGPT Codex Connector
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 priority: medium Normal-priority or P2 work status: draft Draft pull request type: docs Documentation, ADR, PRD, or technical writing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant