Skip to content

docs: establish canonical product and trust-boundary documentation - #71

Merged
seonghobae merged 171 commits into
mainfrom
docs/architecture-trust-boundaries
Aug 17, 2026
Merged

docs: establish canonical product and trust-boundary documentation#71
seonghobae merged 171 commits into
mainfrom
docs/architecture-trust-boundaries

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Purpose

Maintain Noema's single canonical PRD/TRD/Architecture/ADR/UML/ERD/Test Strategy/Operability/licensing/traceability graph without reintroducing separately owned root README/CLAUDE/CHANGELOG content.

Current bounded ownership

This PR owns the canonical documentation graph and its documentation-contract tests only. Protected-main runtime/source, the customer-facing README/procedure integrated by #415, and readiness/operator documentation integrated by #413 are separate protected-main lanes.

The branch preserves current protected behavior rather than inventing stronger shipped claims:

  • OpenAPI 3.1 on protected main is recorded as current API truth;
  • ALLOWED_WORKFLOW_REF_PREFIX is documented as exact-full-ref behavior, while stronger immutable workflow-source binding is explicitly not claimed as shipped;
  • source/check/review/live-base/protected-main evidence authorities remain distinct;
  • docs/TEST_STRATEGY.md and traceability close the canonical-documentation portion of issue quality(coverage): remove broad V8 ignore from credential-exchange security core #84 without claiming additional source changes;
  • licensing/IP documentation records readiness/evidence requirements without choosing an outbound license or claiming clearance.

Test-first current-owner repair

Fresh exact-head application CI exposed stale documentation-contract assertions after governance PR #412 and operator/documentation PR #413 had already merged. Restoring those closed PRs to the active-owner table would have made the documentation less correct, so the tests were repaired instead of regressing the canonical graph.

Live-base convergence

Current exact head: e1a2aef6b9bdb621507de4be012fbde40de7e910.

Current protected main: acf16c1e07f7b82659a26d42706212f2cc229882.

The branch is a clean descendant of the current protected head (behind_by=0) and changes exactly the canonical documentation/test surface. It does not modify protected runtime source, workflows, root README, contributor procedure, or readiness/operator documentation.

Exact-head evidence

On unchanged head e1a2aef6b9bdb621507de4be012fbde40de7e910:

  • application CI 32060956407: success;
  • reviewer-ci 32060956362: success;
  • central Security Scan 32060956231: success;
  • commit status CodeRabbit: success;
  • unresolved review threads: 0;
  • formal submitted reviews are COMMENTED only; the live ruleset does not require a counted approval.

The live organization ruleset requires the central Security Scan workflow on the default branch and has no bypass actor. No release, deployment, legal-clearance, certification, or acquisition-ready claim is made.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Noema의 런타임 구조와 신뢰 경계를 문서화했습니다. Worker는 workflow ref와 immutable SHA pair를 검증합니다. readiness, API 계약, 운영 문서와 회귀 테스트를 갱신했습니다.

Changes

아키텍처 및 workflow 신뢰

