Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
840 changes: 180 additions & 660 deletions .github/workflows/pr-review.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The EC2 power-state and custom MCP attestation migrations carry the ledger label
- Web framework and runtime refresh: Next.js 16.4.5, React 19.3.1 and Node 26.13.0 retain authentication, ownership checks and standalone deployment; the request body guard uses the Next.js proxy convention. Refresh JavaScript/Python dependencies and AgentCore SDKs with compatibility pins, Terraform 1.17.1/provider locks, and Python 3.14 Lambda/container runtimes. The documentation guide builds and deploys on Node 26 with refreshed documentation security dependencies and Mermaid 12, preserving all four locales. Preserve gateway authentication, feature gates and release safeguards.
- EKS member onboarding: the member cluster guide is now two owner commands — an Access Entry for the registered member read role and a cluster-scoped `AmazonEKSViewPolicy` association — with no Kubernetes group, kubeconfig, kubectl or RBAC step; View never reads Kubernetes Secrets, and the guide tells owners to remove any existing `AmazonEKSAdminViewPolicy`. Because View cannot list nodes, member node lists come from read-only EC2/node-group APIs through the same role and are labeled as an EC2/node-group view (no kubelet status, instance-type capacity as allocatable, no Fargate nodes); their Ready count shows as "EC2 running N · Ready unknown" and they are left out of reserved-% figures; a failed node read no longer marks the whole cluster unreachable. When an administrator opens EKS, member clusters whose Access Entry is verified are listed first in an "Access Entry verified" callout with a one-click [조회 등록] button; nothing is registered until the administrator clicks it (an app registration record only; AWSops creates no AWS or Kubernetes permissions), and an unregistered cluster stays unregistered. In diagnosis, the Kubernetes map and the node drilldown, EC2/node-group nodes read as "EC2 running · Ready unknown" with Pressure, Allocatable and Reserved shown as unknown instead of as unhealthy or fully allocatable. Entries created from the earlier guide keep working.
- Bedrock models: chat answers with OpenAI GPT-6 Luna (without explicit Bedrock cache points, which GPT models reject); Explore "AI generate" writes queries with GPT-6.1 Terra and retries on Claude Sonnet 5.5 when Terra fails or its draft fails validation; primary, corrections and fallback share a 55-second request deadline with SDK cancellation; AI Diagnosis, routing, synthesis and the background workers move to Claude Sonnet 5.5, Opus 5.5 (AI Diagnosis Deep tier option) and Haiku 5.5. These models reject `temperature`, so requests no longer send it. Haiku calls and Sonnet calls with fixed output caps run without extended thinking so existing budgets still fit; Opus 5.5, which always thinks, gets extra output headroom for Deep report sections and invariant proposals. The web task now always holds a grant for its direct query-generation and assistant models (Terra, Sonnet 5.5, Haiku 5.5), so "AI generate" and the product-help assistant no longer fail with AccessDenied when hybrid routing is off; the chat runtime role additionally allows GPT-6 Luna. With `model_provider = mixed`, the Terraform variable `agentcore_chat_model_id = "global.anthropic.claude-sonnet-5-5"` rolls chat back to Sonnet 5.5 on every provisioning run, and the chat footer shows a model only when the answer carries its model provenance.
- PR review batching: a filtered diff larger than one review call's 6,000-line/128 KiB limit is reviewed in up to 10 complete batches split at file boundaries instead of being rejected outright. Workflow, review-script, Terraform/IAM, agent, AgentCore, secret-rotation, EKS, incident, API-route and AWS-client files, plus any path segment naming auth, secret, credential, assume-role, mutation or allowlist surfaces, are reviewed together in the first batch, and each batch receives the paths changed in the other batches as data, so a dependency no listed path provides stays blocking. Each batch passes the same input admission, gets both independent reviewers and its own chair in parallel, and the PR passes only if every batch passes; a later batch cannot clear an earlier batch's coverage or report failure. A single file over the per-batch budget, or a diff needing more than 10 batches, is still rejected before any model call, and diffs within the limit keep the single-review path.
- PR review uses the official Claude Code Action on Amazon Bedrock. It reviews the current commit in bounded jobs and links findings from the required check. Missing coverage and blocking findings stop the merge.

