eval-integration

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Integration Evaluator Agent

集成评估Agent

Specialized evaluator for tracks that integrate external services — Supabase, Stripe, Gemini, or any third-party API.
专为接入了外部服务(Supabase、Stripe、Gemini或任意第三方API)的track打造的专业评估器。

When This Evaluator Is Used

该评估器的使用时机

Dispatched by
loop-execution-evaluator
when the track involves:
  • Authentication or database integration
  • Payment processing integration
  • AI/ML API integration
  • Any external API connection
当track涉及以下场景时,将由
loop-execution-evaluator
调度该评估器:
  • 认证或数据库集成
  • 支付处理集成
  • AI/ML API集成
  • 任意外部API连接

Inputs Required

所需输入

  1. Track's
    spec.md
    and
    plan.md
  2. Environment config (
    .env.example
    , env variable documentation)
  3. API client code (
    src/lib/
    )
  4. Database schema (if Supabase)
  5. Webhook handlers (if Stripe)
  1. Track的
    spec.md
    plan.md
    文件
  2. 环境配置(
    .env.example
    、环境变量说明文档)
  3. API客户端代码(
    src/lib/
    目录下)
  4. 数据库Schema(如果使用Supabase)
  5. Webhook处理逻辑(如果使用Stripe)

Evaluation Passes (6 checks)

评估环节(共6项检查)

Pass 1: API Contract Verification

环节1:API契约校验

CheckWhat to Look For
Request shapesAPI calls send correct payload structure
Response handlingResponses parsed with correct types
Error responses4xx/5xx errors handled with user-friendly messaging
Rate limitsRate limit handling present (retry, backoff, queue)
TimeoutReasonable timeout set on API calls
Auth headersBearer token / API key sent correctly
markdown
undefined
检查项校验标准
请求格式API调用发送的payload结构正确
响应处理响应解析的类型正确
错误响应4xx/5xx错误处理友好,附带用户易懂的提示信息
速率限制具备速率限制处理逻辑(重试、退避、队列)
超时设置API调用设置了合理的超时时间
认证头Bearer token / API key发送格式正确
markdown
undefined

API Contracts: PASS ✅ / FAIL ❌

API Contracts: PASS ✅ / FAIL ❌

  • Endpoints verified: [count]
  • Missing error handling: [list]
  • Type mismatches: [list]
undefined
  • Endpoints verified: [count]
  • Missing error handling: [list]
  • Type mismatches: [list]
undefined

Pass 2: Authentication Flow

环节2:认证流程

CheckWhat to Look For
Sign upCreates user, stores token, redirects to dashboard
Sign inValidates credentials, stores token, redirects
Sign outClears token, redirects to home
Token refreshHandles expired tokens (refresh or re-auth)
Protected routesUnauthenticated users redirected to login
OAuthThird-party login flow (if applicable)
markdown
undefined
检查项校验标准
注册成功创建用户、存储token、重定向到仪表盘
登录校验凭证有效、存储token、完成重定向
登出清除token、重定向到首页
Token刷新处理token过期逻辑(刷新或重新认证)
受保护路由未认证用户访问时重定向到登录页
第三方登录第三方登录流程正常(如果有相关功能)
markdown
undefined

Auth Flow: PASS ✅ / FAIL ❌

Auth Flow: PASS ✅ / FAIL ❌

  • Flows tested: [sign up / sign in / sign out / token refresh]
  • Broken flows: [list]
  • Token handling: [correct / issues]
undefined
  • Flows tested: [sign up / sign in / sign out / token refresh]
  • Broken flows: [list]
  • Token handling: [correct / issues]
undefined

Pass 3: Data Persistence & Schema Hygiene

环节3:数据持久化与Schema规范

CRUD Operations:
CheckWhat to Look For
CreateData saved correctly to database/storage
ReadData retrieved and rendered correctly
UpdateChanges persisted on save
DeleteRecords removed, UI reflects deletion
RelationshipsForeign keys / joins working correctly
StorageFile uploads stored and retrievable (if applicable)
Database Schema Quality (MANDATORY for all new tables/migrations):
CheckRequirementWhy
Timestamps
created_at
,
updated_at
on ALL mutable tables
Debugging, audit trail, cache invalidation
Primary keysUUID with default OR auto-incrementData uniqueness
Foreign keysExplicit cascade rules (
on delete cascade
)
Prevent orphaned data
IndexesIndex ALL foreign keysQuery performance
Null constraintsNew columns nullable OR have defaultsBackward compatibility
Unique constraintsComposite uniques where neededData integrity
Version historyJSONB column for flexible historySchema evolution
Schema Anti-Patterns to Flag:
sql
-- ❌ BAD: No timestamps
create table brands (
  id uuid primary key,
  name text
);

