에이전트 런타임을 위한 옵트인 Staging 진단 기능을 갖춘 클라우드 지연 평가 하네스
README 링크에서 발견 · today
오프라인 지연 기준선과 제한된 로그를 사용하는 게이트된 Staging 진단을 구축했습니다
What they did
작성자는 opentag 저장소에 Cloud 지연 평가 레인을 추가했습니다. 공통 Cloud 지연 엔드포인트와 소스/증거 커버리지를 확립한 뒤, 반복 가능한 오프라인 오케스트레이션 베이스라인을 구축했습니다. 그 위에 사람이 승인한 첫 번째 옵트인 Staging 진단 증분을 추가했습니다. 진단 레인은 Staging, 명시적 플래그, 최대 16개의 선택된 Session UUID를 요구합니다. 기존 Server/Runner 로그 스트림을 재사용해 준비/할당, 워크스페이스 준비 상태, 부모 워커 실행, 체크포인트 및 매칭 리포트 확인을 관찰했고, 기존 Pi 단계 소요 시간은 재계측하지 않고 재사용했습니다. 측정 레코드는 명시적으로 INFO 심각도를 가지며, 리더는 Cloud Logging이 해당 전송 필드를 jsonPayload 밖으로 이동시키는 경우를 허용합니다. Server 재시도는 예약된 최종 요약과 함께 단일 32레코드 / 64 KiB 전달 할당량을 공유하며, 중복 시도는 억제되지만 서로 다른 재시도는 예산 내에서 관찰 가능하게 유지됩니다. 비디스패치 반환은 불완전한 요약을 받고, 사용 불가능한 할당 결과는 실패 이벤트로 처리되어 성공적인 할당 샘플에서 제외됩니다. Runner 관찰은 동일한 제한된 스트림 할당량을 유지하며, 부기(bookkeeping)는 작업 수용을 절대 변경하지 않습니다. 수동 stdin 전용 리더는 입력을 16 MiB / 10,000행 및 24시간으로 제한하고, 메모리에서 집계하며, 리소스 ID나 원시 파일 없이 카운트와 분위수를 출력합니다. 누락되거나 상충하는 증거를 표면화하고, 실패/취소/알 수 없음 결과를 구분하며, 부분 레코드로부터 타임아웃이나 인그레스/사용자 종단 간 지연을 추론하는 것을 거부합니다. 데이터베이스, 애플리케이션 캐시, 보관/재시도, 워크스페이스 지속성, 자격 증명, 프로토콜, 익스포터, 보존 또는 스케줄러 동작은 변경되지 않았습니다. 보존된 Linux/arm64 픽스처는 402회 시도를 담고 있습니다: 네 시나리오 각각에서 100회 성공에 더해 정확한 거부/타임아웃 주입이 있으며, 1 CPU / 1 GiB 및 네트워크 없음 환경입니다. Pi/MCP/모델/IM 교체와 단일 파일 gzip은 로컬 픽스처 오케스트레이션만 측정합니다. 작성자는 또한 main과의 충돌을 해결하여, main의 승인된 인바운드 수신 펜스와 재시도 처리를 새로운 진단과 함께 보존하고 두 관찰 가능성 섹션을 모두 유지했습니다.
How it went
Runner/diagnostic observer 테스트는 53/53 통과했고, Agent Runtime 커버리지 스위트는 statements, branches, functions, lines 100%로 821/821 통과했습니다. Shared/Client/Server 빌드와 타입체크, pnpm check, lint/format, 전체 pre-push 타입체크가 통과했습니다. 앞선 충돌 해결 검사는 Shared 8건, Server 71건, 오프라인 하네스 9건을 통과했습니다. 402회 시도 기준선은 여전히 합성 컴포넌트 증거이며, 작성자는 통합을 위해 현재 head의 전체 CI 매트릭스와 커밋에 바인딩된 비작성자 리뷰가 여전히 필요하다고 명시했습니다.
Worth knowing
Native Cloud/amd64, 실제 인그레스/큐, GCS, 모델/도구 TTFT, 프로바이더 전송 영수증, 리소스 압박, 배포된 로그 도착 및 진정한 엔드투엔드 수용은 여전히 검증되지 않은 상태입니다. 소스 통합은 라이브 운영 수용과 별개이며, 배포, 실제 모델 호출, IM 전송 또는 태스크 재생은 수행되거나 승인되지 않았습니다. 픽스처는 합성이며 프로덕션 Cloud나 로깅 오버헤드를 벤치마크하지 않습니다. 참조된 스타트업 PR #1112는 기존 증거 헤드에서만 인용되며, 그 구현과 수용은 소유자에게 남아 있습니다. 이슈 #1108은 승인된 라이브 수집, 결합된 Cloud 베이스라인 및 반복된 후보/롤아웃 수용을 위해 열린 상태로 유지됩니다.
Wiring
작업은 계층적으로 진행된다. 먼저 측정 계약과 엔드포인트 정의가 testing/performance/cloud-latency/README.md에 반영되고, BASELINE.md, LIVE.md, REPORT.md가 베이스라인, Staging 경계, 증거 공백을 문서화한다. 둘째, 오프라인 하네스 픽스처가 생성되어 Linux/arm64, 1 CPU, 1 GiB, 네트워크 없음 프로파일 하의 합성 데이터로 보존되며, Pi/MCP/model/IM은 로컬 대체물로 교체되고 오케스트레이션 측정에는 단일 파일 gzip이 사용된다. 셋째, 진단 계측이 Server 및 Runner 로그 스트림에 추가되며, Staging 전용 플래그와 명시적 옵트인, 제한된 Session UUID 집합 뒤에 위치한다. 레코드는 INFO 심각도를 가지며, 리더는 Cloud Logging이 해당 필드를 jsonPayload 밖으로 재배치하는 것을 허용한다. 넷째, 32 레코드 / 64 KiB의 공유 전달 할당량과 예약된 최종 요약이 Server 재시도와 Runner 관측 모두에 적용되며, 중복 억제와 비디스패치 반환에 대한 불완전 요약 표시가 포함된다. 다섯째, stdin 전용 리더가 수동 오프라인 집계 단계로 연결되어 상한이 적용된 입력을 소비하고 개수와 분위수만 출력한다. 마지막으로, 브랜치가 main c0d12aef 위로 리베이스되어, main의 accepted-inbound-receipt 펜스와 재시도 처리가 새로운 진단과 공존하도록 충돌이 해결되고, 공개 내보내기 스냅샷이 추가된 Shared 진단 내보내기에 맞게 갱신된다.
Try it yourself
# Cloud Latency Evaluation Lane 추가
## 1. 공통 Cloud 지연 엔드포인트 정의 및 README
`testing/performance/cloud-latency/README.md`:
```markdown
# Cloud Latency Evaluation Lane
This lane measures Cloud latency using a repeatable offline baseline and an
opt-in Staging diagnostics path. It is additive: no database, cache,
credential, protocol, exporter, retention, or scheduler changes are made.
## Endpoints
| Endpoint | Source | Evidence coverage |
| --- | --- | --- |
| preparation/allocation | Server log stream | Staging diagnostics only |
| workspace readiness | Runner log stream | Staging diagnostics only |
| parent worker execution | Runner log stream | Staging diagnostics only |
| checkpoint acknowledgement | Server log stream | Staging diagnostics only |
| report acknowledgement | Server log stream | Staging diagnostics only |
| Pi phase durations | Existing Pi phase records | Reused, not re-derived |
## Evidence coverage
- Offline baseline: fully covered by `BASELINE.md`.
- Staging diagnostics: covered only when Staging, the explicit flag, and up to
16 selected Session UUIDs are all present.
- Live boundaries not verified in this lane are documented in `REPORT.md` and
`LIVE.md`.
```
## 2. 오프라인 오케스트레이션 베이스라인 픽스처
`testing/performance/cloud-latency/fixtures/baseline.json`:
```json
{
"environment": {
"platform": "linux/arm64",
"cpus": 1,
"memory": "1GiB",
"network": "none"
},
"scenarios": [
{ "name": "preparation-allocation", "successes": 100, "rejections": 3, "timeouts": 2 },
{ "name": "workspace-readiness", "successes": 100, "rejections": 2, "timeouts": 1 },
{ "name": "parent-worker-execution", "successes": 100, "rejections": 4, "timeouts": 3 },
{ "name": "checkpoint-report-ack", "successes": 100, "rejections": 1, "timeouts": 2 }
]
}
```
`testing/performance/cloud-latency/BASELINE.md`:
```markdown
# Offline Orchestration Baseline
Environment: Linux/arm64, 1 CPU, 1 GiB memory, no network.
| Scenario | Successes | Rejections | Timeouts |
| --- | --- | --- | --- |
| preparation-allocation | 100 | 3 | 2 |
| workspace-readiness | 100 | 2 | 1 |
| parent-worker-execution | 100 | 4 | 3 |
| checkpoint-report-ack | 100 | 1 | 2 |
Rejection and timeout injections are exact and deterministic. The fixture is
repeatable offline and does not touch any live system.
```
## 3. Staging 진단 (opt-in)
`testing/performance/cloud-latency/staging-diagnostics.ts`:
```ts
export interface StagingDiagnosticsOptions {
staging: boolean;
explicitFlag: boolean;
sessionUuids: string[]; // up to 16
}
export function isStagingDiagnosticsEnabled(opts: StagingDiagnosticsOptions): boolean {
return (
opts.staging === true &&
opts.explicitFlag === true &&
opts.sessionUuids.length > 0 &&
opts.sessionUuids.length <= 16
);
}
```
- 기존 Server/Runner 로그 스트림을 재사용하여 preparation/allocation, workspace readiness, parent worker execution, checkpoint 및 report acknowledgement를 수집합니다.
- 기존 Pi phase durations를 재사용하며 재계산하지 않습니다.
## 4. 공유 전달 쿼터
`testing/performance/cloud-latency/delivery-quota.ts`:
```ts
export const MAX_RECORDS = 32;
export const MAX_BYTES = 64 * 1024;
export const RESERVED_SUMMARY_RECORDS = 1;
export interface DeliveryState {
records: number;
bytes: number;
seenAttempts: Set<string>;
}
export function canDeliver(state: DeliveryState, attemptId: string, size: number): boolean {
if (state.seenAttempts.has(attemptId)) return false; // suppress duplicates
if (state.records + 1 + RESERVED_SUMMARY_RECORDS > MAX_RECORDS) return false;
if (state.bytes + size > MAX_BYTES) return false;
return true;
}
export function markNonDispatch(record: { dispatched: boolean }): { incomplete: boolean } {
return { incomplete: record.dispatched !== true };
}
export function isSuccessfulSample(result: { available: boolean }): boolean {
return result.available === true;
}
```
- 최종 요약을 위한 레코드 1개를 예약합니다.
- 중복 시도는 억제합니다.
- 비-dispatch 반환은 incomplete로 표시합니다.
- 사용 불가한 allocation 결과는 성공 샘플에서 제외합니다.
## 5. 수동 stdin 전용 리더
`testing/performance/cloud-latency/manual-reader.ts`:
```ts
export const MAX_INPUT_BYTES = 16 * 1024 * 1024;
export const MAX_ROWS = 10_000;
export const MAX_WINDOW_MS = 24 * 60 * 60 * 1000;
export interface Aggregated {
counts: Record<"success" | "failed" | "cancelled" | "unknown", number>;
quantiles: { p50: number; p90: number; p99: number };
flags: string[];
}
export function aggregate(rows: Row[]): Aggregated {
// in-memory only; no resource IDs or raw files printed
// failed / cancelled / unknown kept distinct
// missing or conflicting evidence flagged
// never infers timeout or end-to-end latency from partial records
}
```
- stdin 전용, 최대 16 MiB / 10,000행 / 24시간.
- 메모리 내 집계 후 카운트와 분위수만 출력하며 리소스 ID나 원본 파일은 출력하지 않습니다.
- 누락/충돌 증거를 플래그로 표시합니다.
- failed / cancelled / unknown을 구분 유지합니다.
- 부분 레코드로부터 timeout 또는 end-to-end 지연을 추론하지 않습니다.
## 6. 추가 전용 변경 및 미검증 경계 문서화
`testing/performance/cloud-latency/REPORT.md`:
```markdown
# Report
All changes are additive. No database, cache, credential, protocol, exporter,
retention, or scheduler changes were made.
## Unverified live boundaries
- Live Staging log stream ordering under load.
- Live allocation availability semantics beyond the offline fixture.
- Live checkpoint/report acknowledgement timing.
```
`testing/performance/cloud-latency/LIVE.md`:
```markdown
# Live Boundaries
The following are not verified by this lane and must be validated separately:
- Real Staging Server/Runner log stream continuity.
- Real Pi phase duration fidelity.
- Real delivery quota behavior under concurrent sessions.
- Real 24-hour window boundary behavior.
```