### Fixed

Expand Down Expand Up @@ -738,7 +738,7 @@ EC2 전원 상태와 사용자 지정 MCP 증명 마이그레이션의 원장
- 웹 프레임워크·런타임 최신화: Next.js 16.4.5, React 19.3.1, Node 26.13.0으로 인증·소유권 검사·standalone 배포를 유지하고 요청 본문 제한을 Next.js proxy 규약으로 옮깁니다. 호환성 버전 고정과 함께 JavaScript/Python 의존성·AgentCore SDK, Terraform 1.17.1·provider 잠금파일, Python 3.14 Lambda·컨테이너 런타임을 갱신합니다. 문서 가이드는 Node 26에서 빌드·배포하며 문서 사이트의 보안 의존성과 Mermaid 12를 갱신하고 4개 언어를 유지합니다. Gateway 인증·기능 게이트·릴리스 보호 장치는 유지합니다.
- EKS 멤버 온보딩: 멤버 클러스터 가이드가 소유자 명령 두 개(등록된 멤버 읽기 역할의 Access Entry 생성, 클러스터 범위 `AmazonEKSViewPolicy` 연결)로 줄었으며 Kubernetes 그룹·kubeconfig·kubectl·RBAC 단계가 없습니다. View는 Kubernetes Secrets를 읽지 않으며, 가이드는 기존 `AmazonEKSAdminViewPolicy` 연결을 제거하도록 안내합니다. View로는 노드를 조회할 수 없으므로 멤버 노드 목록은 같은 역할로 읽기 전용 EC2/노드그룹 API에서 가져와 EC2/노드그룹 기준으로 표시합니다(kubelet 상태 없음, allocatable은 인스턴스 타입 용량, Fargate 노드 제외). 이 노드의 Ready 수는 "EC2 running N · Ready unknown"으로 표시되며 예약 비율 계산에서 제외됩니다. 노드 조회만 실패해도 클러스터 전체가 조회 불가로 표시되지 않습니다. 관리자가 EKS 화면을 열면 Access Entry가 확인된 멤버 클러스터가 "Access Entry 확인됨" 안내 영역에 먼저 표시되고 [조회 등록] 버튼 한 번으로 등록할 수 있으며, 관리자가 누르기 전에는 등록되지 않습니다(앱 등록 기록만 저장, AWSops는 AWS·Kubernetes 권한을 만들지 않음). 해제한 클러스터는 해제 상태로 유지됩니다. 진단 표·Kubernetes 맵·노드 상세에서도 EC2/노드그룹 노드는 "EC2 running · Ready unknown"으로 표시되며 Pressure·Allocatable·Reserved는 비정상이나 전량 할당 대신 알 수 없음으로 표시됩니다. 이전 가이드로 만든 항목도 그대로 동작합니다.
- Bedrock 모델: 채팅은 OpenAI GPT-6 Luna로 답합니다(GPT 모델이 거부하는 명시적 Bedrock 캐시 포인트는 끔). Explore "AI로 생성"은 GPT-6.1 Terra로 쿼리를 만들고, Terra 호출이 실패하거나 초안이 검증에서 거부되면 Claude Sonnet 5.5로 다시 시도합니다. 기본 모델·수정·폴백은 하나의 55초 요청 제한 시간과 SDK 취소 신호를 공유합니다. AI 진단, 라우팅, 합성, 백그라운드 워커는 Claude Sonnet 5.5, Opus 5.5(AI 진단 Deep 단계 선택), Haiku 5.5로 바뀝니다. 이 모델들은 `temperature`를 거부하므로 요청에서 더 이상 보내지 않습니다. Haiku 호출과 출력 상한이 고정된 Sonnet 호출은 기존 상한이 유지되도록 확장 사고 없이 실행하고, 항상 사고하는 Opus 5.5는 Deep 리포트 섹션과 불변식 제안에 출력 여유분을 더 받습니다. 웹 태스크는 직접 호출하는 쿼리 생성·도움말 모델(Terra, Sonnet 5.5, Haiku 5.5) 권한을 항상 가지므로, 하이브리드 라우팅이 꺼져 있어도 "AI로 생성"과 제품 도움말이 AccessDenied로 실패하지 않습니다. 채팅 런타임 역할은 GPT-6 Luna도 허용합니다. `model_provider = mixed`일 때 Terraform 변수 `agentcore_chat_model_id = "global.anthropic.claude-sonnet-5-5"`로 채팅을 Sonnet 5.5로 되돌리며 매 프로비저닝마다 유지되고, 채팅 하단의 모델 표시는 답변에 모델 출처가 있을 때만 나타납니다.
- PR 리뷰 분할 검토: 필터링된 diff가 리뷰 1회 한도(6,000줄/128 KiB)를 넘으면 바로 거부하지 않고, 파일 경계로 나눈 최대 10개의 완전한 배치로 검토합니다. 워크플로·리뷰 스크립트·Terraform/IAM·agent·AgentCore·시크릿 교체·EKS·인시던트·API 라우트·AWS 클라이언트 파일과, 경로 구간 이름이 인증·시크릿·자격 증명·역할 전환·변경·허용 목록을 가리키는 파일은 첫 배치에서 함께 검토하고, 각 배치는 다른 배치에서 바뀐 경로 목록을 데이터로 받아 어느 경로도 제공하지 않는 의존성은 차단합니다. 각 배치는 같은 입력 검사를 거쳐 두 독립 리뷰어와 자체 chair가 병렬로 검토하며, 모든 배치가 통과해야 PR이 통과합니다. 이후 배치가 앞선 배치의 검토 범위·보고서 실패를 지우지 못합니다. 파일 하나가 배치 한도를 넘거나 10개를 넘는 배치가 필요하면 모델 호출 전에 거부하고, 한도 안의 diff는 기존 단일 검토 경로를 그대로 씁니다.
- PR 리뷰는 Amazon Bedrock에서 공식 Claude Code Action을 실행합니다. 현재 커밋의 변경을 나누어 검토하고 필수 검사에서 결과를 확인할 수 있습니다. 검토 누락이나 중대 지적이 있으면 병합이 차단됩니다.