Layer / File(s) Summary
런타임 credential exchange
src/worker.ts, src/runtime-readiness.ts, wrangler.toml, docs/api-spec.md, test/*
Worker가 reusable 및 일반 workflow의 ref·SHA pair를 검증합니다. 설정 오류는 503으로 처리하고 claim 불일치는 403으로 처리합니다.
보안 경계와 분산 상태
ARCHITECTURE.md, docs/doctoring/architecture-trust-boundaries.md, docs/runbook.md
Cloudflare binding, outbound 요청, Durable Object 상태, alarm 재시도와 exact-head 규칙을 문서화했습니다.
서비스 조합과 권한 plane
ARCHITECTURE.md, docs/doctoring/architecture-trust-boundaries.md, docs/onboarding.md, docs/runbook.md
중앙 workflow, 리뷰 서비스와 Noema의 역할을 분리했습니다. 독립 배포, versioned contract와 authority plane을 정의했습니다.
운영 문서와 회귀 검증
CLAUDE.md, docs/api-spec.md, README.md, CHANGELOG.md, test/*
/health, /ready, /exchange, workflow SHA 설정과 운영 검증 절차를 문서화했습니다. readiness, 문서 계약과 workflow trust 회귀 테스트를 추가·갱신했습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant CloudflareWorker
  participant NoemaOidcReplayGuard
  participant GitHubApp
  GitHubActions->>CloudflareWorker: /exchange 요청
  CloudflareWorker->>CloudflareWorker: workflow ref·SHA claims 검증
  CloudflareWorker->>NoemaOidcReplayGuard: jti replay 검증
  CloudflareWorker->>GitHubApp: installation token 교환
  GitHubApp-->>CloudflareWorker: 저장소 범위 단기 토큰
  CloudflareWorker-->>GitHubActions: exchange 응답
Loading

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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의 주요 변경인 제품 및 신뢰 경계 문서의 정립을 정확히 설명하며, 관련 구현 변경과도 일치합니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/architecture-trust-boundaries

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
docs/doctoring/architecture-trust-boundaries.md (1)

70-78: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Durable Object alarm의 제한된 자동 재시도 semantics를 기록하세요.

현재 문서는 alarm이 at-least-once로 실행되고 실패 시 자동 재시도된다고 설명합니다. Cloudflare 공식 문서는 자동 재시도가 exponential backoff와 최대 6회로 제한되며, 무기한 복구가 필요하면 handler가 새 alarm을 명시적으로 예약해야 한다고 설명합니다. 이 제한과 reschedule 요구사항을 추가하세요. (developers.cloudflare.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/doctoring/architecture-trust-boundaries.md` around lines 70 - 78, Update
the Durable Object alarm semantics section to state that automatic retries use
exponential backoff and are limited to a maximum of six attempts. Also document
that handlers requiring recovery beyond those retries must explicitly schedule a
new alarm, while preserving the existing at-least-once and stale-state
validation guidance.
test/architecture-documentation.test.ts (1)

5-35: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

문서 회귀 검사를 실제 runtime contract 검사로 강화하세요.

현재 테스트는 required 문자열과 두 개의 오래된 문구만 검사합니다. wrangler.tomlmain, src/entrypoint.ts·src/worker.ts·src/index.ts의 layer ownership, Durable Object binding/class, route method를 비교하지 않습니다. 따라서 runtime 구조가 바뀌어도 일부 키워드가 남아 있으면 테스트가 통과합니다. 문서와 실제 설정·소스의 핵심 관계를 직접 assertion으로 추가하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/architecture-documentation.test.ts` around lines 5 - 35, Strengthen the
architecture documentation tests beyond keyword checks by asserting the runtime
contract against actual configuration and source ownership. In the existing
tests, read wrangler.toml and the relevant src/entrypoint.ts, src/worker.ts, and
src/index.ts files, then validate the configured main entrypoint, layer
ownership, Durable Object binding/class, and route HTTP methods against the
documented architecture. Keep the existing regression assertions while making
these relationships fail when runtime structure changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ARCHITECTURE.md`:
- Around line 11-14: Update the exact workflow trust logic in src/worker.ts to
require immutable SHA-based identity: validate workflow_sha and job_workflow_sha
in addition to the full workflow_ref, rather than trusting mutable branch or tag
refs alone. Update ARCHITECTURE.md lines 11-14 and 24-33 and CLAUDE.md lines 9
and 31-36 so their trust descriptions accurately state the SHA validation and
immutable source binding performed by src/worker.ts.

In `@CLAUDE.md`:
- Line 27: README의 운영 도구 설명과 실제 문서 내용을 정합화하세요. 각 명령(kpi:compute, smoke:check,
production:preflight, readiness:audit, acquisition:manifest/acquisition:audit,
security:evidence)의 필수 NOEMA_* 환경 변수를 README에 명령별로 추가하고, 기존 Worker 및 KPI 수집 예시와
구분해 문서화하세요. 실제 요구 변수를 확인할 수 없다면 해당 변수를 문서화한다고 주장하지 않도록 CLAUDE.md의 문장을 범위에 맞게
축소하세요.

---

Nitpick comments:
In `@docs/doctoring/architecture-trust-boundaries.md`:
- Around line 70-78: Update the Durable Object alarm semantics section to state
that automatic retries use exponential backoff and are limited to a maximum of
six attempts. Also document that handlers requiring recovery beyond those
retries must explicitly schedule a new alarm, while preserving the existing
at-least-once and stale-state validation guidance.

In `@test/architecture-documentation.test.ts`:
- Around line 5-35: Strengthen the architecture documentation tests beyond
keyword checks by asserting the runtime contract against actual configuration
and source ownership. In the existing tests, read wrangler.toml and the relevant
src/entrypoint.ts, src/worker.ts, and src/index.ts files, then validate the
configured main entrypoint, layer ownership, Durable Object binding/class, and
route HTTP methods against the documented architecture. Keep the existing
regression assertions while making these relationships fail when runtime
structure changes.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4bd0e593-d123-4411-ad24-d5e917057839

📥 Commits

Reviewing files that changed from the base of the PR and between 9adb784 and 06ae6aa.

📒 Files selected for processing (6)
  • ARCHITECTURE.md
  • CHANGELOG.md
  • CLAUDE.md
  • README.md
  • docs/doctoring/architecture-trust-boundaries.md
  • test/architecture-documentation.test.ts

Comment thread ARCHITECTURE.md Outdated
Comment thread CLAUDE.md

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/workflow-sha-trust.test.ts`:
- Around line 122-132: Extend the workflow trust tests around
expectWorkflowBlock to cover runtimeEnv without ALLOWED_WORKFLOW_SHA, asserting
it resolves with status 503 and message "Workflow trust configuration
unavailable". Keep the existing malformed-SHA case unchanged and exercise the
undefined binding branch explicitly.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cee8500d-f924-4bb0-9314-7c44ed164834

📥 Commits

Reviewing files that changed from the base of the PR and between 06ae6aa and fadc728.

📒 Files selected for processing (2)
  • src/worker.ts
  • test/workflow-sha-trust.test.ts

Comment thread test/workflow-sha-trust.test.ts Outdated
@seonghobae seonghobae changed the title docs(architecture): define current trust and MSA boundaries fix(security): bind workflow source and document MSA boundaries Aug 7, 2026
@seonghobae
seonghobae marked this pull request as ready for review August 17, 2026 19:35
@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

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