Skip to content

Latest commit

 

History

History
676 lines (568 loc) · 71.5 KB

api-reference.md

File metadata and controls

676 lines (568 loc) · 71.5 KB

API 레퍼런스 / API Reference

역할 / Role

web/app/api/**/route.ts 경로 인덱스 — 경로·메서드·역할·인증. (API route index under web/app/api — path, methods, role, auth.)

  • 인증 컬럼: verifyUser = Cognito awsops_token 쿠키 검증(@/lib/auth). 없음 = 라우트 자체 비게이트(엣지 Lambda@Edge 게이트는 별도). 역할에 "admin"이 있으면 isAdmin 추가 게이트.
  • 모든 라우트는 루트 경로(/api/*) — basePath 없음. web은 thin-BFF: 도메인 작업은 소유권을 검사하는 전용 라우트로 enqueue하며, 일반 POST /api/jobs는 허용된 noop 종류만 받는다.

auth (2)

경로 메서드 역할 인증
/api/auth/login POST 자체 /login 폼 BFF — 무서명 Cognito InitiateAuth → awsops_token 쿠키 발급 (lib/login.ts) 없음 (로그인 진입점)
/api/auth/signout POST 로그아웃 — HttpOnly 쿠키 서버측 만료. 의도적 비게이트(만료 토큰도 로그아웃 가능해야 함) 없음

chat (4)

경로 메서드 역할 인증
/api/chat POST AI 챗 — 분류기 → 게이트웨이/Code Interpreter/Bedrock direct 라우팅, SSE 스트리밍; custom-policy fallback / unavailable pin → 200 SSE (see below) verifyUser
/api/chat/stats GET AI 호출 운영 통계 (게이트웨이별 호출량/성공률/평균 지연, agentcore_stats 집계) verifyUser
/api/chat/threads GET, DELETE 대화 스레드 목록/검색(?q= 본인 메시지 substring) + 전체 삭제 verifyUser
/api/chat/threads/[id] GET, DELETE 스레드 단건 조회/삭제 (사용자별 분리) verifyUser

inventory (8)

경로 메서드 역할 인증
/api/inventory/[type] GET 인벤토리 리소스 목록 — iam_user/iam_role은 admin 전용; ecs_cluster는 MTD 비용(CE) 병합 기본, ?cost=0으로 생략(비용 미표시 소비자용); ?view=agg는 행 대신 전 플릿 집계(총계·state/dist/facet GROUP BY, 동일 스코프·게이트; 클라이언트 파생 키 차원은 제외되어 표본 유지, 버킷 상한 50) 반환 verifyUser
/api/inventory/[type]/metrics GET 보조 KPI 카드 (CloudWatch/Pricing) + ?ids=/?nodes= 타입별 라이브 진단 플릿(ec2/rds/alb/nlb/s3/transit_gateway/lambda/ebs_volume/dynamodb/elasticache/opensearch/msk) — 실패 시 {cards:[]}로 조용히 degrade verifyUser
/api/inventory/[type]/refresh POST warm Steampipe → Aurora sync 트리거 + 첫 페이지 반환 (락 중이면 busy); admin 전용. type=all은 sync Lambda의 type=all fan-out을 1회 dispatch(행 미반환, {status:'queued',dispatched:'all'}; sync 비활성 시 503 unconfigured, enqueue 실패 시 503 error) verifyUser
/api/inventory/cloudtrail/events GET CloudTrail LookupEvents 조회 — 드릴다운(raw+accessKeyId)은 admin 전용 subset, 그 외 사용자는 flat 필드만 verifyUser
/api/inventory/ebs_volume/related GET 볼륨 드릴다운 — 스냅샷 20개 + 연결 EC2 enrichment (Aurora 교차조회, 계정 스코프) verifyUser
/api/inventory/security_group/inbound GET SG 인바운드 규칙 체이닝 — 첨부 SG(≤20)의 인바운드 규칙 파싱 (Aurora 교차조회, 계정 스코프) verifyUser
/api/inventory/summary GET Default returns account/region-filtered resource counts and security splits plus collection. ?view=collection returns only { collection }, skipping fleet aggregation. collection.scope=aggregate is the job-level ledger and is not narrowed by those filters; missing, failed and unknown evidence remains explicit and does not establish per-account health. verifyUser
/api/inventory/trend GET 일별 리소스 카운트 추세 (inventory_snapshots, 기본 14일/최대 90일) — accounts 스코프(기본 self, __all__은 서버에서 self+스캔 스코프 내 활성 멤버[all_regions 또는 활성 리전 ≥1]로 해석, 검증된 CSV; 리전 차원 없음) + (일자, 타입)별 계정 커버리지·해석된 계정 목록(accounts)·계정 레지스트리 조회 실패 시 degraded: true 반환, 파생 보안 시리즈(public_s3_buckets 등)는 total에서 제외 verifyUser

Inventory pagination and sweep ledger

In normal row mode, GET /api/inventory/[type] returns scoped rows plus nullable run metadata and consistency: "statement-snapshot". limit defaults to 100 and is upper-capped at 500; offset defaults to 0. The route uses numeric coercion/defaults, without positive/integer validation or a lower-bound clamp. Callers should send a positive integer limit and nonnegative integer offset; negative/fractional values can reach PostgreSQL, with row-mode errors returned as HTTP 500 and an error message rather than a validation 400.

?view=agg instead returns totals, state/distribution counts and facets, without rows or run. Both modes retain authentication, type-specific admin checks and the same account/region/global scope filters.

The normal-mode run is global per-type job/sweep metadata under account_id='self', including for member/all-account reads; its row_count is not the selected-scope or page count. The collector marks the job running before row writes. A successful finish advances finished_at and last_success_at; partial/failed finishes do not advance the last-success timestamp. The endpoint exposes status, finished_at, row_count, error and last_success_at, not a per-account completion certificate.

readResources uses one read-only SQL statement: an ordered, limited page CTE and a single-row global-ledger CTE are combined into one result. JSON aggregation repeats the page ordering, including worst-first rules. An empty page still returns its ledger; a missing ledger remains null. One pool.query call borrows/releases its connection without a manually held transaction. PostgreSQL supplies one MVCC snapshot for that statement; statement-snapshot describes this guarantee, not a requested transaction isolation level. Parameters and scope filters are unchanged. view=agg remains separate.

Topology reads target groups/ECS tasks/subnets/network interfaces in at most 20 pages of 500 under one 30-second browser load budget shared with EKS. All inventory and VPC/security-group enrichment requests share two lanes per load; critical pages run sequentially within a lane. This bounds this loader’s fan-out against the shared pool. Each critical page must carry the marker; legacy/missing markers fail closed. Succeeded status, finish, last-success and row-count must remain stable across pages. Ownership decisions do not compare browser and database clocks. The snapshot prevents a finalizing sweep from mixing one page's rows with another ledger snapshot. Separate pages/types are not a single snapshot; success still proves neither freshness nor complete AWS coverage. All ECS snapshot labels, including host labels, remain cached configuration rather than current ownership. Incomplete or changed sweeps retain bounded cached rows with confidence withheld; missing ledger, failed, malformed or capped reads never prove absence. Other display reads keep their existing row cap. Authentication and type-specific admin checks still apply. Inventory and EKS reads share the abort signal; superseded loads are aborted and late completions cannot overwrite newer results. If a failed/incomplete load builds an empty graph, the previous nonempty graph and its provenance are retained only for the same account, regions and includeGlobal scope; a complete empty load replaces it. Target-node targetCapturedAt dates only the target-group row, not the independent task/subnet/pod evidence. The Refresh chip uses the newest source/eligible last-success capture time, so a new read does not reset old data freshness. Onboarding gaps use cluster_not_connected separately from actual read failures; their unknown ownership scopes remain blocked.

Source: inventory route, row/ledger reads, collector lifecycle, topology loader, EKS evidence producer, and IP-target builder.

eks (10)

Path Method Behavior Authentication
/api/eks GET Account/region-scoped discovery, canonical cluster IDs, access state, and onboarding guidance; never writes; for an administrator, an unregistered member cluster with a verified Access Entry is flagged accessEntryVerified: true so the admin page can offer one-click registration (the ordinary register POST, sent only when the admin clicks); partial errors and enumeration limits are disclosed verifyUser
/api/eks/fleet GET Scoped registered-cluster aggregates without raw pod rows; cluster read failure returns reachable:false; a node-only read failure keeps the cluster reachable with nodesReason/nodesError, and nodesSource: "aws-api" marks member EC2/node-group rows; unavailable scope/registration storage returns 503 verifyUser
/api/eks/node-eni GET node DNS lookup in EC2 inventory and traffic metrics; optional cluster selects its registered account/region; node-only requests retain host/deployment-region behavior verifyUser
/api/eks/summary GET Scoped registered-cluster counts and reachable count; failed cluster reads are omitted from totals; a node-only failure keeps the cluster counted and reports nodesUnavailable; scope/registration failure returns 503; truncated discloses the fleet cap verifyUser
/api/eks/[cluster]/db-refs GET Managed-database hostnames extracted server-side from Pod env and ConfigMaps, matched to inventory endpoints; returns workload, via, host, kind, matched resource and referenced Secret names only (no values), with truncated/partial flags for the Kubernetes read and inventoryCapped/inventoryIncomplete flags for the inventory match (a type without one stable succeeded sync snapshot, or cut off by the page cap, has its matches withheld); only account/region query parameters accepted; no-store verifyUser
/api/eks/[cluster]/incluster GET Read-only Kubernetes resources selected by kind; canonical registration allowlist applies verifyUser
/api/eks/[cluster]/incluster/describe GET One Kubernetes object; secrets remain unsupported and config-map values are redacted verifyUser
/api/eks/[cluster]/k8sgpt GET Flag-gated read-only diagnosis (ADR-006); admin and cluster allowlist checks remain verifyUser
/api/eks/[cluster]/metrics GET Scoped control-plane/Container Insights metrics, resolved account/region, and per-source ok/no-data/denied/unavailable/partial outcomes; raw name remains the CloudWatch dimension verifyUser
/api/eks/[cluster]/pod-transfer GET NFM pod-transfer query, at most one hour; member/nondefault-region requests return available:false with an unsupported-scope reason verifyUser
/api/eks/[cluster]/register POST, DELETE Admin-only app registration/removal using a validated canonical ID; POST directly describes the selected cluster before checking its Access Entry verifyUser

EKS enumeration metadata

The list, fleet, and summary accept accounts/regions CSV selections or __all__, with legacy singular account/region aliases. Omitted scope retains the host/deployment-region default. includeGlobal may accompany the shared UI scope but does not add global resources to these regional EKS reads.

The /api/eks envelope contains clusters, admin, errors, and truncated. Each cluster has a separate display name, canonical id, accountId, and region. Envelope region is present only for exactly one query target, including a successful empty result; it is omitted for zero or multiple targets. Discovery describes at most 25 clusters per target and considers at most 12 account/region targets. Continuation or a target cap sets truncated. Wildcard discovery covers configured and registered regions and adds an explicit incomplete-discovery entry in errors; it does not certify exhaustive AWS-region coverage. Individual target failures are also in errors. All target queries failing returns 502 with that error detail, not a successful empty list. Invalid selectors return 400, disabled/unregistered member scope returns 403, and unavailable scope/registration storage returns 503.

Fleet and summary use the selected registered population, including authorized registered regions under wildcard scope, with a separate 100-cluster cap. Fleet rows retain id, name, accountId, and region; individual failures have reachable:false and an error. Summary totals cover successful reads only: reachable < clusters or truncated means the result is incomplete. Neither endpoint converts a failed registration-table read into a complete empty population. Consumers must preserve failure/cap metadata and must not fuse these registered counts with a separately scoped discovery count based only on equal cardinality.

EKS read failure classification

Failed EKS and OpenCost reads expose a coarse classification: denied, unreachable, timeout, or upstream-error. message remains a fixed, credential-free explanation (or an application-owned scope validation message). Classification uses allowlisted SDK error codes/names and numeric HTTP status, not raw error text. Kubernetes transport retains HTTP status and a timeout code internally so a real RBAC denial can be distinguished from connectivity failure. Logs contain only the fixed operation label, coarse reason, and validated/fallback status; they never serialize the exception, stack, response body, or credentials.

Existing HTTP/status envelopes remain: list target failures and fleet rows carry their failure metadata; a failed required fleet read is still reachable:false. Error responses and unavailable allocation results use reason. Degraded K8sGPT results use errorReason with message; OpenCost status retains its human-readable reason and adds failureReason. These degraded results may retain HTTP 200. These results do not establish operator absence, a successful empty scan, or a zero cost. A K8sGPT 503 means the feature is disabled only when the payload explicitly says enabled:false; other 503 responses are read/scope failures. See eks-read-error.ts for the controlled classifications.

EKS identity and registration

For [cluster], URL-encode the complete EKS ARN once for member/nondefault-region clusters. Bare names retain their host/deployment-region meaning. Single-cluster routes also accept a bare name with singular account and region; collection-style plural selectors are rejected there. The legacy node-only ENI route remains a separate host-only compatibility path; use its cluster query for scoped lookup.

eks-cluster-id.ts retains the EKS name charset/length, numeric 12-digit account, and region-pattern validation. eks-context.ts rejects conflicting selectors and disabled member scopes before metadata or cached connection/auth reads. POST registration returns 404 for an absent selected cluster, 409 for an absent/unverifiable Access Entry, 413 for an oversized body, and typed 400/403/503 validation/authorization/unavailability responses. It writes only the app's registration state; it does not create AWS roles, entries, policies, or connectivity. For compatibility, an empty or syntactically invalid JSON body selects the default signer; a parseable but invalid auth object returns 400. Saved authentication is reported through authMode, so clients must not infer that an omitted mode was saved.

For member clusters, discovery and default Kubernetes token signing use the registered member read-only role. Its Access Entry/read policy is required. The shared role uses an Access Entry with AmazonEKSViewPolicy only (no RBAC step); do not grant it AdminView/Secret reads. A member nodes 403 returns EC2/node-group rows (source: "aws-api") built from read-only EC2/EKS APIs with the same role. Optional Result-CRD and OpenCost service-proxy reads need separately scoped bindings. Host clusters retain the web task role. Explicit member AssumeRole overrides must belong to the selected member account; the host bearer is never a member fallback. Saved SA authentication remains separate. See EKS onboarding.

Admin DELETE validates the registration identity and removes the local row/auth without requiring an enabled member account or AWS discovery. This preserves offboarding cleanup after an account is disabled/removed. A bare member name needs its explicit region (or use the full ARN); Terraform-managed host entries remain protected. This cleanup changes no AWS role, Access Entry, or policy.

EKS metric read quality

/api/eks/[cluster]/metrics retains range, controlPlane, cluster, and nodes and adds resolved accountId/region and sources.controlPlane, sources.cluster, and sources.nodes. Each source has a status and an optional fixed, sanitized reason. For submitted metric queries, no-data requires complete result envelopes for the requested IDs with no datapoints. Missing or zero result envelopes are unavailable; a missing later chunk retains earlier values as partial. Known global error classifications such as denied are preserved. Successful node discovery with no matching metrics still represents no-data. It is not proof that an observability agent is uninstalled. denied and unavailable identify failed reads, while partial preserves usable values alongside incomplete results. CloudWatch response/query failures, bounded continuation/discovery, and conflicting instance tuples for a node name are included in that quality assessment. Ambiguous node values are withheld rather than choosing an arbitrary instance. No raw SDK denial or credential value is returned in these source reasons. The response uses Cache-Control: no-store. The host response exposes the configured HOST_ACCOUNT_ID when available, while internal AWS reads continue to use the self target. Errors escaping the source readers use the shared reason envelope and controlled eks-metrics log record. See the AWS MetricDataResult contract.

Diagnosis consumers must use this metadata instead of inferring installation state from null metrics. Independent successful sources remain usable when another source fails. CloudWatch permissions (GetMetricData and ListMetrics) and actual Container Insights publication are separate prerequisites from Kubernetes access.

Overview EKS provenance

/api/overview keeps its existing singleton account query in the deployment region; account=__all__ retains host behavior, while jobs/compliance remain app-level. Successful EKS discovery adds clusterScope with accountId (self for host), region, raw names, and truncated. Discovery failure leaves both clusterCount and clusterScope null. This metadata describes the actual query; it does not claim that overview enumerated the entire account/region picker.

The dashboard sends the full picker scope to /api/eks/fleet, labels its charts as selected registered-cluster observations, and discloses failures, timeouts, unreachable clusters, and truncation. It fuses node/pod details into the EKS headline only for an explicit singleton account/region whose complete discovery names exactly match the reachable fleet's names and account/region metadata. Older, incomplete, or mismatched responses do not qualify based on equal counts.

nfm (2)

경로 메서드 역할 인증
/api/nfm GET NFM 상태(메뉴 게이트) — 모니터 목록 + Scope 수; 모니터 없으면 온보딩 안내로 degrade verifyUser
/api/nfm/query GET NFM 모니터 쿼리 — 최대 1시간 윈도우 (초과 시 API ValidationException) verifyUser

NFM observation metadata

Successful /api/nfm/query responses retain monitor, metric, category, range, rows, unit and tookMs, and include:

Field Meaning
startTime, endTime ISO query bounds sent to NFM; preserved unchanged on a four-minute cache hit.
queriedAt Result assembly time, also preserved on cache hits; not the current HTTP request time.
capped The contributor limit was reached or a continuation token remained. More rows may exist.

These are query bounds and truncation signals, not proof of complete traffic coverage. The route owns RANGE_ALLOWED (900/1800/3600 seconds); an unsupported or omitted range uses its existing 3600-second default. Metric/category allowlists remain in nfm.ts.

The client-side topology-observations.ts loader powers explicit queries in /topology?view=e2e. Its NetworkBatch is a client result, not additional HTTP response fields: it carries failed/capped categories, complete/partial status and per-category verified/unknown window quality. verified means parseable, ordered bounds only. Failures use closed codes (query_failed, malformed_payload, malformed_rows, invalid_request) without raw upstream error text. Missing/invalid windows remain unknown and make the batch partial. At most three workers bound category concurrency; cancellation stops further scheduling and result application, without guaranteeing cancellation of a server query already started.

Service/network graph composition

The opt-in /topology?view=e2e view uses the pure web/lib/e2e-topology.ts model and existing authenticated APIs. Source-evidence, identity and selection contracts are maintained in E2E observability; ServiceNetworkTopology orchestrates sources and E2eGraphCanvas renders the model.

dns-logs (2)

경로 메서드 역할 인증
/api/dns-logs GET Resolver query-log 설정 상태(메뉴 게이트) — 미설정/무권한도 200 + 빈 configs verifyUser
/api/dns-logs/analytics GET Resolver 로그 집계 분석 (Logs Insights 병렬 폴링, maxDuration 60s, group은 라이브 allowlist 검증) verifyUser

sg (4)

경로 메서드 역할 인증
/api/sg GET Security Group 사용 분석(ENI 부착+상호참조 미사용 감지, 룰 소스/목적지 식별). ?regions=로 리전 스코핑(안 주면 인벤토리 전 리전). ?view=hits&id=sg-... 트래픽 히트 매칭 — Flow Logs 우선(ACCEPT만 룰 귀속), NFM 폴백은 상대 식별 전용(양방향 집계라 룰 귀속 불가, hits=null) verifyUser
/api/sg/rules GET Filtered, paginated SG-rule inventory and activity from Aurora. Filters are bound parameters (web/lib/sg-rules.ts), never SQL fragments verifyUser
/api/sg/rules/refresh POST Manual refresh — enqueues the same sg_rule_scan job the daily dispatcher uses via enqueueJob (not the generic /api/jobs, ADR-009). 503 when workers are disabled verifyUser + isAdmin
/api/sg/flow-sources GET, PUT Flow Log Athena source configuration (ADR-019). GET for any user; PUT validates workgroup/database/table against allowlist regexes, and the live existence check runs in the isolated Athena broker Lambda verifyUser (+ isAdmin on PUT)

network-paths / network-path-runs (4)

All routes return 503 unless NETWORK_PATH_CHECK_ENABLED=true (web/lib/network-path-gate.ts).

Path Method Role Auth
/api/network-paths GET, POST List saved network-path checks / create one (created_by_sub = caller) verifyUser
/api/network-paths/[id] GET, PATCH, DELETE Read a check; edit or soft-delete it (creator or admin only, otherwise 403) verifyUser
/api/network-paths/[id]/runs GET, POST Run history (most recent first, max 50; kept after soft delete) / start a run, which enqueues the network_path job directly (ADR-009). New runs are also refused by networkPathLiveTopologyCapabilityGate until live topology re-reads are available verifyUser
/api/network-path-runs/[runId] GET Run status and phase; once concluded, overall_status, candidates, steps and the validation bundle verifyUser

anfw (1)

경로 메서드 역할 인증
/api/anfw GET Network Firewall 방화벽/정책/룰그룹 목록+분석 — 인벤토리 VPC 리전 fan-out, 트래픽·드롭 집계, 보호/로깅/전량 통과 기본/룰 용량 (룰 본문은 미탑재, statefulSids로 sid/msg/action/noalert만 파싱해 노출 — noalert는 alert/drop이어도 로그를 남기지 않는 룰이라 UI가 pass와 동일하게 취급). 도메인 리스트(STATEFUL_DOMAIN) 등 SID를 파싱할 수 없는 룰그룹은 sidsUnparseable=true(그 그룹이 참조되면 계정 전체 SID 귀속을 불신하게 만드는 신호 — 정책의 참조는 전체 ARN으로 대조한다: ListRuleGroups는 계정 소유 그룹만 열거해 이름만으로 대조하면 같은 리전의 관리형 그룹과 이름이 같은 계정 소유 그룹이 우연히 있을 때 관리형 참조를 놓친다). 어느 정책이든, 또는 어느 STATELESS 아닌(즉 STATEFUL/STATEFUL_DOMAIN/미확인 ?) 룰 그룹이든 lastModified가 range 시작 이후(또는 null, 즉 확인 불가)면 UI는 계정 전체 SID 귀속을 불신 처리한다(정책 전용 규칙을 룰 그룹 자체의 in-place 수정에도 동일하게 확장: 삭제/재정의된 SID는 현재 토폴로지로 열거할 수 없어 지역적 taint로는 대체 불가하다). 로깅 구성 조회가 거부돼 접두사 발견(discovered)으로 ALERT 로그 그룹을 찾은 리전이 하나라도 있으면 동일하게 계정 전체를 불신 처리한다 — 그 리전은 방화벽/룰그룹 토폴로지를 확인할 수 없는데도 그 히트는 다른 리전과 똑같이 sid로 전역 병합되기 때문. generatedAt(ms epoch, 서버가 이 분석을 생성한 시각)은 UI가 룰그룹/정책의 lastModified를 range 시작과 비교할 때 브라우저 시계 대신 이 값을 기준으로 삼는다 — 클라이언트 시계 왜곡(특히 빠른 쪽)이 있으면 range 시작을 실제보다 늦게 계산해 mid-range 수정 가드가 fail-open할 수 있기 때문. ?view=logs 응답의 generatedAt도 동일한 목적의 별도 값이다 — 이 두 뷰는 서로 독립된 4분 TTL 캐시라 시차가 날 수 있으므로, UI는 두 generatedAt 중 더 이른 쪽을 range 시작 기준으로 써야 한쪽만 캐시로 오래됐을 때도 mid-range 수정을 놓치지 않는다(단, 이 anchor는 로그 쪽이 더 오래된 캐시인 경우만 닫는다 — 토폴로지 쪽 fetch 자체가 오래된 캐시라면 그 안의 lastModified가 이미 스냅샷 시점 값이라 이후에 일어난 수정은 어느 anchor를 쓰든 다음 캐시 갱신 전까지는 보이지 않는다. 4분 TTL로 유효기간이 제한된 잔여 위험). 알려진 미해결 잔여 위험(문서화만 됨, 미해결): 방화벽이 range 도중 다른 정책으로 전환됐거나(어느 firewall이 어느 시점부터 그 정책을 썼는지 API에 없음), 방화벽 자체가 range 도중 삭제됐다면(AnfwFirewallRow에는 정책/룰그룹과 달리 lastModified가 원천적으로 없음 — DescribeFirewall이 반환하지 않음) 위 검사 전부를 통과한다 — 삭제된 방화벽의 로그 그룹과 히트는 여전히 존재해 다른 리전과 동일하게 sid로 전역 병합되기 때문. CloudTrail(?view=audit)의 DeleteFirewall/DisassociateFirewallPolicy 이벤트를 조인하면 닫을 수 있으나 아직 구현되지 않았다. ?range=는 3600/21600/86400/604800 allowlist(그 외는 86400), maxDuration 60s, 상위 실패는 502. 부분 실패는 정직 강등: degradedRegions(firewalls/policies/ruleGroups 중 하나라도 List/Describe 실패 — 포괄 신호)·firewallListDegradedRegions(그 중 firewalls 자체만의 부분 실패로 좁힌 부분집합 — 로깅 구성을 확인 못 한 리전만 필요한 소비처용)·metricsDegradedRegions(CloudWatch 미순회/캡/쿼리 실패). ?view=logs Alert/Flow 로그 Insights 집계(CWL 대상만). stateful 룰 히트 카운트(ruleHits, sid 단위로 미리 합산됨 — 튜플 단위로 자르지 않음)는 alertRuleHits 쿼리 실패·alertTopNPartial(어느 리전이든 로그 그룹 50개 초과로 청크 분할)·discovery unknown 시 ruleHits=null(빈 배열이 아님 — totalAlerts와 동일한 unknown≠0 계약); 최종 join 컷오프(100개 sid) 초과로 일부 sid가 누락됐을 수 있으면 ruleHitsTruncated; 어느 리전이든 리전별 상한(150개)에 도달해 present인 sid의 값 자체가 과소집계됐을 수 있으면 ruleHitsPartial(UI는 ≥N으로 표기). UI는 이 시각적 절단 신호와 동일하게, 서빙 방화벽 중 일부만 ALERT 관측이 확인된(observability === 'unknown') 룰의 양수 히트도 ≥N으로 표기한다 — 관측 안 된 방화벽에서 발생한 매칭이 포함되지 않았을 수 있어서다. alertCoverageComplete(boolean, 계정 전체 단일 신호)는 사용된 모든 ALERT 로그 그룹의 creationTime/retentionInDays를 range 시작 시점과 비교한 것 — false는 "커버리지가 불완전함"과 "커버리지를 확인할 수 없음"(그룹을 못 찾음/creationTime 없음/데드라인 초과/DescribeLogGroups 거부됨— 이 페이지가 다른 곳에서 구분해 다루는 것과 같은 SCP 시나리오) 둘 다를 같은 값으로 뭉뚱그린다 — 두 경우 모두 hits=0을 확정 idle로 표시하지 않는 보수적 방향은 동일하지만, 원인이 하나가 아니다(단, 이 신호는 로그 그룹 메타데이터로부터의 추론일 뿐 — 같은 그룹에서 로깅이 range 중간에 껐다 켜졌다 했는지까지는 증명하지 않는다). ?view=audit는 CloudTrail 변경 감사 verifyUser

dx (1)

경로 메서드 역할 인증
/api/dx GET Direct Connect 커넥션/VIF/게이트웨이 목록+분석 — AWS/DX 메트릭 다운 감지·피크 사용률·BGP 라우트 가시성 (호스티드 <1G는 커넥션 레벨 Bps 미발행 → VIF 레벨). locations[]는 available/down owned·hosted의 확인된 위치/리전별 집계, totals.locations는 고유 위치명 수. 기타·미확인 상태는 원본 목록에 남지만 위치·상태·SLA 평가에서 제외·미평가로 고지하며 SLA는 owned만 대상. / Known deployed sites only; raw inventory remains available, excluded states are unassessed. 부분 실패는 정직 강등: degradedRegions·metricsDegradedRegions·gatewaysDegraded·행 단위 associationsAvailable·totals.gatewaysAssociationsUnknown verifyUser

ip-inventory (1)

경로 메서드 역할 인증
/api/ip-inventory GET ENI 전량 + EIP + EKS 파드 IP 조인 (파드 맵 best-effort — 실패해도 ENI/EIP 반환) verifyUser

tgw (1)

경로 메서드 역할 인증
/api/tgw GET Transit Gateway 상세 — 어태치먼트(+VPC 어태치먼트 options: DNS/IPv6/Appliance — VPC 타입만, 불완전 경로[조회 실패·페이지 캡 절단·미반환 VPC 행]는 optionsDegradedRegions로 공개, options만 누락) + 라우트 테이블(+라우트). ids는 tgw- 접두사만 통과, 인벤토리로 TGW별 소속 리전 해석 verifyUser

vpce (1)

경로 메서드 역할 인증
/api/vpce GET VPC Endpoint 목록+분석 — 인벤토리 VPC 리전 fan-out + PrivateLink 메트릭 기반 미사용 감지 verifyUser

topology (1)

Path Method Role Auth
/api/topology GET Published host service snapshot with bounded service, entry, placement and evidence lenses. Select a returned entity with focus, filter by q and pin snapshot when following nextCursor. Returns 404 when topology_entities_enabled is disabled, 422 for unsupported scopes, or 410 for an expired snapshot. verifyUser

network-topology (1)

Path Method Role Auth
/api/network-topology GET Configuration-only, cross-account network topology projected from central inventory. Optional accounts (__all__ default, or comma-separated self/12-digit IDs) scopes the fleet view; optional vpcs (at most 4 <account>/<region>/<vpc-id> keys) switches to the detail view. One bounded statement reads fleet rows (VPC, TGW, TGW attachments, VPC peering; 20,000-row cap) and detail rows for the selected VPCs (8,000-row cap); overflow sets truncated. Cross-account links resolve by attachment or peering ID, never by CIDR; conflicting duplicates and non-active links are counted in omitted. Out-of-scope peers are external stubs. Edges are configured attachments/peerings, not reachability. Repeated or malformed scope parameters return 400 invalid_request; read failures return 503 network_topology_unavailable. All replies use Cache-Control: private, no-store. verifyUser

vpc-connectivity (1)

Path Method Role Auth
/api/vpc-connectivity GET On-demand, read-only VPC peering and TGW attachment observations for exactly one account (self or a 12-digit account ID), region (commercial-region allowlist shared with the picker) and vpcId. Requires an enabled registered account and an exact indexed inventory match, including host-to-self mapping. source.ownerId is disclosure only; it never selects authorization or credentials. Returns source identity, read-completion checkedAt, peering records, TGW groups and required limitations and incompleteSources arrays. All replies use Cache-Control: private, no-store. See VPC connectivity. verifyUser

Each scope parameter must occur exactly once. Errors return { status: "error", code } with the following stable mapping:

Code HTTP status Meaning
invalid_request 400 Missing, repeated or invalid scope input, including a region outside the commercial-region allowlist.
not_found 404 No unique VPC matches the indexed collecting account, region and resource ID.
account_unavailable 403 Missing, disabled or inconsistent registry account/host identity, or an invalid registered read-role name.
lookup_failed 502 The lookup failed, exhausted its deadline without usable evidence, or exceeded the process's in-flight limit.
unauthenticated 401 verifyUser rejected the session cookie.

limitations contains structural visibility signals (shared-vpc, owner-unknown, shared-tgw). incompleteSources identifies failed, denied, truncated, conflicting or malformed reads. Usable partial results remain HTTP 200. Either nonempty array prevents a definitive empty-connection claim. Results with no operational read gaps may reuse a four-minute process-local cache even with limitations, keyed by collecting account, region, VPC ID and disclosed owner identity. Nonempty incompleteSources prevents caching, so retries read AWS again. The HTTP private, no-store policy applies to both success and error responses.

Reduced-info and pending peerings remain records: peer.vpcId, peer.accountId, peer.region and peer.cidr are each string | null. Missing optional fields remain unknown; present malformed metadata marks the affected read incomplete. Input regions use the shared isVpcConnectivityRegion predicate's current 34-region commercial allowlist, and unsupported picker rows are excluded with a notice. Provider-reported peer regions need only valid syntax and may name a future region without authorizing queries there.

TGW source and peer attachments expose routeTableId: string | null and associationState: string | null. Only active peerings and available attachments receive the active-record label; other lifecycle states remain configuration records with the current connection unconfirmed. The UI labels a table Associated TGW route table only for an available attachment with an associated association; otherwise it shows an association record with the ID and state or unknown. TGW peer lists describe VPC attachment records on that TGW. Retained pending or historical records and route-table associations do not prove reachability.

기타 (55)

경로 메서드 역할 인증
/api/accounts GET, POST, PATCH, DELETE Registered-account CRUD. GET requires authentication; POST/PATCH/DELETE additionally require admin. POST assumes the pinned role and verifies the target account before writing. Host-only registration or a target outside the applied allowlist returns 409; malformed deployment scope returns 503 before STS or registry writes. PATCH retains the registered-account re-test behavior. verifyUser; writes + admin
/api/accounts/regions GET, POST, DELETE 계정별 리전 활성/비활성 ('self' → 호스트 실제 id 해석) — 조회 auth / 변경 admin verifyUser
/api/accounts/onboarding GET, POST Admin discovery and read-only connection diagnostics. GET returns host web role/account, region, registrationEnabled, and optional collector role/target allowlist; discovery or malformed scope returns 503. POST accepts {accountId,region,externalId,firstParty} (no alias), validates a 4 KiB body, then checks host identity, pinned target-role assumption and target identity under a shared 15-second STS deadline; region is requested inventory metadata and optional stsRegion identifies the deployment STS endpoint. STS endpoints use deployment AWS_REGION (default ap-northeast-2), not the selected inventory-region metadata. Requires a nonempty actor sub and either an applied allowlist entry or an enabled nonhost registered target. After single-flight/cooldown admission, unregistered/unlisted targets return 409 target_not_configured even in legacy multi-account mode; malformed scope or failed registry lookup returns 503. Registration and collector scope are unchanged. One in-flight probe including a three-second registry lookup limit and a 60-second admission cooldown per process, including failed/rejected lookups. Lookup timeout returns scope_unavailable/503, discards any checked-out DB connection and releases admission while preserving cooldown; 429 carries a safe code, retryAfterSeconds and Retry-After. Auth: 401/403; invalid input/body: 400/413; success: 200 {ok:true,diagnostic}; AWS check failures: 400/503/504 with {ok:false,diagnostic}. Boundary rejections carry a fixed message/code where available, not an AWS diagnostic. Unexpected verifier errors return check_failed/503 with single-flight released and cooldown preserved. Successful GET and all POST replies use Cache-Control: private, no-store. No registry or AWS-resource writes. See onboarding. verifyUser + admin
/api/actions GET, POST 액션 목록/생성 (ADR-007[legacy 040/041], admin) verifyUser
/api/actions/[id] GET, POST 액션 상세/실행 (admin) — kill-switch 분기(integrations-write vs mutating-actions), 빈 이름 fail-closed verifyUser
/api/agentcore GET AgentCore 컨트롤플레인 상태 (runtime/gateway/memory/interpreter, ?action=stats) verifyUser
/api/ai-usage GET 앱 Bedrock 토큰 비용 — ai_usage_daily SUM (스케줄 집계 산출물, 라이브 AWS 호출 없음) verifyUser
/api/bedrock-metrics GET Bedrock 모델 사용 메트릭 — 단일 계정 라우트 (All accounts는 클라이언트 fan-out) verifyUser
/api/changelog GET 사이드바 버전 칩 + 변경 이력 모달 데이터 — 저장소 CHANGELOG.md와 항상 일치 (배포된 커밋 = 표시 버전) verifyUser
/api/compliance/benchmarks GET UI 셀렉터용 벤치마크 정적 allowlist verifyUser
/api/compliance/run POST CIS 벤치마크 실행 enqueue — allowlist 검증 후 worker compliance job verifyUser
/api/compliance/runs GET 실행 이력 목록 (compliance_runs) verifyUser
/api/compliance/runs/[id] GET 실행 단건 상세 verifyUser
/api/cost GET 비용 요약 — 기간 필터 1m/3m/6m/12m (미지정/오류 → 6개월) verifyUser
/api/cost/availability GET Cost Explorer 가용성 probe (1h 캐시, ?force=1 재확인) verifyUser
/api/cost/detail GET 서비스별 비용 상세 (?service= 필수, ≤100자) verifyUser
/api/finops/findings GET ADR-020 FinOps 기본 권장 엔진 — 미해결 findings + 최근 배치 실행(finops_runs) 조회, Aurora만 읽음(라이브 AWS 호출 없음). finops_baseline_enabled=false면 {enabled:false, findings:[], lastRun:null} verifyUser
/api/customization GET, POST, PUT Admin skill/agent catalog CRUD; invalid tool policy → 400; unavailable validation/read → 503 (see below) verifyUser
/api/datasources GET 데이터소스 인스턴스 목록 — 크리덴셜 미노출 verifyUser
/api/datasources/generate POST 자연어 → 쿼리 초안 생성 (리뷰용 — 절대 실행 안 함) verifyUser
/api/datasources/manage POST, PATCH 인스턴스 생성/수정 + 크리덴셜 저장 (admin); settings(timeoutS 1–60[모든 kind 유효 최대 55 — Prometheus/Mimir/ClickHouse는 서버 실행 제한(Explore의 Prometheus/Mimir는 10초 상한), 그 외는 HTTP 응답 제한]·clickhouse database)는 서버 측 sanitize 후 ds_settings JSONB에 저장 verifyUser
/api/datasources/query POST 인스턴스 대상 read-only 쿼리 실행 (admin 아님 — 탐색용) verifyUser
/api/datasources/test POST 저장 전 연결 probe — SSRF 가드 (admin) verifyUser
/api/datasources/[id] DELETE 인스턴스 삭제 — 스키마 캐시/크리덴셜 cascade, 기본값 재선정 (admin) verifyUser
/api/datasources/[id]/cards GET 사전 생성 대시보드 카드 조회 (read-only, auth) verifyUser
/api/datasources/[id]/default POST kind별 기본 인스턴스 지정 — 트랜잭션으로 기존 기본 해제 (admin) verifyUser
/api/datasources/[id]/diag-signals GET 사전 정의 진단 시그널 — Explore 칩 (DB read only, egress 없음). kind 범위: prometheus/mimir/loki 는 결정론 카탈로그, clickhouse 는 결정론 엔트리가 없어 폴백 전용. tempo 는 tags_or_services matcher 가 introspect 된 어떤 스키마에도 매칭되어 항상 ready 이므로 폴백에 도달하지 않는다. LLM 폴백(diag_signal_querygen_enabled)은 clickhouse 전용이 아니다 — ready 0행인 모든 배선 kind 에서 발동하므로 라벨 미탐지로 0행이 된 loki 인스턴스의 칩에도 provenance='generated' 가 섞일 수 있다(리뷰 MAJOR-9). 생성 행은 칩 전용 — 리포트 경로 제외, 플래그 OFF 면 read 에서도 제외. jaeger/dynatrace/datadog 는 아직 배선 없음(빈 응답) verifyUser
/api/db GET Aurora ping — success returns status: "ok", public_tables and UTC ISO server_time from the same table-count/clock_timestamp() SELECT; unset AURORA_ENDPOINT remains 503 and database errors remain generic 500 responses CloudFront edge authentication; BFF verifyUser() omitted (ADR-002 §2-4)
/api/diagnosis GET, POST AI 종합진단 리포트 목록/생성 — worker enqueue + 멱등키 verifyUser
/api/diagnosis/intent GET, POST Plan-2 Intent Engine — architecture_intent 조회(auth) + 쓰기(admin) verifyUser
/api/diagnosis/schedule GET, PUT 사용자별 자동 진단 스케줄 — row read/write만 (실행은 worker schedule_dispatcher) verifyUser
/api/diagnosis/subscribers GET, POST, DELETE 진단 완료 메일링 리스트 (SNS) — 조회 auth / 변경 admin verifyUser
/api/diagnosis/notify GET, PUT 알림 일시중지 토글 — GET 상태 조회 / PUT admin 전용 upsert (app_settings) verifyUser (+PUT isAdmin)
/api/diagnosis/subscribers/test POST 진단 알림 테스트 발송 — 토픽 한정 SNS Publish 1건 (admin 전용) verifyUser
/api/diagnosis/[id] GET, PATCH, DELETE 리포트 단건 조회/수정/삭제 verifyUser
/api/diagnosis/[id]/download GET 산출물(md/docx/pdf) S3 프록시 다운로드 (presign 아님) verifyUser
/api/graph GET 읽기 전용 토폴로지 그래프 — class flow|infra|trace, ?from=으로 서브그래프. 모든 class는 collection 수집·보존 상태를 노출하며, trace는 관측 edge count를 함께 제공. 큐 meta.claimedAccountId/claimedRegion은 보존된 행도 destination ARN에서만 재계산하고 비-ARN/누락 한정자는 null; identityProvenance=telemetry_claim 고정, 호출자 폴백·AWS 인벤토리 bridge 없음. 동일 ARN은 데이터소스·환경 안에서만 호출자 간 연결. / Queue claims derive only from destination ARNs; unverified, scoped by datasource/environment, never inventory authority. 계약·배포 / Contract and rollout verifyUser
/api/health GET 헬스체크 — 컨테이너/타깃그룹 health 경로와 일치 필수 없음 (공개)
/api/incidents GET, POST 인시던트 목록 + 수동 트리거 (ADR-006[legacy 032], admin) verifyUser
/api/incidents/prevention GET 교차 인시던트 예방 인사이트 (admin, read-only) — Aurora 미설정/실패도 200 + 빈 목록 verifyUser
/api/incidents/webhook POST 인시던트 ingress — HMAC 서명 웹훅 (ADR-013[legacy 022] active/standby 로테이션) 없음 (HMAC 검증)
/api/incidents/[id] GET 인시던트 상세 (admin, read-only, UUID 가드) verifyUser
/api/insights GET Overview용 최신 캐시 AI 인사이트 (DB read only) verifyUser
/api/insights/refresh POST AI 인사이트 재생성 enqueue (admin) — 플래그 off 시 fail-closed, 중복 job dedup verifyUser
/api/integrations GET, POST, PUT 통합 등록 — egress 커넥터 + ingress 웹훅 소스 (ADR-007[legacy 039], admin, SSRF 가드) verifyUser
/api/integrations/credential GET, PUT 통합 크리덴셜 저장 — 단일 Secrets Manager secret에 slug(kind) 키 (admin) verifyUser
/api/integrations/schema GET, POST 인스턴스 스키마 introspect/캐시 (admin) verifyUser
/api/deployment/readiness POST 실제 웹 역할·SSM·AgentCore·인벤토리·모델 검증. nonce/account/known CloudFront 입력, no-store, 401/403/429/503. 프로세스당 단일 실행·60초 제한 / bounded deployment evidence verifyUser + admin or deployment-verifiers
/api/deployment/member-inventory GET Minimal member-resource evidence within the applied target-account allowlist. Query: accountId, type (ec2 or cloudfront), resourceId. One Aurora inventory query after authentication; no resource AWS API calls or writes. A unique matching row returns 200 {schemaVersion:1,status:"verified",accountId,type,resourceId,region,capturedAt} without raw resource attributes. Unregistered/disabled/out-of-scan-scope accounts or missing, ambiguous or mismatched row evidence return 200 not_ready with a fixed reason. Invalid input: 400; unauthenticated: 401; outside or absent applied target authorization: 403; DB/malformed-configuration failure: 503. All responses are private/no-store. The caller must check capturedAt against its trusted collection marker; this lookup alone is not complete collection or runtime readiness. verifyUser + applied target allowlist
/api/jobs GET, POST 비동기 작업 enqueue/목록 (P2 — worker_jobs + SQS) verifyUser
/api/jobs/[id] GET 작업 상태 단건 조회 — UUID 검증 + 소유자 또는 관리자 / owner-or-admin verifyUser
/api/jobs/observability GET 접수 기간별 작업 시간·완료 목표: windowHours 1–168, 선택적 type 및 targetMs 1–86400000. 소유자/관리자 범위, 최대 2000건 표본·최근 50건 상세, 누락·잘림 시 미확정 / ownership-scoped workload observations verifyUser
/api/me GET 현재 사용자 + isAdmin 시그널 (UI 표시용 — 쓰기 게이트는 서버측 별도 유지) verifyUser
/api/monitoring GET 모니터링 허브 — ?tab=ec2|rds 플릿, ?series=+range로 단일 리소스 시계열 verifyUser
/api/opencost/[cluster] GET, PUT Canonical-cluster saved config; GET requires authentication, PUT requires admin; null means no config returned (absent or storage unavailable) verifyUser
/api/opencost/[cluster]/allocation GET One-day allocation and per-pod cost for the selected registered identity; unavailable data returns available:false, while typed scope failures retain their error status verifyUser
/api/opencost/[cluster]/bundle GET Generate values.yaml and install.sh for manual operator execution; canonical request identity determines raw cluster name, region, and member-account guard verifyUser
/api/opencost/[cluster]/status GET Canonical scope/registration checks precede install detection; detection may return 200 {installed:false, reason}, while scope/allowlist failures retain typed 400/403/404/503 responses verifyUser
/api/overview GET App-level jobs/compliance plus singleton EKS/cost reads; clusterScope records actual EKS account/region, names, and truncation for safe consumer comparisons verifyUser
/api/security GET 보안 findings (inventory_resources 파생, read-only) + ECR 이미지 스캔 CVE(라이브, 실패 시 빈 탭) — accounts 파라미터 해석(__all__ 포함) verifyUser
/api/security/refresh POST 보안 관련 인벤토리 타입 재동기화 verifyUser
/api/stream GET SSE 스트림 verifyUser

Chat custom-policy availability

GET /api/customization returns 503 {"error":"Customization policy unavailable"} when the catalog or Agent Space cannot be read. Confirmed absence of an Agent Space row retains Phase-1 global custom-agent membership; a read failure never means no cap.

Chat obtains fresh custom policy per turn when needed. Built-in pins (including basic routing mode) and hybrid product help bypass custom selection. Initial catalog/space failures and final enablement-read failures have the same contract:

Selection Response / execution
Explicit custom pin HTTP 200 SSE with an unavailable guide and [DONE]; no custom or substitute invocation
Automatic routing HTTP 200 SSE using independent built-in routing, with one policy-fallback notice streamed and persisted; an Assistant fallback also keeps it
Built-in pin / hybrid product help Normal built-in / Assistant response; no custom policy or persona inherited

A confirmed disabled/missing custom pin also returns a guide without invocation, but is distinguished from unavailable policy. Successful toolAllowlist: [] remains deny-all. The BFF encodes it as a reserved nonempty sentinel for old exact-match runtimes; both agent loops filter duplicate identities before deduplication.

Apply 01M2K0BTQ4P4QHHFHR44ZK1YW6_agent_tool_policy_history.sql through the reviewed standalone migration flow before the web reader update. Automatic Web migration rejects its ALTER/trigger statements; do not bypass that gate. No SQL-reader projection changes. It backfills currently bound nonempty declarations, including disabled skills, then transactionally retains that agent's restriction history through skill edits, binding moves/removal and deletion. It cannot reconstruct declarations removed before migration. Only never-configured agents without an account cap or integration tool grants inherit gateway reads. A cap only removes explicit grants; it cannot create a gateway grant. Reattach/re-enable explicitly declared skills to restore specific grants; editing a skill to [] does not reset the agent to unrestricted mode. Agent Space enabledSkillIds remains metadata, not a runtime skill permission check.

Gateway identities come from web/lib/gateway-tool-catalog.json, parity-tested offline against scripts/v2/agentcore/catalog.py. A bare name must uniquely resolve within the selected gateway; unknown, ambiguous or foreign-target names grant nothing. Integration grants are separate exact names and cannot authorize gateway-qualified tools. No flag, credential boundary, arbitrary MCP support or mutating capability is enabled here.

Custom-tool declaration checks and frozen stdio limitation

Skill writes reject unknown or ambiguous tool names (400). Edits and attachments also check current bindings, including disabled rows: each attached gateway must retain an effective grant for a nonempty declaration. Shared skills may contain known tools from several gateways; each agent resolves only its own subset. Instruction-only [] remains valid and never clears retained policy history. Unavailable validation returns 503 and performs no write. These are authoring preflight checks, not live tool-discovery proof.

Restricted custom agents cannot address the vendor's bare ClickHouse stdio tool names through this gateway-qualified catalog. Reattaching a skill does not restore those stdio tools. CLICKHOUSE_OFFICIAL_MCP remains frozen/default-off; keep it off. The supported ClickHouse path here is the existing gated gateway/Lambda identity set; no stdio identities or new runtime capabilities are introduced.

Configuration topology inventory evidence

The row/ledger wire contract is defined once in Inventory pagination and sweep ledger. For unresolved targets, incomplete reads, onboarding gaps and retained results, use Topology evidence compatibility.

Collection disclosure (including trace)

The GraphCollection / GraphCollectionSource TypeScript contract is defined in web/components/topology/GraphCollectionStatus.tsx; runtime input is still normalized. Trace sources[].windowStartMs/windowEndMs identify the source query window, separately from top-level attempted_at/captured_at and optional source capture/last-success clocks. Positive nodeDrops/edgeDrops/orphanSpans/invalidSpans/unresolvedMessaging and infraUnavailable remain visible for older persisted envelopes as well as newer producer flags. The panel groups positive safe-integer losses and unavailable infrastructure in a localized Collection limitations list outside collapsed source details. This is a display predicate; it does not redefine the server projector's general numeric contract. Only node/edge drops or explicit truncation flags imply a processing limit; malformed spans and unresolved parent/link/messaging evidence are distinct partial-result causes. Losses alone do not prove retention: retainedPrevious is required for that claim. Source-detail totals count displayed current/saved rows; status counts summarize latest-attempt sources. Identical current/saved lists are displayed once with saved provenance. Missing collection metadata stays unknown rather than implying collector failure.

Graph collection metadata

Focused GET /api/graph?from=<node-id> responses include selection.status (resolved, not_found, or ambiguous) and the requested ID. A resolved result includes resolved_id and account_id; ambiguity returns no graph and at most two candidate_ids, with candidates_truncated disclosing further matches. Placement IDs use <kind>:@<account>:<region>:<resource-id> when region is known, and account-union IDs wrap saved IDs as @<account>/<saved-node-id>. Unwrapped exact and legacy-alias matches are considered together, including retained publications. Candidate IDs always wrap the saved ID with its account. Wrapped input selects an exact saved row first and uses aliases only when that row is absent. See the graph read contract.

GET /api/graph returns collection for flow, infra and trace. Older responses without it remain compatible as unknown evidence. The shared TypeScript contract is GraphCollection / GraphCollectionSource in web/components/topology/GraphCollectionStatus.tsx; the renderer also validates unknown runtime payloads for compatibility with older or malformed responses.

Fields Meaning
status, stale, retainedPrevious Collection result and snapshot age/retention; a retained graph does not establish current traffic. Missing metadata stays unknown.
attempted_at, captured_at Latest graph attempt and saved publication clocks, serialized as timestamps; neither substitutes for the source query window.
sources[].sourceId/status/reasons/itemCount Per-source collection result and bounded reason vocabulary.
sources[].producerStatus/attemptedAtMs/finishedAtMs Underlying inventory job outcome and start/finish clocks; not graph publication time or per-account success proof.
failureReason Bounded failure category: publication_failed, source_read_failed, not_attempted, or API-only state_read_failed.
sourceAttempted Explicit false records a source read not attempted within the rebuild budget; it never changes the saved publication clock.
metadataTruncated Stored or computed recognized-field omission/malformation marker, shared by HTTP and SQL projections and included in freshness decisions.
coverage unknown for a flow/infra __all__ union; host state cannot prove union coverage and top-level captured_at is null. Trace __all__ reads the existing host storage scope.
windowStartMs/windowEndMs Optional graph-attempt window, distinct from per-source query windows and saved publication time.
sources[].windowStartMs/windowEndMs Actual trace query window, in epoch milliseconds; displayed independently of publication time.
nodeDrops, edgeDrops, orphanSpans, invalidSpans, unresolvedMessaging, infraUnavailable Existing trace loss counters and unavailable inventory context; span/messaging problems are distinct from processing limits. Positive losses are visible even for older rows without newer truncation flags. Loss alone does not imply that a previous graph was retained.
evidenceKind, inputTruncated, graphTruncated Evidence kind is derived from graph class; inventory changes empty-result wording. Producer truncation remains separate from API read truncation.
readStatus, readReason, readTruncated API read availability/coverage, independent of collector status: ok, partial (row_limit), or unavailable (busy/timeout/query_failed).
sources[].scope/capturedAtMs/lastSuccessAtMs, publishedSources[] Current/saved source status, scope and reasons, plus optional capture/sweep clocks and saved provenance. Missing status is explicitly unknown; absent clocks are not fabricated.

Trace graph sources

A ClickHouse datasource whose registry query is the catalog's exporter-schema otel_v1 template (exactly the bare exporter columns; generated or aliased templates are excluded), or the unregistered default, is read as whole-window aggregates of the same table, not as the newest spans. Two bounded read-only queries return service/kind/status attribute groups with span counts and parent→child service pairs; a third returns span-link pairs when the table has Links columns. Each is limited to 1,000 rows and to the connector's execution budget. If an aggregate query fails (for example the join exceeds that budget), the same table is read with the bounded newest-span reader instead and the source is partial with incomplete_collection. A malformed response envelope fails the read; malformed individual rows are skipped as malformed_rows, a saturated limit adds cap_reached, rows outside the window add incomplete_collection, and an unproven empty result adds empty_not_confirmed (a partial read that may publish nodes without edges). Without those reasons, node and edge spanCount count the window's spans, and source-counted pairs produce no orphanSpans. A child whose parent started before the window is not counted as a pair and is not disclosed. Grouping keeps only EC2 instance IDs and ARNs from the instance claim attributes, plus a fixed marker for any other cloud.resource_id (which still vetoes binding). Generated or custom templates, Tempo and other sources keep span sampling, and a graph mixing them sums both kinds of count.

Publication keeps at most 200 nodes and 500 edges (nodeDrops/edgeDrops). Nodes are selected from the heaviest edges first, both endpoints together. A kept database, queue, workload, runtime or model relationship keeps its caller; a hosts relationship keeps both its runtime and reporting service. Remaining capacity goes to other nodes by span and metric volume.

Service-graph metrics contribute service→service calls only. Rows whose Tempo connection_type is database, messaging_system or virtual_node name a database, queue or uninstrumented peer rather than a service and are not drawn; databases and queues come from trace spans with their host-qualified identity.

Trace inference claims

The trace graph can also return runtime and model nodes from explicit span attributes. A client span with a valid AgentCore runtime ARN produces a calls relationship to that runtime. A reporting service with a matching runtime resource ARN and non-conflicting account/region produces runtime → service with rel=hosts. That relationship is reported execution context, not a traced request. An explicit provider and requested model on a client span produces a requested-model calls relationship; a valid runtime invocation does not also invent a direct model call.

Runtime claims join only by exact ARN within source/environment. Model claims retain source/account/region/environment/cluster/namespace/port isolation; an unknown endpoint is also caller-local. Provider names are normalized to lowercase. Neither relationship proves successful inference or the final provider behind a Gateway, and capped publications still disclose partial coverage.

HTTP, MCP and the current SQL-reader view force identityProvenance=telemetry_claim for these kinds, including retained rows. Only bounded typed sourceId, environment, runtime arn, or model provider/model/endpoint and a valid numeric port survive. Runtime claimedAccountId/claimedRegion are derived from a valid ARN; models and invalid runtime ARNs have null qualifiers. Stored ownership/provenance, infra_ref, raw provider blobs and prompt/response content are excluded.

The SQL-reader projection requires the standalone migration described in the inference projection runbook. Until that migration is applied, the agent may have the node kind/label but lack its identity fields. A source merge is not deployment proof.

Trace edge instance observations

Trace queries edges (service → db) may carry three additive, optional meta fields built by web/lib/trace-graph.ts. Older rows and responses without them remain compatible; absence means no bound observation was recorded, not that no instance queried the database.

Field Meaning
instance_observations[] Distinct (instance_ref, database_ref) pairs from outbound CLIENT spans only. Each entry carries instance_id, instance_ref, database_ref, account, region, db_host, observed_at_ms (latest span start), first_observed_at_ms, observation_count, an opaque correlation_id naming the latest span, optional source_id, and provenance: "trace_span". At most 200 pairs per edge.
instance_observations_omitted Count of further distinct pairs dropped by the 200-pair cap.
instance_observations_unbound Count of spans whose EC2 claim could not be bound: missing or invalid account/region/clock, or no unique inventory EC2 instance and RDS instance endpoint in the same account and region.

For aggregate sources, observation_count and instance_observations_unbound count the spans behind each aggregate row, and correlation_id names one sample span of the row.

These are sampled telemetry claims bound to inventory, not authority: a pair shows that the sampled spans named that instance and endpoint within the trace window. It does not prove current connectivity, credentials or complete coverage of instances querying the database. Binding requires an exact RDS instance endpoint; Aurora cluster/reader and RDS Proxy endpoints stay unbound. The agent SQL view sql_reader.topology_edges does not project these fields; see agent SQL reader.

The UI supports the existing trace envelope and optional inventory/saved-source fields emitted by the bounded publication implementation in web/lib/graph-store.ts. Source integration does not establish successful producer rollout or migration. Source details are collapsed and height-bounded; their count includes displayed saved-source rows except when the entire current/saved lists match. Identical current/saved lists are shown once with the saved-source heading and a localized “Same displayed source evidence as above.” note. Differing and saved-only evidence remains visible. Runtime, Lambda and migration rollout remain separate from source integration. See collection semantics and rollout.

Graph requests and rebuild transactions share two admissions per pool. Requests use 1.5s statement/idle and 2s total transaction limits; rebuild checkout has a separate 2s deadline before 2s statements and a 4s PostgreSQL transaction budget, protected by a 6s post-checkout watchdog; an in-flight write COMMIT is allowed to settle. JSON serialization runs after commit and release. Class reads return at most 4000 nodes and 8000 raw edges, then deduplicate bounded edge evidence; edges reference returned nodes. A sentinel row discloses read truncation without claiming collection failure. Existing per-hop traversal caps remain.

A missing or failed state read remains unknown; failureReason=state_read_failed is shown separately. Saved-source provenance is visible whenever present, including stale successful publications. Producer start/finish/status and source/attempt windows are separate clocks. For legacy single-account flow/infra rows, top-level captured_at may retain the old row display clock; collection.captured_at remains null and no source freshness is inferred.

Graph requests above the shared read/rebuild admission budget return HTTP 503, including when rebuilds occupy the available admissions. Other read failures return HTTP 500, with fixed message="Graph read failed", class/account and unknown collection/read-unavailable metadata. Raw database messages are never returned. See request/rollout details.

All three graph pages render collection/read errors, parse safe non-2xx envelopes, abort superseded fetches and provide refresh. A shed request includes Retry-After: 1 and a fixed server-side shed diagnostic. Timeout SQLSTATEs (57014/25P03/25P04/55P03) produce readReason=timeout; they never imply empty collection or successful partial publication. Requested subgraph roots are prioritized before the node cap; fan-out capped and readTruncated remain distinct.

The active fetchGraph consumer retries only HTTP503 responses whose collection metadata explicitly has readStatus: "unavailable" and readReason: "busy". It makes at most five requests to the same URL inside one ten-second abort budget. Base waits are 250/750/1500/2000 ms, with a valid Retry-After (seconds or date) as a floor and 0–125 ms jitter. If a wait plus a two-second read reserve cannot fit, recovery stops as busy; five completed requests are not guaranteed. Authentication, other 4xx, query failures and untyped service errors are not retried. Cancellation propagates through pending waits/reads. Exhausted recovery returns unknown, read-unavailable metadata; it never certifies empty collection or exposes an error-body payload. The budget also covers a single stalled request. Without a confirmed busy response, its expiry can synthesize readReason: "timeout" locally without any HTTP response or SQLSTATE. After confirmed admission shedding, an unfinished recovery retains busy as the last observed server cause, not a diagnosis of the final stalled request. A later non-busy response clears that prior cause; if its body then stalls, the client deadline reports timeout. The value alone does not identify its origin; inspect completed response bodies and server logs. Deploy the updated web image for both recovery and collection-panel changes.

HTTP collection details use the same bounded key/status/reason vocabulary as the SQL-reader view: raw/private keys and injected read/coverage fields are excluded. Source arrays are capped at 128 and reason lists at 16; metadataTruncated discloses omitted/malformed metadata separately from graph row truncation. Safe null source clocks remain unknown for compatibility.

The two-second request deadline includes pool acquisition. Expired late checkouts return immediately without starting SQL; admission stays reserved until they settle, preventing an abandoned queue. Both annotation normalization and JSON serialization occur after release. Top-level windows use Graph attempt window start/end labels; individual source windows keep Source window start/end labels. SQL and HTTP projections share null-clock compatibility, the count/not-attempted vocabulary, and metadataTruncated. Reason deduplication alone is not omission.

Capped resource neighborhoods keep the requested root and nearest hops first, using the minimum distance from both traversal directions; lexical order only breaks ties within a hop. Authentication expiry (401 or a followed /login redirect), authorization denial (403), and other4xx rejections use a separate localized error path. They do not become query_failed or a retriable graph outage. Sign-in links stay on the local /login route, and stale graph content is cleared on rejection.

A reader-synthesized unknown result with no collection clocks or source records is neutral “No collection state recorded” information; it does not assert stale age or a collector failure. Unknown aggregate coverage has its own neutral wording. This presentation does not change the backend unknown/stale envelope or establish completeness. Read failures, retention, truncation, metadata loss and other actionable evidence still render alerts.

Class-wide infra truncation prioritizes the actual vpc, subnet, and sg container kinds before resource nodes; within each rank, IDs provide deterministic order. The cap still bounds the response and does not certify complete connectivity. Recognized metadata fields with invalid types/ranges or unknown enum vocabulary set metadataTruncated in both projections; unknown private fields remain excluded without that signal. This deliberately treats vocabulary not understood by the reader as unknown coverage. Published inventory evidence is stale for contradictory status/count pairs, any nonempty or malformed reason list, or an invalid/future optional capture clock. A confirmed zero may omit its capture clock or use null, but requires empty, zero count, a succeeded producer and a valid last-success clock.

Graph full/subgraph metadata and generic inventory data exclude recognized origin-header and OIDC ClientSecret fields, including legacy JSON-string copies. This read-side projection covers existing rows without enabling a publisher; it does not change row counts or snapshot clocks and is not a general secret detector.