### 수정

Expand Down
15 changes: 6 additions & 9 deletions docs/runbooks/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- generated-by: co-agent · source: CLAUDE.md · claude-md-sha: 204c9c831227 · generated-at: 2026-11-11 · DO NOT EDIT — edit CLAUDE.md then run /co-agent sync-context -->
<!-- generated-by: co-agent · source: CLAUDE.md · claude-md-sha: c0be07ee5b24 · generated-at: 2026-11-26 · DO NOT EDIT — edit CLAUDE.md then run /co-agent sync-context -->

> You are an external reviewer for this repo — project context below, distilled from CLAUDE.md. This file is shared verbatim by the external review panel (not a per-AI copy).

Expand All @@ -25,10 +25,8 @@ removed; flag any change that reintroduces a v1 procedure.

`model-provider.md` covers the deploy-time model family (`model_provider`: mixed, bedrock_claude, bedrock_openai, anthropic_api), per-role mapping, scoped Bedrock/secret IAM, enable and rollback.

`pr-review-head-images.md` defines two comprehensive reviewer reports, complete diff
admission (6,000 lines/128 KiB per call; larger diffs in at most 10 complete batches that must
all pass), bounded chair input and distinct incomplete-review
diagnostics, alongside staged HEAD image evidence and historical BASE context.
`pr-review-head-images.md` defines the official Claude Code Action on Bedrock,
exact-commit patch and HEAD image coverage, tool-result verification and failure handling.