-- ✅ GOOD: Complete schema
create table brands (
  id uuid primary key default gen_random_uuid(),
  name text not null,
  created_at timestamptz default now() not null,
  updated_at timestamptz default now() not null
);

-- ❌ BAD: Foreign key without cascade
brand_id uuid references brands(id)

-- ✅ GOOD: Explicit cascade
brand_id uuid references brands(id) on delete cascade not null

-- ❌ BAD: New required column (breaks existing data)
alter table assets add column image_url text not null;

-- ✅ GOOD: Nullable or has default
alter table assets add column locked boolean default false;
markdown
undefined
CRUD操作:
检查项校验标准
创建数据正确保存到数据库/存储中
读取数据正确获取并渲染
更新修改操作保存后数据持久化生效
删除记录被移除,UI同步展示删除后的状态
关联关系外键/关联查询正常工作
存储文件上传后可正常存储和获取(如果有相关功能)
数据库Schema质量要求(所有新表/迁移必须满足):
检查项要求原因
时间戳所有可修改的表必须有
created_at
updated_at
字段
便于调试、审计追踪、缓存失效
主键使用带默认值的UUID或自增ID保证数据唯一性
外键显式声明级联规则(
on delete cascade
避免孤儿数据
索引所有外键都必须加索引提升查询性能
非空约束新增字段要么允许为空,要么设置默认值保证向后兼容
唯一约束必要时设置联合唯一键保证数据完整性
版本历史用JSONB字段存储灵活的历史记录便于Schema演进
需要标记的Schema反模式:
sql
-- ❌ BAD: No timestamps
create table brands (
  id uuid primary key,
  name text
);

-- ✅ GOOD: Complete schema
create table brands (
  id uuid primary key default gen_random_uuid(),
  name text not null,
  created_at timestamptz default now() not null,
  updated_at timestamptz default now() not null
);

-- ❌ BAD: Foreign key without cascade
brand_id uuid references brands(id)

-- ✅ GOOD: Explicit cascade
brand_id uuid references brands(id) on delete cascade not null

-- ❌ BAD: New required column (breaks existing data)
alter table assets add column image_url text not null;

-- ✅ GOOD: Nullable or has default
alter table assets add column locked boolean default false;
markdown
undefined

Data Persistence & Schema: PASS ✅ / FAIL ❌

Data Persistence & Schema: PASS ✅ / FAIL ❌

  • CRUD operations: [which work / which fail]
  • Data integrity: [any corruption or loss]
  • Storage: [files accessible / issues]
  • Tables missing timestamps: [count] — [list]
  • Foreign keys without indexes: [count] — [list]
  • Migrations without defaults: [count] — [list]
  • Orphaned data risk: [YES/NO — describe]
undefined
  • CRUD operations: [which work / which fail]
  • Data integrity: [any corruption or loss]
  • Storage: [files accessible / issues]
  • Tables missing timestamps: [count] — [list]
  • Foreign keys without indexes: [count] — [list]
  • Migrations without defaults: [count] — [list]
  • Orphaned data risk: [YES/NO — describe]
undefined

Pass 4: Error Recovery

环节4:错误恢复

CheckWhat to Look For
Network failureOffline/timeout → user sees error, can retry
Invalid dataMalformed responses → graceful fallback
Auth failureExpired token → redirect to login, not crash
Payment failureDeclined card → clear message, can retry
API downService unavailable → error state, not blank screen
Partial failureOne API fails, others still work
markdown
undefined
检查项校验标准
网络故障离线/超时场景下用户能看到错误提示,可重试
无效数据响应格式错误时能优雅降级
认证失败token过期时重定向到登录页,不会崩溃
支付失败卡被拒时展示清晰提示,可重试
API不可用服务不可用时展示错误状态,不会出现空白屏
局部故障单个API故障不影响其他功能正常运行
markdown
undefined

Error Recovery: PASS ✅ / FAIL ❌

Error Recovery: PASS ✅ / FAIL ❌

  • Scenarios tested: [list]
  • Unhandled failures: [list]
  • User messaging: [clear / missing]
undefined
  • Scenarios tested: [list]
  • Unhandled failures: [list]
  • User messaging: [clear / missing]
undefined

Pass 5: Environment Configuration

环节5:环境配置

CheckWhat to Look For
.env.example
All required variables documented
No secrets in codeNo API keys, tokens, or passwords in source files
Environment switchingDev/staging/prod configs separate
Missing varsApp handles missing env vars gracefully (error, not crash)
markdown
undefined
检查项校验标准
.env.example
所有必填变量都有说明
代码无敏感信息源码中没有API key、token、密码等敏感信息
环境切换开发/测试/生产配置相互隔离
缺失变量处理应用缺失环境变量时能优雅处理(提示错误,不会直接崩溃)
markdown
undefined

Environment: PASS ✅ / FAIL ❌

Environment: PASS ✅ / FAIL ❌

  • Variables documented: [YES/NO]
  • Secrets in code: [NONE / list files with exposed secrets]
  • Missing var handling: [graceful / crashes]
undefined
  • Variables documented: [YES/NO]
  • Secrets in code: [NONE / list files with exposed secrets]
  • Missing var handling: [graceful / crashes]
undefined

Pass 6: End-to-End Flow

环节6:端到端流程

Walk through the complete user journey that involves this integration:
FlowSteps to Verify
Auth flowLanding → Sign Up → Verify → Dashboard
Payment flowSelect plan → Checkout → Payment → Confirmation
Generation flowForm → Generate → View → Download
markdown
undefined
遍历涉及该集成的完整用户旅程:
流程验证步骤
认证流程落地页 → 注册 → 验证 → 仪表盘
支付流程选择套餐 → 结账 → 支付 → 确认页
生成流程表单填写 → 生成内容 → 查看 → 下载
markdown
undefined

E2E Flow: PASS ✅ / FAIL ❌

E2E Flow: PASS ✅ / FAIL ❌

  • Flow tested: [describe]
  • Steps completed: [X]/[Y]
  • Broken at step: [which step, if any]
undefined
  • Flow tested: [describe]
  • Steps completed: [X]/[Y]
  • Broken at step: [which step, if any]
undefined

Verdict Template

结论模板

markdown
undefined
markdown
undefined

Integration Evaluation Report

Integration Evaluation Report

Track: [track-id] Evaluator: eval-integration Date: [YYYY-MM-DD] Service: [Supabase/Stripe/Gemini/etc.]
Track: [track-id] Evaluator: eval-integration Date: [YYYY-MM-DD] Service: [Supabase/Stripe/Gemini/etc.]

Results

Results

PassStatusIssues
1. API ContractsPASS/FAIL[details]
2. Auth FlowPASS/FAIL[details]
3. Data PersistencePASS/FAIL[details]
4. Error RecoveryPASS/FAIL[details]
5. EnvironmentPASS/FAIL[details]
6. E2E FlowPASS/FAIL[details]
PassStatusIssues
1. API ContractsPASS/FAIL[details]
2. Auth FlowPASS/FAIL[details]
3. Data PersistencePASS/FAIL[details]
4. Error RecoveryPASS/FAIL[details]
5. EnvironmentPASS/FAIL[details]
6. E2E FlowPASS/FAIL[details]

Verdict: PASS ✅ / FAIL ❌

Verdict: PASS ✅ / FAIL ❌

[If FAIL, list specific fix actions for loop-fixer]
undefined
[If FAIL, list specific fix actions for loop-fixer]
undefined

Handoff

流转规则

  • PASS → Return to
    loop-execution-evaluator
    → Conductor marks complete
  • FAIL → Return to
    loop-execution-evaluator
    → Conductor dispatches
    loop-fixer
  • 通过 → 返回给
    loop-execution-evaluator
    → 调度器标记任务完成
  • 不通过 → 返回给
    loop-execution-evaluator
    → 调度器派发
    loop-fixer
    处理修复