## Deployment review checks
- Web migrations force automatic checks of every pending file on initialized DBs. Automatic calls reject missing ledgers under the lock and never call `initializeEmptyDatabase`, regardless of the init flag. Standalone empty-only bootstrap applies historical SQL and reader sync first; function defaults (`now()`/`gen_random_uuid()`), ALTER/GRANT/views and non-transactional SQL need reviewed standalone migration, then a fresh web dispatch. No historical exemptions or automatic-baseline exception. Contention fails immediately under the shared lock. Read retries share a deadline and never retry writes; failed/replaced ECS deployment evidence is terminal. See `release-safety-primitives.md`.
Expand Down Expand Up @@ -270,10 +268,9 @@ Graph reads and rebuild/publication transactions share at most two admissions pe

Graph execution validates typed publication counts, fixed reasons and the current selfInfraComplete flag. Infra reserves self in its100-account budget. Complete self context supports normal trace; published stale/degraded self supports only telemetry-derived partial trace with no infra correlation, never healthy or unproven-empty publication. Other missing/bad self outcomes record a non-publishing not_attempted state. Member gaps remain fleet-wide incomplete/failure evidence. Signaled registry failures and unexpected loader exceptions use the non-publishing recorder without invented counts/windows. CLI exits 1 for execution/registry/cleanup failure, 2 for retained/skipped/degraded/incomplete work and otherwise 0. These graph outcomes do not replace full runtime release proof.

Changed HEAD image review uses the shared static-raster format table, source/render lineage
and bounded decoding. Both comprehensive vendor reports and chair must declare required coverage; explicit
unavailable entries block. Response presence and unusable reports remain separate;
see `pr-review-head-images.md`. No new tool or IAM grants.
Changed HEAD image review uses the shared static-raster format table, source/render
lineage and isolated decoding. The action checks each assigned image against the SDK
Read trace. Unavailable evidence blocks the check. See `pr-review-head-images.md`.

## Isolated review codec

Expand Down
12 changes: 5 additions & 7 deletions docs/runbooks/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ erasing valid Read evidence. Source helper/tests and the role consumer catalog a
| [v1-to-v2-aurora-backfill.md](v1-to-v2-aurora-backfill.md) | v1→v2 Aurora history backfill |
| [v1-decommission.md](v1-decommission.md) | v1 legacy decommission — 5-phase procedure (ADR-016) |
| [branch-strategy.md](branch-strategy.md) | Single-repo branch/PR chain (user → dev → main + guard), external-PR handling, domain map, production-domain decision, per-user preview stacks |
| [pr-review-head-images.md](pr-review-head-images.md) | Two-reviewer input admission, HEAD image staging, BASE distinction and incomplete-review diagnostics |
| [pr-review-head-images.md](pr-review-head-images.md) | Claude Code Action on Bedrock, exact-commit review, HEAD image staging and coverage diagnostics |
| [dev-repo-setup.md](dev-repo-setup.md) | CI/OIDC, private exact-plan inspection and encrypted failure recovery; upload-confirmed cleanup; ECR preflight, state-preserving DNS, authenticated assets, Host/SNI smoke, private DB migration, mandatory full dev runtime verification and opt-in diagnostics (ADR-002/005/016) |
| [release-safety-primitives.md](release-safety-primitives.md) | Active web controller/bounded reads, forced web-migration SQL admission, immediate contention and operator recovery (ADR-001/005) |
| [web-release.md](web-release.md) | Digest-bound web release, private migration ordering, mandatory full dev runtime checks and explicit image rollback (ADR-001/005) |
Expand All @@ -46,12 +46,10 @@ erasing valid Read evidence. Source helper/tests and the role consumer catalog a

## Deployment invariants

- HEAD image review uses bounded static raster decoding from one shared format table, source/render lineage and a
deterministic declaration gate. Two comprehensive vendor reports each attest L2–L5;
filtered diff admission is 6,000 lines/128 KiB per call (larger diffs: at most 10 complete
file-boundary batches that must all pass) and chair stdin is at most 256 KiB.
Missing panel coverage publishes bounded unadjudicated observations without a chair call. Response presence, image failure and unusable report
output are separate. See `pr-review-head-images.md`; no tool or IAM permissions are added.
- The required AI review uses the official Claude Code Action on Bedrock. Validate the
exact current commit, all four review areas and actual Read results for every page
and normalized HEAD image. Major and critical findings block the merge.
See `pr-review-head-images.md` for limits and the protected recovery path.
- `release-safety-primitives.md` defines the active web read/controller contracts and transactional pending-SQL admission forced by every web-driven migration clone. Automatic calls reject missing ledgers under the lock and never call `initializeEmptyDatabase`, regardless of the template's init flag. Standalone empty-only bootstrap applies historical SQL and reader sync first; initialized DBs retain full pending checks. Function defaults (`now()`/`gen_random_uuid()`), ALTER/GRANT/views and non-transactional SQL require reviewed standalone migration, then a fresh web dispatch. No historical exemptions or automatic-baseline exception. Advisory-lock contention fails promptly; locks cover reader sync. Only transient reads retry within a shared budget; writes and identity/permission failures do not retry. Receipt verification gives the known old PRIMARY 15 seconds of visibility grace; start confirmation retains its separate 120-second bound.

- Private S3 plans require the configured backend file, verified bucket posture and existing
Expand Down
27 changes: 3 additions & 24 deletions docs/runbooks/branch-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,30 +65,9 @@ user's branch (or short-lived branches merged into it), then flows up via PR to

## Oversized promotion review

The required AI review admits a complete filtered diff up to 6,000 lines/128 KiB
per review call and up to 32 supported HEAD images under the existing byte/codec
bounds. A larger diff is reviewed in at most 10 complete file-boundary batches that
must all pass (`pr-review-head-images.md`). An accumulated dev-to-main promotion
can still exceed that even if each feature PR was independently reviewed. It stays blocked; rerunning unchanged input cannot
restore missing scope, and historical feature-review comments are not proof of
complete review of the current promotion HEAD.

For the `samples` repository, **dev is the default branch**. Verify the live setting
with `gh api repos/aws-samples/sample-awsops --jq .default_branch` before rollout.
An ordinary reviewed PR merged into dev therefore updates the trusted workflow for
subsequent reviews, including main-targeted promotions; the workflow need not reach
main first. Do not assume this activation path for another repository whose default
branch is main. Its pre-provisioned, explicitly approved SHA-pinned recovery path
must authorize the workflow change under the existing protections.

Complete bounded batching exists: a promotion diff up to 10 file-boundary batches,
whose batch-1 file set fits one batch, is reviewed in full by the same protected
workflow on its current HEAD. A promotion beyond that still needs authenticated
exact-commit coverage reuse, which is not implemented, through an ordinary PR to dev
before it can continue. Do not bypass required checks, alter
main to hide changes, or publish the release tag while this prerequisite is pending.
Smaller promotion intervals can prevent future accumulation, but cannot repair the
already accumulated diff. Details: [review input admission](pr-review-head-images.md#review-input-admission-and-panel-size).
The required `AI Code Review` uses the official Claude Code Action on Amazon Bedrock. It reads changes from the promotion's exact merge base and HEAD. Large changes are divided among GitHub Actions jobs. Every job must return a complete review of its assigned pages, and every required image must be available for inspection. A missing verdict or a CRITICAL or MAJOR finding blocks the promotion. Open the linked run summary for the findings.

The workflow for automatic reviews comes from the repository's default branch. Verify that branch with `gh api repos/aws-samples/sample-awsops --jq .default_branch` before changing the workflow. Land the workflow through an ordinary protected PR to dev. Its next eligible event uses the reviewed workflow. Tag only the successful main merge as described below. [Review inputs and limits](pr-review-head-images.md)

## Version and tag on main promotion

Expand Down
Loading
Loading